//获得label列表 public MySqlDataReader list_label() { MLabel mlabel = new MLabel(); MySqlDataReader reader = mlabel.list_label(); return(reader); }
public static void MLabel_Constructor_AssignTitle() { string title = LinkTitle(); var label = new MLabel(text: LinkText(), url: LinkUrl(), title: title); Assert.Equal(title, label.Title); }
//=====私有方法 //=====公开方法 ///<summary>生成图例模型</summary> internal void genModel() { model = myModelBuilder.CreateModel(owner.serial, modelType, mat, LstGroupLabel); double maxwidth = Math.Min(owner.width / (owner.ModelLegendCount) * 0.7, owner.width / 2 * 0.7) * addScale; model.SizeX3D = maxwidth; model.SizeZ3D = maxwidth; model.SizeY3D = owner.height * 0.8;// / (owner.ModelLegendCount + 0.5) * (owner.ModelLegendCount - idx); model.X3D = owner.length / (owner.ModelLegendCount) * (0.5 + idx - owner.ModelLegendCount / 2.0); //model.Rotate(new Vector3D(0,1,0),-15); mg.Children.Add(model.model); //图例名称 if (LegendName != null) { MLabel namemodel = new MLabel(owner.serial); namemodel.mAlign = new Vector3D(0.5, 0.5, 0); namemodel.LabelDirection = ELabelDirection.垂直; namemodel.LabelHeight = 0.4; namemodel.isGlow = false; namemodel.LabelColor = new SolidColorBrush(Colors.Yellow); namemodel.LabelText = LegendName; namemodel.X3D = model.model.Bounds.X + model.model.Bounds.SizeX / 2; namemodel.Z3D = 2;//model.model.Bounds.Z + model.model.Bounds.SizeZ + 1; //namemodel.SizeZ3D = 1.5; mg.Children.Add(namemodel.model); } //图例注释 owner.grdMain.UpdateLayout(); genSizeXLabel(); genSizeYLabel(); genSizeZLabel(); genColorLabel(); genGroupLabel(); }
public static void MLabel_Constructor_AssignText() { string text = LinkText(); var label = new MLabel(text: text, url: LinkUrl(), title: LinkTitle()); Assert.Equal(text, label.Text); }
public static void MLabel_Constructor_AssignUrl() { string url = LinkUrl(); var label = new MLabel(text: LinkText(), url: url, title: LinkTitle()); Assert.Equal(url, label.Url); }
public static void MLabel_OperatorEquals() { MLabel label = CreateLabel(); MLabel label2 = label; Assert.True(label == label2); }
public static void MLabel_OperatorNotEquals() { MLabel label = CreateLabel(); MLabel label2 = label.Modify(); Assert.True(label != label2); }
public static void MLabel_NotEquals() { MLabel label = CreateLabel(); MLabel label2 = label.Modify(); Assert.False(label.Equals((object)label2)); }
public static void MLabel_GetHashCode_NotEqual() { MLabel label = CreateLabel(); MLabel label2 = label.Modify(); Assert.NotEqual(label.GetHashCode(), label2.GetHashCode()); }
public static MLabel CloneMedLabel(MLabel source) { MLabel target = new MLabel(); CloneMLabel(source, target); return(target); }
private void MBar_ValueChanged(object sender, EventArgs e) { m = MBar.Value; MLabel.Text = " m = " + m; MLabel.Refresh(); RedrawBitmap(); }
// 编辑LABEL文字 protected void EditLabel(MLabel label) { Point pt = label.Parent.PointToScreen(label.Location); TabPage tabpage = tabControl1.TabPages[CurrentDocumentsDesignIndex]; pt = tabpage.PointToClient(pt); pt.Offset(1, -2); _textBox.Location = pt; _textBox.Width = label.Width; _textBox.Height = label.Height; _textBox.Font = label.Font; _textBox.BorderStyle = BorderStyle.FixedSingle; _textBox.Visible = true; _textBox.Tag = label; _textBox.Multiline = label.MultiLine; if (_textBox.Multiline) { _textBox.AcceptsReturn = true; } else { _textBox.AcceptsReturn = false; } _textBox.BringToFront(); _textBox.Focus(); _textBox.Text = label.Text; _textBox.SelectionStart = _textBox.Text.Length; }
public void hide() { NLabel.Hide(); NBox.Hide(); MLabel.Hide(); MBox.Hide(); sceneImage.Hide(); }
public void show() { NLabel.Show(); NBox.Show(); MLabel.Show(); MBox.Show(); sceneImage.Show(); }
/// <summary> /// 当Label为PageIndex时,则显示页码信息 /// </summary> public override void BindDataToUI(MLabel control, Dictionary <string, System.Data.DataTable> dataSources) { base.BindDataToUI(control, dataSources); if (control.Name == "PageIndex") { control.Text = string.Format("第{0}页/共{1}页", PagerSetting.CurrentPageIndex + 1, PagerSetting.TotalPageCount); } }
public GameBoardScreen() : base("GameBoardScreen") { GNet.OnGotMessage += GNet_OnGotMessage; // Hail the opponent GNet.SendMessage(Systems.MessageType.Hail, GSettings.Name); MyNameLabel = GetMenuItem <MLabel>("MyName"); OpponentNameLabel = GetMenuItem <MLabel>("OpponentName"); }
public Form1() { _5pW = _5pL = _5pD = 0; p5flag = drawflag = imgflag = whsflag = true; this.Hide(); this.Location = new Point(150, 150); //this.ShowInTaskbar = true; InitializeComponent(); //Gomoku a = new Gomoku(); //a.ShowDialog(); this.ShowInTaskbar = true; trackBar1.Hide(); ColorBox.Hide(); button2.Hide(); Login log = new Login(); log.ShowDialog(); if (log.DialogResult == DialogResult.Cancel) { this.Close(); } else { this.Show(); //this.ShowInTaskbar = true; SetUpData init = log.Get(); Username = init.UserName; MLabel.Hide(); //Box.ForeColor = Bcolor; UserBox.DataSource = UserList; myGraphic = DrawBox.CreateGraphics(); DrawBox.BringToFront(); c.Setup(init.IP, init.Port); //addMsg("2.成功連線"); msgHandler = this.addMsg; dwHandler = this.addDw; imgHandler = this.ShowPic; c.Recv(processMsgComeIn, processDwComeIn, processImgComeIn); //MessageBox.Show("歡迎加入~"); } }
public override void BindDataToUI(MLabel control, Dictionary <string, System.Data.DataTable> dataSources) { base.BindDataToUI(control, dataSources); if (control.Name == "PageIndex") { //_pageSetting.PagerDesc[_pageSetting.CurrentPageIndex].IsMain control.Text = string.Format("第{0}页/共{1}页", PagerSetting.CurrentPageIndex + 1, PagerSetting.TotalPageCount); } if (control.Name == "DocTitle") { control.Text = ExtendApplicationContext.Current.HospitalName; } }
// 编辑LABEL的文本框失去焦点时,将文本框内容赋给LABEL protected void LabelTextBox_LostFocus(object sender, EventArgs e) { if (_textBox.Tag is MLabel) { MLabel label = _textBox.Tag as MLabel; label.Text = _textBox.Text; _textBox.Visible = false; } else if (_textBox.Tag is CustomControl) { CustomControl csctrl = _textBox.Tag as CustomControl; csctrl.DefaultItems.Clear(); foreach (string str in _textBox.Lines) { int index = str.IndexOf("[#", 0); if (index >= 0) { CustomControl.DefualtItem item = new CustomControl.DefualtItem(); item.ItemName = str.Substring(0, index); if (index < str.Length - 4) { item.ItemValue = str.Substring(index + 2, str.Length - index - 4); } csctrl.DefaultItems.Add(item); } else if (str.Length > 3 && str.Substring(0, 2) == "(@") { csctrl.SourceTableName = "MED_CUSTOM_DATA"; csctrl.SourceFieldName = str.Substring(2, str.Length - 3); } else { CustomControl.DefualtItem item = new CustomControl.DefualtItem(); item.ItemName = str; item.ItemValue = str; csctrl.DefaultItems.Add(item); } } _textBox.Visible = false; } }
private void timer1_Tick(object sender, EventArgs e) { MLabel.Show(); if (second == 50) { second = 0; MLabel.Hide(); timer1.Stop(); } else { second++; String temp = Marquee.Substring(0, 1); Marquee = Marquee.Substring(1, Marquee.Length - 1) + Marquee_temp.Substring(0, 1); Marquee_temp = Marquee_temp.Substring(1, Marquee_temp.Length - 1) + temp; MLabel.Text = Marquee; } }
/// <summary> /// 控件创建后,未被UIElementHandler处理前调用的方法 /// </summary> protected override void OnControlInitalizing(Control control) { if (control is MLabel) { MLabel lable = control as MLabel; if (_pageFromHeight == false && lable.Name == "pageline") { _pageFromHeight = true; float h = (float)lable.Location.Y; Control ctl = lable; while (ctl.Parent is Panel) { h += ctl.Parent.Top; ctl = ctl.Parent; } _pagePrintHeight = h; pageCount = 2; } } }
/// <summary> /// 初始化界面 /// </summary> protected void Initialize() { #region 窗口阴影 WinAPI.SetClassLong(this.Handle, WinAPI.GCL_STYLE, WinAPI.GetClassLong(this.Handle, WinAPI.GCL_STYLE) | WinAPI.CS_DropSHADOW); //API函数加载,实现窗体边框阴影效果 #endregion #region 画板初始化 Logger.LogInfo("画板初始化!"); RECT defult = new RECT(); this.board = new MBorad(); this.board.Dock = DockStyle.Fill; this.board.Location = new Point(0, 0); this.board.Name = "cBoard"; this.board.BackColor = Color.Black; this.board.Click += Board_Click; this.board.DoubleClick += Board_DoubleClick; this.board.MouseWheel += Board_MouseWheel; this.Controls.Add(board); #endregion #region 第二行 #region 买卖基价 lbs1 = new MLabels(); Logger.LogInfo("初始化买入基价!"); MLabel lbbuy = new MLabel(); lbbuy.Text = "买入基价:"; lbbuy.ForeColor = COLOR.RGB(Color.Red); lbbuy.BackColor = -1; lbbuy.Font = MCommonData.d2Font; lbbuy.LeftAligned = true; lbs1.lbs.Add(lbbuy); Logger.LogInfo("初始化买入基价值!"); MLabel lbbuyvalue = new MLabel(); lbbuyvalue.Text = " "; lbbuyvalue.ForeColor = COLOR.RGB(Color.White); lbbuyvalue.BackColor = -1; lbbuyvalue.Font = MCommonData.d3Font; lbbuyvalue.LeftAligned = true; lbs1.lbs.Add(lbbuyvalue); Logger.LogInfo("初始化卖出基价!"); MLabel lbsell = new MLabel(); lbsell.Text = "卖出基价:"; lbsell.ForeColor = COLOR.RGB(Color.Green); lbsell.BackColor = -1; lbsell.Font = MCommonData.d2Font; lbsell.LeftAligned = true; lbs1.lbs.Add(lbsell); Logger.LogInfo("初始化卖出基价值!"); MLabel lbsellvalue = new MLabel(); lbsellvalue.Text = " "; lbsellvalue.ForeColor = COLOR.RGB(Color.White); lbsellvalue.BackColor = -1; lbsellvalue.Font = MCommonData.d3Font; lbsellvalue.LeftAligned = true; lbs1.lbs.Add(lbsellvalue); this.board.AddControl(lbs1); #endregion #endregion #region 表格 table = new MUseTable(); this.board.AddControl(table); #endregion #region 择框 Logger.LogInfo("初始化第二行快捷按钮!"); select = new MSelect(); select.BackgroundImage = Resources.select_normal; select.MouseClickImage = Resources.select_press; select.MouseEnterImage = Resources.select_normal; select.Font = MCommonData.d4Font; select.ForeColor = COLOR.RGB(MCommonData.fontColor4); select.DropDownBoxForeColor = COLOR.RGB(MCommonData.fontColor5); select.DropDownBoxBackColor = COLOR.RGB(MCommonData.fontColor4); select.DropDownBoxRowMouseEnterColor = COLOR.RGB(MCommonData.fontColor13); select.Text = "请选择"; select.TextChangeEvent += Select_TextChangeEvent; this.board.AddControl(select); #endregion Initialized(); this.SizeChanged += Form1_SizeChanged; Draw(); }
public static void CloneMLabel(MLabel source, MLabel target) { CloneControl(source, target); target.AutoSize = source.AutoSize; }
public static MLabel Modify(this MLabel label) { return(new MLabel(label.Text.Modify(), label.Url.Modify(), label.Title.Modify())); }
public static void MLabel_Equals() { MLabel label = CreateLabel(); Assert.True(label.Equals((object)label)); }
public static void MLabel_GetHashCode_Equal() { MLabel label = CreateLabel(); Assert.Equal(label.GetHashCode(), label.GetHashCode()); }
/// <summary> /// 控件属性事件设置 /// </summary> /// <param name="element"></param> public override void ControlSetting(MLabel control) { base.ControlSetting(control); }
private MLabel CreateYoteiDateLabel(string labelText, int x, int y) { MLabel ml = new MLabel(); // TODO 日付表示向けに、スタイルを調整する // TODO 曜日を指定する必要がある(曜日によって、ラベルの色が変わる) ml.LayerNo = ICON_LAYER_NO; ml.BackColor = Color.Yellow; ml.ForeColor = Color.Black; ml.FontHeight = 11; // TODO 開発版では10だと正常に表示されない(原因は後日調査) ml.FontWidth = 1; //ml.FontWidth = 11; ml.LabelString = labelText; ml.X = x; ml.Y = y; ml.FontStyle = mwcFontStyle.FS_BOLD; ml.Style = 0; ml.UseLayerAttrib = false;//レイヤ設定使うか return ml; }
private MLabel CreateToolTipLabel(string labelText, int x, int y) { MLabel ml = new MLabel(); ml.LayerNo = ICON_LAYER_NO; ml.BackColor = Color.YellowGreen; ml.ForeColor = Color.Black; ml.FontHeight = 10; // TODO 開発版では10だと正常に表示されない(原因は後日調査) ml.FontWidth = 1; //ml.FontWidth = 10; ml.LabelString = labelText; ml.X = x; ml.Y = y; ml.FontStyle = mwcFontStyle.FS_BOLD; ml.Style = 1001; //吹き出し風 //ml.Style = 4; //吹き出し風 ml.UseLayerAttrib = false;//レイヤ設定使うか // 初期表示では表示しない ml.Visible = false; return ml; }