public static void ChangeIconSize(ToolStrip toolStrip, IconSize iconSize) { toolStrip.SuspendLayout(); toolStrip.ImageScalingSize = StandardIconSizes.GetSize(iconSize); ChangeIconSize(toolStrip.Items, iconSize); toolStrip.ResumeLayout(false); toolStrip.PerformLayout(); }
private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); toolStrip1 = new System.Windows.Forms.ToolStrip(); toolStripButton1 = new System.Windows.Forms.ToolStripButton(); toolStrip1.SuspendLayout(); SuspendLayout(); // <Snippet1> // This is an example of some common ToolStrip property settings. // toolStrip1.AllowDrop = false; toolStrip1.AllowItemReorder = true; toolStrip1.AllowMerge = false; toolStrip1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); toolStrip1.AutoSize = false; toolStrip1.CanOverflow = false; toolStrip1.Cursor = System.Windows.Forms.Cursors.Cross; toolStrip1.DefaultDropDownDirection = System.Windows.Forms.ToolStripDropDownDirection.BelowRight; toolStrip1.Dock = System.Windows.Forms.DockStyle.None; toolStrip1.GripMargin = new System.Windows.Forms.Padding(3); toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { toolStripButton1 }); toolStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); toolStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow; toolStrip1.Location = new System.Drawing.Point(0, 0); toolStrip1.Margin = new System.Windows.Forms.Padding(1); toolStrip1.Name = "toolStrip1"; toolStrip1.Padding = new System.Windows.Forms.Padding(0, 0, 2, 0); toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; toolStrip1.ShowItemToolTips = false; toolStrip1.Size = new System.Drawing.Size(109, 273); toolStrip1.Stretch = true; toolStrip1.TabIndex = 0; toolStrip1.TabStop = true; toolStrip1.Text = "toolStrip1"; toolStrip1.TextDirection = System.Windows.Forms.ToolStripTextDirection.Vertical90; // </Snippet1> // toolStripButton1 // toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image"))); toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; toolStripButton1.Name = "toolStripButton1"; toolStripButton1.Size = new System.Drawing.Size(23, 270); toolStripButton1.Text = "toolStripButton1"; // // Form1 // ClientSize = new System.Drawing.Size(292, 273); Controls.Add(toolStrip1); Name = "Form1"; toolStrip1.ResumeLayout(false); toolStrip1.PerformLayout(); ResumeLayout(false); }
private void InitializeComponent() { toolStrip = new ToolStrip(); btnSizeToFit = new ToolStripButton(); btnZoomIn = new ToolStripButton(); btnZoomOut = new ToolStripButton(); cbZoomLevels = new ToolStripComboBox(); imageBox = new ImageBox(); toolStrip.SuspendLayout(); SuspendLayout(); toolStrip.Items.AddRange(new ToolStripItem[] { btnSizeToFit, btnZoomIn, btnZoomOut, new ToolStripSeparator(), cbZoomLevels, new ToolStripSeparator() }); btnSizeToFit.DisplayStyle = ToolStripItemDisplayStyle.Image; btnSizeToFit.Image = UIHelper.LoadResourceImage("Resources.btn_size_to_fit.png"); btnSizeToFit.ImageTransparentColor = Color.Magenta; btnSizeToFit.Name = "btnSizeToFit"; btnSizeToFit.Click += btnSizeToFit_Click; btnZoomIn.DisplayStyle = ToolStripItemDisplayStyle.Image; btnZoomIn.Image = UIHelper.LoadResourceImage("Resources.btn_zoom_in.png"); btnZoomIn.ImageTransparentColor = Color.Magenta; btnZoomIn.Name = "btnZoomIn"; btnZoomIn.Click += btnZoomIn_Click; btnZoomOut.DisplayStyle = ToolStripItemDisplayStyle.Image; btnZoomOut.Image = UIHelper.LoadResourceImage("Resources.btn_zoom_out.png"); btnZoomOut.ImageTransparentColor = Color.Magenta; btnZoomOut.Name = "btnZoomOut"; btnZoomOut.Click += btnZoomOut_Click; cbZoomLevels.DropDownStyle = ComboBoxStyle.DropDownList; cbZoomLevels.Name = "zoomLevelsToolStripComboBox"; cbZoomLevels.Size = new Size(140, 28); cbZoomLevels.SelectedIndexChanged += cbZoomLevels_SelectedIndexChanged; imageBox.BackColor = SystemColors.ControlDark; imageBox.Dock = DockStyle.Fill; imageBox.ZoomChanged += imageBox_ZoomChanged; Controls.Add(imageBox); Controls.Add(toolStrip); Size = new Size(944, 389); toolStrip.ResumeLayout(false); toolStrip.PerformLayout(); ResumeLayout(false); PerformLayout(); }
private void InitializeComponent() { toolStrip1 = new System.Windows.Forms.ToolStrip(); toolStripComboBox1 = new System.Windows.Forms.ToolStripComboBox(); toolStrip1.SuspendLayout(); SuspendLayout(); // // toolStrip1 // toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { toolStripComboBox1 }); toolStrip1.Location = new System.Drawing.Point(0, 0); toolStrip1.Name = "toolStrip1"; toolStrip1.Size = new System.Drawing.Size(292, 25); toolStrip1.TabIndex = 0; toolStrip1.Text = "toolStrip1"; // <Snippet1> // The following code example demonstrates the syntax for setting // various ToolStripComboBox properties. // toolStripComboBox1.AutoCompleteCustomSource.AddRange(new string[] { "aaa", "bbb", "ccc" }); toolStripComboBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; toolStripComboBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource; toolStripComboBox1.DropDownHeight = 110; toolStripComboBox1.DropDownWidth = 122; toolStripComboBox1.FlatStyle = System.Windows.Forms.FlatStyle.Standard; toolStripComboBox1.IntegralHeight = false; toolStripComboBox1.Items.AddRange(new object[] { "xxx", "yyy", "zzz" }); toolStripComboBox1.MaxDropDownItems = 9; toolStripComboBox1.MergeAction = System.Windows.Forms.MergeAction.Insert; toolStripComboBox1.Name = "toolStripComboBox1"; toolStripComboBox1.Size = new System.Drawing.Size(121, 25); toolStripComboBox1.Sorted = true; // </Snippet1> // // Form1 // ClientSize = new System.Drawing.Size(292, 273); Controls.Add(toolStrip1); Name = "Form1"; toolStrip1.ResumeLayout(false); toolStrip1.PerformLayout(); ResumeLayout(false); PerformLayout(); }
private void InitializeComponent() { toolStrip1 = new System.Windows.Forms.ToolStrip(); toolStripTextBox1 = new System.Windows.Forms.ToolStripTextBox(); toolStrip1.SuspendLayout(); SuspendLayout(); // // toolStrip1 // toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { toolStripTextBox1 }); toolStrip1.Location = new System.Drawing.Point(0, 0); toolStrip1.Name = "toolStrip1"; toolStrip1.Size = new System.Drawing.Size(292, 25); toolStrip1.TabIndex = 0; toolStrip1.Text = "toolStrip1"; // <Snippet1> // This code example demonstrates the syntax for setting // various ToolStripTextBox properties. // toolStripTextBox1.AcceptsReturn = true; toolStripTextBox1.AcceptsTab = true; toolStripTextBox1.AutoCompleteCustomSource.AddRange(new string[] { "This is line one.", "Second line.", "Another line." }); toolStripTextBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; toolStripTextBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource; toolStripTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; toolStripTextBox1.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; toolStripTextBox1.HideSelection = false; toolStripTextBox1.MaxLength = 32000; toolStripTextBox1.Name = "toolStripTextBox1"; toolStripTextBox1.ShortcutsEnabled = false; toolStripTextBox1.Size = new System.Drawing.Size(100, 25); toolStripTextBox1.Text = "STRING1\r\nSTRING2\r\nSTRING3\r\nSTRING4"; toolStripTextBox1.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Center; // </Snippet1> // // Form1 // ClientSize = new System.Drawing.Size(292, 273); Controls.Add(toolStrip1); Name = "Form1"; toolStrip1.ResumeLayout(false); toolStrip1.PerformLayout(); ResumeLayout(false); PerformLayout(); }
protected void CreateMenu(ToolStripContainer container, Action <ToolStrip> itemsInitializer) { MainMenuControl = new ToolStrip(); MainMenuControl.SuspendLayout(); container.TopToolStripPanel.Controls.Add(MainMenuControl); MainMenuControl.Dock = DockStyle.None; itemsInitializer(MainMenuControl); MainMenuControl.Location = new Point(3, 0); MainMenuControl.Name = "mainMenuControl"; MainMenuControl.Size = new Size(478, 25); MainMenuControl.TabIndex = 1; MainMenuControl.ResumeLayout(false); MainMenuControl.PerformLayout(); }
private void InitializeComponent() { toolStripContainer1 = new ToolStripContainer(); toolStrip1 = new ToolStrip(); toolStripDropDown = new ToolStripDropDownButton(); toolStripContainer1.TopToolStripPanel.SuspendLayout(); toolStripContainer1.SuspendLayout(); toolStrip1.SuspendLayout(); SuspendLayout(); toolStripContainer1.ContentPanel.Size = new Size(813, 237); toolStripContainer1.Dock = DockStyle.Fill; toolStripContainer1.Location = new Point(0, 0); toolStripContainer1.Name = "toolStripContainer1"; toolStripContainer1.Size = new Size(813, 262); toolStripContainer1.TabIndex = 0; toolStripContainer1.Text = "toolStripContainer1"; toolStripContainer1.TopToolStripPanel.Controls.Add(toolStrip1); toolStrip1.Dock = DockStyle.None; toolStrip1.Items.AddRange(new ToolStripItem[] { toolStripDropDown }); toolStrip1.Location = new Point(3, 0); toolStrip1.Name = "toolStrip1"; toolStrip1.Size = new Size(207, 25); toolStrip1.TabIndex = 0; toolStripDropDown.DisplayStyle = ToolStripItemDisplayStyle.Text; toolStripDropDown.ImageTransparentColor = Color.Magenta; toolStripDropDown.Name = "toolStripDropDown"; toolStripDropDown.Size = new Size(164, 22); toolStripDropDown.Text = "toolStripDropDownButton1"; toolStripDropDown.DropDownOpened += toolStripDropDown_DropDownOpened; AutoScaleDimensions = new SizeF(6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(813, 262); Controls.Add(toolStripContainer1); Name = "Form1"; Text = "Form1"; toolStripContainer1.TopToolStripPanel.ResumeLayout(false); toolStripContainer1.TopToolStripPanel.PerformLayout(); toolStripContainer1.ResumeLayout(false); toolStripContainer1.PerformLayout(); toolStrip1.ResumeLayout(false); toolStrip1.PerformLayout(); ResumeLayout(false); }
private void InitializeComponent() { var resources = new ComponentResourceManager(typeof(ImageButton)); _tsMain = new ToolStrip(); _bButton = new ToolStripButton(); _tsMain.SuspendLayout(); SuspendLayout(); // // tsMain // _tsMain.BackColor = System.Drawing.Color.Transparent; _tsMain.CanOverflow = false; _tsMain.Dock = DockStyle.Fill; _tsMain.GripMargin = new Padding(0); _tsMain.GripStyle = ToolStripGripStyle.Hidden; _tsMain.Items.AddRange(new ToolStripItem[] { _bButton }); _tsMain.Location = new System.Drawing.Point(0, 0); _tsMain.Name = "_tsMain"; _tsMain.Size = new System.Drawing.Size(25, 25); _tsMain.TabIndex = 0; _tsMain.Renderer = new ImageButtonToolStripSystemRenderer(); // // bButton // _bButton.DisplayStyle = ToolStripItemDisplayStyle.Image; _bButton.Image = ((System.Drawing.Image)(resources.GetObject("_bButton.Image"))); _bButton.ImageTransparentColor = System.Drawing.Color.Magenta; _bButton.Name = "_bButton"; _bButton.Size = new System.Drawing.Size(23, 22); _bButton.Click += bButton_Click; _bButton.DoubleClick += bButton_DoubleClick; // // ImageButton // Controls.Add(_tsMain); Name = "ImageButton"; Size = new System.Drawing.Size(25, 25); _tsMain.ResumeLayout(false); _tsMain.PerformLayout(); ResumeLayout(false); PerformLayout(); }
public void Size2() { Form f = new Form(); f.ShowInTaskbar = false; f.Show(); ToolStrip ts = new ToolStrip(); f.Controls.Add(ts); ToolStripOverflowButton tsi = ts.OverflowButton; Assert.AreEqual(new Size(16, 25), tsi.Size, "B1"); Assert.AreEqual(false, tsi.Visible, "B3"); ToolStripItem test = ts.Items.Add("test"); test.Overflow = ToolStripItemOverflow.Always; ts.PerformLayout(); Assert.AreEqual(Size.Empty, tsi.Size, "B2"); f.Hide(); }
protected virtual void CreateToolStrip() { var GenericToolName = new ToolStripLabel(); _toolStrip = new ToolStrip(); _toolStrip.SuspendLayout(); GenericToolName.BackColor = SystemColors.ControlDark; GenericToolName.Font = new Font("Segoe UI", 9F, FontStyle.Bold); GenericToolName.Image = this.ToolBoxImage; GenericToolName.Name = "GenericToolName"; GenericToolName.Size = new Size(93, 22); GenericToolName.Text = this.Name; _toolStrip.GripStyle = ToolStripGripStyle.Hidden; _toolStrip.Items.AddRange(new ToolStripItem[] { GenericToolName }); _toolStrip.Name = "Generic_ToolStrip"; _toolStrip.ResumeLayout(false); _toolStrip.PerformLayout(); }
private void InitializeComponent() { components = new Container(); System.ComponentModel.ComponentResourceManager resources = new ComponentResourceManager(typeof(PDDLTabItem)); ProblemsNode = new TreeNode(Parsing.PROBLEMS_NODE_NAME); DomainNode = new TreeNode(Parsing.DOMAIN_NODE_NAME); //TreeNode treeNode8 = new TreeNode(Parsing.PDDL_MODEL_NODE_NAME, // new[] {DomainNode, FunctionsNode}); DomainNode = new TreeNode(Parsing.DOMAIN_NODE_NAME, new[] { ProblemsNode }); splitContainer1 = new SplitContainer(); TreeView_Structure = new TreeView(); contextMenuStrip2 = new ContextMenuStrip(components); openWindowsExplorerToolStripMenuItem = new ToolStripMenuItem(); importDomainFileToolStripMenuItem = new ToolStripMenuItem(); openModelInWindowsExplorerToolStripMenuItem = new ToolStripMenuItem(); addFunctionToolStripMenuItem = new ToolStripMenuItem(); changeFunctionNameToolStripMenuItem = new ToolStripMenuItem(); deleteFunctionToolStripMenuItem = new ToolStripMenuItem(); imageList2 = new ImageList(components); toolStripContainer1 = new ToolStripContainer(); toolStrip1 = new ToolStrip(); toolStripSeparator3 = new ToolStripSeparator(); splitContainer1.Panel1.SuspendLayout(); splitContainer1.Panel2.SuspendLayout(); splitContainer1.SuspendLayout(); contextMenuStrip2.SuspendLayout(); toolStripContainer1.TopToolStripPanel.SuspendLayout(); toolStripContainer1.SuspendLayout(); toolStrip1.SuspendLayout(); SuspendLayout(); // // splitContainer1 // splitContainer1.Dock = DockStyle.Fill; splitContainer1.Location = new Point(0, 0); splitContainer1.Name = "splitContainer1"; // // splitContainer1.Panel1 // splitContainer1.Panel1.Controls.Add(TreeView_Structure); splitContainer1.Panel1MinSize = 120; // // splitContainer1.Panel2 // splitContainer1.Panel2.Controls.Add(toolStripContainer1); splitContainer1.Panel2MinSize = 100; splitContainer1.Size = new Size(617, 399); splitContainer1.SplitterDistance = 178; splitContainer1.TabIndex = 3; // // TreeView_Structure // TreeView_Structure.ContextMenuStrip = contextMenuStrip2; TreeView_Structure.Dock = DockStyle.Fill; TreeView_Structure.HideSelection = false; TreeView_Structure.Location = new Point(0, 0); TreeView_Structure.Name = "TreeView_Structure"; DomainNode.Name = Parsing.DOMAIN_NODE_NAME; DomainNode.StateImageIndex = 0; DomainNode.Text = Parsing.DOMAIN_NODE_NAME; DomainNode.Tag = new PDDLFile("", "", ""); ProblemsNode.Name = Parsing.PROBLEMS_NODE_NAME; ProblemsNode.StateImageIndex = 1; ProblemsNode.Text = Parsing.PROBLEMS_NODE_NAME; DomainNode.Name = Parsing.DOMAIN_NODE_NAME; DomainNode.Text = Parsing.DOMAIN_NODE_NAME; TreeView_Structure.Nodes.AddRange(new[] { DomainNode }); TreeView_Structure.Size = new Size(178, 399); TreeView_Structure.StateImageList = imageList2; TreeView_Structure.TabIndex = 0; TreeView_Structure.NodeMouseClick += TreeView_Structure_NodeMouseClick; TreeView_Structure.NodeMouseDoubleClick += TreeView_Structure_NodeMouseDoubleClick; // // contextMenuStrip2 // contextMenuStrip2.Items.Add(openWindowsExplorerToolStripMenuItem); contextMenuStrip2.Items.Add(importDomainFileToolStripMenuItem); contextMenuStrip2.Items.Add(openModelInWindowsExplorerToolStripMenuItem); contextMenuStrip2.Items.Add(addFunctionToolStripMenuItem); contextMenuStrip2.Items.Add(changeFunctionNameToolStripMenuItem); contextMenuStrip2.Items.Add(deleteFunctionToolStripMenuItem); contextMenuStrip2.Name = "contextMenuStrip2"; contextMenuStrip2.Size = new Size(50, 15); contextMenuStrip2.Opening += contextMenuStrip2_Opening; // // openWindowsExplorerToolStripMenuItem // openWindowsExplorerToolStripMenuItem.Name = "openWindowsExplorerToolStripMenuItem"; openWindowsExplorerToolStripMenuItem.Size = new Size(50, 15); openWindowsExplorerToolStripMenuItem.Text = "View File in Windows Explorer"; openWindowsExplorerToolStripMenuItem.Click += openWindowsExplorerToolStripMenuItem_Click; // // importDomainFileToolStripMenuItem // importDomainFileToolStripMenuItem.Name = "importDomainFileToolStripMenuItem"; importDomainFileToolStripMenuItem.Size = new Size(50, 15); importDomainFileToolStripMenuItem.Text = "Import a PDDL domain file"; importDomainFileToolStripMenuItem.Click += importDomainFileToolStripMenuItem_Click; // // changeFunctionNameToolStripMenuItem // changeFunctionNameToolStripMenuItem.Name = "changeDiagramNameToolStripMenuItem"; changeFunctionNameToolStripMenuItem.Size = new Size(50, 15); changeFunctionNameToolStripMenuItem.Text = "Change Name"; //changeFunctionNameToolStripMenuItem.Click += changeDiagramNameToolStripMenuItem_Click; // // deleteFunctionToolStripMenuItem // deleteFunctionToolStripMenuItem.Name = "deleteFunctionToolStripMenuItem"; deleteFunctionToolStripMenuItem.Size = new Size(50, 15); deleteFunctionToolStripMenuItem.Text = "Delete this Problem"; deleteFunctionToolStripMenuItem.Click += DeleteFunctionToolStripMenuItemClick; // // addFunctionToolStripMenuItem // addFunctionToolStripMenuItem.Name = "addFunctionToolStripMenuItem"; addFunctionToolStripMenuItem.Size = new Size(50, 15); addFunctionToolStripMenuItem.Text = "Add a PDDL Problem"; addFunctionToolStripMenuItem.Click += AddFunctionToolStripMenuItemClick; // //openModelInWindowsExplorerToolStripMenuItem // openModelInWindowsExplorerToolStripMenuItem.Name = "openModelInWindowsExplorerToolStripMenuItem"; openModelInWindowsExplorerToolStripMenuItem.Size = new Size(50, 15); openModelInWindowsExplorerToolStripMenuItem.Text = "View Model in Windows Explorer"; openModelInWindowsExplorerToolStripMenuItem.Click += openModelInWindowsExplorerToolStripMenuItem_Click; // // imageList2 // imageList2.ImageStream = ((ImageListStreamer)(resources.GetObject("imageList2.ImageStream"))); imageList2.TransparentColor = Color.Transparent; imageList2.Images.SetKeyName(0, "declare.png"); imageList2.Images.SetKeyName(1, "channel.png"); imageList2.Images.SetKeyName(2, "templates.png"); imageList2.Images.SetKeyName(3, "questionMark.png"); // // toolStripContainer1 // // // toolStripContainer1.ContentPanel // toolStripContainer1.ContentPanel.Size = new Size(435, 374); toolStripContainer1.Dock = DockStyle.Fill; toolStripContainer1.Location = new Point(0, 0); toolStripContainer1.Name = "toolStripContainer1"; toolStripContainer1.Size = new Size(435, 399); toolStripContainer1.TabIndex = 3; // // toolStripContainer1.TopToolStripPanel // toolStripContainer1.TopToolStripPanel.Controls.Add(toolStrip1); // // toolStrip1 // toolStrip1.Dock = DockStyle.None; toolStrip1.Items.AddRange(new ToolStripItem[] { toolStripSeparator3, }); toolStrip1.Location = new Point(3, 0); toolStrip1.Name = "toolStrip1"; toolStrip1.Size = new Size(133, 25); toolStrip1.TabIndex = 1; // // toolStripSeparator3 // toolStripSeparator3.Name = "toolStripSeparator3"; toolStripSeparator3.Size = new Size(6, 25); // // PDDLTabItem // ClientSize = new Size(617, 399); Controls.Add(splitContainer1); Name = "PDDLTabItem"; //contextMenuStrip1.ResumeLayout(false); splitContainer1.Panel1.ResumeLayout(false); splitContainer1.Panel2.ResumeLayout(false); splitContainer1.ResumeLayout(false); contextMenuStrip2.ResumeLayout(false); toolStripContainer1.TopToolStripPanel.ResumeLayout(false); toolStripContainer1.TopToolStripPanel.PerformLayout(); toolStripContainer1.ResumeLayout(false); toolStripContainer1.PerformLayout(); toolStrip1.ResumeLayout(false); toolStrip1.PerformLayout(); ResumeLayout(false); //InitializeCanvasMethod(); //InitializePOROverheadsMethod(); }
private void InitializeComponent() { ComponentResourceManager resources = new ComponentResourceManager(typeof(ScriptEditor)); panel1 = new Panel(); description = new Label(); toolStrip1 = new ToolStrip(); btnAdd = new ToolStripButton(); btnRemove = new ToolStripButton(); btnModify = new ToolStripButton(); btnUp = new ToolStripButton(); btnDown = new ToolStripButton(); panel2 = new Panel(); toolStrip2 = new ToolStrip(); btnCopy = new ToolStripButton(); btnCut = new ToolStripButton(); btnPaste = new ToolStripButton(); btnCopyText = new ToolStripButton(); EventList = new ListBox(); splitter1 = new Splitter(); panel1.SuspendLayout(); toolStrip1.SuspendLayout(); panel2.SuspendLayout(); toolStrip2.SuspendLayout(); SuspendLayout(); // // panel1 // panel1.Controls.Add(description); panel1.Controls.Add(toolStrip1); panel1.Dock = DockStyle.Bottom; panel1.Location = new Point(1, 188); panel1.Name = "panel1"; panel1.Size = new Size(324, 95); panel1.TabIndex = 2; // // description // description.BackColor = SystemColors.Control; description.BorderStyle = BorderStyle.Fixed3D; description.Dock = DockStyle.Fill; description.Font = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Regular, GraphicsUnit.Point, (byte)0); description.Location = new Point(0, 25); description.Name = "description"; description.Size = new Size(324, 70); description.TabIndex = 59; // // toolStrip1 // toolStrip1.GripStyle = ToolStripGripStyle.Hidden; toolStrip1.Items.AddRange(new ToolStripItem[] { btnAdd, btnRemove, btnModify, btnUp, btnDown }); toolStrip1.Location = new Point(0, 0); toolStrip1.Name = "toolStrip1"; toolStrip1.Size = new Size(324, 25); toolStrip1.TabIndex = 0; toolStrip1.Text = "toolStrip1"; // // btnAdd // btnAdd.DisplayStyle = ToolStripItemDisplayStyle.Text; //btnAdd.Image = (Image) resources.GetObject("btnAdd.Image"); btnAdd.ImageTransparentColor = Color.Magenta; btnAdd.Name = "btnAdd"; btnAdd.Size = new Size(33, 22); btnAdd.Text = "Add"; btnAdd.Click += new EventHandler(btnAdd_Click); // // btnRemove // btnRemove.DisplayStyle = ToolStripItemDisplayStyle.Text; //btnRemove.Image = (Image) resources.GetObject("btnRemove.Image"); btnRemove.ImageTransparentColor = Color.Magenta; btnRemove.Name = "btnRemove"; btnRemove.Size = new Size(54, 22); btnRemove.Text = "Remove"; btnRemove.Click += new EventHandler(btnRemove_Click); // // btnModify // btnModify.DisplayStyle = ToolStripItemDisplayStyle.Text; //btnModify.Image = (Image) resources.GetObject("btnModify.Image"); btnModify.ImageTransparentColor = Color.Magenta; btnModify.Name = "btnModify"; btnModify.Size = new Size(49, 22); btnModify.Text = "Modify"; btnModify.Click += new EventHandler(btnModify_Click); // // btnUp // btnUp.DisplayStyle = ToolStripItemDisplayStyle.Text; //btnUp.Image = (Image) resources.GetObject("btnUp.Image"); btnUp.ImageTransparentColor = Color.Magenta; btnUp.Name = "btnUp"; btnUp.Size = new Size(23, 22); btnUp.Text = "▲"; btnUp.Click += new EventHandler(btnUp_Click); // // btnDown // btnDown.DisplayStyle = ToolStripItemDisplayStyle.Text; //btnDown.Image = (Image) resources.GetObject("btnDown.Image"); btnDown.ImageTransparentColor = Color.Magenta; btnDown.Name = "btnDown"; btnDown.Size = new Size(23, 22); btnDown.Text = "▼"; btnDown.Click += new EventHandler(btnDown_Click); // // panel2 // panel2.Controls.Add(toolStrip2); panel2.Dock = DockStyle.Top; panel2.Location = new Point(1, 1); panel2.Name = "panel2"; panel2.Size = new Size(324, 23); panel2.TabIndex = 15; // // toolStrip2 // toolStrip2.Dock = DockStyle.Fill; toolStrip2.GripStyle = ToolStripGripStyle.Hidden; toolStrip2.Items.AddRange(new ToolStripItem[] { btnCopy, btnCut, btnPaste, btnCopyText }); toolStrip2.Location = new Point(0, 0); toolStrip2.Name = "toolStrip2"; toolStrip2.Size = new Size(324, 23); toolStrip2.TabIndex = 1; toolStrip2.Text = "toolStrip2"; // // btnCopy // btnCopy.DisplayStyle = ToolStripItemDisplayStyle.Text; //btnCopy.Image = (Image) resources.GetObject("btnCopy.Image"); btnCopy.ImageTransparentColor = Color.Magenta; btnCopy.Name = "btnCopy"; btnCopy.Size = new Size(39, 20); btnCopy.Text = "Copy"; btnCopy.Click += new EventHandler(btnCopy_Click); // // btnCut // btnCut.DisplayStyle = ToolStripItemDisplayStyle.Text; //btnCut.Image = (Image) resources.GetObject("btnCut.Image"); btnCut.ImageTransparentColor = Color.Magenta; btnCut.Name = "btnCut"; btnCut.Size = new Size(30, 20); btnCut.Text = "Cut"; btnCut.Click += new EventHandler(btnCut_Click); // // btnPaste // btnPaste.DisplayStyle = ToolStripItemDisplayStyle.Text; //btnPaste.Image = (Image) resources.GetObject("btnPaste.Image"); btnPaste.ImageTransparentColor = Color.Magenta; btnPaste.Name = "btnPaste"; btnPaste.Size = new Size(39, 20); btnPaste.Text = "Paste"; btnPaste.Click += new EventHandler(btnPaste_Click); // // btnCopyText // btnCopyText.DisplayStyle = ToolStripItemDisplayStyle.Text; //btnCopyText.Image = (Image) resources.GetObject("btnCopyText.Image"); btnCopyText.ImageTransparentColor = Color.Magenta; btnCopyText.Name = "btnCopyText"; btnCopyText.Size = new Size(64, 20); btnCopyText.Text = "Copy Text"; btnCopyText.Click += new EventHandler(btnCopyText_Click); // // EventList // EventList.Dock = DockStyle.Fill; EventList.FormattingEnabled = true; EventList.HorizontalScrollbar = true; EventList.IntegralHeight = false; EventList.Location = new Point(1, 24); EventList.Name = "EventList"; EventList.SelectionMode = SelectionMode.MultiExtended; EventList.Size = new Size(324, 161); EventList.TabIndex = 16; EventList.SelectedIndexChanged += new EventHandler(EventList_SelectedIndexChanged); EventList.DoubleClick += new EventHandler(EventList_DoubleClick); // // splitter1 // splitter1.Dock = DockStyle.Bottom; splitter1.Location = new Point(1, 185); splitter1.Name = "splitter1"; splitter1.Size = new Size(324, 3); splitter1.TabIndex = 60; splitter1.TabStop = false; // // ScriptEditor // Controls.Add(EventList); Controls.Add(panel2); Controls.Add(splitter1); Controls.Add(panel1); Name = "ScriptEditor"; Padding = new Padding(1); Size = new Size(326, 284); panel1.ResumeLayout(false); panel1.PerformLayout(); toolStrip1.ResumeLayout(false); toolStrip1.PerformLayout(); panel2.ResumeLayout(false); panel2.PerformLayout(); toolStrip2.ResumeLayout(false); toolStrip2.PerformLayout(); ResumeLayout(false); }
private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Microsoft.Reporting.WinForms.ReportToolBar)); firstPage = new Microsoft.Reporting.WinForms.ReportToolBar.ToolStripButtonOverride(); previousPage = new Microsoft.Reporting.WinForms.ReportToolBar.ToolStripButtonOverride(); currentPage = new System.Windows.Forms.ToolStripTextBox(); labelOf = new System.Windows.Forms.ToolStripLabel(); totalPages = new System.Windows.Forms.ToolStripLabel(); nextPage = new Microsoft.Reporting.WinForms.ReportToolBar.ToolStripButtonOverride(); lastPage = new Microsoft.Reporting.WinForms.ReportToolBar.ToolStripButtonOverride(); toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); back = new Microsoft.Reporting.WinForms.ReportToolBar.ToolStripButtonOverride(); stop = new Microsoft.Reporting.WinForms.ReportToolBar.ToolStripButtonOverride(); refresh = new Microsoft.Reporting.WinForms.ReportToolBar.ToolStripButtonOverride(); toolStrip1 = new System.Windows.Forms.ToolStrip(); toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); print = new Microsoft.Reporting.WinForms.ReportToolBar.ToolStripButtonOverride(); printPreview = new Microsoft.Reporting.WinForms.ReportToolBar.ToolStripButtonOverride(); pageSetup = new Microsoft.Reporting.WinForms.ReportToolBar.ToolStripButtonOverride(); export = new System.Windows.Forms.ToolStripDropDownButton(); separator4 = new System.Windows.Forms.ToolStripSeparator(); zoom = new System.Windows.Forms.ToolStripComboBox(); textToFind = new System.Windows.Forms.ToolStripTextBox(); find = new Microsoft.Reporting.WinForms.ReportToolBar.ToolStripButtonOverride(); toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); findNext = new Microsoft.Reporting.WinForms.ReportToolBar.ToolStripButtonOverride(); toolStrip1.SuspendLayout(); SuspendLayout(); firstPage.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; firstPage.Image = (System.Drawing.Image)resources.GetObject("firstPage.Image"); firstPage.ImageTransparentColor = System.Drawing.Color.Fuchsia; firstPage.Name = "firstPage"; firstPage.RightToLeftAutoMirrorImage = true; firstPage.Size = new System.Drawing.Size(23, 22); firstPage.Click += new System.EventHandler(OnPageNavButtonClick); previousPage.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; previousPage.Image = (System.Drawing.Image)resources.GetObject("previousPage.Image"); previousPage.ImageTransparentColor = System.Drawing.Color.Fuchsia; previousPage.Name = "previousPage"; previousPage.RightToLeftAutoMirrorImage = true; previousPage.Size = new System.Drawing.Size(23, 22); previousPage.Click += new System.EventHandler(OnPageNavButtonClick); currentPage.AcceptsReturn = true; currentPage.AcceptsTab = true; currentPage.MaxLength = 10; currentPage.Name = "currentPage"; currentPage.Size = new System.Drawing.Size(40, 25); currentPage.WordWrap = false; currentPage.KeyPress += new System.Windows.Forms.KeyPressEventHandler(CurrentPage_KeyPress); labelOf.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; labelOf.ImageTransparentColor = System.Drawing.Color.Fuchsia; labelOf.Name = "labelOf"; labelOf.Size = new System.Drawing.Size(0, 22); totalPages.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; totalPages.ImageTransparentColor = System.Drawing.Color.Fuchsia; totalPages.Name = "totalPages"; totalPages.Size = new System.Drawing.Size(0, 22); totalPages.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; nextPage.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; nextPage.Image = (System.Drawing.Image)resources.GetObject("nextPage.Image"); nextPage.ImageTransparentColor = System.Drawing.Color.Fuchsia; nextPage.Name = "nextPage"; nextPage.RightToLeftAutoMirrorImage = true; nextPage.Size = new System.Drawing.Size(23, 22); nextPage.Click += new System.EventHandler(OnPageNavButtonClick); lastPage.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; lastPage.Image = (System.Drawing.Image)resources.GetObject("lastPage.Image"); lastPage.ImageTransparentColor = System.Drawing.Color.Fuchsia; lastPage.Name = "lastPage"; lastPage.RightToLeftAutoMirrorImage = true; lastPage.Size = new System.Drawing.Size(23, 22); lastPage.Click += new System.EventHandler(OnPageNavButtonClick); toolStripSeparator2.Name = "toolStripSeparator2"; toolStripSeparator2.Size = new System.Drawing.Size(6, 25); back.Image = (System.Drawing.Image)resources.GetObject("back.Image"); back.ImageTransparentColor = System.Drawing.Color.Fuchsia; back.Name = "back"; back.RightToLeftAutoMirrorImage = true; back.Size = new System.Drawing.Size(23, 22); back.Click += new System.EventHandler(OnBack); stop.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; stop.Image = (System.Drawing.Image)resources.GetObject("stop.Image"); stop.ImageTransparentColor = System.Drawing.Color.Fuchsia; stop.Name = "stop"; stop.Size = new System.Drawing.Size(23, 22); stop.Click += new System.EventHandler(OnStopClick); refresh.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; refresh.Image = (System.Drawing.Image)resources.GetObject("refresh.Image"); refresh.ImageTransparentColor = System.Drawing.Color.Fuchsia; refresh.Name = "refresh"; refresh.Size = new System.Drawing.Size(23, 22); refresh.Click += new System.EventHandler(OnRefresh); toolStrip1.AccessibleName = "Toolstrip"; toolStrip1.Dock = System.Windows.Forms.DockStyle.Fill; toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[22] { firstPage, previousPage, currentPage, labelOf, totalPages, nextPage, lastPage, toolStripSeparator2, back, stop, refresh, toolStripSeparator3, print, printPreview, pageSetup, export, separator4, zoom, textToFind, find, toolStripSeparator4, findNext }); toolStrip1.Location = new System.Drawing.Point(0, 0); toolStrip1.Name = "toolStrip1"; toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; toolStrip1.Size = new System.Drawing.Size(714, 25); toolStrip1.TabIndex = 3; toolStrip1.TabStop = true; toolStripSeparator3.Name = "toolStripSeparator3"; toolStripSeparator3.Size = new System.Drawing.Size(6, 25); print.Image = (System.Drawing.Image)resources.GetObject("print.Image"); print.ImageTransparentColor = System.Drawing.Color.Fuchsia; print.Name = "print"; print.Size = new System.Drawing.Size(23, 22); print.Click += new System.EventHandler(OnPrint); printPreview.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; printPreview.Image = (System.Drawing.Image)resources.GetObject("printPreview.Image"); printPreview.ImageTransparentColor = System.Drawing.Color.Fuchsia; printPreview.Name = "printPreview"; printPreview.Size = new System.Drawing.Size(23, 22); printPreview.Click += new System.EventHandler(OnPrintPreviewClick); pageSetup.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; pageSetup.Image = (System.Drawing.Image)resources.GetObject("pageSetup.Image"); pageSetup.ImageTransparentColor = System.Drawing.Color.Magenta; pageSetup.Name = "pageSetup"; pageSetup.Size = new System.Drawing.Size(23, 22); pageSetup.Click += new System.EventHandler(OnPageSetupClick); export.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; export.Image = (System.Drawing.Image)resources.GetObject("export.Image"); export.ImageTransparentColor = System.Drawing.Color.Fuchsia; export.Name = "export"; export.Size = new System.Drawing.Size(29, 22); export.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(OnExport); separator4.Margin = new System.Windows.Forms.Padding(2, 0, 0, 0); separator4.Name = "separator4"; separator4.Size = new System.Drawing.Size(6, 25); zoom.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; zoom.Margin = new System.Windows.Forms.Padding(7, 0, 1, 0); zoom.MaxDropDownItems = 9; zoom.Name = "zoom"; zoom.Size = new System.Drawing.Size(110, 25); zoom.SelectedIndexChanged += new System.EventHandler(OnZoomChanged); textToFind.AcceptsReturn = true; textToFind.Margin = new System.Windows.Forms.Padding(10, 0, 1, 0); textToFind.Name = "textToFind"; textToFind.Size = new System.Drawing.Size(75, 25); textToFind.KeyPress += new System.Windows.Forms.KeyPressEventHandler(textToFind_KeyPress); textToFind.TextChanged += new System.EventHandler(textToFind_TextChanged); find.Enabled = false; find.ForeColor = System.Drawing.Color.Blue; find.Margin = new System.Windows.Forms.Padding(3, 1, 1, 2); find.Name = "find"; find.Size = new System.Drawing.Size(23, 22); find.Click += new System.EventHandler(find_Click); toolStripSeparator4.AutoSize = false; toolStripSeparator4.Name = "toolStripSeparator4"; toolStripSeparator4.Size = new System.Drawing.Size(6, 20); findNext.Enabled = false; findNext.ForeColor = System.Drawing.Color.Blue; findNext.Margin = new System.Windows.Forms.Padding(2, 1, 0, 2); findNext.Name = "findNext"; findNext.Size = new System.Drawing.Size(23, 22); findNext.Click += new System.EventHandler(findNext_Click); BackColor = System.Drawing.SystemColors.Control; base.Controls.Add(toolStrip1); base.Name = "ReportToolBar"; base.Size = new System.Drawing.Size(714, 25); toolStrip1.ResumeLayout(false); toolStrip1.PerformLayout(); ResumeLayout(false); PerformLayout(); }
private void InitializeComponent() { _imagePreviewBox = new PictureBox(); _imageInfoBox = new GroupBox(); _extractImgBtn = new Button(); _replaceImgBtn = new Button(); _lblHeight = new Label(); _lblWidth = new Label(); _lblBpp = new Label(); _lblMipMaps = new Label(); _lblFormat = new Label(); _heightTxt = new TextBox(); _formatTxt = new TextBox(); _widthTxt = new TextBox(); _mipMapTxt = new TextBox(); _bppTxt = new TextBox(); _imgList = new ListBox(); _dataFolderTreeView = new TreeView(); _rebuildBtn = new Button(); _tableLayoutPanel1 = new TableLayoutPanel(); _tableLayoutPanel2 = new TableLayoutPanel(); _tableLayoutPanel3 = new TableLayoutPanel(); _tableLayoutPanel4 = new TableLayoutPanel(); _groupBox1 = new GroupBox(); _chkEditMetadata = new CheckBox(); _txtWidth = new TextBox(); _txtKey = new TextBox(); _txtLength = new TextBox(); _txtStart = new TextBox(); _txtUnk4 = new TextBox(); _txtMipMaps = new TextBox(); _txtUnk3 = new TextBox(); _txtHeight = new TextBox(); _txtFlags = new TextBox(); _label9 = new Label(); _label8 = new Label(); _label7 = new Label(); _label6 = new Label(); _label5 = new Label(); _label4 = new Label(); _label3 = new Label(); _label2 = new Label(); _label1 = new Label(); _tblImageList = new TableLayoutPanel(); _btnCloneImage = new Button(); _treeViewContainer = new ToolStripContainer(); _searchToolStrip = new ToolStrip(); _searchTxtBox = new ToolStripTextBox(); _searchBtn = new ToolStripButton(); _prevSearchBtn = new ToolStripButton(); _nextSearchBtn = new ToolStripButton(); _searchPosLbl = new ToolStripLabel(); ((ISupportInitialize)(_imagePreviewBox)).BeginInit(); _imageInfoBox.SuspendLayout(); _tableLayoutPanel1.SuspendLayout(); _tableLayoutPanel2.SuspendLayout(); _tableLayoutPanel3.SuspendLayout(); _tableLayoutPanel4.SuspendLayout(); _groupBox1.SuspendLayout(); _tblImageList.SuspendLayout(); _treeViewContainer.ContentPanel.SuspendLayout(); _treeViewContainer.TopToolStripPanel.SuspendLayout(); _treeViewContainer.SuspendLayout(); _searchToolStrip.SuspendLayout(); SuspendLayout(); // // ImagePreviewBox // _imagePreviewBox.BackColor = Color.Transparent; _imagePreviewBox.BorderStyle = BorderStyle.FixedSingle; _imagePreviewBox.Dock = DockStyle.Fill; _imagePreviewBox.Location = new Point(103, 3); _imagePreviewBox.Name = "_imagePreviewBox"; _imagePreviewBox.Size = new Size(1015, 511); _imagePreviewBox.SizeMode = PictureBoxSizeMode.CenterImage; _imagePreviewBox.TabIndex = 7; _imagePreviewBox.TabStop = false; _imagePreviewBox.Click += ImagePreviewBox_Click; // // ImageInfoBox // _imageInfoBox.Controls.Add(_extractImgBtn); _imageInfoBox.Controls.Add(_replaceImgBtn); _imageInfoBox.Controls.Add(_lblHeight); _imageInfoBox.Controls.Add(_lblWidth); _imageInfoBox.Controls.Add(_lblBpp); _imageInfoBox.Controls.Add(_lblMipMaps); _imageInfoBox.Controls.Add(_lblFormat); _imageInfoBox.Controls.Add(_heightTxt); _imageInfoBox.Controls.Add(_formatTxt); _imageInfoBox.Controls.Add(_widthTxt); _imageInfoBox.Controls.Add(_mipMapTxt); _imageInfoBox.Controls.Add(_bppTxt); _imageInfoBox.Enabled = false; _imageInfoBox.Location = new Point(1030, 3); _imageInfoBox.Name = "_imageInfoBox"; _imageInfoBox.Size = new Size(288, 100); _imageInfoBox.TabIndex = 8; _imageInfoBox.TabStop = false; _imageInfoBox.Text = "Image Information"; // // ExtractImgBtn // _extractImgBtn.Font = new Font("Times New Roman", 12F, FontStyle.Bold, GraphicsUnit.Point, 0); _extractImgBtn.Location = new Point(215, 67); _extractImgBtn.Name = "_extractImgBtn"; _extractImgBtn.Size = new Size(67, 27); _extractImgBtn.TabIndex = 46; _extractImgBtn.Text = "Extract"; _extractImgBtn.UseVisualStyleBackColor = true; _extractImgBtn.Click += ExtractImgBtn_Click; // // ReplaceImgBtn // _replaceImgBtn.Font = new Font("Times New Roman", 12F, FontStyle.Bold, GraphicsUnit.Point, 0); _replaceImgBtn.Location = new Point(137, 67); _replaceImgBtn.Name = "_replaceImgBtn"; _replaceImgBtn.Size = new Size(72, 27); _replaceImgBtn.TabIndex = 45; _replaceImgBtn.Text = "Replace"; _replaceImgBtn.UseVisualStyleBackColor = true; _replaceImgBtn.Click += ReplaceImgBtn_Click; // // lblHeight // _lblHeight.AutoSize = true; _lblHeight.Font = new Font("Times New Roman", 12F, FontStyle.Bold, GraphicsUnit.Point, 0); _lblHeight.Location = new Point(163, 44); _lblHeight.Name = "_lblHeight"; _lblHeight.Size = new Size(59, 19); _lblHeight.TabIndex = 44; _lblHeight.Text = "Height:"; _lblHeight.TextAlign = ContentAlignment.MiddleCenter; // // lblWidth // _lblWidth.AutoSize = true; _lblWidth.Font = new Font("Times New Roman", 12F, FontStyle.Bold, GraphicsUnit.Point, 0); _lblWidth.Location = new Point(168, 18); _lblWidth.Name = "_lblWidth"; _lblWidth.Size = new Size(54, 19); _lblWidth.TabIndex = 43; _lblWidth.Text = "Width:"; _lblWidth.TextAlign = ContentAlignment.MiddleCenter; // // lblBPP // _lblBpp.AutoSize = true; _lblBpp.Font = new Font("Times New Roman", 12F, FontStyle.Bold, GraphicsUnit.Point, 0); _lblBpp.Location = new Point(44, 44); _lblBpp.Name = "_lblBpp"; _lblBpp.Size = new Size(43, 19); _lblBpp.TabIndex = 42; _lblBpp.Text = "BPP:"; _lblBpp.TextAlign = ContentAlignment.MiddleCenter; // // lblMipMaps // _lblMipMaps.AutoSize = true; _lblMipMaps.Font = new Font("Times New Roman", 12F, FontStyle.Bold, GraphicsUnit.Point, 0); _lblMipMaps.Location = new Point(6, 71); _lblMipMaps.Name = "_lblMipMaps"; _lblMipMaps.Size = new Size(81, 19); _lblMipMaps.TabIndex = 41; _lblMipMaps.Text = "MipMaps:"; _lblMipMaps.TextAlign = ContentAlignment.MiddleCenter; // // lblFormat // _lblFormat.AutoSize = true; _lblFormat.Font = new Font("Times New Roman", 12F, FontStyle.Bold, GraphicsUnit.Point, 0); _lblFormat.Location = new Point(25, 18); _lblFormat.Name = "_lblFormat"; _lblFormat.Size = new Size(62, 19); _lblFormat.TabIndex = 40; _lblFormat.Text = "Format:"; _lblFormat.TextAlign = ContentAlignment.MiddleCenter; // // HeightTxt // _heightTxt.Location = new Point(228, 45); _heightTxt.Name = "_heightTxt"; _heightTxt.ReadOnly = true; _heightTxt.Size = new Size(53, 20); _heightTxt.TabIndex = 13; // // FormatTxt // _formatTxt.Location = new Point(93, 17); _formatTxt.Name = "_formatTxt"; _formatTxt.ReadOnly = true; _formatTxt.Size = new Size(64, 20); _formatTxt.TabIndex = 11; // // WidthTxt // _widthTxt.Location = new Point(228, 19); _widthTxt.Name = "_widthTxt"; _widthTxt.ReadOnly = true; _widthTxt.Size = new Size(53, 20); _widthTxt.TabIndex = 5; // // MipMapTxt // _mipMapTxt.Location = new Point(93, 72); _mipMapTxt.Name = "_mipMapTxt"; _mipMapTxt.ReadOnly = true; _mipMapTxt.Size = new Size(38, 20); _mipMapTxt.TabIndex = 3; // // BPPTxt // _bppTxt.Location = new Point(93, 45); _bppTxt.Name = "_bppTxt"; _bppTxt.ReadOnly = true; _bppTxt.Size = new Size(64, 20); _bppTxt.TabIndex = 2; // // ImgList // _imgList.Dock = DockStyle.Fill; _imgList.FormattingEnabled = true; _imgList.IntegralHeight = false; _imgList.Location = new Point(3, 3); _imgList.Name = "_imgList"; _imgList.Size = new Size(88, 465); _imgList.TabIndex = 9; _imgList.SelectedIndexChanged += ImgList_SelectedIndexChanged; // // DataFolder_TreeView // _dataFolderTreeView.Dock = DockStyle.Fill; _dataFolderTreeView.Location = new Point(0, 0); _dataFolderTreeView.Name = "_dataFolderTreeView"; _dataFolderTreeView.Size = new Size(230, 610); _dataFolderTreeView.TabIndex = 10; _dataFolderTreeView.DoubleClick += DataFolder_TreeView_DoubleClick; // // RebuildBtn // _rebuildBtn.Dock = DockStyle.Fill; _rebuildBtn.Font = new Font("Times New Roman", 12F, FontStyle.Bold, GraphicsUnit.Point, 0); _rebuildBtn.Location = new Point(3, 3); _rebuildBtn.Name = "_rebuildBtn"; _rebuildBtn.Size = new Size(1021, 100); _rebuildBtn.TabIndex = 46; _rebuildBtn.Text = "Rebuild Container"; _rebuildBtn.UseVisualStyleBackColor = true; _rebuildBtn.Click += RebuildBtn_Click; // // tableLayoutPanel1 // _tableLayoutPanel1.ColumnCount = 2; _tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 236F)); _tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); _tableLayoutPanel1.Controls.Add(_tableLayoutPanel2, 1, 0); _tableLayoutPanel1.Controls.Add(_treeViewContainer, 0, 0); _tableLayoutPanel1.Dock = DockStyle.Fill; _tableLayoutPanel1.Location = new Point(0, 0); _tableLayoutPanel1.Name = "_tableLayoutPanel1"; _tableLayoutPanel1.RowCount = 1; _tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); _tableLayoutPanel1.Size = new Size(1569, 641); _tableLayoutPanel1.TabIndex = 47; _tableLayoutPanel1.Paint += tableLayoutPanel1_Paint; // // tableLayoutPanel2 // _tableLayoutPanel2.ColumnCount = 1; _tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); _tableLayoutPanel2.Controls.Add(_tableLayoutPanel3, 0, 1); _tableLayoutPanel2.Controls.Add(_tableLayoutPanel4, 0, 0); _tableLayoutPanel2.Dock = DockStyle.Fill; _tableLayoutPanel2.Location = new Point(239, 3); _tableLayoutPanel2.Name = "_tableLayoutPanel2"; _tableLayoutPanel2.RowCount = 2; _tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); _tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 112F)); _tableLayoutPanel2.Size = new Size(1327, 635); _tableLayoutPanel2.TabIndex = 0; // // tableLayoutPanel3 // _tableLayoutPanel3.ColumnCount = 2; _tableLayoutPanel3.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); _tableLayoutPanel3.ColumnStyles.Add(new ColumnStyle()); _tableLayoutPanel3.Controls.Add(_rebuildBtn, 0, 0); _tableLayoutPanel3.Controls.Add(_imageInfoBox, 1, 0); _tableLayoutPanel3.Dock = DockStyle.Fill; _tableLayoutPanel3.Location = new Point(3, 526); _tableLayoutPanel3.Name = "_tableLayoutPanel3"; _tableLayoutPanel3.RowCount = 1; _tableLayoutPanel3.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); _tableLayoutPanel3.Size = new Size(1321, 106); _tableLayoutPanel3.TabIndex = 0; // // tableLayoutPanel4 // _tableLayoutPanel4.ColumnCount = 3; _tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 100F)); _tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); _tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 200F)); _tableLayoutPanel4.Controls.Add(_imagePreviewBox, 1, 0); _tableLayoutPanel4.Controls.Add(_groupBox1, 2, 0); _tableLayoutPanel4.Controls.Add(_tblImageList, 0, 0); _tableLayoutPanel4.Dock = DockStyle.Fill; _tableLayoutPanel4.Location = new Point(3, 3); _tableLayoutPanel4.Name = "_tableLayoutPanel4"; _tableLayoutPanel4.RowCount = 1; _tableLayoutPanel4.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); _tableLayoutPanel4.RowStyles.Add(new RowStyle(SizeType.Absolute, 632F)); _tableLayoutPanel4.Size = new Size(1321, 517); _tableLayoutPanel4.TabIndex = 1; _tableLayoutPanel4.Paint += tableLayoutPanel4_Paint; // // groupBox1 // _groupBox1.Controls.Add(_chkEditMetadata); _groupBox1.Controls.Add(_txtWidth); _groupBox1.Controls.Add(_txtKey); _groupBox1.Controls.Add(_txtLength); _groupBox1.Controls.Add(_txtStart); _groupBox1.Controls.Add(_txtUnk4); _groupBox1.Controls.Add(_txtMipMaps); _groupBox1.Controls.Add(_txtUnk3); _groupBox1.Controls.Add(_txtHeight); _groupBox1.Controls.Add(_txtFlags); _groupBox1.Controls.Add(_label9); _groupBox1.Controls.Add(_label8); _groupBox1.Controls.Add(_label7); _groupBox1.Controls.Add(_label6); _groupBox1.Controls.Add(_label5); _groupBox1.Controls.Add(_label4); _groupBox1.Controls.Add(_label3); _groupBox1.Controls.Add(_label2); _groupBox1.Controls.Add(_label1); _groupBox1.Location = new Point(1124, 3); _groupBox1.Name = "_groupBox1"; _groupBox1.Size = new Size(194, 283); _groupBox1.TabIndex = 10; _groupBox1.TabStop = false; _groupBox1.Text = "Metadata"; // // chkEditMetadata // _chkEditMetadata.AutoSize = true; _chkEditMetadata.Location = new Point(62, 254); _chkEditMetadata.Name = "_chkEditMetadata"; _chkEditMetadata.Size = new Size(86, 17); _chkEditMetadata.TabIndex = 10; _chkEditMetadata.Text = "Allow Editing"; _chkEditMetadata.UseVisualStyleBackColor = true; _chkEditMetadata.CheckedChanged += chkEditMetadata_CheckedChanged; // // txtWidth // _txtWidth.Location = new Point(62, 72); _txtWidth.Name = "_txtWidth"; _txtWidth.ReadOnly = true; _txtWidth.Size = new Size(125, 20); _txtWidth.TabIndex = 9; // // txtKey // _txtKey.Location = new Point(62, 46); _txtKey.Name = "_txtKey"; _txtKey.ReadOnly = true; _txtKey.Size = new Size(125, 20); _txtKey.TabIndex = 9; _txtKey.TextChanged += txtKey_TextChanged; // // txtLength // _txtLength.Location = new Point(62, 228); _txtLength.Name = "_txtLength"; _txtLength.ReadOnly = true; _txtLength.Size = new Size(125, 20); _txtLength.TabIndex = 9; // // txtStart // _txtStart.Location = new Point(62, 202); _txtStart.Name = "_txtStart"; _txtStart.ReadOnly = true; _txtStart.Size = new Size(125, 20); _txtStart.TabIndex = 9; // // txtUnk4 // _txtUnk4.Location = new Point(62, 176); _txtUnk4.Name = "_txtUnk4"; _txtUnk4.ReadOnly = true; _txtUnk4.Size = new Size(125, 20); _txtUnk4.TabIndex = 9; // // txtMipMaps // _txtMipMaps.Location = new Point(62, 150); _txtMipMaps.Name = "_txtMipMaps"; _txtMipMaps.ReadOnly = true; _txtMipMaps.Size = new Size(125, 20); _txtMipMaps.TabIndex = 9; // // txtUnk3 // _txtUnk3.Location = new Point(62, 124); _txtUnk3.Name = "_txtUnk3"; _txtUnk3.ReadOnly = true; _txtUnk3.Size = new Size(125, 20); _txtUnk3.TabIndex = 9; // // txtHeight // _txtHeight.Location = new Point(62, 98); _txtHeight.Name = "_txtHeight"; _txtHeight.ReadOnly = true; _txtHeight.Size = new Size(125, 20); _txtHeight.TabIndex = 9; // // txtFlags // _txtFlags.Location = new Point(62, 20); _txtFlags.Name = "_txtFlags"; _txtFlags.ReadOnly = true; _txtFlags.Size = new Size(125, 20); _txtFlags.TabIndex = 9; // // label9 // _label9.AutoSize = true; _label9.Location = new Point(8, 231); _label9.Name = "_label9"; _label9.Size = new Size(43, 13); _label9.TabIndex = 8; _label9.Text = "Length:"; // // label8 // _label8.AutoSize = true; _label8.Location = new Point(8, 205); _label8.Name = "_label8"; _label8.Size = new Size(32, 13); _label8.TabIndex = 7; _label8.Text = "Start:"; // // label7 // _label7.AutoSize = true; _label7.Location = new Point(8, 179); _label7.Name = "_label7"; _label7.Size = new Size(36, 13); _label7.TabIndex = 6; _label7.Text = "Unk4:"; // // label6 // _label6.AutoSize = true; _label6.Location = new Point(6, 153); _label6.Name = "_label6"; _label6.Size = new Size(53, 13); _label6.TabIndex = 5; _label6.Text = "MipMaps:"; // // label5 // _label5.AutoSize = true; _label5.Location = new Point(6, 127); _label5.Name = "_label5"; _label5.Size = new Size(36, 13); _label5.TabIndex = 4; _label5.Text = "Unk3:"; // // label4 // _label4.AutoSize = true; _label4.Location = new Point(6, 101); _label4.Name = "_label4"; _label4.Size = new Size(41, 13); _label4.TabIndex = 3; _label4.Text = "Height:"; // // label3 // _label3.AutoSize = true; _label3.Location = new Point(6, 75); _label3.Name = "_label3"; _label3.Size = new Size(38, 13); _label3.TabIndex = 2; _label3.Text = "Width:"; // // label2 // _label2.AutoSize = true; _label2.Location = new Point(6, 49); _label2.Name = "_label2"; _label2.Size = new Size(28, 13); _label2.TabIndex = 1; _label2.Text = "Key:"; // // label1 // _label1.AutoSize = true; _label1.Location = new Point(6, 23); _label1.Name = "_label1"; _label1.Size = new Size(35, 13); _label1.TabIndex = 0; _label1.Text = "Flags:"; // // tblImageList // _tblImageList.ColumnCount = 1; _tblImageList.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); _tblImageList.Controls.Add(_imgList, 0, 0); _tblImageList.Controls.Add(_btnCloneImage, 0, 1); _tblImageList.Dock = DockStyle.Fill; _tblImageList.Location = new Point(3, 3); _tblImageList.Name = "_tblImageList"; _tblImageList.RowCount = 2; _tblImageList.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); _tblImageList.RowStyles.Add(new RowStyle(SizeType.Absolute, 40F)); _tblImageList.Size = new Size(94, 511); _tblImageList.TabIndex = 11; _tblImageList.Paint += tableLayoutPanel5_Paint; // // btnCloneImage // _btnCloneImage.Location = new Point(3, 474); _btnCloneImage.Name = "_btnCloneImage"; _btnCloneImage.Size = new Size(88, 34); _btnCloneImage.TabIndex = 11; _btnCloneImage.Text = "Clone"; _btnCloneImage.UseVisualStyleBackColor = true; _btnCloneImage.Click += btnCloneImage_Click; // // TreeViewContainer // _treeViewContainer.BottomToolStripPanelVisible = false; // // TreeViewContainer.ContentPanel // _treeViewContainer.ContentPanel.Controls.Add(_dataFolderTreeView); _treeViewContainer.ContentPanel.Size = new Size(230, 610); _treeViewContainer.Dock = DockStyle.Fill; _treeViewContainer.LeftToolStripPanelVisible = false; _treeViewContainer.Location = new Point(3, 3); _treeViewContainer.Name = "_treeViewContainer"; _treeViewContainer.RightToolStripPanelVisible = false; _treeViewContainer.Size = new Size(230, 635); _treeViewContainer.TabIndex = 11; _treeViewContainer.Text = "toolStripContainer1"; // // TreeViewContainer.TopToolStripPanel // _treeViewContainer.TopToolStripPanel.Controls.Add(_searchToolStrip); // // Search_ToolStrip // _searchToolStrip.Dock = DockStyle.None; _searchToolStrip.GripStyle = ToolStripGripStyle.Hidden; _searchToolStrip.Items.AddRange(new ToolStripItem[] { _searchTxtBox, _searchBtn, _prevSearchBtn, _nextSearchBtn, _searchPosLbl }); _searchToolStrip.Location = new Point(0, 0); _searchToolStrip.Name = "_searchToolStrip"; _searchToolStrip.Size = new Size(230, 25); _searchToolStrip.Stretch = true; _searchToolStrip.TabIndex = 0; // // Search_TxtBox // _searchTxtBox.Name = "_searchTxtBox"; _searchTxtBox.Size = new Size(70, 25); // // Search_Btn // _searchBtn.DisplayStyle = ToolStripItemDisplayStyle.Text; _searchBtn.ImageTransparentColor = Color.Magenta; _searchBtn.Name = "_searchBtn"; _searchBtn.Size = new Size(46, 22); _searchBtn.Text = "Search"; _searchBtn.Click += Search_Btn_Click; // // PrevSearch_Btn // _prevSearchBtn.DisplayStyle = ToolStripItemDisplayStyle.Text; _prevSearchBtn.ImageTransparentColor = Color.Magenta; _prevSearchBtn.Name = "_prevSearchBtn"; _prevSearchBtn.Size = new Size(34, 22); _prevSearchBtn.Text = "Prev"; _prevSearchBtn.Click += PrevSearch_Btn_Click; // // NextSearch_Btn // _nextSearchBtn.DisplayStyle = ToolStripItemDisplayStyle.Text; _nextSearchBtn.ImageTransparentColor = Color.Magenta; _nextSearchBtn.Name = "_nextSearchBtn"; _nextSearchBtn.Size = new Size(35, 22); _nextSearchBtn.Text = "Next"; _nextSearchBtn.Click += NextSearch_Btn_Click; // // SearchPos_Lbl // _searchPosLbl.Name = "_searchPosLbl"; _searchPosLbl.Size = new Size(24, 22); _searchPosLbl.Text = "0/0"; // // TexExplorer // AutoScaleDimensions = new SizeF(6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(1569, 641); Controls.Add(_tableLayoutPanel1); Name = "TexExplorer"; Text = "Texture Explorer"; ((ISupportInitialize)(_imagePreviewBox)).EndInit(); _imageInfoBox.ResumeLayout(false); _imageInfoBox.PerformLayout(); _tableLayoutPanel1.ResumeLayout(false); _tableLayoutPanel2.ResumeLayout(false); _tableLayoutPanel3.ResumeLayout(false); _tableLayoutPanel4.ResumeLayout(false); _groupBox1.ResumeLayout(false); _groupBox1.PerformLayout(); _tblImageList.ResumeLayout(false); _treeViewContainer.ContentPanel.ResumeLayout(false); _treeViewContainer.TopToolStripPanel.ResumeLayout(false); _treeViewContainer.TopToolStripPanel.PerformLayout(); _treeViewContainer.ResumeLayout(false); _treeViewContainer.PerformLayout(); _searchToolStrip.ResumeLayout(false); _searchToolStrip.PerformLayout(); ResumeLayout(false); }
private void GenerateToolbar(ToolStrip rootToolStrip, List <ToolBarItem> toolsBarItem, List <ActionVerb> actions) { rootToolStrip.SuspendLayout(); foreach (var item in toolsBarItem) { if (item.Group.Count > 1) { bool toolAvaialble = false; var splitButton = new ToolStripSplitButton(); splitButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; splitButton.Image = Image.FromFile(string.Format(@"{0}\Resource\{1}.png", RuntimeInfo.Inst.LaunchEnvExeDir, item.Name)); splitButton.Name = string.Format("{0}_toolStripBttn{1}", rootToolStrip.Name, item.Name); splitButton.Text = item.Name; splitButton.Tag = item.Name; splitButton.MouseDown += StripButton_MouseDown; foreach (var splitItem in item.Group) { //if dynamic path tool then don't check the file path if (string.IsNullOrWhiteSpace(splitItem.Path) || File.Exists(splitItem.Path)) { toolAvaialble = true; var toolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); toolStripMenuItem.Image = Image.FromFile(string.Format(@"{0}\Resource\{1}.png", RuntimeInfo.Inst.LaunchEnvExeDir, splitItem.Name)); toolStripMenuItem.Name = string.Format("{0}_toolStripBttn{1}_{2}", rootToolStrip.Name, item.Name, splitItem.Name); toolStripMenuItem.Text = splitItem.Name; toolStripMenuItem.Tag = splitItem.Name; toolStripMenuItem.Click += EditorsToolStripMenuItem_Click; if (RuntimeInfo.Inst.ShowRunAsForAll) { var retMenu = GUIUtility.GenerateActionMenus(toolStripMenuItem.Name, toolStripMenuItem.Tag as string, actions, EditorsToolStripActionMenuItem_Click); if (retMenu.Length > 0) { toolStripMenuItem.DropDownItems.AddRange(retMenu); } } splitButton.DropDownItems.Add(toolStripMenuItem); } } if (toolAvaialble) { rootToolStrip.Items.Add(splitButton); _toolStripItem.Add(splitButton); } } else { var splitItem = item.Group.FirstOrDefault(); if (splitItem != null) { //if dynamic path tool then don't check the file path if (string.IsNullOrWhiteSpace(splitItem.Path) || File.Exists(splitItem.Path)) { ToolStripItem stripButton = new ToolStripButton(); stripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; stripButton.Image = Image.FromFile(string.Format(@"{0}\Resource\{1}.png", RuntimeInfo.Inst.LaunchEnvExeDir, splitItem.Name)); stripButton.Name = string.Format("{0}_toolStripBttn{1}", rootToolStrip.Name, splitItem.Name); stripButton.Text = splitItem.Name; stripButton.Tag = splitItem.Name; stripButton.MouseDown += StripButton_MouseDown; rootToolStrip.Items.Add(stripButton); } } } } rootToolStrip.ResumeLayout(false); rootToolStrip.PerformLayout(); }
private void InitializeComponent() { var resources = new System.ComponentModel.ComponentResourceManager(typeof(FolderForm)); ToolStrip1 = new ToolStrip(); ToolStripButton1 = new ToolStripButton(); ToolStripButton2 = new ToolStripButton(); ToolStripButton3 = new ToolStripButton(); ToolStripButton4 = new ToolStripButton(); ToolStripButton5 = new ToolStripButton(); ToolStripButton6 = new ToolStripButton(); ToolStripButton7 = new ToolStripButton(); ToolStripButton8 = new ToolStripButton(); ToolStripButton9 = new ToolStripButton(); ToolStripButton10 = new ToolStripButton(); ToolStripButton11 = new ToolStripButton(); ToolStripButton12 = new ToolStripButton(); ToolStripButton13 = new ToolStripButton(); ToolStripButton14 = new ToolStripButton(); ToolStripButton15 = new ToolStripButton(); ToolStrip1.SuspendLayout(); SuspendLayout(); // // ToolStrip1 // ToolStrip1.Items.AddRange(new ToolStripItem[] { ToolStripButton1, ToolStripButton2, ToolStripButton3, ToolStripButton4, ToolStripButton5, ToolStripButton6, ToolStripButton7, ToolStripButton8, ToolStripButton9, ToolStripButton10, ToolStripButton11, ToolStripButton12, ToolStripButton13, ToolStripButton14, ToolStripButton15 }); ToolStrip1.Location = new Point(0, 0); ToolStrip1.Name = "ToolStrip1"; ToolStrip1.Size = new Size(621, 25); ToolStrip1.TabIndex = 0; ToolStrip1.Text = "ToolStrip1"; // // ToolStripButton1 // ToolStripButton1.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton1.Image = My.Resources.Resources.test; ToolStripButton1.ImageTransparentColor = Color.Magenta; ToolStripButton1.Name = "ToolStripButton1"; ToolStripButton1.Size = new Size(23, 22); ToolStripButton1.Text = "ToolStripButton1"; // // ToolStripButton2 // ToolStripButton2.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton2.Image = My.Resources.Resources.test2; ToolStripButton2.ImageTransparentColor = Color.Magenta; ToolStripButton2.Name = "ToolStripButton2"; ToolStripButton2.Size = new Size(23, 22); ToolStripButton2.Text = "ToolStripButton2"; // // ToolStripButton3 // ToolStripButton3.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton3.Image = My.Resources.Resources.test3; ToolStripButton3.ImageTransparentColor = Color.Magenta; ToolStripButton3.Name = "ToolStripButton3"; ToolStripButton3.Size = new Size(23, 22); ToolStripButton3.Text = "ToolStripButton3"; // // ToolStripButton4 // ToolStripButton4.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton4.Image = My.Resources.Resource1.test; ToolStripButton4.ImageTransparentColor = Color.Magenta; ToolStripButton4.Name = "ToolStripButton4"; ToolStripButton4.Size = new Size(23, 22); ToolStripButton4.Text = "ToolStripButton4"; // // ToolStripButton5 // ToolStripButton5.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton5.Image = My.Resources.Resource1.test2; ToolStripButton5.ImageTransparentColor = Color.Magenta; ToolStripButton5.Name = "ToolStripButton5"; ToolStripButton5.Size = new Size(23, 22); ToolStripButton5.Text = "ToolStripButton5"; // // ToolStripButton6 // ToolStripButton6.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton6.Image = My.Resources.Resource1.test3; ToolStripButton6.ImageTransparentColor = Color.Magenta; ToolStripButton6.Name = "ToolStripButton6"; ToolStripButton6.Size = new Size(23, 22); ToolStripButton6.Text = "ToolStripButton6"; // // ToolStripButton7 // ToolStripButton7.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton7.Image = (Image)resources.GetObject("ToolStripButton7.Image"); ToolStripButton7.ImageTransparentColor = Color.Magenta; ToolStripButton7.Name = "ToolStripButton7"; ToolStripButton7.Size = new Size(23, 22); ToolStripButton7.Text = "ToolStripButton7"; // // ToolStripButton8 // ToolStripButton8.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton8.Image = (Image)resources.GetObject("ToolStripButton8.Image"); ToolStripButton8.ImageTransparentColor = Color.Magenta; ToolStripButton8.Name = "ToolStripButton8"; ToolStripButton8.Size = new Size(23, 22); ToolStripButton8.Text = "ToolStripButton8"; // // ToolStripButton9 // ToolStripButton9.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton9.Image = (Image)resources.GetObject("ToolStripButton9.Image"); ToolStripButton9.ImageTransparentColor = Color.Magenta; ToolStripButton9.Name = "ToolStripButton9"; ToolStripButton9.Size = new Size(23, 22); ToolStripButton9.Text = "ToolStripButton9"; // // ToolStripButton10 // ToolStripButton10.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton10.Image = (Image)resources.GetObject("ToolStripButton10.Image"); ToolStripButton10.ImageTransparentColor = Color.Magenta; ToolStripButton10.Name = "ToolStripButton10"; ToolStripButton10.Size = new Size(23, 22); ToolStripButton10.Text = "ToolStripButton10"; // // ToolStripButton11 // ToolStripButton11.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton11.Image = (Image)resources.GetObject("ToolStripButton11.Image"); ToolStripButton11.ImageTransparentColor = Color.Magenta; ToolStripButton11.Name = "ToolStripButton11"; ToolStripButton11.Size = new Size(23, 22); ToolStripButton11.Text = "ToolStripButton11"; // // ToolStripButton12 // ToolStripButton12.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton12.Image = (Image)resources.GetObject("ToolStripButton12.Image"); ToolStripButton12.ImageTransparentColor = Color.Magenta; ToolStripButton12.Name = "ToolStripButton12"; ToolStripButton12.Size = new Size(23, 22); ToolStripButton12.Text = "ToolStripButton12"; // // ToolStripButton13 // ToolStripButton13.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton13.Image = (Image)resources.GetObject("ToolStripButton13.Image"); ToolStripButton13.ImageTransparentColor = Color.Magenta; ToolStripButton13.Name = "ToolStripButton13"; ToolStripButton13.Size = new Size(23, 22); ToolStripButton13.Text = "ToolStripButton13"; // // ToolStripButton14 // ToolStripButton14.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton14.Image = (Image)resources.GetObject("ToolStripButton14.Image"); ToolStripButton14.ImageTransparentColor = Color.Magenta; ToolStripButton14.Name = "ToolStripButton14"; ToolStripButton14.Size = new Size(23, 22); ToolStripButton14.Text = "ToolStripButton14"; // // ToolStripButton15 // ToolStripButton15.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton15.Image = (Image)resources.GetObject("ToolStripButton15.Image"); ToolStripButton15.ImageTransparentColor = Color.Magenta; ToolStripButton15.Name = "ToolStripButton15"; ToolStripButton15.Size = new Size(23, 22); ToolStripButton15.Text = "ToolStripButton15"; // // FolderForm // AutoScaleDimensions = new SizeF(6.0F, 13.0F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(621, 257); Controls.Add(ToolStrip1); Name = "FolderForm"; Text = "DesignTime images: 123123 then 9 blank, Runtime: 123123123123111 - check tooltips" + ""; ToolStrip1.ResumeLayout(false); ToolStrip1.PerformLayout(); Load += new EventHandler(FolderForm_Load); ResumeLayout(false); PerformLayout(); }
private void dockPanel_ActiveDocumentChanged(object sender, EventArgs e) { if (dockPanel.ActiveDocument != null) { if (dockPanel.ActiveDocument is IToolstripInterface) { ToolStripPanel[] tspanels = new ToolStripPanel[] { tspTop, tspBottom, tspLeft, tspRight }; foreach (ToolStripPanel tp in tspanels) { foreach (ToolStrip ts in tp.Controls) { ts.AutoSize = false; ToolStripManager.RevertMerge(ts); } } foreach (ToolStrip tstrip in (dockPanel.ActiveDocument as IToolstripInterface).ToolStirps) { tstrip.Visible = false; ToolStrip parentStrip = null; foreach (ToolStripPanel tp in tspanels) { parentStrip = tp.Controls[tstrip.Name] as ToolStrip; if (parentStrip != null) { break; } } if (parentStrip == null) { parentStrip = new ToolStrip(); parentStrip.SuspendLayout(); parentStrip.Name = tstrip.Name; parentStrip.Dock = System.Windows.Forms.DockStyle.None; int left = 0; foreach (ToolStrip ts in tspTop.Controls) { if (ts.Top == 0 && ts.Right > left) { left = ts.Right; } } parentStrip.Location = new System.Drawing.Point(left, 0); parentStrip.TabIndex = 0; this.tspTop.Controls.Add(parentStrip); parentStrip.ResumeLayout(false); parentStrip.PerformLayout(); } ToolStripManager.Merge(tstrip, parentStrip); parentStrip.Refresh(); } foreach (ToolStripPanel tp in tspanels) { foreach (ToolStrip ts in tp.Controls) { if (ts.Items.Count <= 0) { //Settings tp.Controls.Remove(ts); } else { ts.AutoSize = true; } } } } if (dockPanel.ActiveDocument is IPropertyGridInterface) { childSelectionChanged(dockPanel.ActiveDocument as IPropertyGridInterface); } } }
private void ReadXML_Ex1() { // this is how you load an xml document object from a file like yours... XmlDocument doc = new XmlDocument(); doc.Load(@"d:\path\form.xml"); //获取根节点 XmlNode rootNode = doc.SelectSingleNode("controls"); //获取根节点的所有子节点,以列表形式存放 XmlNodeList subNode = rootNode.ChildNodes; foreach (XmlNode xNode in subNode) { XmlElement x = (XmlElement)xNode; switch (x.GetAttribute("type")) { case "MenuStrip": // 1.加载plugins目录下的所有的dll文件 //string plugins = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); // 1.1 搜索plugins目录下的所有的dll文件 //string[] dlls = Directory.GetFiles(plugins, "*.dll"); //label1.Text = "MenuStrip"; //MenuStrip menuStrip1 = new MenuStrip(); //获取MenuStrip的所有子节点,其中第一个子节点为MenuStrip的属性值,第二个节点为子节点subcontrol XmlNodeList subMenuStrip = x.ChildNodes; string dll = subMenuStrip[2].InnerText; //加载程序集(dll文件地址),使用Assembly类 Assembly assembly = Assembly.LoadFile(dll); //所有属性值,subMenuStrip[0]为属性值 string menuStripName = subMenuStrip[0].ChildNodes[0].Name; int x_location = Convert.ToInt32(subMenuStrip[0].ChildNodes[1].Attributes["x"].Value); int y_location = Convert.ToInt32(subMenuStrip[0].ChildNodes[1].Attributes["y"].Value); int x_size = Convert.ToInt32(subMenuStrip[0].ChildNodes[2].Attributes["x"].Value); int y_size = Convert.ToInt32(subMenuStrip[0].ChildNodes[2].Attributes["y"].Value); //获取MenuStrip的属性值 //添加菜单栏 MenuStrip menuStrip1; menuStrip1 = new System.Windows.Forms.MenuStrip(); menuStrip1.Name = menuStripName; menuStrip1.Size = new System.Drawing.Size(x_size, y_size); menuStrip1.Location = new System.Drawing.Point(x_location, y_location); //添加ToolStrip //subMenuStrip[1]为子节点subcontrol XmlNodeList subSubMenuStrip = subMenuStrip[1].ChildNodes; ToolStripMenuItem[] toolStripMenuItems = new ToolStripMenuItem[5]; int i = 0; //获取到每一个ToolStrip的content Type type; foreach (XmlNode x2 in subSubMenuStrip) { //[0]为name属性 string toolStripMenuItemsName = x2.ChildNodes[0].Name; int x_size_toolStrip = Convert.ToInt32(x2.ChildNodes[1].Attributes["height"].Value); int y_size_toolStrip = Convert.ToInt32(x2.ChildNodes[1].Attributes["width"].Value); string text_toolStripMenuItems = ""; //空间名+类名 string spaceClassName = x2.ChildNodes[3].InnerText; if (ch) { text_toolStripMenuItems = x2.ChildNodes[2].ChildNodes[0].InnerText; } else { text_toolStripMenuItems = x2.ChildNodes[2].ChildNodes[1].InnerText; } //声明变量 toolStripMenuItems[i] = new ToolStripMenuItem(); toolStripMenuItems[i].Name = toolStripMenuItemsName; toolStripMenuItems[i].Text = text_toolStripMenuItems; toolStripMenuItems[i].Size = new Size(x_size_toolStrip, y_size_toolStrip); type = assembly.GetType(spaceClassName); if (typeIMenu.IsAssignableFrom(type) && !type.IsAbstract) { IMenu editor = (IMenu)Activator.CreateInstance(type); menuStrip1.Items.Add(toolStripMenuItems[i]); toolStripMenuItems[i].Click += toolStripMenuItems_Click; toolStripMenuItems[i].Tag = editor; } ++i; } //【0】实现打开 //用反射实现!!!! //================================ //toolStripMenuItems[0].Click += fileToolStripMenuItem_Click; ////[1]实现示例查找 //toolStripMenuItems[1].Click += searchToolStripMenuItem_Click; //================================ //Type typeIMenu = typeof(IMenu); //获取类型,参数(名称空间+类) //Type type = assembly.GetType("assembly_name.assembly_class"); //if (typeIMenu.IsAssignableFrom(types[i]) && !types[i].IsAbstract) //{ // IMenu editor = (IMenu)Activator.CreateInstance(types[i]); // // 2.5 向菜单栏中动态添加一个菜单项 // ToolStripItem toolItem = 编辑ToolStripMenuItem.DropDownItems.Add(editor.PluginName); // // 2.6 为刚刚增加的菜单项注册一个单击事件 // toolItem.Click += new EventHandler(toolItem_Click); // toolItem.Tag = editor; //} Controls.Add(menuStrip1); this.MainMenuStrip = menuStrip1; break; case "TreeView": //label1.Text = "TreeView"; TreeView[] treeViews = new TreeView[2]; int j = 0; //获取TreeView的所有子节点 XmlNodeList subTreeView = x.ChildNodes; //每一个x3为一个treeView foreach (XmlNode x3 in subTreeView) { XmlNodeList subSubTreeView = x3.ChildNodes; //每一个treeView都有自己的ContextMenu但是,具体有多少项是在xml里面写的, //暂时不实现每一项的功能,仅作不同显示 this.components = new System.ComponentModel.Container(); ContextMenuStrip contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); //subSubTreeView[0]为properties string treeViewName = subSubTreeView[0].ChildNodes[0].InnerText; int x_location_treeView = Convert.ToInt32(subSubTreeView[0].ChildNodes[1].Attributes["x"].Value); int y_location_treeView = Convert.ToInt32(subSubTreeView[0].ChildNodes[1].Attributes["y"].Value); int x_size_treeView = Convert.ToInt32(subSubTreeView[0].ChildNodes[2].Attributes["height"].Value); int y_size_treeView = Convert.ToInt32(subSubTreeView[0].ChildNodes[2].Attributes["width"].Value); string rootNodeTreeView = subSubTreeView[0].ChildNodes[3].ChildNodes[0].InnerText; TreeNode rooTreeNode = new TreeNode(); rooTreeNode.Name = rootNodeTreeView; if (ch) { rooTreeNode.Text = subSubTreeView[0].ChildNodes[3].ChildNodes[1].ChildNodes[0].InnerText; } else { rooTreeNode.Text = subSubTreeView[0].ChildNodes[3].ChildNodes[1].ChildNodes[1].InnerText; } //实现rootNode的上下文菜单 rooTreeNode.ContextMenuStrip = contextMenuStrip1; //获取contextMenu的节点 XmlNode contextMenuNode = subSubTreeView[0].ChildNodes[3].ChildNodes[2]; XmlNodeList contextNodeLists = contextMenuNode.ChildNodes; //为每一项菜单赋值,设置属性 ToolStripMenuItem[] tool_StripMenuItem = new ToolStripMenuItem[2]; int m = 0; foreach (XmlNode itemContext in contextNodeLists) { tool_StripMenuItem[m] = new ToolStripMenuItem(); tool_StripMenuItem[m].Name = itemContext.ChildNodes[0].InnerText; int x_size_item = Convert.ToInt32(itemContext.ChildNodes[1].Attributes["height"].Value); int y_size_item = Convert.ToInt32(itemContext.ChildNodes[1].Attributes["width"].Value); tool_StripMenuItem[m].Size = new Size(x_size_item, y_size_item); if (ch) { tool_StripMenuItem[m].Text = itemContext.ChildNodes[2].FirstChild.InnerText; } else { tool_StripMenuItem[m].Text = itemContext.ChildNodes[2].LastChild.InnerText; } contextMenuStrip1.Items.Add(tool_StripMenuItem[m]); } //string treeViewName = x3.ChildNodes[0].InnerText; //int x_location_treeView = Convert.ToInt32(x3.ChildNodes[1].Attributes["x"].Value); //int y_location_treeView = Convert.ToInt32(x3.ChildNodes[1].Attributes["y"].Value); //int x_size_treeView = Convert.ToInt32(x3.ChildNodes[2].Attributes["height"].Value); //int y_size_treeView = Convert.ToInt32(x3.ChildNodes[2].Attributes["width"].Value); treeViews[j] = new TreeView(); treeViews[j].Name = treeViewName; treeViews[j].Location = new Point(x_location_treeView, y_location_treeView); treeViews[j].Size = new Size(x_size_treeView, y_size_treeView); Controls.Add(treeViews[j]); treeViews[j].Nodes.Add(rooTreeNode); TreeNode[] treeNodes = new TreeNode[3]; int p = 0; foreach (XmlNode x5 in subSubTreeView[1].ChildNodes) { treeNodes[p] = new TreeNode(); treeNodes[p].Name = x5.FirstChild.InnerText; if (ch) { treeNodes[p].Text = x5.LastChild.ChildNodes[0].InnerText; } else { treeNodes[p].Text = x5.LastChild.ChildNodes[1].InnerText; } rooTreeNode.Nodes.Add(treeNodes[p]); ++p; } ++j; } break; case "TextBox": //label1.Text = "TextBox"; //获取TextBox的所有子节点 XmlNodeList subTextBox = x.ChildNodes; string textBoxName = subTextBox[0].InnerText; bool isMultiline = Convert.ToBoolean(subTextBox[0].Attributes["multiline"].Value); int x_location_textBox = Convert.ToInt32(subTextBox[1].Attributes["x"].Value); int y_location_textBox = Convert.ToInt32(subTextBox[1].Attributes["y"].Value); int x_size_textBox = Convert.ToInt32(subTextBox[2].Attributes["height"].Value); int y_size_textBox = Convert.ToInt32(subTextBox[2].Attributes["width"].Value); TextBox textBox = new TextBox(); textBox.Multiline = isMultiline; textBox.Name = textBoxName; textBox.Location = new Point(x_location_textBox, y_location_textBox); textBox.Size = new Size(x_size_textBox, y_size_textBox); Controls.Add(textBox); break; case "StatusStrip": XmlNodeList subStatusStrip = x.ChildNodes; string statusStripName = subStatusStrip[0].InnerText; int x_size_statusStrip = Convert.ToInt32(subStatusStrip[1].Attributes["height"].Value); int y_size_statusStrip = Convert.ToInt32(subStatusStrip[1].Attributes["width"].Value); StatusStrip statusStrip = new StatusStrip(); statusStrip.Name = statusStripName; statusStrip.Size = new Size(x_size_statusStrip, y_size_statusStrip); Controls.Add(statusStrip); break; case "ToolStrip": XmlNodeList subToolStrip = x.ChildNodes; //subToolStrip[0]为属性值 string toolStrip_Name = subToolStrip[0].ChildNodes[0].InnerText; int x_location_toolStrip = Convert.ToInt32(subToolStrip[0].ChildNodes[1].Attributes["x"].Value); int y_location_toolStrip = Convert.ToInt32(subToolStrip[0].ChildNodes[1].Attributes["y"].Value); int xSize_toolStrip = Convert.ToInt32(subToolStrip[0].ChildNodes[2].Attributes["height"].Value); int ySize_toolStrip = Convert.ToInt32(subToolStrip[0].ChildNodes[2].Attributes["width"].Value); string toolStrip_Text = subToolStrip[0].ChildNodes[3].InnerText; ToolStrip toolStrip = new ToolStrip(); toolStrip.Name = toolStrip_Name; toolStrip.Location = new Point(x_location_toolStrip, y_location_toolStrip); toolStrip.Size = new Size(xSize_toolStrip, ySize_toolStrip); toolStrip.Text = toolStrip_Text; toolStrip.SuspendLayout(); toolStrip.ResumeLayout(false); toolStrip.PerformLayout(); Controls.Add(toolStrip); XmlNodeList subSubToolStrip = subToolStrip[1].ChildNodes; ToolStripButton[] toolStripButtons = new ToolStripButton[3]; int k = 0; foreach (XmlNode x4 in subSubToolStrip) { string toolStripButtonName = x4.ChildNodes[0].InnerText; int x_size_toolStripButton = Convert.ToInt32(x4.ChildNodes[1].Attributes["height"].Value); int y_size_toolStripButton = Convert.ToInt32(x4.ChildNodes[1].Attributes["width"].Value); string text_toolStripButton = ""; if (ch) { text_toolStripButton = x4.ChildNodes[2].ChildNodes[0].InnerText; } else { text_toolStripButton = x4.ChildNodes[2].ChildNodes[1].InnerText; } //string ImageTransparentColor = x4.ChildNodes[3].InnerText; //string Image = x4.ChildNodes[4].InnerText; toolStripButtons[k] = new ToolStripButton(); toolStripButtons[k].Name = toolStripButtonName; toolStripButtons[k].Size = new Size(x_size_toolStripButton, y_size_toolStripButton); toolStripButtons[k].Text = text_toolStripButton; //toolStripButtons[k].ImageTransparentColor = ImageTransparentColor; //toolStripButtons[k].Image = ((System.Drawing.Image)(resources.GetObject("Image"))); toolStripButtons[k].DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; toolStrip.Items.Add(toolStripButtons[k]); ++k; } break; } } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); mainMenu_ = new System.Windows.Forms.MenuStrip(); fileMi_ = new System.Windows.Forms.ToolStripMenuItem(); exitMi_ = new System.Windows.Forms.ToolStripMenuItem(); serverMi_ = new System.Windows.Forms.ToolStripMenuItem(); connectMi_ = new System.Windows.Forms.ToolStripMenuItem(); disconnecMi_ = new System.Windows.Forms.ToolStripMenuItem(); separatorS1_ = new System.Windows.Forms.ToolStripMenuItem(); viewStatusMi_ = new System.Windows.Forms.ToolStripMenuItem(); browseMi_ = new System.Windows.Forms.ToolStripMenuItem(); separatorS2_ = new System.Windows.Forms.ToolStripMenuItem(); readMi_ = new System.Windows.Forms.ToolStripMenuItem(); writeMi_ = new System.Windows.Forms.ToolStripMenuItem(); menuItem1_ = new System.Windows.Forms.ToolStripMenuItem(); outputMi_ = new System.Windows.Forms.ToolStripMenuItem(); outputClearMi_ = new System.Windows.Forms.ToolStripMenuItem(); optionsMi_ = new System.Windows.Forms.ToolStripMenuItem(); clearHistoryMi_ = new System.Windows.Forms.ToolStripMenuItem(); forceDa20UsageMenuItem_ = new System.Windows.Forms.ToolStripMenuItem(); helpMi_ = new System.Windows.Forms.ToolStripMenuItem(); aboutMi_ = new System.Windows.Forms.ToolStripMenuItem(); toolBar_ = new System.Windows.Forms.ToolStrip(); toolBarImageList_ = new System.Windows.Forms.ImageList(components); connectBtn_ = new System.Windows.Forms.ToolStripButton(); disconnectBtn_ = new System.Windows.Forms.ToolStripButton(); viewStatusBtn_ = new System.Windows.Forms.ToolStripButton(); browseBtn_ = new System.Windows.Forms.ToolStripButton(); toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); readBtn_ = new System.Windows.Forms.ToolStripButton(); writeBtn_ = new System.Windows.Forms.ToolStripButton(); toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); aboutBtn_ = new System.Windows.Forms.ToolStripButton(); bottomPn_ = new System.Windows.Forms.Panel(); outputCtrl_ = new System.Windows.Forms.RichTextBox(); splitterH_ = new System.Windows.Forms.Splitter(); splitterV_ = new System.Windows.Forms.Splitter(); leftPn_ = new System.Windows.Forms.Panel(); subscriptionCtrl_ = new SampleClients.Da.Subscription.SubscriptionsTreeCtrl(); rightPn_ = new System.Windows.Forms.Panel(); updatesCtrl_ = new SampleClients.Da.UpdatesListViewCtrl(); updateTimerControl_ = new System.Windows.Forms.Timer(components); statusCtrl_ = new SampleClients.Da.Server.ServerStatusCtrl(); selectServerCtrl_ = new SampleClients.Common.SelectServerCtrl(); mainMenu_.SuspendLayout(); toolBar_.SuspendLayout(); bottomPn_.SuspendLayout(); leftPn_.SuspendLayout(); rightPn_.SuspendLayout(); SuspendLayout(); // // mainMenu_ // mainMenu_.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { fileMi_, serverMi_, outputMi_, optionsMi_, helpMi_ }); mainMenu_.Location = new System.Drawing.Point(0, 0); mainMenu_.Name = "mainMenu_"; mainMenu_.Size = new System.Drawing.Size(200, 24); mainMenu_.TabIndex = 0; // // fileMi_ // fileMi_.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { exitMi_ }); fileMi_.Name = "fileMi_"; fileMi_.Size = new System.Drawing.Size(37, 20); fileMi_.Text = "&File"; // // exitMi_ // exitMi_.Name = "exitMi_"; exitMi_.Size = new System.Drawing.Size(93, 22); exitMi_.Text = "&Exit"; exitMi_.Click += new System.EventHandler(ExitMI_Click); // // serverMi_ // serverMi_.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { connectMi_, disconnecMi_, separatorS1_, viewStatusMi_, browseMi_, separatorS2_, readMi_, writeMi_, menuItem1_ }); serverMi_.Name = "serverMi_"; serverMi_.Size = new System.Drawing.Size(51, 20); serverMi_.Text = "&Server"; // // connectMi_ // connectMi_.Name = "connectMi_"; connectMi_.Size = new System.Drawing.Size(134, 22); connectMi_.Text = "&Connect"; connectMi_.Click += new System.EventHandler(ConnectMI_Click); // // disconnecMi_ // disconnecMi_.Name = "disconnecMi_"; disconnecMi_.Size = new System.Drawing.Size(134, 22); disconnecMi_.Text = "&Disconnect"; disconnecMi_.Click += new System.EventHandler(DisconnectMI_Click); // // separatorS1_ // separatorS1_.Name = "separatorS1_"; separatorS1_.Size = new System.Drawing.Size(134, 22); separatorS1_.Text = "-"; // // viewStatusMi_ // viewStatusMi_.Name = "viewStatusMi_"; viewStatusMi_.Size = new System.Drawing.Size(134, 22); viewStatusMi_.Text = "&View Status"; viewStatusMi_.Click += new System.EventHandler(ViewStatusMI_Click); // // browseMi_ // browseMi_.Name = "browseMi_"; browseMi_.Size = new System.Drawing.Size(134, 22); browseMi_.Text = "&Browse..."; browseMi_.Click += new System.EventHandler(BrowseMI_Click); // // separatorS2_ // separatorS2_.Name = "separatorS2_"; separatorS2_.Size = new System.Drawing.Size(134, 22); separatorS2_.Text = "-"; // // readMi_ // readMi_.Name = "readMi_"; readMi_.Size = new System.Drawing.Size(134, 22); readMi_.Text = "&Read..."; readMi_.Click += new System.EventHandler(ReadMI_Click); // // writeMi_ // writeMi_.Name = "writeMi_"; writeMi_.Size = new System.Drawing.Size(134, 22); writeMi_.Text = "&Write..."; writeMi_.Click += new System.EventHandler(WriteMI_Click); // // menuItem1_ // menuItem1_.Name = "menuItem1_"; menuItem1_.Size = new System.Drawing.Size(134, 22); menuItem1_.Text = "-"; // // outputMi_ // outputMi_.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { outputClearMi_ }); outputMi_.Name = "outputMi_"; outputMi_.Size = new System.Drawing.Size(57, 20); outputMi_.Text = "&Output"; // // outputClearMi_ // outputClearMi_.Name = "outputClearMi_"; outputClearMi_.Size = new System.Drawing.Size(101, 22); outputClearMi_.Text = "&Clear"; outputClearMi_.Click += new System.EventHandler(OutputClearMI_Click); // // optionsMi_ // optionsMi_.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { clearHistoryMi_, forceDa20UsageMenuItem_ }); optionsMi_.Name = "optionsMi_"; optionsMi_.Size = new System.Drawing.Size(61, 20); optionsMi_.Text = "O&ptions"; // // clearHistoryMi_ // clearHistoryMi_.Name = "clearHistoryMi_"; clearHistoryMi_.Size = new System.Drawing.Size(175, 22); clearHistoryMi_.Text = "&Clear History"; clearHistoryMi_.Click += new System.EventHandler(ClearHistoryMI_Click); // // forceDa20UsageMenuItem_ // forceDa20UsageMenuItem_.Name = "forceDa20UsageMenuItem_"; forceDa20UsageMenuItem_.Size = new System.Drawing.Size(175, 22); forceDa20UsageMenuItem_.Text = "&Force DA 2.0 Usage"; forceDa20UsageMenuItem_.Click += new System.EventHandler(OnForceDa20Usage); // // helpMi_ // helpMi_.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { aboutMi_ }); helpMi_.Name = "helpMi_"; helpMi_.Size = new System.Drawing.Size(44, 20); helpMi_.Text = "&Help"; // // aboutMi_ // aboutMi_.Name = "aboutMi_"; aboutMi_.Size = new System.Drawing.Size(116, 22); aboutMi_.Text = "&About..."; aboutMi_.Click += new System.EventHandler(AboutMI_Click); // // toolBar_ // toolBar_.ImageList = toolBarImageList_; toolBar_.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { connectBtn_, disconnectBtn_, viewStatusBtn_, browseBtn_, toolStripSeparator1, readBtn_, writeBtn_, toolStripSeparator2, aboutBtn_ }); toolBar_.Location = new System.Drawing.Point(3, 0); toolBar_.Name = "toolBar_"; toolBar_.Size = new System.Drawing.Size(1010, 25); toolBar_.TabIndex = 0; // // toolBarImageList_ // toolBarImageList_.ColorDepth = System.Windows.Forms.ColorDepth.Depth24Bit; toolBarImageList_.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("toolBarImageList_.ImageStream"))); toolBarImageList_.TransparentColor = System.Drawing.Color.Teal; toolBarImageList_.Images.SetKeyName(0, ""); toolBarImageList_.Images.SetKeyName(1, ""); toolBarImageList_.Images.SetKeyName(2, ""); toolBarImageList_.Images.SetKeyName(3, ""); toolBarImageList_.Images.SetKeyName(4, ""); toolBarImageList_.Images.SetKeyName(5, ""); toolBarImageList_.Images.SetKeyName(6, ""); toolBarImageList_.Images.SetKeyName(7, ""); toolBarImageList_.Images.SetKeyName(8, ""); toolBarImageList_.Images.SetKeyName(9, ""); toolBarImageList_.Images.SetKeyName(10, ""); toolBarImageList_.Images.SetKeyName(11, ""); toolBarImageList_.Images.SetKeyName(12, ""); toolBarImageList_.Images.SetKeyName(13, ""); // // connectBtn_ // connectBtn_.ImageIndex = 0; connectBtn_.Name = "connectBtn_"; connectBtn_.Size = new System.Drawing.Size(23, 22); connectBtn_.ToolTipText = "Connect to Server"; connectBtn_.Click += new System.EventHandler(ConnectMI_Click); // // disconnectBtn_ // disconnectBtn_.ImageIndex = 1; disconnectBtn_.Name = "disconnectBtn_"; disconnectBtn_.Size = new System.Drawing.Size(23, 22); disconnectBtn_.ToolTipText = "Disconnect from Server"; disconnectBtn_.Click += new System.EventHandler(DisconnectMI_Click); // // viewStatusBtn_ // viewStatusBtn_.ImageIndex = 4; viewStatusBtn_.Name = "viewStatusBtn_"; viewStatusBtn_.Size = new System.Drawing.Size(23, 22); viewStatusBtn_.ToolTipText = "View Server Status"; viewStatusBtn_.Click += new System.EventHandler(ViewStatusMI_Click); // // browseBtn_ // browseBtn_.ImageIndex = 6; browseBtn_.Name = "browseBtn_"; browseBtn_.Size = new System.Drawing.Size(23, 22); browseBtn_.ToolTipText = "Browse Address Space"; browseBtn_.Click += new System.EventHandler(BrowseMI_Click); // // toolStripSeparator1 // toolStripSeparator1.Name = "toolStripSeparator1"; toolStripSeparator1.Size = new System.Drawing.Size(6, 25); // // readBtn_ // readBtn_.ImageIndex = 7; readBtn_.Name = "readBtn_"; readBtn_.Size = new System.Drawing.Size(23, 22); readBtn_.ToolTipText = "Read Items"; readBtn_.Click += new System.EventHandler(ReadMI_Click); // // writeBtn_ // writeBtn_.ImageIndex = 8; writeBtn_.Name = "writeBtn_"; writeBtn_.Size = new System.Drawing.Size(23, 22); writeBtn_.ToolTipText = "Write Items"; writeBtn_.Click += new System.EventHandler(WriteMI_Click); // // toolStripSeparator2 // toolStripSeparator2.Name = "toolStripSeparator2"; toolStripSeparator2.Size = new System.Drawing.Size(6, 25); // // aboutBtn_ // aboutBtn_.ImageIndex = 13; aboutBtn_.Name = "aboutBtn_"; aboutBtn_.Size = new System.Drawing.Size(23, 22); aboutBtn_.ToolTipText = "About"; aboutBtn_.Click += new System.EventHandler(AboutMI_Click); // // bottomPn_ // bottomPn_.Controls.Add(outputCtrl_); bottomPn_.Dock = System.Windows.Forms.DockStyle.Bottom; bottomPn_.Location = new System.Drawing.Point(3, 463); bottomPn_.Name = "bottomPn_"; bottomPn_.Size = new System.Drawing.Size(1010, 123); bottomPn_.TabIndex = 3; // // outputCtrl_ // outputCtrl_.Dock = System.Windows.Forms.DockStyle.Fill; outputCtrl_.Location = new System.Drawing.Point(0, 0); outputCtrl_.Name = "outputCtrl_"; outputCtrl_.Size = new System.Drawing.Size(1010, 123); outputCtrl_.TabIndex = 0; outputCtrl_.Text = ""; // // splitterH_ // splitterH_.Dock = System.Windows.Forms.DockStyle.Bottom; splitterH_.Location = new System.Drawing.Point(3, 459); splitterH_.Name = "splitterH_"; splitterH_.Size = new System.Drawing.Size(1010, 4); splitterH_.TabIndex = 4; splitterH_.TabStop = false; // // splitterV_ // splitterV_.Location = new System.Drawing.Point(319, 52); splitterV_.Name = "splitterV_"; splitterV_.Size = new System.Drawing.Size(4, 407); splitterV_.TabIndex = 5; splitterV_.TabStop = false; // // leftPn_ // leftPn_.Controls.Add(subscriptionCtrl_); leftPn_.Dock = System.Windows.Forms.DockStyle.Left; leftPn_.Location = new System.Drawing.Point(3, 52); leftPn_.Name = "leftPn_"; leftPn_.Padding = new System.Windows.Forms.Padding(0, 3, 0, 0); leftPn_.Size = new System.Drawing.Size(316, 407); leftPn_.TabIndex = 6; // // subscriptionCtrl_ // subscriptionCtrl_.Dock = System.Windows.Forms.DockStyle.Fill; subscriptionCtrl_.Location = new System.Drawing.Point(0, 3); subscriptionCtrl_.Name = "subscriptionCtrl_"; subscriptionCtrl_.Size = new System.Drawing.Size(316, 404); subscriptionCtrl_.TabIndex = 0; // // rightPn_ // rightPn_.Controls.Add(updatesCtrl_); rightPn_.Dock = System.Windows.Forms.DockStyle.Fill; rightPn_.Location = new System.Drawing.Point(323, 52); rightPn_.Name = "rightPn_"; rightPn_.Padding = new System.Windows.Forms.Padding(0, 3, 0, 0); rightPn_.Size = new System.Drawing.Size(690, 407); rightPn_.TabIndex = 7; // // updatesCtrl_ // updatesCtrl_.AllowDrop = true; updatesCtrl_.Dock = System.Windows.Forms.DockStyle.Fill; updatesCtrl_.Location = new System.Drawing.Point(0, 3); updatesCtrl_.Name = "updatesCtrl_"; updatesCtrl_.Size = new System.Drawing.Size(690, 404); updatesCtrl_.TabIndex = 0; // // updateTimerControl_ // updateTimerControl_.Interval = 10000; updateTimerControl_.Tick += new System.EventHandler(UpdateTimerCtrlTick); // // statusCtrl_ // statusCtrl_.Location = new System.Drawing.Point(3, 586); statusCtrl_.Name = "statusCtrl_"; statusCtrl_.Size = new System.Drawing.Size(1010, 22); statusCtrl_.TabIndex = 8; // // selectServerCtrl_ // selectServerCtrl_.Dock = System.Windows.Forms.DockStyle.Top; selectServerCtrl_.Label = "Server"; selectServerCtrl_.Location = new System.Drawing.Point(3, 25); selectServerCtrl_.Name = "selectServerCtrl_"; selectServerCtrl_.Padding = new System.Windows.Forms.Padding(4, 0, 4, 0); selectServerCtrl_.Size = new System.Drawing.Size(1010, 27); selectServerCtrl_.TabIndex = 0; // // MainForm // AutoScaleBaseSize = new System.Drawing.Size(6, 16); ClientSize = new System.Drawing.Size(1016, 608); Controls.Add(rightPn_); Controls.Add(splitterV_); Controls.Add(leftPn_); Controls.Add(splitterH_); Controls.Add(bottomPn_); Controls.Add(statusCtrl_); Controls.Add(selectServerCtrl_); Controls.Add(toolBar_); MainMenuStrip = mainMenu_; Name = "MainForm"; Padding = new System.Windows.Forms.Padding(3, 0, 3, 0); Text = "OPC DA Sample Client"; mainMenu_.ResumeLayout(false); mainMenu_.PerformLayout(); toolBar_.ResumeLayout(false); toolBar_.PerformLayout(); bottomPn_.ResumeLayout(false); leftPn_.ResumeLayout(false); rightPn_.ResumeLayout(false); ResumeLayout(false); PerformLayout(); }
private void InitializeComponent() { findToolStrip = new System.Windows.Forms.ToolStrip(); lblFind = new System.Windows.Forms.ToolStripLabel(); lblLookin = new System.Windows.Forms.ToolStripLabel(); findWhatList = new System.Windows.Forms.ToolStripComboBox(); lookinList = new System.Windows.Forms.ToolStripComboBox(); btnFind = new System.Windows.Forms.ToolStripButton(); findToolStrip.SuspendLayout(); SuspendLayout(); findToolStrip.AutoSize = false; findToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[5] { lblFind, findWhatList, lblLookin, lookinList, btnFind }); findToolStrip.Location = new System.Drawing.Point(0, 0); findToolStrip.Name = "findToolStrip"; findToolStrip.Size = new System.Drawing.Size(800, 25); findToolStrip.TabIndex = 0; lblFind.Name = "lblFind"; lblFind.Size = new System.Drawing.Size(58, 22); lblFind.Text = Microsoft.Tools.ServiceModel.TraceViewer.SR.GetString("Find_What2"); lblLookin.Name = "lblLookin"; lblLookin.Size = new System.Drawing.Size(58, 22); lblLookin.Text = Microsoft.Tools.ServiceModel.TraceViewer.SR.GetString("Find_Lookin2"); findWhatList.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; findWhatList.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; findWhatList.AutoToolTip = true; findWhatList.MaxDropDownItems = 50; findWhatList.MaxLength = 500; findWhatList.Name = "findWhatList"; findWhatList.Size = new System.Drawing.Size(200, 25); findWhatList.KeyUp += new System.Windows.Forms.KeyEventHandler(findWhatList_KeyUp); findWhatList.ToolTipText = Microsoft.Tools.ServiceModel.TraceViewer.SR.GetString("Find_FindWhatTip"); lookinList.AutoSize = false; lookinList.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.ImageAndText; lookinList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; lookinList.Items.AddRange(new object[2] { Microsoft.Tools.ServiceModel.TraceViewer.SR.GetString("Find_Scope1"), Microsoft.Tools.ServiceModel.TraceViewer.SR.GetString("Find_Scope2") }); lookinList.Name = "lookinList"; lookinList.Size = new System.Drawing.Size(250, 25); lookinList.SelectedIndexChanged += new System.EventHandler(lookinList_SelectedIndexChanged); lookinList.ToolTipText = Microsoft.Tools.ServiceModel.TraceViewer.SR.GetString("Find_LookInTip"); btnFind.AutoSize = false; btnFind.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; btnFind.Name = "btnFind"; btnFind.Size = new System.Drawing.Size(64, 22); btnFind.Text = Microsoft.Tools.ServiceModel.TraceViewer.SR.GetString("Find_Button"); btnFind.Click += new System.EventHandler(btnFind_Click); base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f); base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; base.Controls.Add(findToolStrip); base.Name = "FindToolbar"; base.Size = new System.Drawing.Size(800, 25); findToolStrip.ResumeLayout(performLayout: false); findToolStrip.PerformLayout(); ResumeLayout(performLayout: false); }
private void InitializeComponent() { #region Controls _components = new Container(); _mainToolStrip = new ToolStrip(); _listViewToolStripButton = new ToolStripButton(); _textViewToolStripButton = new ToolStripButton(); _clearViewToolStripSeparator = new ToolStripSeparator(); _clearViewToolStripButton = new ToolStripButton(); _textViewTextBox = new TextBox(); _listViewListView = new ListView(); _displayLine = new ColumnHeader(); _listViewImageList = new ImageList(_components); #endregion _mainToolStrip.SuspendLayout(); SuspendLayout(); _mainToolStrip.Items.AddRange(new ToolStripItem[] { _listViewToolStripButton, _textViewToolStripButton, _clearViewToolStripSeparator, _clearViewToolStripButton }); _mainToolStrip.Location = new Point(0, 0); _mainToolStrip.Name = "mainToolStrip"; _mainToolStrip.TabIndex = 0; _mainToolStrip.Text = "toolStrip1"; _listViewToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; _listViewToolStripButton.Image = Resources.ListView; _listViewToolStripButton.ImageTransparentColor = Color.Fuchsia; _listViewToolStripButton.Name = "listViewToolStripButton"; _listViewToolStripButton.Text = Resources.ToolbarViewAsList; _listViewToolStripButton.Click += new System.EventHandler(listViewToolStripButton_Click); _textViewToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; _textViewToolStripButton.Image = Resources.TextView; _textViewToolStripButton.ImageTransparentColor = Color.Fuchsia; _textViewToolStripButton.Name = "textViewToolStripButton"; _textViewToolStripButton.Text = Resources.ToolbarViewAsText; _textViewToolStripButton.Click += new System.EventHandler(textViewToolStripButton_Click); _clearViewToolStripSeparator.Name = "toolStripSeparator1"; _clearViewToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; _clearViewToolStripButton.Image = Resources.ClearOutput; _clearViewToolStripButton.ImageTransparentColor = Color.Fuchsia; _clearViewToolStripButton.Name = "clearViewToolStripButton"; _clearViewToolStripButton.Text = Resources.ToolbarClearView; _clearViewToolStripButton.Click += new System.EventHandler(clearViewToolStripButton_Click); _textViewTextBox.BackColor = SystemColors.Window; _textViewTextBox.Font = new Font("Courier New", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); _textViewTextBox.Location = new Point(460, 76); _textViewTextBox.Multiline = true; _textViewTextBox.Name = "textViewTextBox"; _textViewTextBox.ReadOnly = true; _textViewTextBox.ScrollBars = ScrollBars.Both; _textViewTextBox.TabIndex = 1; _textViewTextBox.WordWrap = false; _textViewTextBox.KeyDown += new KeyEventHandler(TextViewTextBox_KeyDown); _listViewListView.Columns.AddRange(new ColumnHeader[] { _displayLine }); _listViewListView.Font = new Font("Courier New", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); _listViewListView.FullRowSelect = true; _listViewListView.HeaderStyle = ColumnHeaderStyle.None; _listViewListView.Location = new Point(288, 76); _listViewListView.MultiSelect = false; _listViewListView.Name = "listViewListView"; _listViewListView.SmallImageList = _listViewImageList; _listViewListView.TabIndex = 2; _listViewListView.UseCompatibleStateImageBehavior = false; _listViewListView.View = View.Details; _listViewListView.MouseDoubleClick += new MouseEventHandler(ListViewListView_MouseDoubleClick); _listViewImageList.TransparentColor = Color.Fuchsia; _listViewImageList.Images.Add("ERROR", Resources.Error); AutoScaleDimensions = new SizeF(6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(701, 233); Controls.Add(_listViewListView); Controls.Add(_textViewTextBox); Controls.Add(_mainToolStrip); DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas) ((((((WeifenLuo.WinFormsUI.Docking.DockAreas.Float) | WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft) | WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight) | WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop) | WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom))); Font = new Font("Tahoma", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); HideOnClose = true; Icon = Resources.OutputIcon; Name = "OutputForm"; ShowInTaskbar = false; Text = Resources.OutputWindowTitle; _mainToolStrip.ResumeLayout(false); _mainToolStrip.PerformLayout(); ResumeLayout(false); PerformLayout(); }
private void InitializeComponent() { System.ComponentModel.ComponentResourceManager componentResourceManager = new System.ComponentModel.ComponentResourceManager(typeof(CIT.Client.ToolScript.ucBase)); toolStrip1 = new System.Windows.Forms.ToolStrip(); tol_refresh = new System.Windows.Forms.ToolStripButton(); tol_add = new System.Windows.Forms.ToolStripButton(); toolStripButton3 = new System.Windows.Forms.ToolStripButton(); toolStripButton4 = new System.Windows.Forms.ToolStripButton(); toolStripButton5 = new System.Windows.Forms.ToolStripButton(); toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); toolStripButton6 = new System.Windows.Forms.ToolStripButton(); toolStripButton7 = new System.Windows.Forms.ToolStripButton(); toolStripButton8 = new System.Windows.Forms.ToolStripButton(); toolStripButton9 = new System.Windows.Forms.ToolStripButton(); toolStrip1.SuspendLayout(); SuspendLayout(); toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[10] { tol_refresh, tol_add, toolStripButton3, toolStripButton4, toolStripButton5, toolStripSeparator1, toolStripButton6, toolStripButton7, toolStripButton8, toolStripButton9 }); toolStrip1.Location = new System.Drawing.Point(0, 0); toolStrip1.Name = "toolStrip1"; toolStrip1.Size = new System.Drawing.Size(848, 25); toolStrip1.TabIndex = 0; toolStrip1.Text = "toolStrip1"; tol_refresh.Image = (System.Drawing.Image)componentResourceManager.GetObject("tol_refresh.Image"); tol_refresh.ImageTransparentColor = System.Drawing.Color.Magenta; tol_refresh.Name = "tol_refresh"; tol_refresh.Size = new System.Drawing.Size(52, 22); tol_refresh.Text = "刷新"; tol_add.Image = (System.Drawing.Image)componentResourceManager.GetObject("tol_add.Image"); tol_add.ImageTransparentColor = System.Drawing.Color.Magenta; tol_add.Name = "tol_add"; tol_add.Size = new System.Drawing.Size(52, 22); tol_add.Text = "新增"; tol_add.Click += new System.EventHandler(tol_add_Click); toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta; toolStripButton3.Name = "toolStripButton3"; toolStripButton3.Size = new System.Drawing.Size(36, 22); toolStripButton3.Text = "编辑"; toolStripButton4.Image = (System.Drawing.Image)componentResourceManager.GetObject("toolStripButton4.Image"); toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta; toolStripButton4.Name = "toolStripButton4"; toolStripButton4.Size = new System.Drawing.Size(52, 22); toolStripButton4.Text = "删除"; toolStripButton5.Image = (System.Drawing.Image)componentResourceManager.GetObject("toolStripButton5.Image"); toolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta; toolStripButton5.Name = "toolStripButton5"; toolStripButton5.Size = new System.Drawing.Size(52, 22); toolStripButton5.Text = "保存"; toolStripSeparator1.Name = "toolStripSeparator1"; toolStripSeparator1.Size = new System.Drawing.Size(6, 25); toolStripButton6.Image = (System.Drawing.Image)componentResourceManager.GetObject("toolStripButton6.Image"); toolStripButton6.ImageTransparentColor = System.Drawing.Color.Magenta; toolStripButton6.Name = "toolStripButton6"; toolStripButton6.Size = new System.Drawing.Size(52, 22); toolStripButton6.Text = "导入"; toolStripButton7.Image = (System.Drawing.Image)componentResourceManager.GetObject("toolStripButton7.Image"); toolStripButton7.ImageTransparentColor = System.Drawing.Color.Magenta; toolStripButton7.Name = "toolStripButton7"; toolStripButton7.Size = new System.Drawing.Size(52, 22); toolStripButton7.Text = "导出"; toolStripButton8.Image = (System.Drawing.Image)componentResourceManager.GetObject("toolStripButton8.Image"); toolStripButton8.ImageTransparentColor = System.Drawing.Color.Magenta; toolStripButton8.Name = "toolStripButton8"; toolStripButton8.Size = new System.Drawing.Size(52, 22); toolStripButton8.Text = "下载"; toolStripButton9.Image = (System.Drawing.Image)componentResourceManager.GetObject("toolStripButton9.Image"); toolStripButton9.ImageTransparentColor = System.Drawing.Color.Magenta; toolStripButton9.Name = "toolStripButton9"; toolStripButton9.Size = new System.Drawing.Size(52, 22); toolStripButton9.Text = "分享"; base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f); base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; base.Controls.Add(toolStrip1); base.Name = "ucBase"; base.Size = new System.Drawing.Size(848, 115); toolStrip1.ResumeLayout(performLayout: false); toolStrip1.PerformLayout(); ResumeLayout(performLayout: false); PerformLayout(); }
public FormMain(string[] args) { _logger = Logger.Get(nameof(FormMain)); _logger.Trace("constructing the main window..."); // コントロールのインスタンス生成 _logger.Trace("creating controls..."); _mdi_tab = new MdiChildrenTab(); _main_menu = new MenuStrip(); _tool_menu = new ToolStrip(); _status_bar = new StatusStrip(); _explorer = new FileTreeBox(this); _terminal = new TabControlEx(); _splitter_vert = new Splitter(); _splitter_hori = new Splitter(); // レイアウト停止 _logger.Trace("suspending the control layouts..."); this.SuspendLayout(); _mdi_tab.SuspendLayout(); _main_menu.SuspendLayout(); _tool_menu.SuspendLayout(); _status_bar.SuspendLayout(); _explorer.SuspendLayout(); _terminal.SuspendLayout(); _splitter_vert.SuspendLayout(); _splitter_hori.SuspendLayout(); { // MDI親ウィンドウとして設定 _logger.Trace($"setting the main window as MDI parent..."); this.IsMdiContainer = true; for (int i = 0; i < this.Controls.Count; ++i) { if (this.Controls[i] is MdiClient mc) { _mdi_client = mc; break; } } } { // _mdi_tab _logger.Trace($"setting {nameof(_mdi_tab)}..."); _mdi_tab.Name = nameof(_mdi_tab); _mdi_tab.Dock = DockStyle.Top; _mdi_tab.Size = new Size(192, 32); _mdi_tab.MdiClient = _mdi_client; _mdi_tab.Font = SystemFonts.IconTitleFont; } this.BuildMenus(); this.BuildMainMenuItems(); this.BuildToolMenuItems(); this.BuildStatusLabels(); { // _explorer _logger.Trace($"setting {nameof(_explorer)}..."); _explorer.Name = nameof(_explorer); _explorer.Dock = DockStyle.Left; _explorer.Size = new Size(200, 200); _explorer.BorderStyle = BorderStyle.Fixed3D; } { // _terminal _logger.Trace($"setting {nameof(_terminal)}..."); _terminal.Name = nameof(_terminal); _terminal.Dock = DockStyle.Bottom; _terminal.Size = new Size(200, 200); } { // _splitter_vert _logger.Trace($"setting {nameof(_splitter_vert)}..."); _splitter_vert.Name = nameof(_splitter_vert); _splitter_vert.Dock = DockStyle.Left; } { // _splitter_hori _logger.Trace($"setting {nameof(_splitter_hori)}..."); _splitter_hori.Name = nameof(_splitter_hori); _splitter_hori.Dock = DockStyle.Bottom; } { // FormMain _logger.Trace($"setting {nameof(FormMain)}..."); this.Name = nameof(FormMain); this.Text = $"{ASMINFO.Caption} {ASMINFO.Edition}"; this.Icon = Libosdev.GetIcon(FormMainRes.Icon); this.MinimumSize = new Size(600, 450); this.ClientSize = SettingManager.System.MainWindowPosition.Size; if (SettingManager.System.MainWindowPosition.X > -1 && SettingManager.System.MainWindowPosition.Y > -1) { this.StartPosition = FormStartPosition.Manual; this.Location = SettingManager.System.MainWindowPosition.Location; } } // ToolStrip系コントロールに関する設定 ToolStripManager.Renderer = new ToolStripRendererEx(new ToolStripColorTable()); // コントロール登録 _logger.Trace($"adding controls..."); this.Controls.Add(_mdi_tab); this.Controls.Add(_splitter_hori); this.Controls.Add(_splitter_vert); this.Controls.Add(_terminal); this.Controls.Add(_explorer); this.Controls.Add(_status_bar); this.Controls.Add(_tool_menu); this.Controls.Add(_main_menu); this.MainMenuStrip = _main_menu; // レイアウト再開 _logger.Trace("resuming the control layouts..."); _splitter_hori.ResumeLayout(false); _splitter_hori.PerformLayout(); _splitter_vert.ResumeLayout(false); _splitter_vert.PerformLayout(); _terminal.ResumeLayout(false); _terminal.PerformLayout(); _explorer.ResumeLayout(false); _explorer.PerformLayout(); _status_bar.ResumeLayout(false); _status_bar.PerformLayout(); _tool_menu.ResumeLayout(false); _tool_menu.PerformLayout(); _main_menu.ResumeLayout(false); _main_menu.PerformLayout(); _mdi_tab.ResumeLayout(false); _mdi_tab.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); _logger.Trace("constructed the main window"); }
void CreateSelectPlentyDialog(Page mode) { spFrm = sf.CreateCustomDialog(); bm8 = new Bitmap(new MemoryStream(sf.ReadDataFile("installfiles\\ui\\dui_logo.png"))); lb = new ListBox(); bok = new Button(); babort = new Button(); pb = new PictureBox(); rtb = new RichTextBox(); ts = new ToolStrip(); ToolStripButton tsbSelectAll = new ToolStripButton(); ToolStripButton tsbSelectNone = new ToolStripButton(); ToolStripButton tsbInvert = new ToolStripButton(); ((System.ComponentModel.ISupportInitialize)(pb)).BeginInit(); ts.SuspendLayout(); spFrm.SuspendLayout(); // // lbComponents // lb.Anchor = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left))); lb.Font = SetFont(8.25F, FontStyle.Bold); lb.ItemHeight = 16; lb.Location = new System.Drawing.Point(9, 9); lb.Margin = new Padding(0); lb.Name = "lb"; lb.Size = new Size(272, 500); lb.TabIndex = 0; if (!unattended) { lb.SelectedIndexChanged += new EventHandler(this.lb_SelectedIndexChanged); lb.SizeChanged += new EventHandler(this.lb_SizeChanged); } // // btnOk // bok.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Right))); bok.Location = new Point(598, 522); bok.Margin = new Padding(3, 4, 3, 4); bok.Name = "bok"; bok.Size = new Size(87, 30); bok.TabIndex = 1; bok.Text = "&Ok"; bok.UseVisualStyleBackColor = true; bok.Click += new EventHandler(this.bok_Click); bok.Enabled = false; // // btnAbort // babort.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Right))); babort.DialogResult = System.Windows.Forms.DialogResult.Abort; babort.Location = new Point(691, 522); babort.Margin = new Padding(3, 4, 3, 4); babort.Name = "babort"; babort.Size = new Size(87, 30); babort.TabIndex = 2; babort.Text = "&Abort"; babort.UseVisualStyleBackColor = true; // // pb // pb.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right))); pb.Location = new Point(284, 9); pb.Margin = new Padding(3, 4, 3, 4); pb.Name = "pb"; pb.Size = new Size(496, 311); pb.SizeMode = PictureBoxSizeMode.Zoom; pb.Click += new EventHandler(this.pb_Click); pb.Cursor = Cursors.Hand; // // rtbDesription // rtb.Anchor = ((AnchorStyles)((((AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right))); rtb.BackColor = SystemColors.Window; rtb.Cursor = Cursors.Default; rtb.Location = new Point(284, 323); rtb.Name = "rtb"; rtb.ReadOnly = true; rtb.Size = new Size(496, 186); rtb.TabStop = false; rtb.SelectionAlignment = HorizontalAlignment.Center; rtb.WordWrap = true; // // ts // ts.LayoutStyle = ToolStripLayoutStyle.Flow; ts.Font = SetFont(8.25F, FontStyle.Regular); ts.Dock = DockStyle.None; ts.Items.AddRange(new ToolStripItem[] { tsbSelectAll, tsbSelectNone, tsbInvert }); ts.Location = new Point(9, 509); ts.Name = "ts"; ts.Size = new Size(211, 25); ts.Visible = true; // // tsbSelectAll // tsbSelectAll.Name = "tsbSelectAll"; tsbSelectAll.Size = new Size(54, 22); tsbSelectAll.Text = "A&ll"; tsbSelectAll.ToolTipText = "Select all entries"; tsbSelectAll.Click += new EventHandler(this.tsbSelect_Click); // // tsbSelectNone // tsbSelectNone.Name = "tsbSelectNone"; tsbSelectNone.Size = new Size(68, 22); tsbSelectNone.Text = "&None"; tsbSelectNone.ToolTipText = "Deselect all entries"; tsbSelectNone.Click += new EventHandler(this.tsbSelect_Click); // // tsbInvert // tsbInvert.Name = "tsbInvert"; tsbInvert.Size = new Size(86, 22); tsbInvert.Text = "&Invert"; tsbInvert.ToolTipText = "Select all unselected entries and deselect all selected ones"; tsbInvert.Click += new EventHandler(this.tsbSelect_Click); // // SelectPlentyDialog // spFrm.AutoScaleDimensions = new SizeF(7F, 17F); spFrm.AutoScaleMode = AutoScaleMode.Font; spFrm.ClientSize = new Size(792, 566); spFrm.MinimumSize = new Size(800, 600); spFrm.Controls.Add(rtb); spFrm.Controls.Add(pb); spFrm.Controls.Add(babort); spFrm.Controls.Add(bok); spFrm.Controls.Add(lb); spFrm.Controls.Add(ts); spFrm.ControlBox = false; spFrm.Font = SetFont(9F, FontStyle.Regular); spFrm.Margin = new Padding(3, 4, 3, 4); spFrm.StartPosition = FormStartPosition.CenterScreen; spFrm.Name = "SelectPlentyDialog"; spFrm.Text = duiVersion + " Install"; spFrm.FormClosed += new FormClosedEventHandler(this.spFrm_FormClosed); InitPage(mode); ResetInfo(); ((System.ComponentModel.ISupportInitialize)(pb)).EndInit(); ts.BringToFront(); //helps flicker ts.ResumeLayout(false); ts.PerformLayout(); spFrm.ResumeLayout(false); spFrm.PerformLayout(); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { _Components = new System.ComponentModel.Container(); _TopLayoutPanel = new System.Windows.Forms.Panel(); _ToolStrip = new System.Windows.Forms.ToolStrip(); _NewTaskSplitButton = new System.Windows.Forms.ToolStripSplitButton(); _NewTaskMenuItem = new System.Windows.Forms.ToolStripMenuItem(); _NewFolderMenuItem = new System.Windows.Forms.ToolStripMenuItem(); _SortBySplitButton = new System.Windows.Forms.ToolStripSplitButton(); _PriorityMenuItem = new System.Windows.Forms.ToolStripMenuItem(); _CompletedMenuItem = new System.Windows.Forms.ToolStripMenuItem(); _DescriptionMenuItem = new System.Windows.Forms.ToolStripMenuItem(); _SplitContainer = new System.Windows.Forms.SplitContainer(); _TaskTreeView = new Genetibase.NuGenTaskList.NuGenTaskTreeView(); _TaskEditBox = new Genetibase.NuGenTaskList.NuGenTaskEditBox(); _TopLayoutPanel.SuspendLayout(); _ToolStrip.SuspendLayout(); _SplitContainer.Panel1.SuspendLayout(); _SplitContainer.Panel2.SuspendLayout(); _SplitContainer.SuspendLayout(); this.SuspendLayout(); // // topLayoutPanel // _TopLayoutPanel.Controls.Add(_ToolStrip); _TopLayoutPanel.Dock = System.Windows.Forms.DockStyle.Top; _TopLayoutPanel.Location = new System.Drawing.Point(0, 0); _TopLayoutPanel.Name = "topLayoutPanel"; _TopLayoutPanel.Size = new System.Drawing.Size(265, 27); _TopLayoutPanel.TabIndex = 0; // // toolStrip // _ToolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; _ToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { _NewTaskSplitButton, _SortBySplitButton }); _ToolStrip.Location = new System.Drawing.Point(0, 0); _ToolStrip.Name = "toolStrip"; _ToolStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; _ToolStrip.Size = new System.Drawing.Size(265, 25); _ToolStrip.TabIndex = 0; _ToolStrip.Text = "toolStrip1"; // // newTaskSplitButton // _NewTaskSplitButton.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { _NewTaskMenuItem, _NewFolderMenuItem }); _NewTaskSplitButton.Image = global::Genetibase.NuGenTaskList.Properties.Resources.Create_New; _NewTaskSplitButton.ImageTransparentColor = System.Drawing.Color.Magenta; _NewTaskSplitButton.Name = "newTaskSplitButton"; _NewTaskSplitButton.Size = new System.Drawing.Size(85, 22); _NewTaskSplitButton.Text = "New &Task"; _NewTaskSplitButton.ButtonClick += new System.EventHandler(_NewTaskMenuItem_Click); // // newTaskMenuItem // _NewTaskMenuItem.Image = global::Genetibase.NuGenTaskList.Properties.Resources.Create_New; _NewTaskMenuItem.Name = "newTaskMenuItem"; _NewTaskMenuItem.Size = new System.Drawing.Size(139, 22); _NewTaskMenuItem.Text = "New &Task"; _NewTaskMenuItem.Click += new System.EventHandler(_NewTaskMenuItem_Click); // // newFolderMenuItem // _NewFolderMenuItem.Image = global::Genetibase.NuGenTaskList.Properties.Resources.Create_New_Folder; _NewFolderMenuItem.Name = "newFolderMenuItem"; _NewFolderMenuItem.Size = new System.Drawing.Size(139, 22); _NewFolderMenuItem.Text = "New &Folder"; _NewFolderMenuItem.Click += new System.EventHandler(_NewFolderMenuItem_Click); // // sortBySplitButton // _SortBySplitButton.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { _PriorityMenuItem, _CompletedMenuItem, _DescriptionMenuItem }); _SortBySplitButton.Image = global::Genetibase.NuGenTaskList.Properties.Resources.Sort_AZ; _SortBySplitButton.ImageTransparentColor = System.Drawing.Color.White; _SortBySplitButton.Name = "sortBySplitButton"; _SortBySplitButton.Size = new System.Drawing.Size(74, 22); _SortBySplitButton.Text = "&Sort By"; // // priorityMenuItem // _PriorityMenuItem.Image = global::Genetibase.NuGenTaskList.Properties.Resources.Sort_Priority; _PriorityMenuItem.Name = "priorityMenuItem"; _PriorityMenuItem.Size = new System.Drawing.Size(152, 22); _PriorityMenuItem.Text = "&Priority"; _PriorityMenuItem.Click += new System.EventHandler(_PriorityMenuItem_Click); // // completedMenuItem // _CompletedMenuItem.Image = global::Genetibase.NuGenTaskList.Properties.Resources.Sort_Completed; _CompletedMenuItem.Name = "completedMenuItem"; _CompletedMenuItem.Size = new System.Drawing.Size(152, 22); _CompletedMenuItem.Text = "&Completed"; _CompletedMenuItem.Click += new System.EventHandler(_CompletedMenuItem_Click); // // descriptionMenuItem // _DescriptionMenuItem.Image = global::Genetibase.NuGenTaskList.Properties.Resources.Sort_Description; _DescriptionMenuItem.Name = "descriptionMenuItem"; _DescriptionMenuItem.Size = new System.Drawing.Size(152, 22); _DescriptionMenuItem.Text = "&Description"; _DescriptionMenuItem.Click += new System.EventHandler(_DescriptionMenuItem_Click); // // splitContainer // _SplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; _SplitContainer.Location = new System.Drawing.Point(0, 27); _SplitContainer.Name = "splitContainer"; _SplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; // // splitContainer.Panel1 // _SplitContainer.Panel1.Controls.Add(_TaskTreeView); // // splitContainer.Panel2 // _SplitContainer.Panel2.Controls.Add(_TaskEditBox); _SplitContainer.Size = new System.Drawing.Size(265, 373); _SplitContainer.SplitterDistance = 260; _SplitContainer.TabIndex = 1; // // taskTreeView // _TaskTreeView.AllowDrop = true; _TaskTreeView.CheckBoxes = true; _TaskTreeView.Dock = System.Windows.Forms.DockStyle.Fill; _TaskTreeView.HideSelection = false; _TaskTreeView.ImageIndex = 0; _TaskTreeView.Location = new System.Drawing.Point(0, 0); _TaskTreeView.Name = "taskTreeView"; _TaskTreeView.SelectedImageIndex = 0; _TaskTreeView.ShowLines = false; _TaskTreeView.Size = new System.Drawing.Size(265, 165); _TaskTreeView.TabIndex = 0; // // taskEditBox // _TaskEditBox.BackColor = System.Drawing.SystemColors.Window; _TaskEditBox.Dock = System.Windows.Forms.DockStyle.Fill; _TaskEditBox.Enabled = false; _TaskEditBox.Location = new System.Drawing.Point(0, 0); _TaskEditBox.Multiline = true; _TaskEditBox.Name = "taskEditBox"; _TaskEditBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; _TaskEditBox.Size = new System.Drawing.Size(265, 204); _TaskEditBox.TabIndex = 0; // // NuGenTaskListUI // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(_SplitContainer); this.Controls.Add(_TopLayoutPanel); this.Name = "NuGenTaskListUI"; this.Size = new System.Drawing.Size(265, 400); _TopLayoutPanel.ResumeLayout(false); _TopLayoutPanel.PerformLayout(); _ToolStrip.ResumeLayout(false); _ToolStrip.PerformLayout(); _SplitContainer.Panel1.ResumeLayout(false); _SplitContainer.Panel2.ResumeLayout(false); _SplitContainer.Panel2.PerformLayout(); _SplitContainer.ResumeLayout(false); this.ResumeLayout(false); }
private void InitializeComponent() { //INIT ComponentResourceManager resources = new ComponentResourceManager(GetType()); toolStrip.SuspendLayout(); SuspendLayout(); //web browser webBrowser.Location = new Point(12, 72); webBrowser.Name = "webBrowser"; webBrowser.Size = new Size(0, 0); webBrowser.TabIndex = 0; webBrowser.Url = new Uri("https://google.com", UriKind.Absolute); webBrowser.Navigating += WebBrowser_Navigating; //url bar URLbar.Location = new Point(12, 28); URLbar.Name = "URLbar"; URLbar.Size = new Size(0, 20); URLbar.TabIndex = 1; URLbar.KeyUp += URLbar_KeyUp; //new tab button newTab.DisplayStyle = ToolStripItemDisplayStyle.Text; newTab.Name = "newTab"; newTab.Size = new Size(75, 22); newTab.Text = "new tab"; newTab.ToolTipText = "creates a new tab"; newTab.Click += NewTab_Click; //prev button prev.DisplayStyle = ToolStripItemDisplayStyle.Text; prev.ImageTransparentColor = Color.Magenta; prev.Name = "prev"; prev.Size = new Size(50, 22); prev.Text = "prev"; prev.Click += Prev_Click; //next button next.DisplayStyle = ToolStripItemDisplayStyle.Text; next.ImageTransparentColor = Color.Magenta; next.Name = "next"; next.Size = new Size(50, 22); next.Text = "next"; next.Click += Next_Click; //about button about.DisplayStyle = ToolStripItemDisplayStyle.Text; about.Name = "about"; about.Size = new Size(50, 22); about.Text = "about"; about.Click += About_Click; //reload button reload.DisplayStyle = ToolStripItemDisplayStyle.Text; reload.Name = "reload"; reload.Size = new Size(50, 22); reload.Text = "reload"; reload.Click += Reload_Click; //EMERGENCYSTOP button EMERGENCYSTOP.DisplayStyle = ToolStripItemDisplayStyle.Text; EMERGENCYSTOP.Name = "EMERGENCYSTOP"; EMERGENCYSTOP.Size = new Size(100, 22); EMERGENCYSTOP.Text = "EMERGENCY STOP"; EMERGENCYSTOP.Click += EMERGENCYSTOP_Click; //toolstrip toolStrip.Location = new Point(0, 0); toolStrip.Name = "toolStrip"; toolStrip.RenderMode = ToolStripRenderMode.Professional; toolStrip.Size = new Size(300, 25); toolStrip.TabIndex = 0; tss[0] = new ToolStripSeparator { Size = new Size(1, 15) }; tss[1] = new ToolStripSeparator { Size = new Size(1, 15) }; tss[2] = new ToolStripSeparator { Size = new Size(1, 15) }; tss[3] = new ToolStripSeparator { Size = new Size(1, 15) }; tss[4] = new ToolStripSeparator { Size = new Size(1, 15) }; toolStrip.Items.AddRange(new ToolStripItem[] { newTab, tss[0], prev, tss[1], next, tss[2], reload, tss[3], EMERGENCYSTOP, tss[4], about }); toolStrip.GripStyle = ToolStripGripStyle.Hidden; //ThunderBrowserUI's KLUI AutoScaleDimensions = new SizeF(6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = Size; Controls.Add(toolStrip); Controls.Add(URLbar); Controls.Add(webBrowser); Name = "ThunderBrowserUI"; SizeGripStyle = SizeGripStyle.Show; Text = "ThunderBrowser: an extremely lightweight, simple and high-performance but quite restricted browser made by Jessie Lesbian all by herself."; WindowState = FormWindowState.Maximized; SizeChanged += Form1_SizeChanged; FormClosed += Form1_FormClosed; //DONE toolStrip.ResumeLayout(false); toolStrip.PerformLayout(); ResumeLayout(false); PerformLayout(); }
private void InitializeUserReport() { //create a toolbar and user Report types userReportMenu = new ToolStrip(); userReportMenu.SuspendLayout(); SuspendLayout(); userReportMenu.Location = new Point(0, 62);//toolStrip.Location.Y + toolStrip.Size.Height); // new System.Drawing.Point(0, 61); userReportMenu.Size = new Size(1016, 29); userReportMenu.Name = "userReportMenu"; userReportMenu.TabIndex = 2; userReportMenu.Text = "userReportMenu"; userReportMenu.GripStyle = ToolStripGripStyle.Hidden; ToolStripButton tempToolStripButton; int separatorCounter = mUserReports.ReportTypes.Count; //add all user types toolstripbuttons foreach (KeyValuePair <int, UserReportType> userType in mUserReports.ReportTypes) { tempToolStripButton = new ToolStripButton { DisplayStyle = ToolStripItemDisplayStyle.Text, Font = new Font("Trebuchet MS", 12F, FontStyle.Bold, GraphicsUnit.Point, 0), ImageTransparentColor = Color.ForestGreen, Name = "button1", Text = userType.Value.UserReportTypeName, Tag = userType.Value.UserReportTypeID }; tempToolStripButton.Click += TempToolStripButtonClick; userReportMenu.Items.Add(tempToolStripButton); separatorCounter--; if (separatorCounter > 0) { ToolStripSeparator tempSeparator = new ToolStripSeparator(); userReportMenu.Items.Add(tempSeparator); } } //reorder it as backword Control[] myControls = new Control[Controls.Count]; int iCounter = 0, controlCount = Controls.Count; for (int iControl = 0; iControl < controlCount; iControl++) { if (Controls[0].Name != "userReportMenu") //we only add this once { myControls[iCounter++] = Controls[0]; } Controls.RemoveAt(0); } Controls.Add(userReportMenu); //add it back for (int iControl = 0; iControl < myControls.Length; iControl++) { Controls.Add(myControls[iControl]); } userReportMenu.ResumeLayout(false); userReportMenu.PerformLayout(); ResumeLayout(true); PerformLayout(); }
private void InitializeComponent() { splitContainer1 = new SplitContainer(); pictureBox1 = new PictureBox(); splitContainer2 = new SplitContainer(); toolStrip1 = new ToolStrip(); toolStripLabel1 = new ToolStripLabel(); toolStrip2 = new ToolStrip(); toolStripLabel2 = new ToolStripLabel(); dataGridView1 = new DataGridView(); dataGridView2 = new DataGridView(); Column1 = new DataGridViewTextBoxColumn(); Column2 = new DataGridViewTextBoxColumn(); Column3 = new DataGridViewTextBoxColumn(); Column4 = new DataGridViewTextBoxColumn(); dataGridViewTextBoxColumn1 = new DataGridViewTextBoxColumn(); dataGridViewTextBoxColumn2 = new DataGridViewTextBoxColumn(); dataGridViewTextBoxColumn3 = new DataGridViewTextBoxColumn(); dataGridViewTextBoxColumn4 = new DataGridViewTextBoxColumn(); ((ISupportInitialize)splitContainer1).BeginInit(); splitContainer1.Panel1.SuspendLayout(); splitContainer1.Panel2.SuspendLayout(); splitContainer1.SuspendLayout(); ((ISupportInitialize)pictureBox1).BeginInit(); ((ISupportInitialize)splitContainer2).BeginInit(); splitContainer2.Panel1.SuspendLayout(); splitContainer2.Panel2.SuspendLayout(); splitContainer2.SuspendLayout(); toolStrip1.SuspendLayout(); toolStrip2.SuspendLayout(); ((ISupportInitialize)dataGridView1).BeginInit(); ((ISupportInitialize)dataGridView2).BeginInit(); SuspendLayout(); splitContainer1.Dock = DockStyle.Fill; splitContainer1.Location = new Point(0, 0); splitContainer1.Name = "splitContainer1"; splitContainer1.Panel1.Controls.Add(pictureBox1); splitContainer1.Panel2.Controls.Add(splitContainer2); splitContainer1.Size = new Size(1387, 712); splitContainer1.SplitterDistance = 930; splitContainer1.TabIndex = 0; pictureBox1.BorderStyle = BorderStyle.FixedSingle; pictureBox1.Dock = DockStyle.Fill; pictureBox1.Location = new Point(0, 0); pictureBox1.Name = "pictureBox1"; pictureBox1.Size = new Size(930, 712); pictureBox1.SizeMode = PictureBoxSizeMode.Zoom; pictureBox1.TabIndex = 0; pictureBox1.TabStop = false; splitContainer2.Dock = DockStyle.Fill; splitContainer2.Location = new Point(0, 0); splitContainer2.Name = "splitContainer2"; splitContainer2.Orientation = Orientation.Horizontal; splitContainer2.Panel1.Controls.Add(dataGridView1); splitContainer2.Panel1.Controls.Add(toolStrip1); splitContainer2.Panel2.Controls.Add(dataGridView2); splitContainer2.Panel2.Controls.Add(toolStrip2); splitContainer2.Size = new Size(453, 712); splitContainer2.SplitterDistance = 371; splitContainer2.TabIndex = 0; toolStrip1.Items.AddRange(new ToolStripItem[1] { toolStripLabel1 }); toolStrip1.Location = new Point(0, 0); toolStrip1.Name = "toolStrip1"; toolStrip1.Size = new Size(453, 25); toolStrip1.TabIndex = 0; toolStrip1.Text = "toolStrip1"; toolStripLabel1.Name = "toolStripLabel1"; toolStripLabel1.Size = new Size(80, 22); toolStripLabel1.Text = "设备行驶记录"; toolStrip2.Items.AddRange(new ToolStripItem[1] { toolStripLabel2 }); toolStrip2.Location = new Point(0, 0); toolStrip2.Name = "toolStrip2"; toolStrip2.Size = new Size(453, 25); toolStrip2.TabIndex = 1; toolStrip2.Text = "toolStrip2"; toolStripLabel2.Name = "toolStripLabel2"; toolStripLabel2.Size = new Size(80, 22); toolStripLabel2.Text = "设备停止记录"; dataGridView1.AllowUserToAddRows = false; dataGridView1.AllowUserToDeleteRows = false; dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridView1.Columns.AddRange(Column1, Column2, Column3, Column4); dataGridView1.Dock = DockStyle.Fill; dataGridView1.Location = new Point(0, 25); dataGridView1.MultiSelect = false; dataGridView1.Name = "dataGridView1"; dataGridView1.ReadOnly = true; dataGridView1.RowHeadersVisible = false; dataGridView1.RowTemplate.Height = 23; dataGridView1.Size = new Size(453, 346); dataGridView1.TabIndex = 1; dataGridView2.AllowUserToAddRows = false; dataGridView2.AllowUserToDeleteRows = false; dataGridView2.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridView2.Columns.AddRange(dataGridViewTextBoxColumn1, dataGridViewTextBoxColumn2, dataGridViewTextBoxColumn3, dataGridViewTextBoxColumn4); dataGridView2.Dock = DockStyle.Fill; dataGridView2.Location = new Point(0, 25); dataGridView2.MultiSelect = false; dataGridView2.Name = "dataGridView2"; dataGridView2.ReadOnly = true; dataGridView2.RowHeadersVisible = false; dataGridView2.RowTemplate.Height = 23; dataGridView2.Size = new Size(453, 312); dataGridView2.TabIndex = 2; Column1.FillWeight = 20f; Column1.HeaderText = "ID"; Column1.Name = "Column1"; Column1.ReadOnly = true; Column2.HeaderText = "StartTime"; Column2.Name = "Column2"; Column2.ReadOnly = true; Column3.HeaderText = "EndTime"; Column3.Name = "Column3"; Column3.ReadOnly = true; Column4.HeaderText = "Distance"; Column4.Name = "Column4"; Column4.ReadOnly = true; dataGridViewTextBoxColumn1.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dataGridViewTextBoxColumn1.FillWeight = 20f; dataGridViewTextBoxColumn1.HeaderText = "ID"; dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; dataGridViewTextBoxColumn1.ReadOnly = true; dataGridViewTextBoxColumn1.Width = 42; dataGridViewTextBoxColumn2.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dataGridViewTextBoxColumn2.HeaderText = "StartTime"; dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; dataGridViewTextBoxColumn2.ReadOnly = true; dataGridViewTextBoxColumn2.Width = 84; dataGridViewTextBoxColumn3.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dataGridViewTextBoxColumn3.HeaderText = "EndTime"; dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3"; dataGridViewTextBoxColumn3.ReadOnly = true; dataGridViewTextBoxColumn3.Width = 72; dataGridViewTextBoxColumn4.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dataGridViewTextBoxColumn4.FillWeight = 180f; dataGridViewTextBoxColumn4.HeaderText = "Address"; dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4"; dataGridViewTextBoxColumn4.ReadOnly = true; dataGridViewTextBoxColumn4.Width = 72; base.AutoScaleDimensions = new SizeF(6f, 12f); base.AutoScaleMode = AutoScaleMode.Font; base.ClientSize = new Size(1387, 712); base.Controls.Add(splitContainer1); base.FormBorderStyle = FormBorderStyle.FixedSingle; base.Name = "Form2"; Text = "Form2"; splitContainer1.Panel1.ResumeLayout(false); splitContainer1.Panel2.ResumeLayout(false); ((ISupportInitialize)splitContainer1).EndInit(); splitContainer1.ResumeLayout(false); ((ISupportInitialize)pictureBox1).EndInit(); splitContainer2.Panel1.ResumeLayout(false); splitContainer2.Panel1.PerformLayout(); splitContainer2.Panel2.ResumeLayout(false); splitContainer2.Panel2.PerformLayout(); ((ISupportInitialize)splitContainer2).EndInit(); splitContainer2.ResumeLayout(false); toolStrip1.ResumeLayout(false); toolStrip1.PerformLayout(); toolStrip2.ResumeLayout(false); toolStrip2.PerformLayout(); ((ISupportInitialize)dataGridView1).EndInit(); ((ISupportInitialize)dataGridView2).EndInit(); ResumeLayout(false); }
private void InitializeComponent() { this.nextBtn = new ToolStripButton(); this.prevBtn = new ToolStripButton(); this.helpBtn = new ToolStripButton(); this.sourceText = new RichTextBox(); this.commentText = new Label(); this.topPanel = new Panel(); toolStrip = new ToolStrip(); toolStrip.SuspendLayout(); this.SuspendLayout(); toolStrip.Items.AddRange(new ToolStripItem[] { this.helpBtn, this.prevBtn, this.nextBtn }); toolStrip.Anchor = System.Windows.Forms.AnchorStyles.Right; toolStrip.BackColor = System.Drawing.SystemColors.Info; toolStrip.Dock = System.Windows.Forms.DockStyle.None; toolStrip.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Flow; toolStrip.Location = new System.Drawing.Point(501, 9); toolStrip.Size = new System.Drawing.Size(70, 23); toolStrip.Location = new System.Drawing.Point(0, 0); toolStrip.Name = "toolStrip1"; toolStrip.TabIndex = 1; toolStrip.Text = "toolStrip1"; // // startCollectingDataBtn // this.helpBtn.DisplayStyle = ToolStripItemDisplayStyle.Image; this.helpBtn.Image = MSFast.GUI.Engine.Resources.Resources.help; this.helpBtn.ImageTransparentColor = System.Drawing.Color.Magenta; this.helpBtn.Name = "helpBtn"; this.helpBtn.Size = new System.Drawing.Size(23, 22); this.helpBtn.Text = "More Details"; this.helpBtn.Alignment = ToolStripItemAlignment.Left; // // startCollectingDataBtn // this.nextBtn.DisplayStyle = ToolStripItemDisplayStyle.Image; this.nextBtn.Image = MSFast.GUI.Engine.Resources.Resources.next; this.nextBtn.ImageTransparentColor = System.Drawing.Color.Magenta; this.nextBtn.Name = "nextBtn"; this.nextBtn.Size = new System.Drawing.Size(23, 22); this.nextBtn.Text = "Next Occurance"; this.nextBtn.Alignment = ToolStripItemAlignment.Left; // // startCollectingDataBtn // this.prevBtn.DisplayStyle = ToolStripItemDisplayStyle.Image; this.prevBtn.Image = MSFast.GUI.Engine.Resources.Resources.prev; this.prevBtn.ImageTransparentColor = System.Drawing.Color.Magenta; this.prevBtn.Name = "prevBtn"; this.prevBtn.Size = new System.Drawing.Size(23, 22); this.prevBtn.Text = "Previous Occurance"; this.prevBtn.Alignment = ToolStripItemAlignment.Left; // // startCollectingDataBtn // this.commentText.Name = "commentText"; this.commentText.Text = ""; this.commentText.Visible = false; this.commentText.Height = 58; this.commentText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.commentText.BackColor = System.Drawing.SystemColors.Info; this.commentText.Padding = new Padding(5, 5, 5, 5); // // sourceText // this.sourceText.Location = new System.Drawing.Point(66, 92); this.sourceText.Name = "sourceText"; this.sourceText.Size = new System.Drawing.Size(100, 96); this.sourceText.TabIndex = 1; this.sourceText.Text = ""; this.sourceText.ReadOnly = true; this.sourceText.BackColor = Color.White; this.sourceText.WordWrap = false; this.topPanel.BackColor = System.Drawing.SystemColors.Info; this.topPanel.Visible = true; this.topPanel.SuspendLayout(); this.topPanel.Size = new System.Drawing.Size(479, 50); this.topPanel.Controls.Add(this.commentText); this.topPanel.Controls.Add(this.toolStrip); this.Controls.Add(this.sourceText); this.Controls.Add(this.topPanel); topPanel.ResumeLayout(false); topPanel.PerformLayout(); toolStrip.ResumeLayout(false); toolStrip.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); this.nextBtn.Click += new EventHandler(nextBtn_Click); this.prevBtn.Click += new EventHandler(prevBtn_Click); this.helpBtn.Click += new EventHandler(helpBtn_Click); }
/// <summary> /// returns true if it made any changes. /// </summary> private void FillToolbar(ChoiceGroup choiceGroup, ToolStrip toolStrip) { bool wantsSeparatorBefore = false; choiceGroup.PopulateNow(); if (!DoesToolStripNeedRegenerating(choiceGroup, toolStrip)) { return; } // Don't let the GC run dispose. for (int i = toolStrip.Items.Count - 1; i >= 0; --i) { toolStrip.Items[i].Dispose(); } toolStrip.Items.Clear(); foreach (ChoiceRelatedClass item in choiceGroup) { if (item is SeparatorChoice) { wantsSeparatorBefore = true; } else if (item is ChoiceBase) { UIItemDisplayProperties displayProperties = item.GetDisplayProperties(); bool reallyVisible; ToolStripItem toolStripItem = CreateButtonItem(item as ChoiceBase, out reallyVisible); //toolStripItem.ToolTipText = item.Label; // TODO-Linux: add shortcut accessolrator here. // choiceBase.Shortcut. //maybe this should be done by CreateButtonItem? toolStripItem.DisplayStyle = ToolStripItemDisplayStyle.Image; if (wantsSeparatorBefore && displayProperties != null && displayProperties.Visible) { var separator = new ToolStripSeparator(); separator.AccessibilityObject.Name = "separator"; // separator.GetType().Name; toolStrip.Items.Add(separator); } wantsSeparatorBefore = false; toolStrip.Items.Add(toolStripItem); } else if (item is ChoiceGroup) { ToolStripComboBox toolStripItem = CreateComboBox(item as ChoiceGroup, true); toolStrip.Items.Add(toolStripItem); } else { //debugging continue; } } toolStrip.PerformLayout(); return; }