internal Point InitialOrigin(Point origin) { if (this.Group != null) { if (this.Group.Layout is MultiLayout) { return(origin); } Point loc = this.Group.Location; if (Double.IsNaN(loc.X) || Double.IsNaN(loc.Y)) { return(origin); } GroupPanel gp = this.Group.GroupPanel; if (gp != null) { loc = this.Group.GetElementPoint(gp, Spot.TopLeft); loc.X += gp.Padding.Left; loc.Y += gp.Padding.Top; } else { loc = this.Group.Position; } return(loc); } return(origin); }
private void lblMessage_Draw(object sender, DrawEventArgs e) { // update parent Panel with new Height Label lbl = sender as Label; string parentName = lbl.Parent.Parent.Text; int num = int.Parse(lbl.Parent.Parent.Tag.ToString()); GroupPanel newsPnl = ScreenManager.MainWindow.ClientArea.Controls["InsaneRO News"] as GroupPanel; Panel newsSubPanel = newsPnl.ClientArea.Controls[parentName] as Panel; newsSubPanel.Height = lbl.ClientHeight + 15 + 24; // get top padding from other panels above this int top = 10 + (num * 10); for (int i = 0; i < num; i++) { top += newsPnl.ClientArea.Controls["News_" + num].ClientHeight; } newsSubPanel.Top = top; newsSubPanel.Invalidate(); // refresh newsPnl.Refresh(); newsPnl.Invalidate(); // no need to do this more than once lbl.Draw -= new DrawEventHandler(lblMessage_Draw); }
private void dropPanel_OnDelete(GroupPanel sender, NpcDropGroup data) { int index = lstDropGroups.Children.IndexOf(sender); if (index < 0) { return; } // if (data.Items.Count > 0) { MessageBoxResult r = MessageBox.Show("Are you sure you want to delete the current Drop group?", "Warning!", MessageBoxButton.YesNo, MessageBoxImage.Warning); if (r == MessageBoxResult.No) { return; } } // GroupPanel panel; int c = lstDropGroups.Children.Count; for (int i = index + 1; i < c; i++) { panel = (GroupPanel)lstDropGroups.Children[i]; panel.SetIndex(i - 1); } // lstDropGroups.Children.RemoveAt(index); npcMgr.HasChanges = true; hasDropChanges = true; }
private void Start() { SimulationControlPanel.Open(); BuildingPanel.Close(); AgentPanel.Close(); GroupPanel.Close(); HeatmapPanel.Open(); }
public GroupView AddGroupView(GroupPanel _group) { var groupView = new GroupView(); groupView.SetUp(_group, CommandDispatcher, this); GroupViews[_group] = groupView; AddElement(groupView); AddSelectionsToGroup(groupView); return(groupView); }
public void RemoveGroupView(GroupPanel _group) { if (!GroupViews.TryGetValue(_group, out GroupView _groupView)) { return; } RemoveElement(_groupView); GroupViews.Remove(_group); }
//----------------------------- // Drop Groups private GroupPanel appendDropPanel(NpcDropGroup data) { int i = lstDropGroups.Children.Count; GroupPanel panel = new GroupPanel(); panel.Margin = new Thickness(2, 2, 2, 2); panel.SetIndex(i); panel.Load(data); panel.OnDelete += dropPanel_OnDelete; panel.OnChanged += dropPanel_OnChanged; lstDropGroups.Children.Add(panel); return(panel); }
public void UpdateGroupControl(GroupPanel groupControl, string text) { if (groupControl.InvokeRequired) { groupControl.BeginInvoke( new MethodInvoker( delegate { UpdateGroupControl(groupControl, text); })); } else { groupControl.Text = text; } }
/// <summary> /// 获取GroupBox控件成员勾选的值 /// </summary> /// <param name="group">包含CheckBox控件组的GroupBox控件</param> /// <returns>返回逗号分隔的值列表</returns> public static string GetCheckedItems(GroupPanel group) { string resultList = ""; foreach (Control control in group.Controls) { CheckBox chk = control as CheckBox; if (chk != null && chk.Checked) { resultList += string.Format("{0},", chk.Text); } } return(resultList.Trim(',')); }
/// <summary> /// 如果列表中有的,根据内容勾选GroupBox里面的成员 /// </summary> /// <param name="group">包含CheckBox控件组的GroupBox控件</param> /// <param name="valueList">逗号分隔的值列表</param> public static void SetCheck(GroupPanel group, string valueList) { string[] strtemp = valueList.Split(','); foreach (string str in strtemp) { foreach (Control control in group.Controls) { CheckBox chk = control as CheckBox; if (chk != null && chk.Text == str) { chk.Checked = true; } } } }
// so, the whole page reloads, and then a modal pops up..... // that is a terrible UX. so TO JAVASCRIPT WE GOOOOOO public void loadComments(object sender, EventArgs evt) { int postId = Int32.Parse((sender as LinkButton).Attributes["postid"]); List <Post> comments = getComments(postId); // find a post with the matching postID in the DOM...... !!!!!!!!!!! FML! WHY C#! WHY!!!! Control Post = GroupPanel.FindControl("post" + postId); int i = GroupPanel.Controls.IndexOf(Post) + 1; // then find that element in the list of controls, so we can add stuff after it. foreach (Post post in comments) { GroupPanel.Controls.AddAt(i, post.control); i++; } }
private void SetWarring(IMoralConductInstance item, GroupPanel groupPanel) { if (!item.IsValidate) { //Resize圖片成16*16大小 Bitmap b = new Bitmap(14, 14); using (Graphics g = Graphics.FromImage(b)) g.DrawImage(Properties.Resources.warning1, 0, 0, 14, 14); groupPanel.TitleImage = b; } else { groupPanel.TitleImage = null; } }
private void AddNews(string author, string date, string title, string message, int num) { GroupPanel newsPnl = ScreenManager.MainWindow.ClientArea.Controls["InsaneRO News"] as GroupPanel; Panel pnl = new Panel(WindowManager); pnl.Init(); pnl.Text = "News_" + num; pnl.Tag = num; pnl.Width = newsPnl.ClientWidth - 20; pnl.Height = 210; pnl.Left = 10; pnl.Top = (num * 10) + (num * 210) + 10; pnl.BevelBorder = EBevelBorder.All; pnl.BevelMargin = 1; pnl.BevelStyle = EBevelStyle.Flat; pnl.Color = Color.Transparent; pnl.Passive = true; Label lblTitle = new Label(WindowManager); lblTitle.Init(); lblTitle.Skin.Layers[0].Text.Font.Resource = WindowManager.Skin.Fonts[WindowManager.Skin.Controls["Dialog"].Layers["TopPanel"].Attributes["CaptFont"].Value].Resource; lblTitle.Text = "'" + title + "' - Von " + author + " (" + date + ")"; lblTitle.TextColor = new Color(81, 172, 232); lblTitle.Top = 5; lblTitle.Left = 5; lblTitle.Width = pnl.ClientWidth - 15; lblTitle.Height = 24; lblTitle.Alignment = EAlignment.TopLeft; pnl.Add(lblTitle); Label lblMessage = new Label(WindowManager); lblMessage.Init(); lblMessage.Text = ""; lblMessage.TextLines.AddRange(message.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)); lblMessage.Top = 5 + 5 + 24; lblMessage.Left = 10; lblMessage.Width = pnl.ClientWidth - 20; lblMessage.Height = pnl.ClientHeight - 15 - 24; lblMessage.Ellipsis = false; lblMessage.Alignment = EAlignment.TopLeft; lblMessage.Autosize = true; lblMessage.Draw += new DrawEventHandler(lblMessage_Draw); pnl.Add(lblMessage); newsPnl.Add(pnl); }
// Start is called before the first frame update //TODO: check if need to delete component by keeping tabs private void Start() { // this is to render existing group controller = Canvas.GetComponent <GroupInformationcontrol>(); //group = controller.GetGroupMap(); groupObject = new List <GameObject>(); master = GroupPanel.GetComponent <Transform>(); index = 0; Debug.Log(group); //Debug.Log(group); foreach (string x in group.Keys) { Debug.Log(x); Instant(x); index++; } }
public SplitPanel(int l) { InitializeComponent(); lPanel = new GroupPanel(l) { Dock = DockStyle.Fill }; rPanel = new GroupPanel(l) { Dock = DockStyle.Fill }; lPanel.TabEmpty += lPanel_TabEmpty; lPanel.OnFocused += GPanel_OnFocused; rPanel.TabEmpty += rPanel_TabEmpty; rPanel.OnFocused += GPanel_OnFocused; cPanel = lPanel; DoubleBuffered = true; SetStyle(ControlStyles.DoubleBuffer | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); UpdateStyles(); scPanel.Panel1.Controls.Add(lPanel); scPanel.Panel2.Controls.Add(rPanel); void lPanel_TabEmpty() { SPanelEmpty?.Invoke(rPanel); } void rPanel_TabEmpty() { SPanelEmpty?.Invoke(lPanel); } void GPanel_OnFocused(GroupPanel gp) { cPanel = gp; } }
private void groupPanel_TitleClick(object sender, EventArgs e) { flowLayoutPanel.SuspendLayout(); GroupPanel groupPanel = sender as GroupPanel; groupPanel.Expand(); if (groupPanel1 != groupPanel) { groupPanel1.Collapse(); } if (groupPanel2 != groupPanel) { groupPanel2.Collapse(); } flowLayoutPanel.ResumeLayout(); }
public TaskCrafting(Manager manager) : base(manager) { //Set up the window TopPanel.Visible = true; BottomPanel.Visible = false; Resizable = false; Height = 512; Width = 696; imageCaption = new ImageBox(manager); imageCaption.Init(); imageCaption.Left = 8; imageCaption.Width = 48; imageCaption.Height = 48; imageCaption.Top = -4; Add(imageCaption); Caption.Left = Description.Left = imageCaption.Left + imageCaption.Width + 8; TopPanel.Height = imageCaption.Height + 8; grpPnlRecipie = new GroupPanel(manager); grpPnlRecipie.Init(); grpPnlRecipie.Left = 4; grpPnlRecipie.Top = TopPanel.Height + 2; grpPnlRecipie.Width = (ClientWidth / 2) - 4 - 2; grpPnlRecipie.Height = ClientHeight - grpPnlRecipie.Top - 6; grpPnlRecipie.Text = "Recipies"; grpPnlRecipie.Color = Color.White; Add(grpPnlRecipie); grpPnlItem = new GroupPanel(manager); grpPnlItem.Init(); grpPnlItem.Left = (ClientWidth / 2) + 2; grpPnlItem.Top = TopPanel.Height + 2; grpPnlItem.Width = (ClientWidth / 2) - 6; grpPnlItem.Height = ClientHeight - grpPnlRecipie.Top - 6; grpPnlItem.Text = "Item"; grpPnlItem.Color = Color.White; Add(grpPnlItem); pnlItem = new Panel(manager); pnlItem.Anchor = Anchors.Left | Anchors.Top | Anchors.Right; pnlItem.Init(); pnlItem.Width = grpPnlItem.ClientWidth; pnlItem.Height = 64; pnlItem.BevelBorder = BevelBorder.Bottom; grpPnlItem.Add(pnlItem); grpPnlReq = new GroupPanel(manager); grpPnlReq.Init(); grpPnlReq.Left = -1; grpPnlReq.Top = 62; grpPnlReq.Width = (ClientWidth / 2) - 6; grpPnlReq.Height = 84; grpPnlReq.Text = "Requirements"; grpPnlReq.Color = Color.White; grpPnlItem.Add(grpPnlReq); imgItem = new ImageBox(manager); imgItem.Init(); imgItem.Left = 8; imgItem.Width = 0; imgItem.Height = 0; imgItem.Top = 8; pnlItem.Add(imgItem); lblName = new Label(manager); lblName.Init(); lblName.Left = imgItem.Width + imgItem.Left + 6; lblName.Top = imgItem.Top; lblName.Width = pnlItem.Width - lblName.Left; lblName.Font = FontSize.Default12; pnlItem.Add(lblName); lblDesc = new Label(manager); lblDesc.Init(); lblDesc.Left = imgItem.Width + imgItem.Left + 10; lblDesc.Top = lblName.Top + lblName.Height; lblDesc.Width = pnlItem.Width - lblName.Left; lblDesc.TextColor = Color.Gray; pnlItem.Add(lblDesc); lblIngredients = new Label(manager); lblIngredients.Init(); lblIngredients.Left = 8; lblIngredients.Top = 4; lblIngredients.Height = Tile.Height; lblIngredients.Text = "Ingredients:"; lblIngredients.Width = (int)manager.Skin.Fonts[0].Resource.MeasureRichString(lblIngredients.Text, manager).X; grpPnlReq.Add(lblIngredients); lblStation = new Label(manager); lblStation.Init(); lblStation.Left = 8; lblStation.Top = lblIngredients.Top + lblIngredients.Height + 8; lblStation.Text = "Station:"; lblStation.Width = (int)manager.Skin.Fonts[0].Resource.MeasureRichString(lblStation.Text, manager).X; grpPnlReq.Add(lblStation); cmbTopCat = new ComboBox(manager); cmbTopCat.Init(); cmbTopCat.Left = 8; cmbTopCat.Top = 8; cmbTopCat.Width = grpPnlRecipie.Width / 2 - 11; cmbTopCat.Items.AddRange(ItemCategory.ItemCategories.Where(x => x.TopLevel).Select(element => element.Name).ToList()); grpPnlRecipie.Add(cmbTopCat); cmbSubCat = new ComboBox(manager); cmbSubCat.Init(); cmbSubCat.Left = cmbTopCat.Left + cmbTopCat.Width + 2; cmbSubCat.Top = cmbTopCat.Top; cmbSubCat.Width = grpPnlRecipie.Width / 2 - 8; cmbSubCat.MaxItems = 128; grpPnlRecipie.Add(cmbSubCat); cmbSubCat.Items.Add(ItemCategory.All.Name); chkHasMaterials = new CheckBox(manager); chkHasMaterials.Init(); chkHasMaterials.Top = cmbTopCat.Top + cmbTopCat.Height + 8; chkHasMaterials.Left = cmbTopCat.Left; chkHasMaterials.Text = "Have Materials"; chkHasMaterials.Width = 106; chkHasMaterials.ToolTip.Text = "Only display items that you have materials for."; chkHasMaterials.CheckedChanged += chkHasMaterials_CheckedChanged; grpPnlRecipie.Add(chkHasMaterials); chkAtStation = new CheckBox(manager); chkAtStation.Init(); chkAtStation.Top = cmbTopCat.Top + cmbTopCat.Height + 8; chkAtStation.Left = cmbTopCat.Left + chkHasMaterials.Width; chkAtStation.Text = "At Station"; chkAtStation.Width = 80; chkAtStation.ToolTip.Text = "Only display items who's crafting station is near."; chkAtStation.CheckedChanged += chkAtStation_CheckedChanged; grpPnlRecipie.Add(chkAtStation); txtSearch = new TextBox(manager); txtSearch.Init(); txtSearch.Top = cmbTopCat.Top + cmbTopCat.Height + 4; txtSearch.Left = chkAtStation.Left + chkAtStation.Width; txtSearch.Text = "Search..."; txtSearch.Width = 131; txtSearch.ToolTip.Text = "Only display items that contain or match the search text."; txtSearch.FocusGained += txtSearch_FocusGained; txtSearch.FocusLost += txtSearch_FocusLost; txtSearch.TextChanged += txtSearch_TextChanged; grpPnlRecipie.Add(txtSearch); itemSelector = new ControlList <ItemListControl>(manager); itemSelector.Init(); itemSelector.Width = grpPnlRecipie.ClientWidth - 16; itemSelector.Height = grpPnlRecipie.ClientHeight - 16 - chkHasMaterials.Top - chkHasMaterials.Height; itemSelector.Left = 8; itemSelector.Top = chkHasMaterials.Top + chkHasMaterials.Height + 8; grpPnlRecipie.Add(itemSelector); pnlCraft = new Panel(manager); pnlCraft.Anchor = Anchors.Left | Anchors.Bottom | Anchors.Right; pnlCraft.Init(); pnlCraft.Width = grpPnlItem.ClientWidth; pnlCraft.Height = 56 + 8 + 8; pnlCraft.Top = grpPnlItem.ClientHeight - pnlCraft.Height; pnlCraft.BevelBorder = BevelBorder.Top; grpPnlItem.Add(pnlCraft); grpPnlStats = new GroupPanel(manager); grpPnlStats.Init(); grpPnlStats.Left = -1; grpPnlStats.Top = grpPnlReq.Top + grpPnlReq.Height; grpPnlStats.Width = grpPnlReq.Width; grpPnlStats.Height = (int)Math.Abs(pnlCraft.Top - (grpPnlReq.Top + grpPnlReq.Height)) + 2; grpPnlStats.Text = "Stats"; grpPnlStats.Color = Color.White; grpPnlItem.Add(grpPnlStats); btnCraft = new Button(manager); btnCraft.Init(); btnCraft.Enabled = false; btnCraft.Text = "Craft"; btnCraft.Left = (grpPnlItem.Width / 2) - btnCraft.Width - 4; btnCraft.Top = grpPnlItem.ClientHeight - btnCraft.Height - 8; btnCraft.Click += btnCraft_Click; grpPnlItem.Add(btnCraft); itemSlotOutput[0] = new Slot(Item.Blank, 0); sltOutput = new SlotContainer(manager, 1, 1); sltOutput.ItemSlots = itemSlotOutput; sltOutput.Init(); sltOutput.Left = (grpPnlItem.ClientWidth / 2) + 4; sltOutput.Top = grpPnlItem.ClientHeight - sltOutput.Height; sltOutput.MoveItems += sltOutput_MoveItems; sltOutput.CanAdd = false; spnCraft = new SpinBox(manager, SpinBoxMode.Range); spnCraft.Init(); spnCraft.Width = btnCraft.Width; spnCraft.Left = (grpPnlItem.Width / 2) - spnCraft.Width - 4; spnCraft.Minimum = 0; spnCraft.Maximum = (int)StackSize.Max; spnCraft.ReadOnly = false; spnCraft.Rounding = 0; spnCraft.Top = sltOutput.Top; spnCraft.TextChanged += spnCraft_TextChanged; grpPnlItem.Add(spnCraft); grpPnlItem.Add(sltOutput); itemSlotInput[0] = new Slot(Item.Blank, 0); sltInput = new SlotContainer(manager, 1, 1); sltInput.ItemSlots = itemSlotInput; sltInput.Init(); sltInput.Left = btnCraft.Left - sltInput.ClientWidth; sltInput.Top = grpPnlItem.ClientHeight - sltOutput.Height + 4; sltInput.CheckItems += sltInput_CheckItems; sltInput.MoveItems += sltInput_MoveItems; sltInput.CanAdd = true; grpPnlItem.Add(sltOutput); grpPnlItem.Add(sltInput); prgFuel = new ProgressBar(manager); prgFuel.Init(); prgFuel.Color = Color.Orange; prgFuel.Text = "Fuel"; prgFuel.ToolTip.Text = "Fuel"; prgFuel.Top = pnlCraft.Top + 4; prgFuel.Left = sltInput.Left; prgFuel.Width = sltInput.ClientWidth - 8; prgFuel.Height = 15; grpPnlItem.Add(prgFuel); prgOutput = new ProgressBar(manager); prgOutput.Init(); prgOutput.Color = Color.ForestGreen; prgOutput.Text = "Output"; prgOutput.ToolTip.Text = "Output"; prgOutput.Top = pnlCraft.Top + 4; prgOutput.Left = sltOutput.Left; prgOutput.Width = sltOutput.ClientWidth - 8; prgOutput.Height = 15; grpPnlItem.Add(prgOutput); imgStationNeeded = new ImageBox(Manager); imgStationNeeded.Init(); grpPnlReq.Add(imgStationNeeded); lblStationNeeded = new Label(Manager); lblStationNeeded.Init(); grpPnlReq.Add(lblStationNeeded); ItemStatLabels = new Label[15]; for (int j = 0; j < 15; j++) { ItemStatLabels[j] = new Label(Manager); ItemStatLabels[j].Init(); ingredientsNeeded.Add(Tuple.Create(new ImageBox(Manager), new Label(Manager))); ingredientsNeeded[j].Item1.Init(); } HideAll(); SetupCraftingControls(manager); Center(); }
private void InitializeComponent() { this.btnOK = new ButtonX(); this.btnCancel = new ButtonX(); this.tbSoundPath = new TextBoxX(); this.groupPanel1 = new GroupPanel(); this.labelX1 = new LabelX(); this.groupPanel2 = new GroupPanel(); this.rbExit = new System.Windows.Forms.RadioButton(); this.rbHide = new System.Windows.Forms.RadioButton(); this.btnBrowse = new ButtonX(); this.groupPanel1.SuspendLayout(); this.groupPanel2.SuspendLayout(); base.SuspendLayout(); this.btnOK.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnOK.ColorTable = eButtonColor.OrangeWithBackground; this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; this.btnOK.Location = new System.Drawing.Point(245, 238); this.btnOK.Name = "btnOK"; this.btnOK.Size = new System.Drawing.Size(75, 23); this.btnOK.Style = eDotNetBarStyle.StyleManagerControlled; this.btnOK.TabIndex = 0; this.btnOK.Text = "确定"; this.btnOK.Click += new System.EventHandler(this.btnOK_Click); this.btnCancel.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnCancel.ColorTable = eButtonColor.OrangeWithBackground; this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnCancel.Location = new System.Drawing.Point(364, 238); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(75, 23); this.btnCancel.Style = eDotNetBarStyle.StyleManagerControlled; this.btnCancel.TabIndex = 1; this.btnCancel.Text = "取消"; this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); this.tbSoundPath.BackColor = System.Drawing.Color.White; this.tbSoundPath.Border.Class = "TextBoxBorder"; this.tbSoundPath.Border.CornerType = eCornerType.Square; this.tbSoundPath.DisabledBackColor = System.Drawing.Color.White; this.tbSoundPath.ForeColor = System.Drawing.Color.Black; this.tbSoundPath.Location = new System.Drawing.Point(83, 9); this.tbSoundPath.Name = "tbSoundPath"; this.tbSoundPath.PreventEnterBeep = true; this.tbSoundPath.ReadOnly = true; this.tbSoundPath.Size = new System.Drawing.Size(297, 21); this.tbSoundPath.TabIndex = 2; this.groupPanel1.BackColor = System.Drawing.Color.FromArgb(254, 254, 254); this.groupPanel1.CanvasColor = System.Drawing.Color.FromArgb(254, 254, 254); this.groupPanel1.ColorSchemeStyle = eDotNetBarStyle.StyleManagerControlled; this.groupPanel1.Controls.Add(this.btnBrowse); this.groupPanel1.Controls.Add(this.labelX1); this.groupPanel1.Controls.Add(this.tbSoundPath); this.groupPanel1.DisabledBackColor = System.Drawing.Color.Empty; this.groupPanel1.Location = new System.Drawing.Point(12, 12); this.groupPanel1.Name = "groupPanel1"; this.groupPanel1.Size = new System.Drawing.Size(438, 76); this.groupPanel1.Style.BackColor2SchemePart = eColorSchemePart.PanelBackground2; this.groupPanel1.Style.BackColorGradientAngle = 90; this.groupPanel1.Style.BackColorSchemePart = eColorSchemePart.PanelBackground; this.groupPanel1.Style.BorderBottom = eStyleBorderType.Solid; this.groupPanel1.Style.BorderBottomWidth = 1; this.groupPanel1.Style.BorderColorSchemePart = eColorSchemePart.PanelBorder; this.groupPanel1.Style.BorderLeft = eStyleBorderType.Solid; this.groupPanel1.Style.BorderLeftWidth = 1; this.groupPanel1.Style.BorderRight = eStyleBorderType.Solid; this.groupPanel1.Style.BorderRightWidth = 1; this.groupPanel1.Style.BorderTop = eStyleBorderType.Solid; this.groupPanel1.Style.BorderTopWidth = 1; this.groupPanel1.Style.CornerDiameter = 4; this.groupPanel1.Style.CornerType = eCornerType.Rounded; this.groupPanel1.Style.TextColorSchemePart = eColorSchemePart.PanelText; this.groupPanel1.Style.TextLineAlignment = eStyleTextAlignment.Near; this.groupPanel1.StyleMouseDown.CornerType = eCornerType.Square; this.groupPanel1.StyleMouseOver.CornerType = eCornerType.Square; this.groupPanel1.TabIndex = 3; this.groupPanel1.Text = "声音提醒"; this.labelX1.BackColor = System.Drawing.Color.Transparent; this.labelX1.BackgroundStyle.CornerType = eCornerType.Square; this.labelX1.ForeColor = System.Drawing.Color.Black; this.labelX1.Location = new System.Drawing.Point(15, 9); this.labelX1.Name = "labelX1"; this.labelX1.Size = new System.Drawing.Size(68, 23); this.labelX1.Style = eDotNetBarStyle.StyleManagerControlled; this.labelX1.TabIndex = 3; this.labelX1.Text = "声音路径:"; this.groupPanel2.BackColor = System.Drawing.Color.FromArgb(254, 254, 254); this.groupPanel2.CanvasColor = System.Drawing.Color.FromArgb(254, 254, 254); this.groupPanel2.ColorSchemeStyle = eDotNetBarStyle.StyleManagerControlled; this.groupPanel2.Controls.Add(this.rbHide); this.groupPanel2.Controls.Add(this.rbExit); this.groupPanel2.DisabledBackColor = System.Drawing.Color.Empty; this.groupPanel2.Location = new System.Drawing.Point(12, 102); this.groupPanel2.Name = "groupPanel2"; this.groupPanel2.Size = new System.Drawing.Size(438, 100); this.groupPanel2.Style.BackColor2SchemePart = eColorSchemePart.PanelBackground2; this.groupPanel2.Style.BackColorGradientAngle = 90; this.groupPanel2.Style.BackColorSchemePart = eColorSchemePart.PanelBackground; this.groupPanel2.Style.BorderBottom = eStyleBorderType.Solid; this.groupPanel2.Style.BorderBottomWidth = 1; this.groupPanel2.Style.BorderColorSchemePart = eColorSchemePart.PanelBorder; this.groupPanel2.Style.BorderLeft = eStyleBorderType.Solid; this.groupPanel2.Style.BorderLeftWidth = 1; this.groupPanel2.Style.BorderRight = eStyleBorderType.Solid; this.groupPanel2.Style.BorderRightWidth = 1; this.groupPanel2.Style.BorderTop = eStyleBorderType.Solid; this.groupPanel2.Style.BorderTopWidth = 1; this.groupPanel2.Style.CornerDiameter = 4; this.groupPanel2.Style.CornerType = eCornerType.Rounded; this.groupPanel2.Style.TextColorSchemePart = eColorSchemePart.PanelText; this.groupPanel2.Style.TextLineAlignment = eStyleTextAlignment.Near; this.groupPanel2.StyleMouseDown.CornerType = eCornerType.Square; this.groupPanel2.StyleMouseOver.CornerType = eCornerType.Square; this.groupPanel2.TabIndex = 4; this.groupPanel2.Text = "窗口关闭"; this.rbExit.AutoSize = true; this.rbExit.BackColor = System.Drawing.Color.FromArgb(254, 254, 254); this.rbExit.ForeColor = System.Drawing.Color.Black; this.rbExit.Location = new System.Drawing.Point(15, 16); this.rbExit.Name = "rbExit"; this.rbExit.Size = new System.Drawing.Size(95, 16); this.rbExit.TabIndex = 0; this.rbExit.Text = "直接退出程序"; this.rbExit.UseVisualStyleBackColor = false; this.rbHide.AutoSize = true; this.rbHide.BackColor = System.Drawing.Color.FromArgb(254, 254, 254); this.rbHide.Checked = true; this.rbHide.ForeColor = System.Drawing.Color.Black; this.rbHide.Location = new System.Drawing.Point(15, 48); this.rbHide.Name = "rbHide"; this.rbHide.Size = new System.Drawing.Size(83, 16); this.rbHide.TabIndex = 1; this.rbHide.TabStop = true; this.rbHide.Text = "隐藏到托盘"; this.rbHide.UseVisualStyleBackColor = false; this.btnBrowse.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnBrowse.ColorTable = eButtonColor.OrangeWithBackground; this.btnBrowse.Location = new System.Drawing.Point(387, 8); this.btnBrowse.Name = "btnBrowse"; this.btnBrowse.Size = new System.Drawing.Size(37, 23); this.btnBrowse.Style = eDotNetBarStyle.StyleManagerControlled; this.btnBrowse.TabIndex = 4; this.btnBrowse.Text = "..."; this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click); base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f); base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; base.ClientSize = new System.Drawing.Size(462, 279); base.Controls.Add(this.groupPanel2); base.Controls.Add(this.groupPanel1); base.Controls.Add(this.btnCancel); base.Controls.Add(this.btnOK); this.DoubleBuffered = true; base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "SettingForm"; base.ShowIcon = false; base.ShowInTaskbar = false; base.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "设置"; this.groupPanel1.ResumeLayout(false); this.groupPanel2.ResumeLayout(false); this.groupPanel2.PerformLayout(); base.ResumeLayout(false); }
public override void Initialize() { base.Initialize(); string[] actions = new string[]{ "Gegner suchen", "Deck bearbeiten", "noch ne Aktion", "Und noch eine", "keine Ahnung", "Ficken?", "Ok o.o", "blubb", "foo", "bar", "moepse sin toll", }; // just to refresh ScreenManager.MainWindow.BringToFront(); #region Links - Übersicht GroupPanel wnd = new GroupPanel(WindowManager); wnd.Init(); wnd.Text = "Übersicht"; wnd.TextColor = Color.LightGray; wnd.Width = 200; wnd.Height = ScreenManager.MainWindow.ClientHeight - 40; wnd.Top = 20; wnd.Left = 20; wnd.Visible = true; // Actions int btnWidth = 160; int btnHeight = 40; Button btn; for (int i = 0; i < actions.Length; i++) { btn = new Button(WindowManager); btn.Init(); btn.Width = btnWidth; btn.Height = btnHeight; btn.Left = 20; btn.Top = ((i * 20) + btnHeight * i) + 20; btn.Text = actions[i]; btn.Click += new WindowLibrary.Controls.EventHandler(ActionButton_Click); btn.Tag = i; wnd.Add(btn); } AddWindow(wnd); #endregion #region Rechts - Spiele & Statistik GroupPanel runingGamesPanel = new GroupPanel(WindowManager); runingGamesPanel.Init(); runingGamesPanel.Text = "Laufende Spiele"; runingGamesPanel.TextColor = Color.LightGray; runingGamesPanel.Width = 200; runingGamesPanel.Height = 400; runingGamesPanel.Top = 20; runingGamesPanel.Left = ScreenManager.MainWindow.ClientWidth - runingGamesPanel.Width - 20; runingGamesPanel.Visible = true; AddWindow(runingGamesPanel); GroupPanel statPanel = new GroupPanel(WindowManager); statPanel.Init(); statPanel.Text = "Statistik"; statPanel.TextColor = Color.LightGray; statPanel.Width = 200; statPanel.Height = ScreenManager.MainWindow.ClientHeight - 460; statPanel.Top = 440; statPanel.Left = ScreenManager.MainWindow.ClientWidth - statPanel.Width - 20; statPanel.Visible = true; AddWindow(statPanel); #endregion #region Mitte - Chat TabControl tbc = new TabControl(WindowManager); mConsole = new WindowLibrary.Controls.Console(WindowManager); tbc.Init(); tbc.AddPage("Allgemein"); tbc.Alpha = 200; tbc.Left = 240; tbc.Height = 220; tbc.Width = ScreenManager.MainWindow.ClientWidth - 480; tbc.Top = ScreenManager.MainWindow.ClientHeight - tbc.Height - 18; tbc.Movable = false; tbc.Resizable = false; tbc.MinimumHeight = 96; tbc.MinimumWidth = 160; tbc.TabPages[0].Add(mConsole); mConsole.Init(); mConsole.Width = tbc.TabPages[0].ClientWidth; mConsole.Height = tbc.TabPages[0].ClientHeight; mConsole.Anchor = EAnchors.All; mConsole.Channels.Add(new ConsoleChannel(0, "Allgemein", Color.White)); mConsole.SelectedChannel = 0; mConsole.MessageFormat = ConsoleMessageFormats.None; SendSystemMessage("Dein Login war erfolgreich!"); SendSystemMessage("Willkommen im InsaneRO Card Game ;D"); mConsole.MessageSent += new ConsoleMessageEventHandler(Channel1_MessageSent); AddWindow(tbc); #endregion GroupPanel newsPanel = new GroupPanel(WindowManager); newsPanel.Init(); newsPanel.Text = "InsaneRO News"; newsPanel.TextColor = Color.LightGray; newsPanel.Width = ScreenManager.MainWindow.ClientWidth - 480; newsPanel.Height = ScreenManager.MainWindow.ClientHeight - 40 - 220; newsPanel.Top = 20; newsPanel.Left = 240; newsPanel.Visible = true; newsPanel.AutoScroll = EAutoScroll.Vertical; AddWindow(newsPanel); LoadNews(); }
void OnGroupRemoved(GroupPanel _group) { RemoveGroupView(_group); SetDirty(); }
//void OnStackAdded(StackPanel _stack) //{ // AddStackNodeView(_stack); //} //void OnStackRemoved(StackPanel _stack) //{ // RemoveStackNodeView(StackViews[_stack.GUID]); //} void OnGroupAdded(GroupPanel _group) { AddGroupView(_group); SetDirty(); }
public TaskControls(Manager manager) : base(manager) { MinimumWidth = 340; MinimumHeight = 140; Height = 480; Center(); Text = "Controls Test"; TopPanel.Visible = true; Caption.Text = "Information"; Description.Text = "Demonstration of various controls available in Window Library"; Caption.TextColor = Description.TextColor = new Color(96, 96, 96); grpEdit = new GroupPanel(Manager); grpEdit.Init(); grpEdit.Parent = this; grpEdit.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right; grpEdit.Width = ClientWidth - 200; grpEdit.Height = 160; grpEdit.Left = 8; grpEdit.Top = TopPanel.Height + 8; grpEdit.Text = "EditBox"; pnlControls = new Panel(Manager); pnlControls.Init(); pnlControls.Passive = true; pnlControls.Parent = this; pnlControls.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right; pnlControls.Left = 8; pnlControls.Top = grpEdit.Top + grpEdit.Height + 8; pnlControls.Width = ClientWidth - 200; pnlControls.Height = BottomPanel.Top - 32 - pnlControls.Top; pnlControls.BevelBorder = EBevelBorder.All; pnlControls.BevelMargin = 1; pnlControls.BevelStyle = EBevelStyle.Etched; pnlControls.Color = Color.Transparent; lblEdit = new Label(manager); lblEdit.Init(); lblEdit.Parent = grpEdit; lblEdit.Left = 16; lblEdit.Top = 8; lblEdit.Text = "Testing field:"; lblEdit.Width = 128; lblEdit.Height = 16; txtEdit = new TextBox(manager); txtEdit.Init(); txtEdit.Parent = grpEdit; txtEdit.Left = 16; txtEdit.Top = 24; txtEdit.Width = grpEdit.ClientWidth - 32; txtEdit.Height = 20; txtEdit.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right | EAnchors.Bottom; txtEdit.Text = "Text"; rdbNormal = new RadioButton(manager); rdbNormal.Init(); rdbNormal.Parent = grpEdit; rdbNormal.Left = 16; rdbNormal.Top = 52; rdbNormal.Width = grpEdit.ClientWidth - 32; rdbNormal.Anchor = EAnchors.Left | EAnchors.Bottom | EAnchors.Right; rdbNormal.Checked = true; rdbNormal.Text = "Normal mode"; rdbNormal.ToolTip.Text = "Enables normal mode for TextBox control."; rdbNormal.CheckedChanged += new GodLesZ.Library.XNA.WindowLibrary.Controls.EventHandler(ModeChanged); rdbPassword = new RadioButton(manager); rdbPassword.Init(); rdbPassword.Parent = grpEdit; rdbPassword.Left = 16; rdbPassword.Top = 68; rdbPassword.Width = grpEdit.ClientWidth - 32; rdbPassword.Anchor = EAnchors.Left | EAnchors.Bottom | EAnchors.Right; rdbPassword.Checked = false; rdbPassword.Text = "Password mode"; rdbPassword.ToolTip.Text = "Enables password mode for TextBox control."; rdbPassword.CheckedChanged += new GodLesZ.Library.XNA.WindowLibrary.Controls.EventHandler(ModeChanged); chkBorders = new CheckBox(manager); chkBorders.Init(); chkBorders.Parent = grpEdit; chkBorders.Left = 16; chkBorders.Top = 96; chkBorders.Width = grpEdit.ClientWidth - 32; chkBorders.Anchor = EAnchors.Left | EAnchors.Bottom | EAnchors.Right; chkBorders.Checked = false; chkBorders.Text = "Borderless mode"; chkBorders.ToolTip.Text = "Enables or disables borderless mode for TextBox control."; chkBorders.CheckedChanged += new GodLesZ.Library.XNA.WindowLibrary.Controls.EventHandler(chkBorders_CheckedChanged); chkReadOnly = new CheckBox(manager); chkReadOnly.Init(); chkReadOnly.Parent = grpEdit; chkReadOnly.Left = 16; chkReadOnly.Top = 110; chkReadOnly.Width = grpEdit.ClientWidth - 32; chkReadOnly.Anchor = EAnchors.Left | EAnchors.Bottom | EAnchors.Right; chkReadOnly.Checked = false; chkReadOnly.Text = "Read only mode"; chkReadOnly.ToolTip.Text = "Enables or disables read only mode for TextBox control.\nThis mode is necessary to enable explicitly."; chkReadOnly.CheckedChanged += new GodLesZ.Library.XNA.WindowLibrary.Controls.EventHandler(chkReadOnly_CheckedChanged); string[] colors = new string[] { "Red", "Green", "Blue", "Yellow", "Orange", "Purple", "White", "Black", "Magenta", "Cyan", "Brown", "Aqua", "Beige", "Coral", "Crimson", "Gray", "Azure", "Ivory", "Indigo", "Khaki", "Orchid", "Plum", "Salmon", "Silver", "Gold", "Pink", "Linen", "Lime", "Olive", "Slate" }; spnMain = new SpinBox(manager, ESpinBoxMode.List); spnMain.Init(); spnMain.Parent = pnlControls; spnMain.Left = 16; spnMain.Top = 16; spnMain.Width = pnlControls.Width - 32; spnMain.Height = 20; spnMain.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right; spnMain.Items.AddRange(colors); spnMain.Mode = ESpinBoxMode.Range; spnMain.ItemIndex = 0; cmbMain = new ComboBox(manager); cmbMain.Init(); cmbMain.Parent = pnlControls; cmbMain.Left = 16; cmbMain.Top = 44; cmbMain.Width = pnlControls.Width - 32; cmbMain.Height = 20; cmbMain.ReadOnly = true; cmbMain.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right; cmbMain.Items.AddRange(colors); cmbMain.ItemIndex = 0; cmbMain.MaxItems = 5; cmbMain.ToolTip.Color = Color.Yellow; cmbMain.Movable = cmbMain.Resizable = true; cmbMain.OutlineMoving = cmbMain.OutlineResizing = true; trkMain = new TrackBar(manager); trkMain.Init(); trkMain.Parent = pnlControls; trkMain.Left = 16; trkMain.Top = 72; trkMain.Width = pnlControls.Width - 32; trkMain.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right; trkMain.Range = 64; trkMain.Value = 16; trkMain.ValueChanged += new GodLesZ.Library.XNA.WindowLibrary.Controls.EventHandler(trkMain_ValueChanged); lblTrack = new Label(manager); lblTrack.Init(); lblTrack.Parent = pnlControls; lblTrack.Left = 16; lblTrack.Top = 96; lblTrack.Width = pnlControls.Width - 32; lblTrack.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right; lblTrack.Alignment = EAlignment.TopRight; lblTrack.TextColor = new Color(32, 32, 32); trkMain_ValueChanged(this, null); // forcing label redraw with init values mnuListBox = new ContextMenu(manager); MenuItem i1 = new MenuItem("This is very long text"); MenuItem i2 = new MenuItem("Menu", true); MenuItem i3 = new MenuItem("Item", false); //i3.Enabled = false; MenuItem i4 = new MenuItem("Separated", true); MenuItem i11 = new MenuItem(); MenuItem i12 = new MenuItem(); MenuItem i13 = new MenuItem(); MenuItem i14 = new MenuItem(); MenuItem i111 = new MenuItem(); MenuItem i112 = new MenuItem(); MenuItem i113 = new MenuItem(); mnuListBox.Items.AddRange(new MenuItem[] { i1, i2, i3, i4 }); i2.Items.AddRange(new MenuItem[] { i11, i12, i13, i14 }); i13.Items.AddRange(new MenuItem[] { i111, i112, i113 }); lstMain = new ListBox(manager); lstMain.Init(); lstMain.Parent = this; lstMain.Top = TopPanel.Height + 8; lstMain.Left = grpEdit.Left + grpEdit.Width + 8; lstMain.Width = ClientWidth - lstMain.Left - 8; lstMain.Height = ClientHeight - 16 - BottomPanel.Height - TopPanel.Height; lstMain.Anchor = EAnchors.Top | EAnchors.Right | EAnchors.Bottom; lstMain.HideSelection = false; lstMain.Items.AddRange(colors); lstMain.ContextMenu = mnuListBox; prgMain = new ProgressBar(manager); prgMain.Init(); prgMain.Parent = this.BottomPanel; prgMain.Left = lstMain.Left; prgMain.Top = 10; prgMain.Width = lstMain.Width; prgMain.Height = 16; prgMain.Anchor = EAnchors.Top | EAnchors.Right; prgMain.Mode = EProgressBarMode.Infinite; prgMain.Passive = false; btnDisable = new Button(manager); btnDisable.Init(); btnDisable.Parent = BottomPanel; btnDisable.Left = 8; btnDisable.Top = 8; btnDisable.Text = "Disable"; btnDisable.Click += new Controls.EventHandler(btnDisable_Click); btnDisable.TextColor = Color.FromNonPremultiplied(255, 64, 32, 200); btnProgress = new Button(manager); btnProgress.Init(); btnProgress.Parent = BottomPanel; btnProgress.Left = prgMain.Left - 16; btnProgress.Top = prgMain.Top; btnProgress.Height = 16; btnProgress.Width = 16; btnProgress.Text = "!"; btnProgress.Anchor = EAnchors.Top | EAnchors.Right; btnProgress.Click += new Controls.EventHandler(btnProgress_Click); mnuMain = new MainMenu(manager); mnuMain.Items.Add(i2); mnuMain.Items.Add(i13); mnuMain.Items.Add(i3); mnuMain.Items.Add(i4); MainMenu = mnuMain; ToolBarPanel tlp = new ToolBarPanel(manager); ToolBarPanel = tlp; ToolBar tlb = new ToolBar(manager); ToolBar tlbx = new ToolBar(manager); tlb.FullRow = true; tlbx.Row = 1; tlbx.FullRow = false; tlp.Add(tlb); tlp.Add(tlbx); /* * tlb.Init(); * tlb.Width = 256; * tlb.Parent = ToolBarPanel;*/ //tlbx.Init(); /* * tlbx.Width = 512; * tlbx.Top = 25; * tlbx.Parent = ToolBarPanel;*/ /* * ToolBarButton tb1 = new ToolBarButton(manager); * tb1.Init(); * tb1.Parent = tlb; * tb1.Left = 10; * tb1.Top = 1; * tb1.Glyph = new Glyph(Manager.Skin.Images["Icon.Warning"].Resource); * tb1.Glyph.SizeMode = SizeMode.Stretched; */ StatusBar stb = new StatusBar(Manager); StatusBar = stb; DefaultControl = txtEdit; OutlineMoving = true; OutlineResizing = true; BottomPanel.BringToFront(); SkinChanged += new GodLesZ.Library.XNA.WindowLibrary.Controls.EventHandler(TaskControls_SkinChanged); TaskControls_SkinChanged(null, null); }
/* * public void CreateWinControls(Control dockWinControl) * { * dockWinControl.SuspendLayout(); * listWinControls.Clear(); * string type; * foreach (TlControl tlControl in _clmb.listTlControls) * { * Control winControl = null; * type = tlControl.Type; * * if (type == "GroupBox") * { * winControl = new GroupBox(); * winControl.SuspendLayout(); * * ((GroupBox)winControl).ForeColor = ((TlGroupBox)tlControl).ForeColor; * ((GroupBox)winControl).Text = ((TlGroupBox)tlControl).Text; * } * else if (type == "Label") * { * winControl = new Label(); * * ((Label)winControl).ForeColor = ((TlLabel)tlControl).ForeColor; * ((Label)winControl).AutoSize = ((TlLabel)tlControl).AutoSize; * ((Label)winControl).Text = ((TlLabel)tlControl).Text; * } * else if (type == "ComboBox") * { * winControl = new ComboBox(); * * ((ComboBox)winControl).DropDownStyle = (ComboBoxStyle)((TlComboBox)tlControl).DropDownStyle; * ((ComboBox)winControl).Items.AddRange(((TlComboBox)tlControl).ListItems.ToArray()); * * } * else if (type == "TextBox") * { * winControl = new TextBox(); * } * else if (type == "Button") * { * winControl = new Button(); * ((Button)winControl).Text = ((TlButton)tlControl).Text; * } * else if (type == "CheckBox") * { * winControl = new CheckBox(); * * ((CheckBox)winControl).ForeColor = ((TlCheckBox)tlControl).ForeColor; * ((CheckBox)winControl).AutoSize = ((TlCheckBox)tlControl).AutoSize; * ((CheckBox)winControl).Text = ((TlCheckBox)tlControl).Text; * } * else if (type == "ListBox") * { * winControl = new ListBox(); * } * else if (type == "Panel") * { * winControl = new Panel(); * winControl.SuspendLayout(); * } * else if (type == "DateTimePicker") * { * winControl = new DateTimePicker(); * * ((DateTimePicker)winControl).ShowUpDown = ((TlDateTimePicker)tlControl).ShowUpDown; * ((DateTimePicker)winControl).Format = (DateTimePickerFormat)((TlDateTimePicker)tlControl).Format; * ((DateTimePicker)winControl).CustomFormat = ((TlDateTimePicker)tlControl).CustomFormat; * } * * if (winControl != null) * { * winControl.Name = tlControl.Name; * winControl.Location = new Point(tlControl.X, tlControl.Y); * winControl.Size = new Size(tlControl.Width, tlControl.Height); * winControl.TabIndex = tlControl.TabIndex; * winControl.Visible = tlControl.Visable; * winControl.Enabled = tlControl.Enable; * winControl.TabStop = tlControl.TabStop; * winControl.Dock = (DockStyle)tlControl.Dock; * * foreach (TlFont tlFont in listTlFonts) * { * if (tlControl.FontName == tlFont.Name) * { * winControl.Font = new Font(tlFont.FamilyName, tlFont.EmSize, (FontStyle)tlFont.Style); * break; * } * } * * listWinControls.Add(winControl); * * } * } * * //遍历处理控件Controls.Add(); * foreach (Control winControl in listWinControls) * { * foreach (TlControl tlControl in _clmb.listTlControls) * { * if (winControl.Name == tlControl.Name) * { * foreach (Control winParentControl in listWinControls) * { * if (tlControl.TlParentControl == null) * { * if (!dockWinControl.Controls.Contains(winControl)) * { * dockWinControl.Controls.Add(winControl); * } * break; * } * else if (winParentControl.Name == tlControl.TlParentControl.Name) * { * winParentControl.Controls.Add(winControl); * break; * } * } * break; * } * } * } * * * foreach (Control winControl in listWinControls) * { * foreach (TlControl tlControl in _clmb.listTlControls) * { * if (winControl.Name == tlControl.Name) * { * if (tlControl.Type == "Panel" || tlControl.Type == "GroupBox") * { * winControl.ResumeLayout(true); * break; * } * } * } * } * dockWinControl.ResumeLayout(false); * } */ #endregion #region 第2种实现方式, 要求:listTlControlst和listWinControls一一对应,效率更高 public void CreateWinControls(Control dockWinControl) { //dockWinControl.SuspendLayout(); listWinControls.Clear(); string type; for (int i = 0; i < _clmb.listTlControls.Count; i++) { Control winControl = null; type = _clmb.listTlControls[i].Type; if (type == "GroupBox") { winControl = new GroupBox(); //winControl.SuspendLayout(); ((GroupBox)winControl).ForeColor = ((TlGroupBox)_clmb.listTlControls[i]).ForeColor; // ((GroupBox)winControl).Text = ((TlGroupBox)_clmb.listTlControls[i]).Text; } else if (type == "Label") { winControl = new Label(); ((Label)winControl).ForeColor = ((TlLabel)_clmb.listTlControls[i]).ForeColor; ((Label)winControl).AutoSize = ((TlLabel)_clmb.listTlControls[i]).AutoSize; // ((Label)winControl).Text = ((TlLabel)_clmb.listTlControls[i]).Text; } else if (type == "ComboBox") { winControl = new ComboBox(); ((ComboBox)winControl).DropDownStyle = (ComboBoxStyle)((TlComboBox)_clmb.listTlControls[i]).DropDownStyle; ((ComboBox)winControl).Items.AddRange(((TlComboBox)_clmb.listTlControls[i]).ListItems.ToArray()); if (_clmb.listTlControls[i].DicEvents.ContainsKey("SelectedIndexChanged")) { ((ComboBox)winControl).SelectedIndexChanged += new EventHandler(controlEvent_SelectedIndexChanged); } } else if (type == "TextBox") { winControl = new TextBox(); } else if (type == "Button") { winControl = new Button(); } else if (type == "ButtonX") { winControl = new DevComponents.DotNetBar.ButtonX(); if (((TlButtonX)_clmb.listTlControls[i]).Image != "") { ((DevComponents.DotNetBar.ButtonX)winControl).Image = (System.Drawing.Bitmap)(global::TempertureEditor.Properties.Resources.ResourceManager.GetObject(((TlButtonX)_clmb.listTlControls[i]).Image, global::TempertureEditor.Properties.Resources.Culture)); } ((DevComponents.DotNetBar.ButtonX)winControl).AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; ((DevComponents.DotNetBar.ButtonX)winControl).ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; } else if (type == "PrintPreviewControl") { winControl = new PrintPreviewControl(); ((PrintPreviewControl)winControl).UseAntiAlias = true; ((PrintPreviewControl)winControl).AutoZoom = false; ((PrintPreviewControl)winControl).Zoom = 1D; } else if (type == "CheckBox") { winControl = new CheckBox(); ((CheckBox)winControl).ForeColor = ((TlCheckBox)_clmb.listTlControls[i]).ForeColor; ((CheckBox)winControl).AutoSize = ((TlCheckBox)_clmb.listTlControls[i]).AutoSize; ((CheckBox)winControl).Text = ((TlCheckBox)_clmb.listTlControls[i]).Text; ((CheckBox)winControl).Checked = ((TlCheckBox)_clmb.listTlControls[i]).Checked; ((CheckBox)winControl).CheckedChanged += new EventHandler(controlEvent_CheckedChanged); ((CheckBox)winControl).CheckStateChanged += new EventHandler(controlEvent_CheckStateChanged); } else if (type == "RadioButton") { winControl = new RadioButton(); ((RadioButton)winControl).ForeColor = ((TlRadioButton)_clmb.listTlControls[i]).ForeColor; ((RadioButton)winControl).AutoSize = ((TlRadioButton)_clmb.listTlControls[i]).AutoSize; // ((RadioButton)winControl).Text = ((TlRadioButton)_clmb.listTlControls[i]).Text; ((RadioButton)winControl).UseVisualStyleBackColor = ((TlRadioButton)_clmb.listTlControls[i]).UseVisualStyleBackColor; ((RadioButton)winControl).Checked = ((TlRadioButton)_clmb.listTlControls[i]).Checked; ((RadioButton)winControl).CheckedChanged += new EventHandler(controlEvent_CheckedChanged); } else if (type == "ListBox") { winControl = new ListBox(); } else if (type == "Panel" || type == "PanelControl" || type == "GroupPanel") { if (type == "Panel") { winControl = new Panel(); } else { if (type == "PanelControl") { winControl = new PanelControl(); } else { if (type == "GroupPanel") { winControl = new GroupPanel(); } else { } } #region 未实现配置样式 ((PanelControl)winControl).Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; ((PanelControl)winControl).Style.BackColorGradientAngle = 90; ((PanelControl)winControl).Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; ((PanelControl)winControl).Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; ((PanelControl)winControl).Style.BorderBottomWidth = 1; ((PanelControl)winControl).Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; ((PanelControl)winControl).Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; ((PanelControl)winControl).Style.BorderLeftWidth = 1; ((PanelControl)winControl).Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; ((PanelControl)winControl).Style.BorderRightWidth = 1; ((PanelControl)winControl).Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; ((PanelControl)winControl).Style.BorderTopWidth = 1; ((PanelControl)winControl).Style.CornerDiameter = 4; ((PanelControl)winControl).Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; ((PanelControl)winControl).Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; ((PanelControl)winControl).Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; ((PanelControl)winControl).Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; ((PanelControl)winControl).StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; ((PanelControl)winControl).StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; #endregion ((PanelControl)winControl).ShowFocusRectangle = ((TlPanelControl)_clmb.listTlControls[i]).ShowFocusRectangle; ((PanelControl)winControl).ColorSchemeStyle = (eDotNetBarStyle)((TlPanelControl)_clmb.listTlControls[i]).ColorSchemeStyle; ((PanelControl)winControl).CanvasColor = ((TlPanelControl)_clmb.listTlControls[i]).CanvasColor; } ((Panel)winControl).AutoScroll = ((TlPanel)_clmb.listTlControls[i]).AutoScroll; } else if (type == "DateTimePicker") { winControl = new DateTimePicker(); ((DateTimePicker)winControl).ShowUpDown = ((TlDateTimePicker)_clmb.listTlControls[i]).ShowUpDown; ((DateTimePicker)winControl).Format = (DateTimePickerFormat)((TlDateTimePicker)_clmb.listTlControls[i]).Format; ((DateTimePicker)winControl).CustomFormat = ((TlDateTimePicker)_clmb.listTlControls[i]).CustomFormat; if (_clmb.listTlControls[i].DicEvents.ContainsKey("ValueChanged")) { ((DateTimePicker)winControl).ValueChanged += new EventHandler(controlEvent_ValueChanged); } } else if (type == "PictureBox") { winControl = new PictureBox(); ((PictureBox)winControl).BackColor = ((TlPictureBox)_clmb.listTlControls[i]).BackColor; } else if (type == "ExpandableSplitter") { winControl = new DevComponents.DotNetBar.ExpandableSplitter(); ((DevComponents.DotNetBar.ExpandableSplitter)winControl).Style = (DevComponents.DotNetBar.eSplitterStyle)((TlExpandableSplitter)_clmb.listTlControls[i]).Style; } else if (type == "AdvTree") { winControl = new DevComponents.AdvTree.AdvTree(); ((DevComponents.AdvTree.AdvTree)winControl).ForeColor = ((TlAdvTree)_clmb.listTlControls[i]).ForeColor; ((DevComponents.AdvTree.AdvTree)winControl).AllowDrop = ((TlAdvTree)_clmb.listTlControls[i]).AllowDrop; ((DevComponents.AdvTree.AdvTree)winControl).AccessibleRole = System.Windows.Forms.AccessibleRole.Outline; ((DevComponents.AdvTree.AdvTree)winControl).BackgroundStyle.Class = "TreeBorderKey"; ((DevComponents.AdvTree.AdvTree)winControl).BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; ((DevComponents.AdvTree.AdvTree)winControl).NodeSpacing = 2; ((DevComponents.AdvTree.AdvTree)winControl).PathSeparator = ";"; } else if (type == "Slider") { winControl = new DevComponents.DotNetBar.Controls.Slider(); ((DevComponents.DotNetBar.Controls.Slider)winControl).Minimum = ((TlSlider)_clmb.listTlControls[i]).Minimum; ((DevComponents.DotNetBar.Controls.Slider)winControl).Maximum = ((TlSlider)_clmb.listTlControls[i]).Maximum; ((DevComponents.DotNetBar.Controls.Slider)winControl).Value = ((TlSlider)_clmb.listTlControls[i]).Value; ((DevComponents.DotNetBar.Controls.Slider)winControl).BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; ((DevComponents.DotNetBar.Controls.Slider)winControl).Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; } else if (type == "ucAiTemperature") { winControl = new ucAiTemperature(((TlAiTemperature)_clmb.listTlControls[i]).ClmbFileName); } /* * else if (type == "ucTemperatureFrame") * { * winControl = new ucTemperatureFrame(((TlAiTemperature)_clmb.listTlControls[i]).ClmbFileName); * } */ else if (type == "ucTemperatureReport") { winControl = new ucTemperatureReport(((TlTemperatureReport)_clmb.listTlControls[i]).TmbFileName); } else if (type == "RibbonBar") { winControl = new RibbonBar(); ((RibbonBar)winControl).Style = (eDotNetBarStyle)((TlRibbonBar)_clmb.listTlControls[i]).Style; ((RibbonBar)winControl).TitleVisible = ((TlRibbonBar)_clmb.listTlControls[i]).TitleVisible; ((RibbonBar)winControl).AutoOverflowEnabled = ((TlRibbonBar)_clmb.listTlControls[i]).AutoOverflowEnabled; ((RibbonBar)winControl).ContainerControlProcessDialogKey = ((TlRibbonBar)_clmb.listTlControls[i]).ContainerControlProcessDialogKey; } if (winControl != null) { if (_clmb.listTlControls[i].BackColor != null) { winControl.BackColor = (Color)_clmb.listTlControls[i].BackColor; } winControl.Name = _clmb.listTlControls[i].Name; winControl.Location = new Point(_clmb.listTlControls[i].X, _clmb.listTlControls[i].Y); winControl.Size = new Size(_clmb.listTlControls[i].Width, _clmb.listTlControls[i].Height); winControl.TabIndex = _clmb.listTlControls[i].TabIndex; winControl.Visible = _clmb.listTlControls[i].Visable; winControl.Enabled = _clmb.listTlControls[i].Enable; winControl.TabStop = _clmb.listTlControls[i].TabStop; foreach (TlFont tlFont in _clmb.listTlFonts) { if (_clmb.listTlControls[i].FontName == tlFont.Name) { winControl.Font = new Font(tlFont.FamilyName, tlFont.EmSize, (FontStyle)tlFont.Style); break; } } winControl.Dock = (DockStyle)_clmb.listTlControls[i].Dock; winControl.Text = _clmb.listTlControls[i].Text; // 注: 不能使用if/else,因为同个控件可能要处理多个事件 if (_clmb.listTlControls[i].DicEvents.ContainsKey("Click")) { winControl.Click += new EventHandler(controlEvent_Click); } if (_clmb.listTlControls[i].DicEvents.ContainsKey("TextChanged")) { winControl.TextChanged += new EventHandler(controlEvent_TextChanged); } if (_clmb.listTlControls[i].DicEvents.ContainsKey("SizeChanged")) { winControl.SizeChanged += new EventHandler(controlEvent_SizeChanged); } listWinControls.Add(winControl); } } //特殊类型处理,需在所有控件创建后处理 for (int i = 0; i < _clmb.listTlControls.Count; i++) { if (_clmb.listTlControls[i].Type == "ExpandableSplitter") { ((DevComponents.DotNetBar.ExpandableSplitter)listWinControls[i]).ExpandableControl = listWinControls.Find(cl => cl.Name == ((TlExpandableSplitter)_clmb.listTlControls[i]).ExpandableControl); //等同以下注释代码功能 /* * foreach (Control tmpControl in listWinControls) * { * if (tmpControl.Name == ((TlExpandableSplitter)_clmb.listTlControls[i]).ExpandableControl) * { * ((DevComponents.DotNetBar.ExpandableSplitter)listWinControls[i]).ExpandableControl = tmpControl; * break; * } * } */ } /* * if (_clmb.listTlControls[i].Type == "RibbonBar") * { * foreach (string itemName in ((TlRibbonBar)_clmb.listTlControls[i]).ListItems) * { * Control findControl = listWinControls.Find(cl => cl.Name == itemName); * if (findControl != null) * { * // ((RibbonBar)listWinControls[i]).Items.Add((BaseItem)findControl); * * * } * } * } */ } //遍历处理控件Controls.Add(); 当同一DockStyle时,如都为DockStyle.Top时,倒序Add才能按配置文件的正序展示 for (int i = listWinControls.Count - 1; i >= 0; i--) { Control winControl = listWinControls[i]; if (_clmb.listTlControls[i].TlParentControl == null) { if (!dockWinControl.Controls.Contains(winControl)) { dockWinControl.Controls.Add(winControl); } } else { foreach (Control winParentControl in listWinControls) { if (winParentControl.Name == _clmb.listTlControls[i].TlParentControl.Name) { winParentControl.Controls.Add(winControl); break; } } } } /* * for (int i = listWinControls.Count - 1; i >= 0 ; i--) * { * Control winControl = listWinControls[i]; * if (_clmb.listTlControls[i].Type == "Panel" || _clmb.listTlControls[i].Type == "GroupBox") * { * winControl.ResumeLayout(true); * break; * } * } */ //dockWinControl.ResumeLayout(false); }
public override void Initialize() { base.Initialize(); string[] actions = new string[] { "Gegner suchen", "Deck bearbeiten", "noch ne Aktion", "Und noch eine", "keine Ahnung", "Ficken?", "Ok o.o", "blubb", "foo", "bar", "moepse sin toll", }; // just to refresh ScreenManager.MainWindow.BringToFront(); #region Links - Übersicht GroupPanel wnd = new GroupPanel(WindowManager); wnd.Init(); wnd.Text = "Übersicht"; wnd.TextColor = Color.LightGray; wnd.Width = 200; wnd.Height = ScreenManager.MainWindow.ClientHeight - 40; wnd.Top = 20; wnd.Left = 20; wnd.Visible = true; // Actions int btnWidth = 160; int btnHeight = 40; Button btn; for (int i = 0; i < actions.Length; i++) { btn = new Button(WindowManager); btn.Init(); btn.Width = btnWidth; btn.Height = btnHeight; btn.Left = 20; btn.Top = ((i * 20) + btnHeight * i) + 20; btn.Text = actions[i]; btn.Click += new WindowLibrary.Controls.EventHandler(ActionButton_Click); btn.Tag = i; wnd.Add(btn); } AddWindow(wnd); #endregion #region Rechts - Spiele & Statistik GroupPanel runingGamesPanel = new GroupPanel(WindowManager); runingGamesPanel.Init(); runingGamesPanel.Text = "Laufende Spiele"; runingGamesPanel.TextColor = Color.LightGray; runingGamesPanel.Width = 200; runingGamesPanel.Height = 400; runingGamesPanel.Top = 20; runingGamesPanel.Left = ScreenManager.MainWindow.ClientWidth - runingGamesPanel.Width - 20; runingGamesPanel.Visible = true; AddWindow(runingGamesPanel); GroupPanel statPanel = new GroupPanel(WindowManager); statPanel.Init(); statPanel.Text = "Statistik"; statPanel.TextColor = Color.LightGray; statPanel.Width = 200; statPanel.Height = ScreenManager.MainWindow.ClientHeight - 460; statPanel.Top = 440; statPanel.Left = ScreenManager.MainWindow.ClientWidth - statPanel.Width - 20; statPanel.Visible = true; AddWindow(statPanel); #endregion #region Mitte - Chat TabControl tbc = new TabControl(WindowManager); mConsole = new WindowLibrary.Controls.Console(WindowManager); tbc.Init(); tbc.AddPage("Allgemein"); tbc.Alpha = 200; tbc.Left = 240; tbc.Height = 220; tbc.Width = ScreenManager.MainWindow.ClientWidth - 480; tbc.Top = ScreenManager.MainWindow.ClientHeight - tbc.Height - 18; tbc.Movable = false; tbc.Resizable = false; tbc.MinimumHeight = 96; tbc.MinimumWidth = 160; tbc.TabPages[0].Add(mConsole); mConsole.Init(); mConsole.Width = tbc.TabPages[0].ClientWidth; mConsole.Height = tbc.TabPages[0].ClientHeight; mConsole.Anchor = EAnchors.All; mConsole.Channels.Add(new ConsoleChannel(0, "Allgemein", Color.White)); mConsole.SelectedChannel = 0; mConsole.MessageFormat = ConsoleMessageFormats.None; SendSystemMessage("Dein Login war erfolgreich!"); SendSystemMessage("Willkommen im InsaneRO Card Game ;D"); mConsole.MessageSent += new ConsoleMessageEventHandler(Channel1_MessageSent); AddWindow(tbc); #endregion GroupPanel newsPanel = new GroupPanel(WindowManager); newsPanel.Init(); newsPanel.Text = "InsaneRO News"; newsPanel.TextColor = Color.LightGray; newsPanel.Width = ScreenManager.MainWindow.ClientWidth - 480; newsPanel.Height = ScreenManager.MainWindow.ClientHeight - 40 - 220; newsPanel.Top = 20; newsPanel.Left = 240; newsPanel.Visible = true; newsPanel.AutoScroll = EAutoScroll.Vertical; AddWindow(newsPanel); LoadNews(); }
public TaskDialog(Manager manager) : base(manager) { //Alpha = 200; Height = 520; MinimumWidth = 254; MinimumHeight = 160; Center(); TopPanel.Height = 80; TopPanel.BevelStyle = EBevelStyle.None; TopPanel.BevelBorder = EBevelBorder.None; Caption.Visible = false; Description.Visible = false; Text = "Dialog Template"; imgTop = new ImageBox(manager); imgTop.Init(); imgTop.Parent = TopPanel; imgTop.Top = 0; imgTop.Left = 0; imgTop.Width = TopPanel.ClientWidth; imgTop.Height = TopPanel.ClientHeight; imgTop.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right | EAnchors.Bottom; imgTop.SizeMode = ESizeMode.Normal; imgTop.Image = Manager.Content.Load<Texture2D>("Content\\Images\\Caption"); tbcMain = new TabControl(manager); tbcMain.Init(); tbcMain.Parent = this; tbcMain.Left = 4; tbcMain.Top = TopPanel.Height + 4; tbcMain.Width = ClientArea.Width - 8; tbcMain.Height = ClientArea.Height - 8 - TopPanel.Height - BottomPanel.Height; tbcMain.Anchor = EAnchors.All; tbcMain.AddPage(); tbcMain.TabPages[0].Text = "First"; tbcMain.AddPage(); tbcMain.TabPages[1].Text = "Second"; tbcMain.AddPage(); tbcMain.TabPages[2].Text = "Third"; btnFirst = new Button(manager); btnFirst.Init(); btnFirst.Parent = tbcMain.TabPages[0]; btnFirst.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right; btnFirst.Top = 8; btnFirst.Left = 8; btnFirst.Width = btnFirst.Parent.ClientWidth - 16; btnFirst.Text = ">>> First Page Button <<<"; grpFirst = new GroupPanel(manager); grpFirst.Init(); grpFirst.Parent = tbcMain.TabPages[0]; grpFirst.Anchor = EAnchors.All; //grpFirst.Type = GroupBoxType.Flat; grpFirst.Left = 8; grpFirst.Top = btnFirst.Top + btnFirst.Height + 4; grpFirst.Width = btnFirst.Parent.ClientWidth - 16; grpFirst.Height = btnFirst.Parent.ClientHeight - grpFirst.Top - 8; btnSecond = new Button(manager); btnSecond.Init(); btnSecond.Parent = tbcMain.TabPages[1]; btnSecond.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right; btnSecond.Top = 8; btnSecond.Left = 8; btnSecond.Width = btnSecond.Parent.ClientWidth - 16; btnSecond.Text = ">>> Second Page Button <<<"; btnThird = new Button(manager); btnThird.Init(); btnThird.Parent = tbcMain.TabPages[2]; btnThird.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right; btnThird.Top = 8; btnThird.Left = 8; btnThird.Width = btnThird.Parent.ClientWidth - 16; btnThird.Text = ">>> Third Page Button <<<"; btnOk = new Button(manager); btnOk.Init(); btnOk.Parent = BottomPanel; btnOk.Anchor = EAnchors.Top | EAnchors.Right; btnOk.Top = btnOk.Parent.ClientHeight - btnOk.Height - 8; btnOk.Left = btnOk.Parent.ClientWidth - 8 - btnOk.Width * 3 - 8; btnOk.Text = "OK"; btnOk.ModalResult = EModalResult.Ok; btnApply = new Button(manager); btnApply.Init(); btnApply.Parent = BottomPanel; btnApply.Anchor = EAnchors.Top | EAnchors.Right; btnApply.Top = btnOk.Parent.ClientHeight - btnOk.Height - 8; btnApply.Left = btnOk.Parent.ClientWidth - 4 - btnOk.Width * 2 - 8; btnApply.Text = "Apply"; btnClose = new Button(manager); btnClose.Init(); btnClose.Parent = BottomPanel; btnClose.Anchor = EAnchors.Top | EAnchors.Right; btnClose.Top = btnOk.Parent.ClientHeight - btnClose.Height - 8; btnClose.Left = btnOk.Parent.ClientWidth - btnClose.Width - 8; btnClose.Text = "Close"; btnClose.ModalResult = EModalResult.Cancel; btnFirst.Focused = true; }
public TaskDialog(Manager manager) : base(manager) { //Alpha = 200; Height = 520; MinimumWidth = 254; MinimumHeight = 160; Center(); TopPanel.Height = 80; TopPanel.BevelStyle = BevelStyle.None; TopPanel.BevelBorder = BevelBorder.None; Caption.Visible = false; Description.Visible = false; Text = "Dialog Template"; imgTop = new ImageBox(manager); imgTop.Init(); imgTop.Parent = TopPanel; imgTop.Top = 0; imgTop.Left = 0; imgTop.Width = TopPanel.ClientWidth; imgTop.Height = TopPanel.ClientHeight; imgTop.Anchor = Anchors.Left | Anchors.Top | Anchors.Right | Anchors.Bottom; imgTop.SizeMode = SizeMode.Normal; imgTop.Image = Manager.Content.Load <Texture2D>("Content\\Images\\Caption"); tbcMain = new TabControl(manager); tbcMain.Init(); tbcMain.Parent = this; tbcMain.Left = 4; tbcMain.Top = TopPanel.Height + 4; tbcMain.Width = ClientArea.Width - 8; tbcMain.Height = ClientArea.Height - 8 - TopPanel.Height - BottomPanel.Height; tbcMain.Anchor = Anchors.All; tbcMain.AddPage(); tbcMain.TabPages[0].Text = "First"; tbcMain.AddPage(); tbcMain.TabPages[1].Text = "Second"; tbcMain.AddPage(); tbcMain.TabPages[2].Text = "Third"; btnFirst = new Button(manager); btnFirst.Init(); btnFirst.Parent = tbcMain.TabPages[0]; btnFirst.Anchor = Anchors.Left | Anchors.Top | Anchors.Right; btnFirst.Top = 8; btnFirst.Left = 8; btnFirst.Width = btnFirst.Parent.ClientWidth - 16; btnFirst.Text = ">>> First Page Button <<<"; grpFirst = new GroupPanel(manager); grpFirst.Init(); grpFirst.Parent = tbcMain.TabPages[0]; grpFirst.Anchor = Anchors.All; //grpFirst.Type = GroupBoxType.Flat; grpFirst.Left = 8; grpFirst.Top = btnFirst.Top + btnFirst.Height + 4; grpFirst.Width = btnFirst.Parent.ClientWidth - 16; grpFirst.Height = btnFirst.Parent.ClientHeight - grpFirst.Top - 8; btnSecond = new Button(manager); btnSecond.Init(); btnSecond.Parent = tbcMain.TabPages[1]; btnSecond.Anchor = Anchors.Left | Anchors.Top | Anchors.Right; btnSecond.Top = 8; btnSecond.Left = 8; btnSecond.Width = btnSecond.Parent.ClientWidth - 16; btnSecond.Text = ">>> Second Page Button <<<"; btnThird = new Button(manager); btnThird.Init(); btnThird.Parent = tbcMain.TabPages[2]; btnThird.Anchor = Anchors.Left | Anchors.Top | Anchors.Right; btnThird.Top = 8; btnThird.Left = 8; btnThird.Width = btnThird.Parent.ClientWidth - 16; btnThird.Text = ">>> Third Page Button <<<"; btnOk = new Button(manager); btnOk.Init(); btnOk.Parent = BottomPanel; btnOk.Anchor = Anchors.Top | Anchors.Right; btnOk.Top = btnOk.Parent.ClientHeight - btnOk.Height - 8; btnOk.Left = btnOk.Parent.ClientWidth - 8 - btnOk.Width * 3 - 8; btnOk.Text = "OK"; btnOk.ModalResult = ModalResult.Ok; btnApply = new Button(manager); btnApply.Init(); btnApply.Parent = BottomPanel; btnApply.Anchor = Anchors.Top | Anchors.Right; btnApply.Top = btnOk.Parent.ClientHeight - btnOk.Height - 8; btnApply.Left = btnOk.Parent.ClientWidth - 4 - btnOk.Width * 2 - 8; btnApply.Text = "Apply"; btnClose = new Button(manager); btnClose.Init(); btnClose.Parent = BottomPanel; btnClose.Anchor = Anchors.Top | Anchors.Right; btnClose.Top = btnOk.Parent.ClientHeight - btnClose.Height - 8; btnClose.Left = btnOk.Parent.ClientWidth - btnClose.Width - 8; btnClose.Text = "Close"; btnClose.ModalResult = ModalResult.Cancel; btnFirst.Focused = true; }
private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormSerial)); this.groupPanel1 = new DevComponents.DotNetBar.Controls.GroupPanel(); this.COMport_box = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.COM1 = new DevComponents.Editors.ComboItem(); this.COM2 = new DevComponents.Editors.ComboItem(); this.COM3 = new DevComponents.Editors.ComboItem(); this.COM4 = new DevComponents.Editors.ComboItem(); this.COM5 = new DevComponents.Editors.ComboItem(); this.COM6 = new DevComponents.Editors.ComboItem(); this.COM7 = new DevComponents.Editors.ComboItem(); this.COM8 = new DevComponents.Editors.ComboItem(); this.COM9 = new DevComponents.Editors.ComboItem(); this.COM10 = new DevComponents.Editors.ComboItem(); this.groupPanel2 = new DevComponents.DotNetBar.Controls.GroupPanel(); this.rate38400 = new System.Windows.Forms.RadioButton(); this.rate19200 = new System.Windows.Forms.RadioButton(); this.rate4800 = new System.Windows.Forms.RadioButton(); this.rate9600 = new System.Windows.Forms.RadioButton(); this.rate2400 = new System.Windows.Forms.RadioButton(); this.rate300 = new System.Windows.Forms.RadioButton(); this.groupPanel3 = new DevComponents.DotNetBar.Controls.GroupPanel(); this.radioButton3 = new System.Windows.Forms.RadioButton(); this.groupPanel4 = new DevComponents.DotNetBar.Controls.GroupPanel(); this.radioButton8 = new System.Windows.Forms.RadioButton(); this.groupPanel5 = new DevComponents.DotNetBar.Controls.GroupPanel(); this.groupPanel6 = new DevComponents.DotNetBar.Controls.GroupPanel(); this.radioButton9 = new System.Windows.Forms.RadioButton(); this.SRS232_OK = new DevComponents.DotNetBar.ButtonX(); this.SRS232_CANCEL = new DevComponents.DotNetBar.ButtonX(); this.groupPanel1.SuspendLayout(); this.groupPanel2.SuspendLayout(); this.groupPanel3.SuspendLayout(); this.groupPanel4.SuspendLayout(); this.groupPanel6.SuspendLayout(); this.SuspendLayout(); // // groupPanel1 // this.groupPanel1.CanvasColor = System.Drawing.SystemColors.Control; this.groupPanel1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; this.groupPanel1.Controls.Add(this.COMport_box); this.groupPanel1.Location = new System.Drawing.Point(12, 12); this.groupPanel1.Name = "groupPanel1"; this.groupPanel1.Size = new System.Drawing.Size(133, 126); // // // this.groupPanel1.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; this.groupPanel1.Style.BackColorGradientAngle = 90; this.groupPanel1.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; this.groupPanel1.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel1.Style.BorderBottomWidth = 1; this.groupPanel1.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; this.groupPanel1.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel1.Style.BorderLeftWidth = 1; this.groupPanel1.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel1.Style.BorderRightWidth = 1; this.groupPanel1.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel1.Style.BorderTopWidth = 1; this.groupPanel1.Style.CornerDiameter = 4; this.groupPanel1.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; this.groupPanel1.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; this.groupPanel1.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; this.groupPanel1.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; // // // this.groupPanel1.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; // // // this.groupPanel1.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.groupPanel1.TabIndex = 0; this.groupPanel1.Text = "Port"; // // COMport_box // this.COMport_box.DisplayMember = "Text"; this.COMport_box.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; this.COMport_box.FormattingEnabled = true; this.COMport_box.ItemHeight = 15; this.COMport_box.Items.AddRange(new object[] { this.COM1, this.COM2, this.COM3, this.COM4, this.COM5, this.COM6, this.COM7, this.COM8, this.COM9, this.COM10 }); this.COMport_box.Location = new System.Drawing.Point(19, 36); this.COMport_box.Name = "COMport_box"; this.COMport_box.Size = new System.Drawing.Size(96, 21); this.COMport_box.TabIndex = 4; // // COM1 // this.COM1.Text = "COM1"; // // COM2 // this.COM2.Text = "COM2"; // // COM3 // this.COM3.Text = "COM3"; // // COM4 // this.COM4.Text = "COM4"; // // COM5 // this.COM5.Text = "COM5"; // // COM6 // this.COM6.Text = "COM6"; // // COM7 // this.COM7.Text = "COM7"; // // COM8 // this.COM8.Text = "COM8"; // // COM9 // this.COM9.Text = "COM9"; // // COM10 // this.COM10.Text = "COM10"; // // groupPanel2 // this.groupPanel2.CanvasColor = System.Drawing.SystemColors.Control; this.groupPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; this.groupPanel2.Controls.Add(this.rate38400); this.groupPanel2.Controls.Add(this.rate19200); this.groupPanel2.Controls.Add(this.rate4800); this.groupPanel2.Controls.Add(this.rate9600); this.groupPanel2.Controls.Add(this.rate2400); this.groupPanel2.Controls.Add(this.rate300); this.groupPanel2.Location = new System.Drawing.Point(160, 12); this.groupPanel2.Name = "groupPanel2"; this.groupPanel2.Size = new System.Drawing.Size(273, 126); // // // this.groupPanel2.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; this.groupPanel2.Style.BackColorGradientAngle = 90; this.groupPanel2.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; this.groupPanel2.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel2.Style.BorderBottomWidth = 1; this.groupPanel2.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; this.groupPanel2.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel2.Style.BorderLeftWidth = 1; this.groupPanel2.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel2.Style.BorderRightWidth = 1; this.groupPanel2.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel2.Style.BorderTopWidth = 1; this.groupPanel2.Style.CornerDiameter = 4; this.groupPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; this.groupPanel2.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; this.groupPanel2.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; this.groupPanel2.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; // // // this.groupPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; // // // this.groupPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.groupPanel2.TabIndex = 1; this.groupPanel2.Text = "Baud Rate"; // // rate38400 // this.rate38400.AutoSize = true; this.rate38400.Checked = true; this.rate38400.Location = new System.Drawing.Point(198, 66); this.rate38400.Name = "rate38400"; this.rate38400.Size = new System.Drawing.Size(55, 17); this.rate38400.TabIndex = 5; this.rate38400.TabStop = true; this.rate38400.Text = "38400"; this.rate38400.UseVisualStyleBackColor = true; this.rate38400.Click += new System.EventHandler(this.rate38400_Click); // // rate19200 // this.rate19200.AutoSize = true; this.rate19200.Location = new System.Drawing.Point(107, 66); this.rate19200.Name = "rate19200"; this.rate19200.Size = new System.Drawing.Size(55, 17); this.rate19200.TabIndex = 4; this.rate19200.Text = "19200"; this.rate19200.UseVisualStyleBackColor = true; this.rate19200.Click += new System.EventHandler(this.rate19200_Click); // // rate4800 // this.rate4800.AutoSize = true; this.rate4800.Location = new System.Drawing.Point(198, 18); this.rate4800.Name = "rate4800"; this.rate4800.Size = new System.Drawing.Size(49, 17); this.rate4800.TabIndex = 3; this.rate4800.Text = "4800"; this.rate4800.UseVisualStyleBackColor = true; this.rate4800.Click += new System.EventHandler(this.rate4800_Click); // // rate9600 // this.rate9600.AutoSize = true; this.rate9600.Location = new System.Drawing.Point(15, 66); this.rate9600.Name = "rate9600"; this.rate9600.Size = new System.Drawing.Size(49, 17); this.rate9600.TabIndex = 2; this.rate9600.Text = "9600"; this.rate9600.UseVisualStyleBackColor = true; this.rate9600.Click += new System.EventHandler(this.rate9600_Click); // // rate2400 // this.rate2400.AutoSize = true; this.rate2400.Location = new System.Drawing.Point(107, 18); this.rate2400.Name = "rate2400"; this.rate2400.Size = new System.Drawing.Size(49, 17); this.rate2400.TabIndex = 1; this.rate2400.Text = "2400"; this.rate2400.UseVisualStyleBackColor = true; this.rate2400.Click += new System.EventHandler(this.rate2400_Click); // // rate300 // this.rate300.AutoSize = true; this.rate300.Location = new System.Drawing.Point(15, 18); this.rate300.Name = "rate300"; this.rate300.Size = new System.Drawing.Size(43, 17); this.rate300.TabIndex = 0; this.rate300.Text = "300"; this.rate300.UseVisualStyleBackColor = true; this.rate300.Click += new System.EventHandler(this.rate300_Click); // // groupPanel3 // this.groupPanel3.CanvasColor = System.Drawing.SystemColors.Control; this.groupPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; this.groupPanel3.Controls.Add(this.radioButton3); this.groupPanel3.Location = new System.Drawing.Point(14, 144); this.groupPanel3.Name = "groupPanel3"; this.groupPanel3.Size = new System.Drawing.Size(131, 74); // // // this.groupPanel3.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; this.groupPanel3.Style.BackColorGradientAngle = 90; this.groupPanel3.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; this.groupPanel3.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel3.Style.BorderBottomWidth = 1; this.groupPanel3.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; this.groupPanel3.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel3.Style.BorderLeftWidth = 1; this.groupPanel3.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel3.Style.BorderRightWidth = 1; this.groupPanel3.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel3.Style.BorderTopWidth = 1; this.groupPanel3.Style.CornerDiameter = 4; this.groupPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; this.groupPanel3.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; this.groupPanel3.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; this.groupPanel3.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; // // // this.groupPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; // // // this.groupPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.groupPanel3.TabIndex = 2; this.groupPanel3.Text = "Data Bits"; // // radioButton3 // this.radioButton3.AutoSize = true; this.radioButton3.Checked = true; this.radioButton3.Location = new System.Drawing.Point(33, 18); this.radioButton3.Name = "radioButton3"; this.radioButton3.Size = new System.Drawing.Size(31, 17); this.radioButton3.TabIndex = 0; this.radioButton3.TabStop = true; this.radioButton3.Text = "8"; this.radioButton3.UseVisualStyleBackColor = true; // // groupPanel4 // this.groupPanel4.CanvasColor = System.Drawing.SystemColors.Control; this.groupPanel4.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; this.groupPanel4.Controls.Add(this.radioButton8); this.groupPanel4.Controls.Add(this.groupPanel5); this.groupPanel4.Location = new System.Drawing.Point(160, 144); this.groupPanel4.Name = "groupPanel4"; this.groupPanel4.Size = new System.Drawing.Size(131, 74); // // // this.groupPanel4.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; this.groupPanel4.Style.BackColorGradientAngle = 90; this.groupPanel4.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; this.groupPanel4.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel4.Style.BorderBottomWidth = 1; this.groupPanel4.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; this.groupPanel4.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel4.Style.BorderLeftWidth = 1; this.groupPanel4.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel4.Style.BorderRightWidth = 1; this.groupPanel4.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel4.Style.BorderTopWidth = 1; this.groupPanel4.Style.CornerDiameter = 4; this.groupPanel4.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; this.groupPanel4.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; this.groupPanel4.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; this.groupPanel4.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; // // // this.groupPanel4.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; // // // this.groupPanel4.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.groupPanel4.TabIndex = 3; this.groupPanel4.Text = "Parity"; // // radioButton8 // this.radioButton8.AutoSize = true; this.radioButton8.Checked = true; this.radioButton8.Location = new System.Drawing.Point(30, 18); this.radioButton8.Name = "radioButton8"; this.radioButton8.Size = new System.Drawing.Size(51, 17); this.radioButton8.TabIndex = 4; this.radioButton8.TabStop = true; this.radioButton8.Text = "None"; this.radioButton8.UseVisualStyleBackColor = true; // // groupPanel5 // this.groupPanel5.CanvasColor = System.Drawing.SystemColors.Control; this.groupPanel5.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; this.groupPanel5.Location = new System.Drawing.Point(160, -11); this.groupPanel5.Name = "groupPanel5"; this.groupPanel5.Size = new System.Drawing.Size(140, 76); // // // this.groupPanel5.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; this.groupPanel5.Style.BackColorGradientAngle = 90; this.groupPanel5.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; this.groupPanel5.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel5.Style.BorderBottomWidth = 1; this.groupPanel5.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; this.groupPanel5.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel5.Style.BorderLeftWidth = 1; this.groupPanel5.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel5.Style.BorderRightWidth = 1; this.groupPanel5.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel5.Style.BorderTopWidth = 1; this.groupPanel5.Style.CornerDiameter = 4; this.groupPanel5.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; this.groupPanel5.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; this.groupPanel5.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; this.groupPanel5.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; // // // this.groupPanel5.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; // // // this.groupPanel5.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.groupPanel5.TabIndex = 3; this.groupPanel5.Text = "groupPanel5"; // // groupPanel6 // this.groupPanel6.CanvasColor = System.Drawing.SystemColors.Control; this.groupPanel6.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; this.groupPanel6.Controls.Add(this.radioButton9); this.groupPanel6.Location = new System.Drawing.Point(302, 144); this.groupPanel6.Name = "groupPanel6"; this.groupPanel6.Size = new System.Drawing.Size(131, 74); // // // this.groupPanel6.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; this.groupPanel6.Style.BackColorGradientAngle = 90; this.groupPanel6.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; this.groupPanel6.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel6.Style.BorderBottomWidth = 1; this.groupPanel6.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; this.groupPanel6.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel6.Style.BorderLeftWidth = 1; this.groupPanel6.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel6.Style.BorderRightWidth = 1; this.groupPanel6.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; this.groupPanel6.Style.BorderTopWidth = 1; this.groupPanel6.Style.CornerDiameter = 4; this.groupPanel6.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; this.groupPanel6.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; this.groupPanel6.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; this.groupPanel6.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; // // // this.groupPanel6.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; // // // this.groupPanel6.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.groupPanel6.TabIndex = 4; this.groupPanel6.Text = "Stop Bits"; // // radioButton9 // this.radioButton9.AutoSize = true; this.radioButton9.Checked = true; this.radioButton9.Location = new System.Drawing.Point(43, 18); this.radioButton9.Name = "radioButton9"; this.radioButton9.Size = new System.Drawing.Size(31, 17); this.radioButton9.TabIndex = 0; this.radioButton9.TabStop = true; this.radioButton9.Text = "1"; this.radioButton9.UseVisualStyleBackColor = true; // // SRS232_OK // this.SRS232_OK.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.SRS232_OK.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.SRS232_OK.Location = new System.Drawing.Point(277, 233); this.SRS232_OK.Name = "SRS232_OK"; this.SRS232_OK.Size = new System.Drawing.Size(75, 23); this.SRS232_OK.TabIndex = 5; this.SRS232_OK.Text = "OK"; this.SRS232_OK.Click += new System.EventHandler(this.SRS232_OK_Click); // // SRS232_CANCEL // this.SRS232_CANCEL.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.SRS232_CANCEL.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.SRS232_CANCEL.Location = new System.Drawing.Point(358, 233); this.SRS232_CANCEL.Name = "SRS232_CANCEL"; this.SRS232_CANCEL.Size = new System.Drawing.Size(75, 23); this.SRS232_CANCEL.TabIndex = 6; this.SRS232_CANCEL.Text = "Cancel"; this.SRS232_CANCEL.Click += new System.EventHandler(this.SRS232_CANCEL_Click); // // FormSerial // this.ClientSize = new System.Drawing.Size(448, 275); this.Controls.Add(this.SRS232_CANCEL); this.Controls.Add(this.SRS232_OK); this.Controls.Add(this.groupPanel6); this.Controls.Add(this.groupPanel4); this.Controls.Add(this.groupPanel3); this.Controls.Add(this.groupPanel2); this.Controls.Add(this.groupPanel1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.Name = "FormSerial"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "RS-232 Setting"; this.Shown += new System.EventHandler(this.RS232DLG_Shown); this.groupPanel1.ResumeLayout(false); this.groupPanel2.ResumeLayout(false); this.groupPanel2.PerformLayout(); this.groupPanel3.ResumeLayout(false); this.groupPanel3.PerformLayout(); this.groupPanel4.ResumeLayout(false); this.groupPanel4.PerformLayout(); this.groupPanel6.ResumeLayout(false); this.groupPanel6.PerformLayout(); this.ResumeLayout(false); }
public TaskOptions(Manager manager) : base(manager) { //Set up window UI MinimumHeight = 100; Height = Manager.ScreenHeight - 48; Width = 300; Resizable = false; Text = "Options"; Caption.Text = "Information"; Description.Text = "Customize and edit the game settings for your liking and best performance.\nHover over an option for more details."; Caption.TextColor = Description.TextColor = new Color(96, 96, 96); //Custom UI Controls ContentPackPnl = new GroupPanel(Manager); //Panel for content pack settings ContentPackPnl.Init(); ContentPackPnl.Parent = this; ContentPackPnl.Width = ClientWidth - 16; ContentPackPnl.ClientHeight = 32; ContentPackPnl.Left = 8; ContentPackPnl.Top = TopPanel.Height + 8; ContentPackPnl.Text = "Content Packs"; btnContentPack = new Button(Manager); btnContentPack.Init(); btnContentPack.Left = 8; btnContentPack.Top = 6; btnContentPack.Text = Game.level != null ? "Choose Content Pack >>" : "Join World To Edit"; btnContentPack.Width = 164; btnContentPack.Height = 18; btnContentPack.Click += btnContentPack_Click; btnContentPack.Enabled = Game.level != null; ContentPackPnl.Add(btnContentPack); GraphicsPnl = new GroupPanel(Manager); //Panel for graphics settings GraphicsPnl.Init(); GraphicsPnl.Parent = this; GraphicsPnl.Width = ClientWidth - 16; GraphicsPnl.Height = 226; GraphicsPnl.Left = 8; GraphicsPnl.Top = ContentPackPnl.Height + ContentPackPnl.Top + 8; GraphicsPnl.Text = "General"; ControlsPnl = new GroupPanel(Manager); //Panel for controls settings ControlsPnl.Init(); ControlsPnl.Parent = this; ControlsPnl.Width = ClientWidth - 16; ControlsPnl.Height = 176; ControlsPnl.Left = GraphicsPnl.Left + GraphicsPnl.Width + 8; ControlsPnl.Top = ContentPackPnl.Top; ControlsPnl.Text = "Controls"; ParticleLbl = new Label(manager); ParticleLbl.Init(); ParticleLbl.Parent = GraphicsPnl; ParticleLbl.Left = 8; ParticleLbl.Top = 8; ParticleLbl.Width = 92; ParticleLbl.Anchor = Anchors.Left; ParticleLbl.Text = "Particle Quality:"; ParticleLbl.ToolTip.Text = "Adjust the particle quality (amount)"; ParticleCmb = new ComboBox(Manager); ParticleCmb.Init(); ParticleCmb.Parent = GraphicsPnl; ParticleCmb.Left = ParticleLbl.Left + ParticleLbl.Width + 4; ParticleCmb.Top = 7; ParticleCmb.Width = 82; ParticleCmb.Height = 20; ParticleCmb.ReadOnly = true; ParticleCmb.Items.Add("Low"); ParticleCmb.Items.Add("Medium"); ParticleCmb.Items.Add("High"); ParticleCmb.Movable = ParticleCmb.Resizable = false; ParticleCmb.OutlineMoving = ParticleCmb.OutlineResizing = false; ParticleCmb.ItemIndex = Game.ParticleQuality; SkinLbl = new Label(manager); SkinLbl.Init(); SkinLbl.Parent = GraphicsPnl; SkinLbl.Left = 8; SkinLbl.Top = ParticleCmb.Top + ParticleCmb.Height + 5; SkinLbl.Width = 48; SkinLbl.Anchor = Anchors.Left; SkinLbl.Text = "UI Skin:"; SkinLbl.ToolTip.Text = "Adjust the visual appearence of the user interface"; SkinCmb = new ComboBox(Manager); SkinCmb.Init(); SkinCmb.Parent = GraphicsPnl; SkinCmb.Left = SkinLbl.Left + SkinLbl.Width + 4; SkinCmb.Top = ParticleCmb.Top + ParticleCmb.Height + 4; SkinCmb.Width = 72; SkinCmb.Height = 20; SkinCmb.ReadOnly = true; SkinCmb.Items.Add("Red"); SkinCmb.Items.Add("Blue"); SkinCmb.Items.Add("Green"); SkinCmb.MaxItems = 3; SkinCmb.Movable = SkinCmb.Resizable = false; SkinCmb.OutlineMoving = SkinCmb.OutlineResizing = false; SkinCmb.ItemIndex = Game.Skin; LightingQualityLbl = new Label(manager); LightingQualityLbl.Init(); LightingQualityLbl.Parent = GraphicsPnl; LightingQualityLbl.Left = 8; LightingQualityLbl.Top = SkinCmb.Top + SkinCmb.Height + 6; LightingQualityLbl.Width = 96; LightingQualityLbl.Anchor = Anchors.Left; LightingQualityLbl.Text = "Lighting Quality:"; LightingQualityLbl.ToolTip.Text = "Adjust the lighting quality\nLow: Simple, Original lighting, twice as fast as medium. However, there may be lighting glitches in complex areas such as caves\nMedium: 'Dual Pass' lighting, which will smooth out any inconsistancies\nHigh: Same as medium, however the lighting gets 'blurred' even more, reducing sharp edges and giving light a smoother look"; LightingQualityCmb = new ComboBox(Manager); LightingQualityCmb.Init(); LightingQualityCmb.Parent = GraphicsPnl; LightingQualityCmb.Left = LightingQualityLbl.Left + LightingQualityLbl.Width + 4; LightingQualityCmb.Top = SkinCmb.Top + SkinCmb.Height + 4; LightingQualityCmb.Width = 72; LightingQualityCmb.Height = 20; LightingQualityCmb.ReadOnly = true; LightingQualityCmb.Items.Add("Low"); LightingQualityCmb.Items.Add("Medium"); LightingQualityCmb.Items.Add("High"); LightingQualityCmb.MaxItems = 3; LightingQualityCmb.Movable = LightingQualityCmb.Resizable = false; LightingQualityCmb.OutlineMoving = LightingQualityCmb.OutlineResizing = false; LightingQualityCmb.ItemIndex = Game.LightingQuality; LightingRefreshLbl = new Label(manager); LightingRefreshLbl.Init(); LightingRefreshLbl.Parent = GraphicsPnl; LightingRefreshLbl.Left = 8; LightingRefreshLbl.Top = LightingQualityLbl.Top + LightingQualityLbl.Height + 6; LightingRefreshLbl.Width = 132; LightingRefreshLbl.Anchor = Anchors.Left; LightingRefreshLbl.Text = "Lighting Refresh Rate:"; LightingRefreshLbl.ToolTip.Text = "Adjust the lighting refresh rate. Slow will cause less lighting re-calculations, thus less lag.\nHowever, fast will have better quality but cause more lag."; LightingRefreshCmb = new ComboBox(Manager); LightingRefreshCmb.Init(); LightingRefreshCmb.Parent = GraphicsPnl; LightingRefreshCmb.Left = LightingQualityLbl.Left + LightingRefreshLbl.Width + 4; LightingRefreshCmb.Top = LightingQualityLbl.Top + LightingQualityLbl.Height + 4; LightingRefreshCmb.Width = 72; LightingRefreshCmb.Height = 20; LightingRefreshCmb.ReadOnly = true; LightingRefreshCmb.Items.Add("Slow"); LightingRefreshCmb.Items.Add("Default"); LightingRefreshCmb.Items.Add("Fast"); LightingRefreshCmb.MaxItems = 3; LightingRefreshCmb.Movable = LightingQualityCmb.Resizable = false; LightingRefreshCmb.OutlineMoving = LightingQualityCmb.OutlineResizing = false; LightingRefreshCmb.ItemIndex = Game.LightingRefresh; FullscreenChk = new CheckBox(Manager); FullscreenChk.Parent = GraphicsPnl; FullscreenChk.Init(); FullscreenChk.Left = 8; FullscreenChk.Width = 150; FullscreenChk.Height = ParticleCmb.Height; FullscreenChk.Text = "Fullscreen Mode"; FullscreenChk.Checked = Game.Fullscreen; FullscreenChk.Top = LightingRefreshCmb.Top + LightingRefreshCmb.Height + 4; DropShadowsChk = new CheckBox(Manager); DropShadowsChk.Parent = GraphicsPnl; DropShadowsChk.Init(); DropShadowsChk.Left = 8; DropShadowsChk.Width = 150; DropShadowsChk.Height = FullscreenChk.Height; DropShadowsChk.Text = "Drop Shadows"; DropShadowsChk.ToolTip.Text = "Gives blocks and collectables small shadows to display a 3D effect (Recommended: On for quality, off for performance)"; DropShadowsChk.Top = FullscreenChk.Top + FullscreenChk.Height; DropShadowsChk.Checked = Game.DropShadows; TilesidesChk = new CheckBox(Manager); TilesidesChk.Parent = GraphicsPnl; TilesidesChk.Init(); TilesidesChk.Left = 8; TilesidesChk.Width = 150; TilesidesChk.Height = FullscreenChk.Height; TilesidesChk.Text = "Tile Edges"; TilesidesChk.Checked = Game.TileEdges; TilesidesChk.ToolTip.Text = "Makes edges of tiles differ from normal tiles, (Recommended: On for quality, Decreases peformance)"; TilesidesChk.Top = DropShadowsChk.Top + DropShadowsChk.Height; AntialiasingChk = new CheckBox(Manager); AntialiasingChk.Parent = GraphicsPnl; AntialiasingChk.Init(); AntialiasingChk.Left = 8; AntialiasingChk.Width = 150; AntialiasingChk.Height = FullscreenChk.Height; AntialiasingChk.Text = "Anti-aliasing"; AntialiasingChk.Checked = Game.Antialiasing; AntialiasingChk.ToolTip.Text = "Smooths out jagged edges on lines, NOTE: Disable this if text/graphics appear extremly blurred. (Recommended: On for quality, Decreases peformance)"; AntialiasingChk.Top = TilesidesChk.Top + TilesidesChk.Height; AutosaveChk = new CheckBox(Manager); AutosaveChk.Parent = GraphicsPnl; AutosaveChk.Init(); AutosaveChk.Left = 8; AutosaveChk.Width = 150; AutosaveChk.Height = AntialiasingChk.Height; AutosaveChk.Text = "Autosave"; AutosaveChk.Checked = Game.Autosave; AutosaveChk.ToolTip.Text = "Autosaves the level every 10 minutes to prevent data loss (Recommended: On)"; AutosaveChk.Top = AntialiasingChk.Top + AntialiasingChk.Height; btnOk = new Button(manager); btnOk.Init(); btnOk.Parent = BottomPanel; btnOk.Anchor = Anchors.Top | Anchors.Right; btnOk.Top = btnOk.Parent.ClientHeight - btnOk.Height - 8; btnOk.Left = btnOk.Parent.ClientWidth - 8 - btnOk.Width * 3 - 8; btnOk.Text = "OK"; btnOk.ModalResult = ModalResult.Ok; btnOk.Click += new TomShane.Neoforce.Controls.EventHandler(btnApply_Click); btnApply = new Button(manager); btnApply.Init(); btnApply.Parent = BottomPanel; btnApply.Anchor = Anchors.Top | Anchors.Right; btnApply.Top = btnOk.Parent.ClientHeight - btnOk.Height - 8; btnApply.Left = btnOk.Parent.ClientWidth - 4 - btnOk.Width * 2 - 8; btnApply.Text = "Apply"; btnApply.Click += new TomShane.Neoforce.Controls.EventHandler(btnApply_Click); btnClose = new Button(manager); btnClose.Init(); btnClose.Parent = BottomPanel; btnClose.Anchor = Anchors.Top | Anchors.Right; btnClose.Top = btnOk.Parent.ClientHeight - btnClose.Height - 8; btnClose.Left = btnOk.Parent.ClientWidth - btnClose.Width - 8; btnClose.Text = "Cancel"; btnClose.ModalResult = ModalResult.Cancel; lblControls = new Label[Game.Controls.Count]; btnControls = new Button[Game.Controls.Count]; for (int i = 0; i < Game.Controls.Count; i++) { Label l = new Label(manager); l.Init(); l.Parent = ControlsPnl; l.Left = 8; l.Top = 2 + ((l.Height + 6) * i); l.Width = 128; l.Text = Game.Controls.ElementAt(i).Key; lblControls[i] = l; Button b = new Button(manager); b.Init(); b.Parent = ControlsPnl; b.Left = ControlsPnl.ClientWidth - 8 - b.Width; b.Top = 2 + ((l.Height + 6) * i); b.Height = 18; b.Text = Game.Controls.ElementAt(i).Value.ToString().AddSpacesToSentence(); b.Click += b_Click; btnControls[i] = b; } ControlsPnl.ClientHeight = btnControls[btnControls.Length - 1].Height + btnControls[btnControls.Length - 1].Top + 4; Height = ControlsPnl.Top + ControlsPnl.Height + BottomPanel.Height + 48; TopPanel.Visible = true; BottomPanel.Visible = true; BottomPanel.Top = ClientHeight - BottomPanel.Height; ClientWidth = ControlsPnl.Left + ControlsPnl.Width + 8; Center(); }
public ColorFillDialog() { Text = "Color/Fill Select"; FormBorderStyle = FormBorderStyle.FixedDialog; ControlBox = MinimizeBox = MaximizeBox = ShowInTaskbar = false; AutoSize = true; AutoSizeMode = AutoSizeMode.GrowAndShrink; FlowLayoutPanel flow = new FlowLayoutPanel(); flow.Parent = this; flow.AutoSize = true; flow.FlowDirection = FlowDirection.TopDown; FlowLayoutPanel flow2 = new FlowLayoutPanel(); flow2.Parent = flow; flow2.AutoSize = true; flow2.Anchor = AnchorStyles.None; grppnl1 = new GroupPanel(); grppnl1.Parent = flow2; grppnl1.AutoSize = true; grppnl1.Text = "Color"; grppnl2 = new GroupPanel(); grppnl2.Parent = flow2; grppnl2.AutoSize = true; grppnl2.Text = "Background"; grppnl1.SuspendLayout(); grppnl2.SuspendLayout(); // Get property information for SystemInformation class. Type type = typeof(Color); PropertyInfo[] apropinfo = type.GetProperties(); // Loop through the property information. foreach (PropertyInfo pi in apropinfo) { if (pi.CanRead && pi.GetGetMethod().IsStatic) { // Get the property names and values. if (pi.Name[0] == 'S' || pi.Name[0] == 'P') { RadioButton radio = new RadioButton(); radio.Parent = pi.Name[0] == 'S' ? grppnl1 : grppnl2; radio.AutoSize = true; radio.Text = radio.Name = pi.Name; } } } grppnl1.ResumeLayout(); grppnl2.ResumeLayout(); chkbox = new CheckBox(); chkbox.Parent = flow; chkbox.AutoSize = true; chkbox.Text = "Fill Ellipse"; chkbox.Anchor = AnchorStyles.None; FlowLayoutPanel flow3 = new FlowLayoutPanel(); flow3.Parent = flow; flow3.AutoSize = true; flow3.Anchor = AnchorStyles.None; Button btn = new Button(); btn.Parent = flow3; btn.AutoSize = true; btn.Text = "OK"; btn.DialogResult = DialogResult.OK; AcceptButton = btn; btn = new Button(); btn.Parent = flow3; btn.AutoSize = true; btn.Text = "Cancel"; btn.DialogResult = DialogResult.Cancel; CancelButton = btn; }
public void CreateInterface(Node node) { foreach (var child in Controls.First().Controls.ToList()) { Controls.First().Remove(child); } _node = node; int yPos = 16; // Create the node editing section var nodeEditing = new GroupPanel(Manager) { Text = "Node Details" }; nodeEditing.Init(); // nodeEditing.Anchor = Anchors.Left | Anchors.Right | Anchors.Top; nodeEditing.Left = 16; nodeEditing.Top = yPos; nodeEditing.Width = Width - 48; nodeEditing.Parent = this; nodeEditing.Visible = true; _nodeEditor = new ObjectEditor <Node>(Manager, nodeEditing); _nodeEditor.SetInstance(node); _nodeEditor.CreateInterface(); yPos += nodeEditing.Height + 16; // Create the binded logic section var bindedLogicEditing = new GroupPanel(Manager) { Text = "Node Details" }; bindedLogicEditing.Init(); //bindedLogicEditing.Anchor = Anchors.Left | Anchors.Right | Anchors.Top; bindedLogicEditing.Left = 16; bindedLogicEditing.Top = yPos; bindedLogicEditing.Width = Width - 48; bindedLogicEditing.Parent = this; bindedLogicEditing.Visible = true; _bindedLogicEditor = new ObjectEditor <BindedLogic>(Manager, bindedLogicEditing); _bindedLogicEditor.SetInstance(node.BindedLogic); _bindedLogicEditor.CreateInterface(); yPos += bindedLogicEditing.Height + 16; // Create the pure logic section pureLogicEditing = new GroupPanel(Manager) { Text = "Node Details", AutoScroll = true, Left = 16, Top = yPos, Width = Width - 48, Parent = this, Visible = true, Height = 80 }; pureLogicEditing.Init(); CreatePureLogicEditor(pureLogicEditing); Invalidate(); Refresh(); pureLogicEditing.Invalidate(); pureLogicEditing.Refresh(); }
//////////////////////////////////////////////////////////////////////////// #endregion #region //// Constructors ////// //////////////////////////////////////////////////////////////////////////// public TaskSinglePlayer(Manager manager) : base(manager) { Width = 600; Resizable = false; Center(); Text = "Singleplayer Mode"; TopPanel.Visible = true; Remove(BottomPanel); Caption.Text = "Information"; Description.Text = "Create or open a new single player world."; Caption.TextColor = Description.TextColor = new Color(96, 96, 96); OpenPanel = new GroupPanel(Manager); OpenPanel.Init(); OpenPanel.Parent = this; OpenPanel.Anchor = Anchors.Left | Anchors.Top | Anchors.Right; OpenPanel.Width = ClientWidth - 16; OpenPanel.Height = 232; OpenPanel.Left = 8; OpenPanel.Top = TopPanel.Height + 8; OpenPanel.Text = "Open a world!"; Height = OpenPanel.Height * 2 + 64 + TopPanel.Height; Add(OpenPanel); CreatePanel = new GroupPanel(Manager); CreatePanel.Init(); CreatePanel.Parent = this; CreatePanel.Anchor = Anchors.Left | Anchors.Top | Anchors.Right; CreatePanel.Width = ClientWidth - 16; CreatePanel.Height = 200; CreatePanel.Left = 8; CreatePanel.Top = OpenPanel.Height + OpenPanel.Top + 8; CreatePanel.Text = "Create a world!"; Add(CreatePanel); name = new Label(manager) { Font = FontSize.Default14 }; name.Init(); name.Width = 96; name.Left = (OpenPanel.Width / 3 * 2) + 8; name.Top = 8; name.Height = 16; OpenPanel.Add(name); descrition = new Label(manager); descrition.Init(); descrition.Height = 200; descrition.Width = OpenPanel.Width / 2; descrition.Left = (OpenPanel.Width / 3 * 2) + 8; descrition.Top = 8 + name.Height; OpenPanel.Add(descrition); Worlds = new ListBox(manager); Worlds.Init(); Worlds.Top = 8; Worlds.Left = 8; Worlds.Width = (OpenPanel.Width / 3 * 2) - 16; Worlds.Height = OpenPanel.Height - 40 - 32; Worlds.ItemIndexChanged += new TomShane.Neoforce.Controls.EventHandler(delegate(object o, Controls.EventArgs e) { string[] s = Info[Worlds.ItemIndex].Split('~'); name.Text = s[0]; descrition.Text = s[1] + "\n\nLast Saved: " + s[3] + "\nVersion Saved: " + s[2] + "\nDimensions: " + s[4] + "x" + s[5]; }); OpenPanel.Add(Worlds); Open = new Button(manager); Open.Init(); Open.Top = Worlds.Top + Worlds.Height + 8; Open.Left = 8; Open.Click += new TomShane.Neoforce.Controls.EventHandler(delegate(object o, Controls.EventArgs e) { }); Open.Text = "Open"; OpenPanel.Add(Open); Delete = new Button(manager); Delete.Init(); Delete.Top = Worlds.Top + Worlds.Height + 8; Delete.Left = Open.Left + Open.Width + 8; Delete.Click += new TomShane.Neoforce.Controls.EventHandler(delegate(object o, Controls.EventArgs e) { File.Delete(IO.Directories["Planets"] + Worlds.Items[Worlds.ItemIndex] + ".z"); AddFilesToList(); }); Delete.Text = "Delete"; OpenPanel.Add(Delete); Rename = new Button(manager); Rename.Init(); Rename.Top = Worlds.Top + Worlds.Height + 8; Rename.Left = Delete.Left + Delete.Width + 8; Rename.Click += new TomShane.Neoforce.Controls.EventHandler(delegate(object o, Controls.EventArgs e) { File.Move(IO.Directories["Planets"] + Worlds.Items[Worlds.ItemIndex] + IO.WorldSuffix, IO.Directories["Planets"] + reName.Text + IO.WorldSuffix); AddFilesToList(); }); Rename.Text = "Rename"; reName = new TextBox(manager); reName.Init(); reName.Top = Worlds.Top + Worlds.Height + 9; reName.Left = Rename.Left + Rename.Width + 8; reName.Text = "New Name"; reName.Width = (OpenPanel.Width / 3 * 2) - reName.Left - 8; OpenPanel.Add(Rename); OpenPanel.Add(reName); //Add worlds AddFilesToList(); NameLbl = new Label(manager); NameLbl.Init(); NameLbl.Top = 8; NameLbl.Left = 8; NameLbl.Text = "Name:"; NameLbl.Width = CreatePanel.Width / 2 - 16; CreatePanel.Add(NameLbl); NameInput = new TextBox(manager); NameInput.Init(); NameInput.Top = NameLbl.Top + NameLbl.Height + 2; NameInput.Left = 8; NameInput.Width = NameLbl.Width; CreatePanel.Add(NameInput); descriptionl = new Label(manager); descriptionl.Init(); descriptionl.Width = NameLbl.Width; descriptionl.Top = NameInput.Top + NameInput.Height + 2; descriptionl.Left = 8; descriptionl.Text = "Description:"; CreatePanel.Add(descriptionl); description = new TextBox(manager); description.Init(); description.Mode = TextBoxMode.Multiline; description.Top = descriptionl.Top + descriptionl.Height + 2; description.Left = 8; description.Width = NameInput.Width; description.Height = 64; description.ScrollBars = ScrollBars.Vertical; description.Text = "A short description\nof the level"; sizel = new Label(manager); sizel.Init(); sizel.Top = 8; sizel.Left = 16 + NameInput.Width; sizel.Text = "Size:"; CreatePanel.Add(sizel); CreatePanel.Add(description); size = new ComboBox(manager); size.Init(); size.Left = sizel.Left; size.Top = sizel.Top + sizel.Height + 2; size.Width = NameInput.Width; size.Height = 20; size.Anchor = Anchors.Left | Anchors.Top | Anchors.Right; size.Items.Add("Little 1000x300"); size.Items.Add("Small 2000x600"); size.Items.Add("Mild 3000x900"); size.Items.Add("Regular 4000x1200"); size.Items.Add("Moderate 5000x1500"); size.Items.Add("Big 6000x1800"); size.Items.Add("Immense 7000x2100"); size.ItemIndex = 0; CreatePanel.Add(size); seedl = new Label(manager); seedl.Init(); seedl.Width = NameLbl.Width; seedl.Top = size.Top + size.Height + 2; seedl.Left = sizel.Left; seedl.Text = "Seed:"; seedl.ToolTip.Text = "seeds are values made up of characters \nand numbers that are used as the \nbasis for generating every world"; CreatePanel.Add(seedl); seed = new TextBox(manager); seed.Init(); seed.Top = seedl.Top + seedl.Height + 2; seed.Left = sizel.Left; seed.Width = NameInput.Width; CreatePanel.Add(seed); Create = new Button(manager); Create.Init(); Create.Top = description.Top + description.Height + 8; Create.Left = 8; Create.Click += new Controls.EventHandler(Create_Click); Create.Text = "Create"; CreatePanel.Add(Create); generatingLbl = new Label(manager); generatingLbl.Init(); generatingLbl.Left = Create.Left + Create.Width + 8; generatingLbl.Top = Create.Top + 4; generatingLbl.Width = CreatePanel.Width; generatingLbl.TextColor = Color.Gold; generatingLbl.Text = string.Empty; CreatePanel.Add(generatingLbl); openingLbl = new Label(manager); openingLbl.Init(); openingLbl.Left = reName.Left + reName.Width + 8; openingLbl.Top = reName.Top + 4; openingLbl.Width = CreatePanel.Width; openingLbl.TextColor = Color.Gold; openingLbl.Text = string.Empty; OpenPanel.Add(openingLbl); }
public LobbyWindow(Manager manager) : base(manager) { //Setup the window CaptionVisible = false; TopPanel.Visible = false; Movable = false; Resizable = false; Width = 700; Height = 500; Shadow = true; Center(); //Group panels grpLobby = new GroupPanel(Manager) { Width = ClientWidth / 2, Height = ClientHeight - BottomPanel.Height + 2, Text = "Rooms" }; grpLobby.Init(); Add(grpLobby); grpServer = new GroupPanel(Manager) { Left = (ClientWidth / 2) - 1, Width = (ClientWidth / 2) + 1, Height = ClientHeight - BottomPanel.Height + 2, Text = "Server" }; grpServer.Init(); Add(grpServer); //Top controls txtSearch = new TextBox(Manager) { Left = 8, Top = 8, Width = (ClientWidth / 4) - 16, }; txtSearch.Init(); txtSearch.Text = searchStr; txtSearch.TextChanged += new TomShane.Neoforce.Controls.EventHandler(delegate(object o, TomShane.Neoforce.Controls.EventArgs e) { RefreshRooms(); }); //Show "Search..." text, but make it dissapear on focus txtSearch.FocusGained += new TomShane.Neoforce.Controls.EventHandler(delegate(object o, TomShane.Neoforce.Controls.EventArgs e) { if (txtSearch.Text.Trim() == searchStr) { txtSearch.Text = string.Empty; } }); txtSearch.FocusLost += new TomShane.Neoforce.Controls.EventHandler(delegate(object o, TomShane.Neoforce.Controls.EventArgs e) { if (txtSearch.Text.Trim() == string.Empty) { txtSearch.Text = searchStr; } }); grpLobby.Add(txtSearch); cmbSort = new ComboBox(Manager) { Left = txtSearch.Right + 8, Top = 8, Width = (ClientWidth / 4) - 16 - 20, }; cmbSort.Init(); cmbSort.Items.AddRange(sortFilters); cmbSort.ItemIndex = 0; cmbSort.ItemIndexChanged += new TomShane.Neoforce.Controls.EventHandler(delegate(object o, TomShane.Neoforce.Controls.EventArgs e) { RefreshRooms(); }); grpLobby.Add(cmbSort); btnReload = new Button(Manager) { Left = cmbSort.Right + 8, Top = 8, Width = 20, Height = 20, Text = string.Empty, }; btnReload.Init(); btnReload.Glyph = new Glyph(ContentPack.Textures["gui\\icons\\refresh"]); btnReload.ToolTip.Text = "Refresh"; btnReload.Click += new TomShane.Neoforce.Controls.EventHandler(delegate(object o, TomShane.Neoforce.Controls.EventArgs e) { Game.NetManager.Send(new RequestMessage(MessageTypes.Lobby)); }); grpLobby.Add(btnReload); //Main room list RoomListCtrl = new ControlList <LobbyDataControl>(Manager) { Left = 8, Top = txtSearch.Bottom + 8, Width = grpLobby.Width - 16, Height = grpLobby.Height - 16 - txtSearch.Bottom - 24 }; RoomListCtrl.Init(); grpLobby.Add(RoomListCtrl); //Server info labels lblName = new Label(Manager) { Text = "Loading...", Top = 8, Font = FontSize.Default20, Left = 8, Alignment = Alignment.MiddleCenter, Height = 30, Width = grpServer.ClientWidth - 16 }; lblName.Init(); grpServer.Add(lblName); lblDescription = new Label(Manager) { Text = string.Empty, Top = 8 + lblName.Bottom, Left = 8, Alignment = Alignment.MiddleCenter, Width = grpServer.ClientWidth - 16 }; lblDescription.Init(); grpServer.Add(lblDescription); lblInfo = new Label(Manager) { Text = string.Empty, Top = 8 + lblDescription.Bottom, Left = 8, Alignment = Alignment.TopLeft, Width = grpServer.ClientWidth - 16, Height = grpServer.Height }; lblInfo.Init(); grpServer.Add(lblInfo); //Bottom buttons btnCreate = new Button(Manager) { Top = 8, Text = "Create" }; btnCreate.Left = (ClientWidth / 2) - (btnCreate.Width / 2); btnCreate.Init(); btnCreate.Click += new TomShane.Neoforce.Controls.EventHandler(delegate(object o, TomShane.Neoforce.Controls.EventArgs e) { CreateWorldDialog window = new CreateWorldDialog(manager, this); window.Init(); Manager.Add(window); window.Show(); }); BottomPanel.Add(btnCreate); btnJoin = new Button(Manager) { Right = btnCreate.Left - 8, Top = 8, Text = "Join" }; btnJoin.Init(); btnJoin.Click += new TomShane.Neoforce.Controls.EventHandler(delegate(object o, TomShane.Neoforce.Controls.EventArgs e) { JoinRoom(RoomListCtrl.ItemIndex); }); BottomPanel.Add(btnJoin); btnDisconnect = new Button(Manager) { Left = btnCreate.Right + 8, Top = 8, Text = "Quit" }; btnDisconnect.Init(); btnDisconnect.Click += new TomShane.Neoforce.Controls.EventHandler(delegate(object o, TomShane.Neoforce.Controls.EventArgs e) { Game.NetManager.Disconnect("Left Lobby"); Game.CurrentGameState = GameState.Login; Interface.MainWindow.ScreenManager.SwitchScreen(new LoginScreen()); }); BottomPanel.Add(btnDisconnect); //When finished, request server send lobby data Game.NetManager.Send(new RequestMessage(MessageTypes.Lobby)); }
public TaskControls(Manager manager) : base(manager) { MinimumWidth = 340; MinimumHeight = 140; Height = 480; Center(); Text = "Controls Test"; TopPanel.Visible = true; Caption.Text = "Information"; Description.Text = "Demonstration of various controls available in Window Library"; Caption.TextColor = Description.TextColor = new Color(96, 96, 96); grpEdit = new GroupPanel(Manager); grpEdit.Init(); grpEdit.Parent = this; grpEdit.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right; grpEdit.Width = ClientWidth - 200; grpEdit.Height = 160; grpEdit.Left = 8; grpEdit.Top = TopPanel.Height + 8; grpEdit.Text = "EditBox"; pnlControls = new Panel(Manager); pnlControls.Init(); pnlControls.Passive = true; pnlControls.Parent = this; pnlControls.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right; pnlControls.Left = 8; pnlControls.Top = grpEdit.Top + grpEdit.Height + 8; pnlControls.Width = ClientWidth - 200; pnlControls.Height = BottomPanel.Top - 32 - pnlControls.Top; pnlControls.BevelBorder = EBevelBorder.All; pnlControls.BevelMargin = 1; pnlControls.BevelStyle = EBevelStyle.Etched; pnlControls.Color = Color.Transparent; lblEdit = new Label(manager); lblEdit.Init(); lblEdit.Parent = grpEdit; lblEdit.Left = 16; lblEdit.Top = 8; lblEdit.Text = "Testing field:"; lblEdit.Width = 128; lblEdit.Height = 16; txtEdit = new TextBox(manager); txtEdit.Init(); txtEdit.Parent = grpEdit; txtEdit.Left = 16; txtEdit.Top = 24; txtEdit.Width = grpEdit.ClientWidth - 32; txtEdit.Height = 20; txtEdit.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right | EAnchors.Bottom; txtEdit.Text = "Text"; rdbNormal = new RadioButton(manager); rdbNormal.Init(); rdbNormal.Parent = grpEdit; rdbNormal.Left = 16; rdbNormal.Top = 52; rdbNormal.Width = grpEdit.ClientWidth - 32; rdbNormal.Anchor = EAnchors.Left | EAnchors.Bottom | EAnchors.Right; rdbNormal.Checked = true; rdbNormal.Text = "Normal mode"; rdbNormal.ToolTip.Text = "Enables normal mode for TextBox control."; rdbNormal.CheckedChanged += new GodLesZ.Library.XNA.WindowLibrary.Controls.EventHandler(ModeChanged); rdbPassword = new RadioButton(manager); rdbPassword.Init(); rdbPassword.Parent = grpEdit; rdbPassword.Left = 16; rdbPassword.Top = 68; rdbPassword.Width = grpEdit.ClientWidth - 32; rdbPassword.Anchor = EAnchors.Left | EAnchors.Bottom | EAnchors.Right; rdbPassword.Checked = false; rdbPassword.Text = "Password mode"; rdbPassword.ToolTip.Text = "Enables password mode for TextBox control."; rdbPassword.CheckedChanged += new GodLesZ.Library.XNA.WindowLibrary.Controls.EventHandler(ModeChanged); chkBorders = new CheckBox(manager); chkBorders.Init(); chkBorders.Parent = grpEdit; chkBorders.Left = 16; chkBorders.Top = 96; chkBorders.Width = grpEdit.ClientWidth - 32; chkBorders.Anchor = EAnchors.Left | EAnchors.Bottom | EAnchors.Right; chkBorders.Checked = false; chkBorders.Text = "Borderless mode"; chkBorders.ToolTip.Text = "Enables or disables borderless mode for TextBox control."; chkBorders.CheckedChanged += new GodLesZ.Library.XNA.WindowLibrary.Controls.EventHandler(chkBorders_CheckedChanged); chkReadOnly = new CheckBox(manager); chkReadOnly.Init(); chkReadOnly.Parent = grpEdit; chkReadOnly.Left = 16; chkReadOnly.Top = 110; chkReadOnly.Width = grpEdit.ClientWidth - 32; chkReadOnly.Anchor = EAnchors.Left | EAnchors.Bottom | EAnchors.Right; chkReadOnly.Checked = false; chkReadOnly.Text = "Read only mode"; chkReadOnly.ToolTip.Text = "Enables or disables read only mode for TextBox control.\nThis mode is necessary to enable explicitly."; chkReadOnly.CheckedChanged += new GodLesZ.Library.XNA.WindowLibrary.Controls.EventHandler(chkReadOnly_CheckedChanged); string[] colors = new string[] {"Red", "Green", "Blue", "Yellow", "Orange", "Purple", "White", "Black", "Magenta", "Cyan", "Brown", "Aqua", "Beige", "Coral", "Crimson", "Gray", "Azure", "Ivory", "Indigo", "Khaki", "Orchid", "Plum", "Salmon", "Silver", "Gold", "Pink", "Linen", "Lime", "Olive", "Slate"}; spnMain = new SpinBox(manager, ESpinBoxMode.List); spnMain.Init(); spnMain.Parent = pnlControls; spnMain.Left = 16; spnMain.Top = 16; spnMain.Width = pnlControls.Width - 32; spnMain.Height = 20; spnMain.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right; spnMain.Items.AddRange(colors); spnMain.Mode = ESpinBoxMode.Range; spnMain.ItemIndex = 0; cmbMain = new ComboBox(manager); cmbMain.Init(); cmbMain.Parent = pnlControls; cmbMain.Left = 16; cmbMain.Top = 44; cmbMain.Width = pnlControls.Width - 32; cmbMain.Height = 20; cmbMain.ReadOnly = true; cmbMain.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right; cmbMain.Items.AddRange(colors); cmbMain.ItemIndex = 0; cmbMain.MaxItems = 5; cmbMain.ToolTip.Color = Color.Yellow; cmbMain.Movable = cmbMain.Resizable = true; cmbMain.OutlineMoving = cmbMain.OutlineResizing = true; trkMain = new TrackBar(manager); trkMain.Init(); trkMain.Parent = pnlControls; trkMain.Left = 16; trkMain.Top = 72; trkMain.Width = pnlControls.Width - 32; trkMain.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right; trkMain.Range = 64; trkMain.Value = 16; trkMain.ValueChanged += new GodLesZ.Library.XNA.WindowLibrary.Controls.EventHandler(trkMain_ValueChanged); lblTrack = new Label(manager); lblTrack.Init(); lblTrack.Parent = pnlControls; lblTrack.Left = 16; lblTrack.Top = 96; lblTrack.Width = pnlControls.Width - 32; lblTrack.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right; lblTrack.Alignment = EAlignment.TopRight; lblTrack.TextColor = new Color(32, 32, 32); trkMain_ValueChanged(this, null); // forcing label redraw with init values mnuListBox = new ContextMenu(manager); MenuItem i1 = new MenuItem("This is very long text"); MenuItem i2 = new MenuItem("Menu", true); MenuItem i3 = new MenuItem("Item", false); //i3.Enabled = false; MenuItem i4 = new MenuItem("Separated", true); MenuItem i11 = new MenuItem(); MenuItem i12 = new MenuItem(); MenuItem i13 = new MenuItem(); MenuItem i14 = new MenuItem(); MenuItem i111 = new MenuItem(); MenuItem i112 = new MenuItem(); MenuItem i113 = new MenuItem(); mnuListBox.Items.AddRange(new MenuItem[] { i1, i2, i3, i4 }); i2.Items.AddRange(new MenuItem[] { i11, i12, i13, i14 }); i13.Items.AddRange(new MenuItem[] { i111, i112, i113 }); lstMain = new ListBox(manager); lstMain.Init(); lstMain.Parent = this; lstMain.Top = TopPanel.Height + 8; lstMain.Left = grpEdit.Left + grpEdit.Width + 8; lstMain.Width = ClientWidth - lstMain.Left - 8; lstMain.Height = ClientHeight - 16 - BottomPanel.Height - TopPanel.Height; lstMain.Anchor = EAnchors.Top | EAnchors.Right | EAnchors.Bottom; lstMain.HideSelection = false; lstMain.Items.AddRange(colors); lstMain.ContextMenu = mnuListBox; prgMain = new ProgressBar(manager); prgMain.Init(); prgMain.Parent = this.BottomPanel; prgMain.Left = lstMain.Left; prgMain.Top = 10; prgMain.Width = lstMain.Width; prgMain.Height = 16; prgMain.Anchor = EAnchors.Top | EAnchors.Right; prgMain.Mode = EProgressBarMode.Infinite; prgMain.Passive = false; btnDisable = new Button(manager); btnDisable.Init(); btnDisable.Parent = BottomPanel; btnDisable.Left = 8; btnDisable.Top = 8; btnDisable.Text = "Disable"; btnDisable.Click += new Controls.EventHandler(btnDisable_Click); btnDisable.TextColor = Color.FromNonPremultiplied(255, 64, 32, 200); btnProgress = new Button(manager); btnProgress.Init(); btnProgress.Parent = BottomPanel; btnProgress.Left = prgMain.Left - 16; btnProgress.Top = prgMain.Top; btnProgress.Height = 16; btnProgress.Width = 16; btnProgress.Text = "!"; btnProgress.Anchor = EAnchors.Top | EAnchors.Right; btnProgress.Click += new Controls.EventHandler(btnProgress_Click); mnuMain = new MainMenu(manager); mnuMain.Items.Add(i2); mnuMain.Items.Add(i13); mnuMain.Items.Add(i3); mnuMain.Items.Add(i4); MainMenu = mnuMain; ToolBarPanel tlp = new ToolBarPanel(manager); ToolBarPanel = tlp; ToolBar tlb = new ToolBar(manager); ToolBar tlbx = new ToolBar(manager); tlb.FullRow = true; tlbx.Row = 1; tlbx.FullRow = false; tlp.Add(tlb); tlp.Add(tlbx); /* tlb.Init(); tlb.Width = 256; tlb.Parent = ToolBarPanel;*/ //tlbx.Init(); /* tlbx.Width = 512; tlbx.Top = 25; tlbx.Parent = ToolBarPanel;*/ /* ToolBarButton tb1 = new ToolBarButton(manager); tb1.Init(); tb1.Parent = tlb; tb1.Left = 10; tb1.Top = 1; tb1.Glyph = new Glyph(Manager.Skin.Images["Icon.Warning"].Resource); tb1.Glyph.SizeMode = SizeMode.Stretched; */ StatusBar stb = new StatusBar(Manager); StatusBar = stb; DefaultControl = txtEdit; OutlineMoving = true; OutlineResizing = true; BottomPanel.BringToFront(); SkinChanged += new GodLesZ.Library.XNA.WindowLibrary.Controls.EventHandler(TaskControls_SkinChanged); TaskControls_SkinChanged(null, null); }