public MainForm () { components = new Container (); ComponentResourceManager resources = new ComponentResourceManager (typeof (MainForm)); menuStrip = new MenuStrip (); fileMenu = new ToolStripMenuItem (); openToolStripMenuItem = new ToolStripMenuItem (); reopenToolStripMenuItem = new ToolStripMenuItem (); closeToolStripMenuItem = new ToolStripMenuItem (); snipperToolStripMenuItem = new ToolStripMenuItem (); toolStripSeparator4 = new ToolStripSeparator (); exitToolStripMenuItem = new ToolStripMenuItem (); copyToolStripMenuItem = new ToolStripMenuItem (); viewMenu = new ToolStripMenuItem (); editMenu = new ToolStripMenuItem (); toolBarToolStripMenuItem = new ToolStripMenuItem (); statusBarToolStripMenuItem = new ToolStripMenuItem (); sourceViewToolStripMenuItem = new ToolStripMenuItem (); timeZoneToolStripMenuItem = new ToolStripMenuItem (); timeZoneMyLocalToolStripMenuItem = new ToolStripMenuItem (); timeZoneLogLocalToolStripMenuItem = new ToolStripMenuItem (); timeZoneUniversalToolStripMenuItem = new ToolStripMenuItem (); timeZoneCycleToolStripMenuItem = new ToolStripMenuItem (); toolsMenu = new ToolStripMenuItem (); optionsToolStripMenuItem = new ToolStripMenuItem (); traceConfigToolStripMenuItem = new ToolStripMenuItem (); windowsMenu = new ToolStripMenuItem (); cascadeToolStripMenuItem = new ToolStripMenuItem (); tileVerticalToolStripMenuItem = new ToolStripMenuItem (); tileHorizontalToolStripMenuItem = new ToolStripMenuItem (); closeAllToolStripMenuItem = new ToolStripMenuItem (); arrangeIconsToolStripMenuItem = new ToolStripMenuItem (); helpMenu = new ToolStripMenuItem (); contentsToolStripMenuItem = new ToolStripMenuItem (); indexToolStripMenuItem = new ToolStripMenuItem (); searchToolStripMenuItem = new ToolStripMenuItem (); toolStripSeparator8 = new ToolStripSeparator (); aboutToolStripMenuItem = new ToolStripMenuItem (); toolStrip = new ToolStrip (); newToolStripButton = new ToolStripButton (); openToolStripButton = new ToolStripButton (); saveToolStripButton = new ToolStripButton (); toolStripSeparator1 = new ToolStripSeparator (); printToolStripButton = new ToolStripButton (); printPreviewToolStripButton = new ToolStripButton (); helpToolStripButton = new ToolStripButton (); statusStrip = new StatusStrip (); toolStripStatusLabel = new ToolStripStatusLabel (); menuStrip.SuspendLayout (); toolStrip.SuspendLayout (); statusStrip.SuspendLayout (); SuspendLayout (); // // menuStrip // menuStrip.Items.AddRange (new ToolStripItem [] { fileMenu, editMenu, viewMenu, toolsMenu, windowsMenu, helpMenu}); menuStrip.Location = new Point (0, 0); menuStrip.MdiWindowListItem = windowsMenu; menuStrip.Size = new Size (632, 24); menuStrip.TabIndex = 0; menuStrip.Text = "MenuStrip"; // // fileMenu // fileMenu.DropDownItems.AddRange (new ToolStripItem [] { openToolStripMenuItem, reopenToolStripMenuItem, closeToolStripMenuItem, snipperToolStripMenuItem, toolStripSeparator4, exitToolStripMenuItem}); fileMenu.ImageTransparentColor = SystemColors.ActiveBorder; fileMenu.Size = new Size (35, 20); fileMenu.MergeAction = MergeAction.Append; fileMenu.MergeIndex = 1; fileMenu.Text = "&File"; // // openToolStripMenuItem // openToolStripMenuItem.Image = ((Image) (resources.GetObject ("openToolStripMenuItem.Image"))); openToolStripMenuItem.ImageTransparentColor = Color.Black; openToolStripMenuItem.ShortcutKeys = ((Keys) ((Keys.Control | Keys.O))); openToolStripMenuItem.Size = new Size (151, 22); openToolStripMenuItem.Text = "&Open"; openToolStripMenuItem.Click += new System.EventHandler (OpenFile); openToolStripMenuItem.MergeAction = MergeAction.Append; openToolStripMenuItem.MergeIndex = 2; // // reopenToolStripMenuItem // reopenToolStripMenuItem.Image = ((Image) (resources.GetObject ("openToolStripMenuItem.Image"))); reopenToolStripMenuItem.ImageTransparentColor = Color.Black; reopenToolStripMenuItem.Size = new Size (151, 22); reopenToolStripMenuItem.Text = "&Reopen"; reopenToolStripMenuItem.MergeAction = MergeAction.Append; reopenToolStripMenuItem.MergeIndex = 3; // // closeToolStripMenuItem // //is.closeToolStripMenuItem.Image = ((Image)(resources.GetObject("saveToolStripMenuItem.Image"))); closeToolStripMenuItem.ImageTransparentColor = Color.Black; //is.closeToolStripMenuItem.ShortcutKeys = ((Keys)((Keys.Control | Keys.S))); closeToolStripMenuItem.Size = new Size (151, 22); closeToolStripMenuItem.Text = "&Close"; closeToolStripMenuItem.MergeAction = MergeAction.Append; closeToolStripMenuItem.MergeIndex = 5; // // snipperToolStripMenuItem // snipperToolStripMenuItem.Size = new Size (151, 22); snipperToolStripMenuItem.Text = "Snip/Merge Log File(s)..."; snipperToolStripMenuItem.MergeAction = MergeAction.Append; snipperToolStripMenuItem.MergeIndex = 6; // // toolStripSeparator4 // toolStripSeparator4.Size = new Size (148, 6); toolStripSeparator4.MergeAction = MergeAction.Append; toolStripSeparator4.MergeIndex = 7; // // exitToolStripMenuItem // exitToolStripMenuItem.Size = new Size (151, 22); exitToolStripMenuItem.Text = "E&xit"; exitToolStripMenuItem.Click += new System.EventHandler (ExitToolsStripMenuItem_Click); exitToolStripMenuItem.MergeAction = MergeAction.Append; exitToolStripMenuItem.MergeIndex = 11; // // editMenu // editMenu.DropDownItems.Add (copyToolStripMenuItem); editMenu.Size = new Size (41, 20); editMenu.Text = "&Edit"; editMenu.MergeAction = MergeAction.Append; // // copyToolStripMenuItem // copyToolStripMenuItem.MergeAction = MergeAction.Append; copyToolStripMenuItem.MergeIndex = 1; copyToolStripMenuItem.Size = new Size (190, 22); copyToolStripMenuItem.Text = "Copy"; copyToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+C"; copyToolStripMenuItem.ShowShortcutKeys = true; copyToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.C; // // viewMenu // viewMenu.DropDownItems.AddRange (new ToolStripItem [] { toolBarToolStripMenuItem, statusBarToolStripMenuItem, sourceViewToolStripMenuItem, timeZoneToolStripMenuItem}); viewMenu.Size = new Size (41, 20); viewMenu.Text = "&View"; viewMenu.MergeAction = MergeAction.Append; // // toolBarToolStripMenuItem // toolBarToolStripMenuItem.Checked = true; toolBarToolStripMenuItem.CheckOnClick = true; toolBarToolStripMenuItem.CheckState = CheckState.Checked; toolBarToolStripMenuItem.Size = new Size (135, 22); toolBarToolStripMenuItem.Text = "&Toolbar"; toolBarToolStripMenuItem.Click += new System.EventHandler (ToolBarToolStripMenuItem_Click); toolBarToolStripMenuItem.MergeAction = MergeAction.Append; toolBarToolStripMenuItem.MergeIndex = 68; // // statusBarToolStripMenuItem // statusBarToolStripMenuItem.Checked = true; statusBarToolStripMenuItem.CheckOnClick = true; statusBarToolStripMenuItem.CheckState = CheckState.Checked; statusBarToolStripMenuItem.Size = new Size (135, 22); statusBarToolStripMenuItem.Text = "&Status Bar"; statusBarToolStripMenuItem.Click += new System.EventHandler (StatusBarToolStripMenuItem_Click); statusBarToolStripMenuItem.MergeAction = MergeAction.Append; statusBarToolStripMenuItem.MergeIndex = 99; // // sourceViewToolStripMenuItem // sourceViewToolStripMenuItem.Checked = true; sourceViewToolStripMenuItem.CheckOnClick = true; sourceViewToolStripMenuItem.CheckState = CheckState.Checked; sourceViewToolStripMenuItem.Size = new Size (135, 22); sourceViewToolStripMenuItem.Text = "Source &View"; sourceViewToolStripMenuItem.MergeAction = MergeAction.Append; sourceViewToolStripMenuItem.MergeIndex = 100; // // timeZoneToolStripMenuItem // timeZoneToolStripMenuItem.DropDownItems.AddRange (new ToolStripItem [] { timeZoneMyLocalToolStripMenuItem, timeZoneLogLocalToolStripMenuItem, timeZoneUniversalToolStripMenuItem, timeZoneCycleToolStripMenuItem}); timeZoneToolStripMenuItem.Size = new Size (41, 20); timeZoneToolStripMenuItem.Text = "Time Zone Setting"; timeZoneToolStripMenuItem.MergeAction = MergeAction.Append; timeZoneToolStripMenuItem.MergeIndex = 10; // // timeZoneMyLocalToolStripMenuItem // timeZoneMyLocalToolStripMenuItem.Size = new Size (135, 22); timeZoneMyLocalToolStripMenuItem.Text = "My &Local Time Zone"; timeZoneMyLocalToolStripMenuItem.MergeAction = MergeAction.Append; timeZoneMyLocalToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Shift+T"; timeZoneMyLocalToolStripMenuItem.ShowShortcutKeys = true; timeZoneMyLocalToolStripMenuItem.ShortcutKeys = Keys.None; // // timeZoneLogLocalToolStripMenuItem // timeZoneLogLocalToolStripMenuItem.Size = new Size (135, 22); timeZoneLogLocalToolStripMenuItem.Text = "Log &Creator's Time Zone"; timeZoneLogLocalToolStripMenuItem.MergeAction = MergeAction.Append; timeZoneLogLocalToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Shift+T"; timeZoneLogLocalToolStripMenuItem.ShowShortcutKeys = true; timeZoneLogLocalToolStripMenuItem.ShortcutKeys = Keys.None; // // timeZoneUniversalToolStripMenuItem // timeZoneUniversalToolStripMenuItem.Size = new Size (135, 22); timeZoneUniversalToolStripMenuItem.Text = "&Universal Coordinated Time"; timeZoneUniversalToolStripMenuItem.MergeAction = MergeAction.Append; timeZoneUniversalToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Shift+T"; timeZoneUniversalToolStripMenuItem.ShowShortcutKeys = true; timeZoneUniversalToolStripMenuItem.ShortcutKeys = Keys.None; // // timeZoneCycleToolStripMenuItem // timeZoneCycleToolStripMenuItem.Size = new Size (135, 22); timeZoneCycleToolStripMenuItem.Text = "Cycle Time Zones"; timeZoneCycleToolStripMenuItem.MergeAction = MergeAction.Append; timeZoneCycleToolStripMenuItem.Visible = false; timeZoneCycleToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Shift+T"; timeZoneCycleToolStripMenuItem.ShowShortcutKeys = true; timeZoneCycleToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.Shift | Keys.T; // // toolsMenu // toolsMenu.DropDownItems.AddRange (new ToolStripItem [] { optionsToolStripMenuItem, traceConfigToolStripMenuItem}); toolsMenu.Size = new Size (44, 20); toolsMenu.Text = "&Tools"; // // optionsToolStripMenuItem // optionsToolStripMenuItem.Size = new Size (122, 22); optionsToolStripMenuItem.Text = "&Options..."; // // traceConfigToolStripMenuItem // traceConfigToolStripMenuItem.Size = new Size (122, 22); traceConfigToolStripMenuItem.Text = "Launch Trace&Config"; // // windowsMenu // windowsMenu.DropDownItems.AddRange (new ToolStripItem [] { cascadeToolStripMenuItem, tileVerticalToolStripMenuItem, tileHorizontalToolStripMenuItem, closeAllToolStripMenuItem, arrangeIconsToolStripMenuItem}); windowsMenu.Size = new Size (62, 20); windowsMenu.Text = "&Windows"; // // cascadeToolStripMenuItem // cascadeToolStripMenuItem.Size = new Size (153, 22); cascadeToolStripMenuItem.Text = "&Cascade"; cascadeToolStripMenuItem.Click += new System.EventHandler (CascadeToolStripMenuItem_Click); // // tileVerticalToolStripMenuItem // tileVerticalToolStripMenuItem.Size = new Size (153, 22); tileVerticalToolStripMenuItem.Text = "Tile &Vertical"; // // tileHorizontalToolStripMenuItem // tileHorizontalToolStripMenuItem.Size = new Size (153, 22); tileHorizontalToolStripMenuItem.Text = "Tile &Horizontal"; tileHorizontalToolStripMenuItem.Click += new System.EventHandler (TileHorizontalToolStripMenuItem_Click); // // closeAllToolStripMenuItem // closeAllToolStripMenuItem.Size = new Size (153, 22); closeAllToolStripMenuItem.Text = "C&lose All"; closeAllToolStripMenuItem.Click += new System.EventHandler (CloseAllToolStripMenuItem_Click); // // arrangeIconsToolStripMenuItem // arrangeIconsToolStripMenuItem.Size = new Size (153, 22); arrangeIconsToolStripMenuItem.Text = "&Arrange Icons"; arrangeIconsToolStripMenuItem.Click += new System.EventHandler (ArrangeIconsToolStripMenuItem_Click); // // helpMenu // helpMenu.DropDownItems.AddRange (new ToolStripItem [] { contentsToolStripMenuItem, indexToolStripMenuItem, searchToolStripMenuItem, toolStripSeparator8, aboutToolStripMenuItem}); helpMenu.Size = new Size (40, 20); helpMenu.Text = "&Help"; // // contentsToolStripMenuItem // contentsToolStripMenuItem.ShortcutKeys = ((Keys) ((Keys.Control | Keys.F1))); contentsToolStripMenuItem.Size = new Size (173, 22); contentsToolStripMenuItem.Text = "&Contents"; // // indexToolStripMenuItem // indexToolStripMenuItem.Image = ((Image) (resources.GetObject ("indexToolStripMenuItem.Image"))); indexToolStripMenuItem.ImageTransparentColor = Color.Black; indexToolStripMenuItem.Size = new Size (173, 22); indexToolStripMenuItem.Text = "&Index"; // // searchToolStripMenuItem // searchToolStripMenuItem.Image = ((Image) (resources.GetObject ("searchToolStripMenuItem.Image"))); searchToolStripMenuItem.ImageTransparentColor = Color.Black; searchToolStripMenuItem.Size = new Size (173, 22); searchToolStripMenuItem.Text = "&Search"; // // toolStripSeparator8 // toolStripSeparator8.Size = new Size (170, 6); // // aboutToolStripMenuItem // aboutToolStripMenuItem.Size = new Size (173, 22); aboutToolStripMenuItem.Text = "&About ..."; // // toolStrip // toolStrip.Items.AddRange (new ToolStripItem [] { newToolStripButton, openToolStripButton, saveToolStripButton, toolStripSeparator1, printToolStripButton, printPreviewToolStripButton, helpToolStripButton}); toolStrip.Location = new Point (0, 24); toolStrip.Size = new Size (632, 25); toolStrip.TabIndex = 1; toolStrip.Text = "ToolStrip"; // // newToolStripButton // newToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; newToolStripButton.Image = ((Image) (resources.GetObject ("newToolStripButton.Image"))); newToolStripButton.ImageTransparentColor = Color.Black; newToolStripButton.Text = "New"; newToolStripButton.Click += new System.EventHandler (ShowNewForm); // // openToolStripButton // openToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; openToolStripButton.Image = ((Image) (resources.GetObject ("openToolStripButton.Image"))); openToolStripButton.ImageTransparentColor = Color.Black; openToolStripButton.Text = "Open"; openToolStripButton.Click += new System.EventHandler (OpenFile); // // saveToolStripButton // saveToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; saveToolStripButton.Image = ((Image) (resources.GetObject ("saveToolStripButton.Image"))); saveToolStripButton.ImageTransparentColor = Color.Black; saveToolStripButton.Text = "Save"; // // toolStripSeparator1 // // // printToolStripButton // printToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; printToolStripButton.Image = ((Image) (resources.GetObject ("printToolStripButton.Image"))); printToolStripButton.ImageTransparentColor = Color.Black; printToolStripButton.Text = "Print"; // // printPreviewToolStripButton // printPreviewToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; printPreviewToolStripButton.Image = ((Image) (resources.GetObject ("printPreviewToolStripButton.Image"))); printPreviewToolStripButton.ImageTransparentColor = Color.Black; printPreviewToolStripButton.Text = "Print Preview"; // // helpToolStripButton // helpToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; helpToolStripButton.Image = ((Image) (resources.GetObject ("helpToolStripButton.Image"))); helpToolStripButton.ImageTransparentColor = Color.Black; helpToolStripButton.Text = "Help"; // // statusStrip // statusStrip.Items.Add (toolStripStatusLabel); statusStrip.LayoutStyle = ToolStripLayoutStyle.Table; statusStrip.Location = new Point (0, 433); statusStrip.Size = new Size (632, 20); statusStrip.TabIndex = 2; statusStrip.Text = "StatusStrip"; // // toolStripStatusLabel // toolStripStatusLabel.Text = "Status"; // // MainForm // AutoScaleDimensions = new SizeF (6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size (400, 300); Controls.Add (statusStrip); Controls.Add (toolStrip); Controls.Add (menuStrip); IsMdiContainer = true; Location = new Point (200, 100); MainMenuStrip = menuStrip; StartPosition = FormStartPosition.Manual; Text = "bug #81477"; menuStrip.ResumeLayout (false); toolStrip.ResumeLayout (false); statusStrip.ResumeLayout (false); ResumeLayout (false); PerformLayout (); Load += new EventHandler (MainForm_Load); }
public MainForm () { // // _statusStrip // _statusStrip = new StatusStrip (); Controls.Add (_statusStrip); // // _progressBar // _progressBar = new ToolStripProgressBar (); _statusStrip.Items.Add (_progressBar); // // _statusLabel // _statusLabel = new ToolStripStatusLabel ("Begin"); _statusStrip.Items.Add (_statusLabel); // // _startButton // _startButton = new ToolStripButton (); _startButton.Text = "Start"; _startButton.Click += new EventHandler (StartButton_Click); _statusStrip.Items.Insert (0, _startButton); // // MainForm // ClientSize = new Size (300, 60); Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #82481"; Load += new EventHandler (MainForm_Load); }
public void addSubeditorButton(FormMain formMain) { this.formMain = formMain; var rm = new ResourceManager("PluginChrView.Icon", this.GetType().Assembly); var icon = (System.Drawing.Bitmap)rm.GetObject("icon_video"); var item = new ToolStripButton("View video", icon, btHex_Click); item.DisplayStyle = ToolStripItemDisplayStyle.Image; formMain.addSubeditorButton(item); }
public StatusStripExam() { this.Text = "StatusStrip 예제"; ImageList imglst = new ImageList(); imglst.TransparentColor = Color.Black; imglst.Images.Add("Color", new Bitmap(GetType(), "StatusStripExam.ColorHS.BMP")); imglst.Images.Add("Comment", new Bitmap(GetType(), "StatusStripExam.CommentHS.bmp")); StatusStrip status = new StatusStrip(); status.Parent = this; status.ImageList = imglst; color_btn = new ToolStripButton(); color_btn.Image = imglst.Images[0]; color_btn.Click += EventProc; status.Items.Add(color_btn); comment_btn = new ToolStripButton(); comment_btn.ImageKey = "Comment"; comment_btn.Click += EventProc; status.Items.Add(comment_btn); // 메뉴 구분선 넣기 ToolStripSeparator item_sep = new ToolStripSeparator(); status.Items.Add(item_sep); txt_box = new ToolStripComboBox(); txt_box.ToolTipText = "글꼴 선택"; txt_box.Text = "글꼴 선택"; txt_box.Items.Add("궁서체"); txt_box.Items.Add("돋움체"); txt_box.Items.Add("바탕체"); status.Items.Add(txt_box); label = new ToolStripLabel(); label.Size = new Size(100, 10); status.Items.Add(label); // 프로그래스바 설정 prog_bar = new ToolStripProgressBar(); prog_bar.Size = new Size(100, 10); prog_bar.Maximum = 100; prog_bar.Minimum = 0; status.Items.Add(prog_bar); Timer timer = new Timer(); timer.Tick += new EventHandler(TimerProc); timer.Interval = 1000; timer.Start(); }
public ToolStripExam() { this.Text = "ToolStrip 예제"; // 이미지리스트 초기화 ImageList imglst = new ImageList(); imglst.TransparentColor = Color.Black; imglst.Images.Add("Copy", new Bitmap(GetType(), "ToolStripExam.CopyHS.bmp")); imglst.Images.Add("CopyFolder", new Bitmap(GetType(), "ToolStripExam.CopyFolderHS.bmp")); imglst.Images.Add("Cut", new Bitmap(GetType(), "ToolStripExam.CutHS.bmp")); // 툴바 생성 ToolStrip tool = new ToolStrip(); tool.Parent = this; // 부모 tool.ImageList = imglst;// 이미지 리스트 설정 // 1. 툴바에 버튼 생성 copy_btn = new ToolStripButton(); copy_btn.ToolTipText = "복사"; copy_btn.Image = imglst.Images[0]; // 이미지 설정1 copy_btn.Click += EventProc; tool.Items.Add(copy_btn); // 2. 툴바에 버튼 생성 copyfolder_btn = new ToolStripButton(); copyfolder_btn.ToolTipText = "디렉토리 복사"; copyfolder_btn.ImageKey = "CopyFolder"; //이미지설정2 copyfolder_btn.Click += EventProc; tool.Items.Add(copyfolder_btn); // 3. 메뉴 구분선 넣기 ToolStripSeparator item_sep = new ToolStripSeparator(); tool.Items.Add(item_sep); // 4. 툴바에 버튼 생성 cut_btn = new ToolStripButton(); cut_btn.ToolTipText = "오려두기"; cut_btn.ImageIndex = 2; // 이미지설정3 cut_btn.Click += EventProc; tool.Items.Add(cut_btn); // 5. 툴바에 콤보박스 추가 txt_box = new ToolStripComboBox(); txt_box.ToolTipText = "글꼴 선택"; txt_box.Text = "글꼴 선택"; txt_box.Items.Add("궁서체"); txt_box.Items.Add("돋움체"); txt_box.Items.Add("바탕체"); txt_box.Click += FontDrawProc; tool.Items.Add(txt_box); }
public MainForm () { ComponentResourceManager resources = new ComponentResourceManager (typeof (MainForm)); SuspendLayout (); // // _toolStrip // _toolStrip = new ToolStrip (); _toolStrip.Location = new Point (0, 24); _toolStrip.Name = "_toolStrip"; _toolStrip.Size = new Size (632, 25); _toolStrip.TabIndex = 1; _toolStrip.Text = "ToolStrip"; Controls.Add (_toolStrip); // // _newButton // _newButton = new ToolStripButton (); _newButton.DisplayStyle = ToolStripItemDisplayStyle.Image; _newButton.Image = ((Image) (resources.GetObject ("_newButton.Image"))); _newButton.ImageTransparentColor = Color.Black; _newButton.Text = "New"; _toolStrip.Items.Add (_newButton); // // _openButton // _openButton = new ToolStripButton (); _openButton.DisplayStyle = ToolStripItemDisplayStyle.Image; _openButton.Image = ((Image) (resources.GetObject ("_openButton.Image"))); _openButton.ImageTransparentColor = Color.Black; _openButton.Text = "Open"; _openButton.Click += new System.EventHandler (OpenFile); _toolStrip.Items.Add (_openButton); // // MainForm // AutoScaleDimensions = new SizeF (6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size (300, 300); IsMdiContainer = true; Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #81568"; Load += new EventHandler (MainForm_Load); ResumeLayout (false); PerformLayout (); }
public frmBuilder(string src, string tsize, bool AutoExport, string OutputDir) { InitializeComponent(); Dictionary <string, TerrainTypeInfo> DefTerrain = new Dictionary <string, TerrainTypeInfo>(); int size = int.Parse(tsize); var yaml = MiniYaml.DictFromFile("OpenRA.TilesetBuilder/defaults.yaml"); DefTerrain = yaml["Terrain"].NodesDict.Values.Select(y => new TerrainTypeInfo(y)).ToDictionary(t => t.Type); int i = 0; surface1.icon = new Bitmap[DefTerrain.Keys.Count]; TerrainType = new TerrainTypeInfo[DefTerrain.Keys.Count]; surface1.Enabled = false; foreach (var deftype in DefTerrain) { Bitmap icon = new Bitmap(16, 16); int x, y; // Loop through the images pixels to reset color. for (x = 0; x < icon.Width; x++) { for (y = 0; y < icon.Height; y++) { Color newColor = deftype.Value.Color; icon.SetPixel(x, y, newColor); } } surface1.icon[i] = icon; TerrainType[i] = deftype.Value; ToolStripButton TerrainTypeButton = new ToolStripButton(deftype.Key, icon, TerrainTypeSelectorClicked); TerrainTypeButton.ToolTipText = deftype.Key; TerrainTypeButton.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText; TerrainTypeButton.Tag = i.ToString(); i++; tsTerrainTypes.Items.Add(TerrainTypeButton); } if (src.Length > 0) { srcfile = src; this.size = size; surface1.TileSize = size; surface1.Image = (Bitmap)Image.FromFile(src); surface1.Image.SetResolution(96, 96); // people keep being noobs about DPI, and GDI+ cares. surface1.TerrainTypes = new int[surface1.Image.Width / size, surface1.Image.Height / size]; /* all passable by default */ surface1.Templates = new List <Template>(); surface1.Size = surface1.Image.Size; surface1.Enabled = true; Load(); } else { CreateNewTileset(); } if (AutoExport) { Export(OutputDir); Application.Exit(); } }
private IEnumerable <ToolStripItem> GetRegexToolStripItems() { { var tsb = new ToolStripButton() { Name = "tblRegStartOrEnd", Text = "^", ToolTipText = ResxManager.GetResourceString(FormStringKeys.TIP_REGEX_START), //@"The match must start at the beginning of the string or line. Right click for $, The match must occur at the end of the string or before \n at the end of the line or string.", }; yield return(tsb); } { var tsb = new ToolStripButton() { Name = "tblRegDigit", Text = "\\d", ToolTipText = ResxManager.GetResourceString(FormStringKeys.TIP_REGEX_DIGIT), //@"Matches any decimal digit. Press Ctrl for \d+, Shift for \d*, Alt for \d?", }; yield return(tsb); } { var tsb = new ToolStripButton() { Name = "tblRegWord", Text = "\\w", ToolTipText = ResxManager.GetResourceString(FormStringKeys.TIP_REGEX_WORD), //@"Matches any word character. Press Ctrl for \w+, Shift for \w*, Alt for \w?", }; yield return(tsb); } { var tsb = new ToolStripButton() { Name = "tblRegSpace", Text = "\\s", ToolTipText = ResxManager.GetResourceString(FormStringKeys.TIP_REGEX_SPACE), //@"Matches any white-space character. Press Ctrl for \s+, Shift for \s*, Alt for \s?", }; yield return(tsb); } { var tsb = new ToolStripButton() { Name = "tblRegTab", Text = "\\t", ToolTipText = ResxManager.GetResourceString(FormStringKeys.TIP_REGEX_TAB), //"Match a tab. You can click it with Shift, Ctrl or Alt key.", }; yield return(tsb); } { var tsb = new ToolStripButton() { Name = "tblRegWildcard", Text = ".", ToolTipText = ResxManager.GetResourceString(FormStringKeys.TIP_REGEX_WILDCARD), //@"Wildcard: Matches any single character except \n. To match a literal period character (. or \u002E), you must precede it with the escape character (\.).", }; yield return(tsb); } { var tsb = new ToolStripButton() { Name = "tblRegReturn", Text = "NewLine(\\r\\n)", ToolTipText = ResxManager.GetResourceString(FormStringKeys.TIP_REGEX_RETURN), //"Match a new line. You can click it with Shift, Ctrl or Alt key.", }; yield return(tsb); } { var tsb = new ToolStripButton() { Name = "tblRegBorder", Text = "Border(\\b)", ToolTipText = ResxManager.GetResourceString(FormStringKeys.TIP_REGEX_BORDER), //"You can click it with Shift, Ctrl or Alt key.", }; yield return(tsb); } { var tsb = new ToolStripSeparator(); yield return(tsb); } { var tsb = new ToolStripButton() { Name = "tblRegMany", Text = "+", ToolTipText = ResxManager.GetResourceString(FormStringKeys.TIP_REGEX_MANY), //"Many (1 or more). Press ALT for +?", }; yield return(tsb); } { var tsb = new ToolStripButton() { Name = "tblRegAny", Text = "*", ToolTipText = ResxManager.GetResourceString(FormStringKeys.TIP_REGEX_ANY), //"Any (0 or more). Press ALT for *?", }; yield return(tsb); } { var tsb = new ToolStripButton() { Name = "tblRegOneOrNone", Text = "?", ToolTipText = ResxManager.GetResourceString(FormStringKeys.TIP_REGEX_NONE_OR_ONE), //"0 or 1", }; yield return(tsb); } { var tsb = new ToolStripButton() { Name = "tblRegMTimes", Text = "{m}", ToolTipText = ResxManager.GetResourceString(FormStringKeys.TIP_REGEX_M_TIMES), //"Matches the previous element exactly m times: {m}, or not more than n {m,n}.", }; yield return(tsb); } { var tsb = new ToolStripButton() { Name = "tblRegOr", Text = "|", ToolTipText = ResxManager.GetResourceString(FormStringKeys.TIP_REGEX_OR), //"Matches any one element separated by the vertical bar (|) character. For example: th(e|is|at) ", }; yield return(tsb); } { var tsb = new ToolStripSeparator(); yield return(tsb); } { var tsb = new ToolStripButton() { Name = "tblRegCharGroup", Text = "[]", ToolTipText = ResxManager.GetResourceString(FormStringKeys.TIP_REGEX_CHAR_GROUP), //"character group, right click to define any single character that is not in character_group. By default, characters in character_group are case-sensitive.", }; yield return(tsb); } { var tsb = new ToolStripButton() { Name = "tblRegGroup", Text = "()", ToolTipText = ResxManager.GetResourceString(FormStringKeys.TIP_REGEX_GROUP), //"group the selected text. Right click to define an uncapturing group.", }; yield return(tsb); } { var tsb = new ToolStripSeparator(); yield return(tsb); } { var tsb = new ToolStripButton() { Name = "tblRegDoc", Text = "Online Document", ToolTipText = ResxManager.GetResourceString(FormStringKeys.TIP_REGEX_ONELINE_DOC), //"Online Document about Regular Expressions", }; yield return(tsb); } }
private void InitializeComponent() { this.icontainer_0 = new Container(); this.toolStrip1 = new ToolStrip(); this.btnState = new ToolStripDropDownButton(); this.监听消息ToolStripMenuItem = new ToolStripMenuItem(); this.停止监听ToolStripMenuItem = new ToolStripMenuItem(); this.btnExport = new ToolStripDropDownButton(); this.btnExportText = new ToolStripMenuItem(); this.btnExportXml = new ToolStripMenuItem(); this.toolStripMenuItem1 = new ToolStripSeparator(); this.btnImportXml = new ToolStripMenuItem(); this.btnDelete = new ToolStripDropDownButton(); this.删除选定项ToolStripMenuItem = new ToolStripMenuItem(); this.删除全部ToolStripMenuItem = new ToolStripMenuItem(); this.toolStripSeparator2 = new ToolStripSeparator(); this.btnTopMost = new ToolStripButton(); this.toolStripSeparator1 = new ToolStripSeparator(); this.btnExit = new ToolStripButton(); this.txtExecuteInfo = new TextBox(); this.splitter1 = new Splitter(); this.listView1 = new ListView(); this.columnHeader_5 = new ColumnHeader(); this.columnHeader_0 = new ColumnHeader(); this.columnHeader_1 = new ColumnHeader(); this.columnHeader_2 = new ColumnHeader(); this.columnHeader_3 = new ColumnHeader(); this.columnHeader_4 = new ColumnHeader(); this.imageList_0 = new ImageList(this.icontainer_0); this.toolStrip1.SuspendLayout(); base.SuspendLayout(); this.toolStrip1.Items.AddRange(new ToolStripItem[] { this.btnState, this.btnExport, this.btnDelete, this.toolStripSeparator2, this.btnTopMost, this.toolStripSeparator1, this.btnExit }); this.toolStrip1.Location = new Point(0, 0); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Size = new Size(881, 25); this.toolStrip1.TabIndex = 0; this.toolStrip1.Text = "toolStrip1"; this.btnState.DropDownItems.AddRange(new ToolStripItem[] { this.监听消息ToolStripMenuItem, this.停止监听ToolStripMenuItem }); //this.btnState.Image = Resources.ball3; this.btnState.Name = "btnState"; this.btnState.Size = new Size(84, 22); this.btnState.Text = "监听消息"; //this.监听消息ToolStripMenuItem.Image = Resources.ball3; this.监听消息ToolStripMenuItem.Name = "监听消息ToolStripMenuItem"; this.监听消息ToolStripMenuItem.Size = new Size(122, 22); this.监听消息ToolStripMenuItem.Text = "监听消息"; this.监听消息ToolStripMenuItem.Click += new EventHandler(this.监听消息ToolStripMenuItem_Click); //this.停止监听ToolStripMenuItem.Image = Resources.ball2; this.停止监听ToolStripMenuItem.Name = "停止监听ToolStripMenuItem"; this.停止监听ToolStripMenuItem.Size = new Size(122, 22); this.停止监听ToolStripMenuItem.Text = "停止监听"; this.停止监听ToolStripMenuItem.Click += new EventHandler(this.停止监听ToolStripMenuItem_Click); this.btnExport.DropDownItems.AddRange(new ToolStripItem[] { this.btnExportText, this.btnExportXml, this.toolStripMenuItem1, this.btnImportXml }); //this.btnExport.Image = Resources.grid7; this.btnExport.Name = "btnExport"; this.btnExport.Size = new Size(108, 22); this.btnExport.Text = "消息导入导出"; this.btnExportText.Name = "btnExportText"; this.btnExportText.Size = new Size(182, 22); this.btnExportText.Text = "以普通文本格式导出"; this.btnExportText.Click += new EventHandler(this.btnExportText_Click); this.btnExportXml.Name = "btnExportXml"; this.btnExportXml.Size = new Size(182, 22); this.btnExportXml.Text = "以XML格式导出"; this.btnExportXml.Click += new EventHandler(this.btnExportXml_Click); this.toolStripMenuItem1.Name = "toolStripMenuItem1"; this.toolStripMenuItem1.Size = new Size(179, 6); this.btnImportXml.Name = "btnImportXml"; this.btnImportXml.Size = new Size(182, 22); this.btnImportXml.Text = "导入XML格式消息"; this.btnImportXml.Click += new EventHandler(this.btnImportXml_Click); this.btnDelete.DropDownItems.AddRange(new ToolStripItem[] { this.删除选定项ToolStripMenuItem, this.删除全部ToolStripMenuItem }); //this.btnDelete.Image = Resources.dele2; this.btnDelete.Name = "btnDelete"; this.btnDelete.Size = new Size(84, 22); this.btnDelete.Text = "删除消息"; this.删除选定项ToolStripMenuItem.Name = "删除选定项ToolStripMenuItem"; this.删除选定项ToolStripMenuItem.Size = new Size(158, 22); this.删除选定项ToolStripMenuItem.Text = "删除选定项"; this.删除选定项ToolStripMenuItem.Click += new EventHandler(this.删除选定项ToolStripMenuItem_Click); this.删除全部ToolStripMenuItem.Name = "删除全部ToolStripMenuItem"; this.删除全部ToolStripMenuItem.Size = new Size(158, 22); this.删除全部ToolStripMenuItem.Text = "删除全部列表项"; this.删除全部ToolStripMenuItem.Click += new EventHandler(this.删除全部ToolStripMenuItem_Click); this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new Size(6, 25); this.btnTopMost.CheckOnClick = true; //this.btnTopMost.Image = Resources.unlockWnd; this.btnTopMost.Name = "btnTopMost"; this.btnTopMost.Size = new Size(75, 22); this.btnTopMost.Text = "窗口置顶"; this.btnTopMost.CheckStateChanged += new EventHandler(this.btnTopMost_CheckStateChanged); this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new Size(6, 25); //this.btnExit.Image = Resources.exit2; this.btnExit.Name = "btnExit"; this.btnExit.Size = new Size(75, 22); this.btnExit.Text = "退出程序"; this.btnExit.Click += new EventHandler(this.btnExit_Click); this.txtExecuteInfo.AcceptsReturn = true; this.txtExecuteInfo.Dock = DockStyle.Bottom; this.txtExecuteInfo.Font = new Font("Courier New", 9f, FontStyle.Regular, GraphicsUnit.Point, 0); this.txtExecuteInfo.Location = new Point(0, 303); this.txtExecuteInfo.Multiline = true; this.txtExecuteInfo.Name = "txtExecuteInfo"; this.txtExecuteInfo.ReadOnly = true; this.txtExecuteInfo.ScrollBars = ScrollBars.Both; this.txtExecuteInfo.Size = new Size(881, 201); this.txtExecuteInfo.TabIndex = 1; this.txtExecuteInfo.WordWrap = false; this.splitter1.Dock = DockStyle.Bottom; this.splitter1.Location = new Point(0, 296); this.splitter1.Name = "splitter1"; this.splitter1.Size = new Size(881, 7); this.splitter1.TabIndex = 2; this.splitter1.TabStop = false; this.listView1.Columns.AddRange(new ColumnHeader[] { this.columnHeader_5, this.columnHeader_0, this.columnHeader_1, this.columnHeader_2, this.columnHeader_3, this.columnHeader_4 }); this.listView1.Dock = DockStyle.Fill; this.listView1.FullRowSelect = true; this.listView1.HideSelection = false; this.listView1.Location = new Point(0, 25); this.listView1.Name = "listView1"; this.listView1.Size = new Size(881, 271); this.listView1.SmallImageList = this.imageList_0; this.listView1.TabIndex = 3; this.listView1.UseCompatibleStateImageBehavior = false; this.listView1.View = View.Details; this.listView1.SelectedIndexChanged += new EventHandler(this.listView1_SelectedIndexChanged); this.columnHeader_5.Text = "序号"; this.columnHeader_5.Width = 54; this.columnHeader_0.Text = "命令文本"; this.columnHeader_0.Width = 196; this.columnHeader_1.Text = "命令参数"; this.columnHeader_1.Width = 210; this.columnHeader_2.Text = "开始时间"; this.columnHeader_2.Width = 115; this.columnHeader_3.Text = "完成时间"; this.columnHeader_3.Width = 168; this.columnHeader_4.Text = "应用程序标识"; this.columnHeader_4.Width = 110; this.imageList_0.ColorDepth = ColorDepth.Depth8Bit; this.imageList_0.ImageSize = new Size(16, 16); this.imageList_0.TransparentColor = Color.Transparent; base.AutoScaleDimensions = new SizeF(6f, 12f); base.AutoScaleMode = AutoScaleMode.Font; base.ClientSize = new Size(881, 504); base.Controls.Add(this.listView1); base.Controls.Add(this.splitter1); base.Controls.Add(this.txtExecuteInfo); base.Controls.Add(this.toolStrip1); base.Name = "SQLProfilerForm"; this.Text = "FastDBEngineSQLProfiler"; base.Load += new EventHandler(this.SQLProfilerForm_Load); base.Shown += new EventHandler(this.SQLProfilerForm_Shown); base.FormClosing += new FormClosingEventHandler(this.SQLProfilerForm_FormClosing); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); base.ResumeLayout(false); base.PerformLayout(); }
private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FindUsagesWindow)); this.ToolStripContainer = new System.Windows.Forms.ToolStripContainer(); this.ListView = new System.Windows.Forms.ListView(); this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.Definition = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.imageList1 = new System.Windows.Forms.ImageList(this.components); this.ToolStrip = new System.Windows.Forms.ToolStrip(); this.ToolStripLabel_Usage = new System.Windows.Forms.ToolStripLabel(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.Button_Clear = new System.Windows.Forms.ToolStripButton(); this.Button_Refresh = new System.Windows.Forms.ToolStripButton(); this.ToolStripContainer.ContentPanel.SuspendLayout(); this.ToolStripContainer.TopToolStripPanel.SuspendLayout(); this.ToolStripContainer.SuspendLayout(); this.ToolStrip.SuspendLayout(); this.SuspendLayout(); // // ToolStripContainer // this.ToolStripContainer.BottomToolStripPanelVisible = false; // // ToolStripContainer.ContentPanel // this.ToolStripContainer.ContentPanel.Controls.Add(this.ListView); resources.ApplyResources(this.ToolStripContainer.ContentPanel, "ToolStripContainer.ContentPanel"); resources.ApplyResources(this.ToolStripContainer, "ToolStripContainer"); this.ToolStripContainer.LeftToolStripPanelVisible = false; this.ToolStripContainer.Name = "ToolStripContainer"; this.ToolStripContainer.RightToolStripPanelVisible = false; // // ToolStripContainer.TopToolStripPanel // this.ToolStripContainer.TopToolStripPanel.Controls.Add(this.ToolStrip); // // ListView // this.ListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader1, this.columnHeader2, this.columnHeader3, this.Definition, this.columnHeader4 }); resources.ApplyResources(this.ListView, "ListView"); this.ListView.FullRowSelect = true; this.ListView.GridLines = true; this.ListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; this.ListView.HideSelection = false; this.ListView.LargeImageList = this.imageList1; this.ListView.MultiSelect = false; this.ListView.Name = "ListView"; this.ListView.SmallImageList = this.imageList1; this.ListView.UseCompatibleStateImageBehavior = false; this.ListView.View = System.Windows.Forms.View.Details; // // columnHeader1 // resources.ApplyResources(this.columnHeader1, "columnHeader1"); // // columnHeader2 // resources.ApplyResources(this.columnHeader2, "columnHeader2"); // // columnHeader3 // resources.ApplyResources(this.columnHeader3, "columnHeader3"); // // Definition // resources.ApplyResources(this.Definition, "Definition"); // // columnHeader4 // resources.ApplyResources(this.columnHeader4, "columnHeader4"); // // imageList1 // this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); this.imageList1.TransparentColor = System.Drawing.Color.Transparent; this.imageList1.Images.SetKeyName(0, "warning.ico"); this.imageList1.Images.SetKeyName(1, "redcross.ico"); // // ToolStrip // resources.ApplyResources(this.ToolStrip, "ToolStrip"); this.ToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.ToolStripLabel_Usage, this.toolStripSeparator1, this.Button_Clear, this.Button_Refresh }); this.ToolStrip.Name = "ToolStrip"; // // ToolStripLabel_Usage // this.ToolStripLabel_Usage.Name = "ToolStripLabel_Usage"; resources.ApplyResources(this.ToolStripLabel_Usage, "ToolStripLabel_Usage"); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1"); // // Button_Clear // this.Button_Clear.Image = global::PAT.GUI.Properties.Resources.Clear; resources.ApplyResources(this.Button_Clear, "Button_Clear"); this.Button_Clear.Name = "Button_Clear"; this.Button_Clear.Click += new System.EventHandler(this.Button_Clear_Click); // // Button_Refresh // resources.ApplyResources(this.Button_Refresh, "Button_Refresh"); this.Button_Refresh.Name = "Button_Refresh"; // // FindUsagesWindow // resources.ApplyResources(this, "$this"); this.Controls.Add(this.ToolStripContainer); this.Name = "FindUsagesWindow"; this.ToolStripContainer.ContentPanel.ResumeLayout(false); this.ToolStripContainer.TopToolStripPanel.ResumeLayout(false); this.ToolStripContainer.TopToolStripPanel.PerformLayout(); this.ToolStripContainer.ResumeLayout(false); this.ToolStripContainer.PerformLayout(); this.ToolStrip.ResumeLayout(false); this.ToolStrip.PerformLayout(); this.ResumeLayout(false); }
private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainControl)); this.cbbFirstEntity = new System.Windows.Forms.ComboBox(); this.cbbRelationship = new System.Windows.Forms.ComboBox(); this.cbbSecondEntity = new System.Windows.Forms.ComboBox(); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.tsbLoadMetadata = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.tsbImportNN = new System.Windows.Forms.ToolStripButton(); this.gbFirst = new System.Windows.Forms.GroupBox(); this.cbbFirstEntityAttribute = new System.Windows.Forms.ComboBox(); this.rdbFirstAttribute = new System.Windows.Forms.RadioButton(); this.rdbFirstGuid = new System.Windows.Forms.RadioButton(); this.label2 = new System.Windows.Forms.Label(); this.gbRelationship = new System.Windows.Forms.GroupBox(); this.gbSecond = new System.Windows.Forms.GroupBox(); this.cbbSecondEntityAttribute = new System.Windows.Forms.ComboBox(); this.rdbSecondAttribute = new System.Windows.Forms.RadioButton(); this.rdbSecondGuid = new System.Windows.Forms.RadioButton(); this.label1 = new System.Windows.Forms.Label(); this.gbImportFile = new System.Windows.Forms.GroupBox(); this.btnBrowse = new System.Windows.Forms.Button(); this.txtFilePath = new System.Windows.Forms.TextBox(); this.gbLog = new System.Windows.Forms.GroupBox(); this.listLog = new System.Windows.Forms.ListBox(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.tsbExport = new System.Windows.Forms.ToolStripButton(); this.tsbClose = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.toolStrip1.SuspendLayout(); this.gbFirst.SuspendLayout(); this.gbRelationship.SuspendLayout(); this.gbSecond.SuspendLayout(); this.gbImportFile.SuspendLayout(); this.gbLog.SuspendLayout(); this.SuspendLayout(); // // cbbFirstEntity // this.cbbFirstEntity.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.cbbFirstEntity.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbbFirstEntity.FormattingEnabled = true; this.cbbFirstEntity.Location = new System.Drawing.Point(6, 19); this.cbbFirstEntity.Name = "cbbFirstEntity"; this.cbbFirstEntity.Size = new System.Drawing.Size(653, 21); this.cbbFirstEntity.Sorted = true; this.cbbFirstEntity.TabIndex = 0; this.cbbFirstEntity.SelectedIndexChanged += new System.EventHandler(this.cbbFirstEntity_SelectedIndexChanged); // // cbbRelationship // this.cbbRelationship.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.cbbRelationship.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbbRelationship.FormattingEnabled = true; this.cbbRelationship.Location = new System.Drawing.Point(9, 19); this.cbbRelationship.Name = "cbbRelationship"; this.cbbRelationship.Size = new System.Drawing.Size(650, 21); this.cbbRelationship.Sorted = true; this.cbbRelationship.TabIndex = 1; this.cbbRelationship.SelectedIndexChanged += new System.EventHandler(this.cbbRelationship_SelectedIndexChanged); // // cbbSecondEntity // this.cbbSecondEntity.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.cbbSecondEntity.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbbSecondEntity.FormattingEnabled = true; this.cbbSecondEntity.Location = new System.Drawing.Point(9, 20); this.cbbSecondEntity.Name = "cbbSecondEntity"; this.cbbSecondEntity.Size = new System.Drawing.Size(650, 21); this.cbbSecondEntity.Sorted = true; this.cbbSecondEntity.TabIndex = 2; this.cbbSecondEntity.SelectedIndexChanged += new System.EventHandler(this.cbbSecondEntity_SelectedIndexChanged); // // toolStrip1 // this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tsbClose, this.toolStripSeparator3, this.tsbLoadMetadata, this.toolStripSeparator1, this.tsbImportNN, this.toolStripSeparator2, this.tsbExport }); this.toolStrip1.Location = new System.Drawing.Point(0, 0); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Size = new System.Drawing.Size(671, 25); this.toolStrip1.TabIndex = 3; this.toolStrip1.Text = "toolStrip1"; // // tsbLoadMetadata // this.tsbLoadMetadata.Image = ((System.Drawing.Image)(resources.GetObject("tsbLoadMetadata.Image"))); this.tsbLoadMetadata.ImageTransparentColor = System.Drawing.Color.Magenta; this.tsbLoadMetadata.Name = "tsbLoadMetadata"; this.tsbLoadMetadata.Size = new System.Drawing.Size(106, 22); this.tsbLoadMetadata.Text = "Load Metadata"; this.tsbLoadMetadata.Click += new System.EventHandler(this.tsbLoadMetadata_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25); // // tsbImportNN // this.tsbImportNN.Enabled = false; this.tsbImportNN.Image = ((System.Drawing.Image)(resources.GetObject("tsbImportNN.Image"))); this.tsbImportNN.ImageTransparentColor = System.Drawing.Color.Magenta; this.tsbImportNN.Name = "tsbImportNN"; this.tsbImportNN.Size = new System.Drawing.Size(154, 22); this.tsbImportNN.Text = "Import NN relationships"; this.tsbImportNN.Click += new System.EventHandler(this.tsbImportNN_Click); // // gbFirst // this.gbFirst.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.gbFirst.Controls.Add(this.cbbFirstEntityAttribute); this.gbFirst.Controls.Add(this.rdbFirstAttribute); this.gbFirst.Controls.Add(this.rdbFirstGuid); this.gbFirst.Controls.Add(this.label2); this.gbFirst.Controls.Add(this.cbbFirstEntity); this.gbFirst.Location = new System.Drawing.Point(3, 28); this.gbFirst.Name = "gbFirst"; this.gbFirst.Size = new System.Drawing.Size(665, 80); this.gbFirst.TabIndex = 5; this.gbFirst.TabStop = false; this.gbFirst.Text = "First Entity"; // // cbbFirstEntityAttribute // this.cbbFirstEntityAttribute.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.cbbFirstEntityAttribute.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbbFirstEntityAttribute.Enabled = false; this.cbbFirstEntityAttribute.FormattingEnabled = true; this.cbbFirstEntityAttribute.Location = new System.Drawing.Point(353, 46); this.cbbFirstEntityAttribute.Name = "cbbFirstEntityAttribute"; this.cbbFirstEntityAttribute.Size = new System.Drawing.Size(306, 21); this.cbbFirstEntityAttribute.Sorted = true; this.cbbFirstEntityAttribute.TabIndex = 4; // // rdbFirstAttribute // this.rdbFirstAttribute.AutoSize = true; this.rdbFirstAttribute.Location = new System.Drawing.Point(243, 47); this.rdbFirstAttribute.Name = "rdbFirstAttribute"; this.rdbFirstAttribute.Size = new System.Drawing.Size(104, 17); this.rdbFirstAttribute.TabIndex = 3; this.rdbFirstAttribute.Text = "Specific attribute"; this.rdbFirstAttribute.UseVisualStyleBackColor = true; // // rdbFirstGuid // this.rdbFirstGuid.AutoSize = true; this.rdbFirstGuid.Checked = true; this.rdbFirstGuid.Location = new System.Drawing.Point(135, 47); this.rdbFirstGuid.Name = "rdbFirstGuid"; this.rdbFirstGuid.Size = new System.Drawing.Size(102, 17); this.rdbFirstGuid.TabIndex = 2; this.rdbFirstGuid.TabStop = true; this.rdbFirstGuid.Text = "Unique Identifier"; this.rdbFirstGuid.UseVisualStyleBackColor = true; this.rdbFirstGuid.CheckedChanged += new System.EventHandler(this.rdbFirstGuid_CheckedChanged); // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(6, 49); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(89, 13); this.label2.TabIndex = 1; this.label2.Text = "Mapping attribute"; // // gbRelationship // this.gbRelationship.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.gbRelationship.Controls.Add(this.cbbRelationship); this.gbRelationship.Location = new System.Drawing.Point(3, 114); this.gbRelationship.Name = "gbRelationship"; this.gbRelationship.Size = new System.Drawing.Size(665, 54); this.gbRelationship.TabIndex = 6; this.gbRelationship.TabStop = false; this.gbRelationship.Text = "Relationship"; // // gbSecond // this.gbSecond.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.gbSecond.Controls.Add(this.cbbSecondEntityAttribute); this.gbSecond.Controls.Add(this.rdbSecondAttribute); this.gbSecond.Controls.Add(this.rdbSecondGuid); this.gbSecond.Controls.Add(this.label1); this.gbSecond.Controls.Add(this.cbbSecondEntity); this.gbSecond.Location = new System.Drawing.Point(3, 174); this.gbSecond.Name = "gbSecond"; this.gbSecond.Size = new System.Drawing.Size(665, 80); this.gbSecond.TabIndex = 6; this.gbSecond.TabStop = false; this.gbSecond.Text = "Second Entity"; // // cbbSecondEntityAttribute // this.cbbSecondEntityAttribute.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.cbbSecondEntityAttribute.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbbSecondEntityAttribute.Enabled = false; this.cbbSecondEntityAttribute.FormattingEnabled = true; this.cbbSecondEntityAttribute.Location = new System.Drawing.Point(353, 46); this.cbbSecondEntityAttribute.Name = "cbbSecondEntityAttribute"; this.cbbSecondEntityAttribute.Size = new System.Drawing.Size(306, 21); this.cbbSecondEntityAttribute.Sorted = true; this.cbbSecondEntityAttribute.TabIndex = 4; // // rdbSecondAttribute // this.rdbSecondAttribute.AutoSize = true; this.rdbSecondAttribute.Location = new System.Drawing.Point(243, 47); this.rdbSecondAttribute.Name = "rdbSecondAttribute"; this.rdbSecondAttribute.Size = new System.Drawing.Size(104, 17); this.rdbSecondAttribute.TabIndex = 3; this.rdbSecondAttribute.Text = "Specific attribute"; this.rdbSecondAttribute.UseVisualStyleBackColor = true; // // rdbSecondGuid // this.rdbSecondGuid.AutoSize = true; this.rdbSecondGuid.Checked = true; this.rdbSecondGuid.Location = new System.Drawing.Point(135, 47); this.rdbSecondGuid.Name = "rdbSecondGuid"; this.rdbSecondGuid.Size = new System.Drawing.Size(102, 17); this.rdbSecondGuid.TabIndex = 2; this.rdbSecondGuid.TabStop = true; this.rdbSecondGuid.Text = "Unique Identifier"; this.rdbSecondGuid.UseVisualStyleBackColor = true; this.rdbSecondGuid.CheckedChanged += new System.EventHandler(this.rdbSecondGuid_CheckedChanged); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(6, 49); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(89, 13); this.label1.TabIndex = 1; this.label1.Text = "Mapping attribute"; // // gbImportFile // this.gbImportFile.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.gbImportFile.Controls.Add(this.btnBrowse); this.gbImportFile.Controls.Add(this.txtFilePath); this.gbImportFile.Location = new System.Drawing.Point(3, 260); this.gbImportFile.Name = "gbImportFile"; this.gbImportFile.Size = new System.Drawing.Size(665, 56); this.gbImportFile.TabIndex = 7; this.gbImportFile.TabStop = false; this.gbImportFile.Text = "Import file"; // // btnBrowse // this.btnBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnBrowse.Location = new System.Drawing.Point(584, 19); this.btnBrowse.Name = "btnBrowse"; this.btnBrowse.Size = new System.Drawing.Size(75, 23); this.btnBrowse.TabIndex = 1; this.btnBrowse.Text = "Browse"; this.btnBrowse.UseVisualStyleBackColor = true; this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click); // // txtFilePath // this.txtFilePath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtFilePath.Location = new System.Drawing.Point(9, 21); this.txtFilePath.Name = "txtFilePath"; this.txtFilePath.Size = new System.Drawing.Size(569, 20); this.txtFilePath.TabIndex = 0; // // gbLog // this.gbLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.gbLog.Controls.Add(this.listLog); this.gbLog.Location = new System.Drawing.Point(3, 322); this.gbLog.Name = "gbLog"; this.gbLog.Size = new System.Drawing.Size(665, 174); this.gbLog.TabIndex = 8; this.gbLog.TabStop = false; this.gbLog.Text = "Log"; // // listLog // this.listLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.listLog.FormattingEnabled = true; this.listLog.Location = new System.Drawing.Point(9, 19); this.listLog.Name = "listLog"; this.listLog.Size = new System.Drawing.Size(650, 147); this.listLog.TabIndex = 0; // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25); // // tsbExport // this.tsbExport.Enabled = false; this.tsbExport.Image = ((System.Drawing.Image)(resources.GetObject("tsbExport.Image"))); this.tsbExport.ImageTransparentColor = System.Drawing.Color.Magenta; this.tsbExport.Name = "tsbExport"; this.tsbExport.Size = new System.Drawing.Size(151, 22); this.tsbExport.Text = "Export NN relationships"; this.tsbExport.Click += new System.EventHandler(this.tsbExport_Click); // // tsbClose // this.tsbClose.Image = ((System.Drawing.Image)(resources.GetObject("tsbClose.Image"))); this.tsbClose.ImageTransparentColor = System.Drawing.Color.Magenta; this.tsbClose.Name = "tsbClose"; this.tsbClose.Size = new System.Drawing.Size(102, 22); this.tsbClose.Text = "Close this tool"; this.tsbClose.Click += new System.EventHandler(this.tsbClose_Click); // // toolStripSeparator3 // this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25); // // MainControl // this.Controls.Add(this.gbLog); this.Controls.Add(this.gbImportFile); this.Controls.Add(this.gbSecond); this.Controls.Add(this.gbRelationship); this.Controls.Add(this.gbFirst); this.Controls.Add(this.toolStrip1); this.Name = "MainControl"; this.Size = new System.Drawing.Size(671, 499); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); this.gbFirst.ResumeLayout(false); this.gbFirst.PerformLayout(); this.gbRelationship.ResumeLayout(false); this.gbSecond.ResumeLayout(false); this.gbSecond.PerformLayout(); this.gbImportFile.ResumeLayout(false); this.gbImportFile.PerformLayout(); this.gbLog.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); }
/// <summary> /// Установить значение свойства ToolStripButton /// </summary> /// <param name="tb">ToolStripButton</param> /// <param name="value">значение</param> /// <param name="property">свойство</param> public void set_tbtn_property(ToolStripButton tb, object value, string property) { PropertySetTBtnPropDelegate showProperty = new PropertySetTBtnPropDelegate(set_tbtn_property2); Application.OpenForms["FormMain"].Invoke(showProperty, new object[] { tb, value, property }); }
public frmReport() { InitializeComponent(); RptPath = AppDomain.CurrentDomain.BaseDirectory + @"Reports\{0}.rdlc"; // // toolStripButtonBalance // _toolStripButtonBalance = new ToolStripButton() { BackColor = System.Drawing.Color.FromArgb(255, 255, 192), DisplayStyle = ToolStripItemDisplayStyle.Text, ForeColor = System.Drawing.Color.Black, Name = "_toolStripButtonBalance", Size = new System.Drawing.Size(80, 25), Tag = "Balance", Text = "Balance" }; _toolStripButtonBalance.Click += new System.EventHandler(this.ToolStripButtonReport_Click); // // toolStripButtonByMonth // _toolStripButtonByMonth = new ToolStripButton() { BackColor = System.Drawing.Color.FromArgb(255, 224, 192), DisplayStyle = ToolStripItemDisplayStyle.Text, ForeColor = System.Drawing.Color.Black, Name = "_toolStripButtonByMonth", Size = new System.Drawing.Size(80, 25), Tag = "ComDescricao", Text = "Por Mês" }; _toolStripButtonByMonth.Click += new System.EventHandler(this.ToolStripButtonReport_Click); // // toolStripButtonByGroup // _toolStripButtonByGroup = new ToolStripButton() { BackColor = System.Drawing.Color.FromArgb(192, 255, 192), DisplayStyle = ToolStripItemDisplayStyle.Text, ForeColor = System.Drawing.Color.Black, Name = "_toolStripButtonByGroup", Size = new System.Drawing.Size(80, 25), Tag = "PorGrupo", Text = "Por Grupo" }; _toolStripButtonByGroup.Click += new System.EventHandler(this.ToolStripButtonReport_Click); // // toolStripLabelConta // _toolStripLabelConta = new ToolStripLabel("Conta:") { ForeColor = System.Drawing.Color.Black, Name = "_toolStripLabelConta", Size = new System.Drawing.Size(51, 25) }; // // toolStripComboBoxConta // _toolStripComboBoxConta = new ToolStripComboBox { AutoSize = false, ForeColor = System.Drawing.Color.Black, Name = "_toolStripComboBoxConta", Size = new System.Drawing.Size(100, 28) }; _toolStripComboBoxConta.SelectedIndexChanged += new System.EventHandler(this.toolStripComboBoxConta_SelectedIndexChanged); // // toolStripLabelInicio // _toolStripLabelInicio = new ToolStripLabel("Início:") { ForeColor = System.Drawing.Color.Black, Name = "_toolStripLabelInicio", Size = new System.Drawing.Size(48, 25) }; // // toolStripLabelTermino // _toolStripLabelTermino = new ToolStripLabel("Término:") { ForeColor = System.Drawing.Color.Black, Name = "_toolStripLabelTermino", Size = new System.Drawing.Size(66, 25) }; _toolStripDateTimeInicio.Width = _toolStripDateTimeTermino.Width = 110; toolStripMenu.Items.AddRange(new ToolStripItem[] { _toolStripButtonBalance, _toolStripButtonByMonth, _toolStripButtonByGroup, new ToolStripSeparator(), _toolStripLabelConta, _toolStripComboBoxConta, _toolStripLabelInicio, _toolStripDateTimeInicio, _toolStripLabelTermino, _toolStripDateTimeTermino }); _toolStripComboBoxConta.ComboBox.DataSource = _ctx.Contas.Where(a => a.Balance.Any()).OrderBy(b => b.Apelido).ToList(); _toolStripComboBoxConta.ComboBox.DisplayMember = "Apelido"; _toolStripComboBoxConta.ComboBox.ValueMember = "Apelido"; _toolStripComboBoxConta.Font = toolStripMenu.Font; }
public void SetRebindAfterSave(ToolStripButton ctl, bool value) { if (_sources.ContainsKey(ctl)) _sources[ctl].RebindAfterSave = value; else { CslaActionExtenderProperties props = new CslaActionExtenderProperties(); props.RebindAfterSave = value; _sources.Add(ctl, props); } }
public bool GetRebindAfterSave(ToolStripButton ctl) { if (_sources.ContainsKey(ctl)) return _sources[ctl].RebindAfterSave; return CslaActionExtenderProperties.RebindAfterSaveDefault; }
public void SetPostSaveAction(ToolStripButton ctl, PostSaveActionType value) { if (_sources.ContainsKey(ctl)) _sources[ctl].PostSaveAction = value; else { CslaActionExtenderProperties props = new CslaActionExtenderProperties(); props.PostSaveAction = value; _sources.Add(ctl, props); } }
public PostSaveActionType GetPostSaveAction(ToolStripButton ctl) { if (_sources.ContainsKey(ctl)) return _sources[ctl].PostSaveAction; return CslaActionExtenderProperties.PostSaveActionDefault; }
public void SetActionType(ToolStripButton ctl, CslaFormAction value) { if (_sources.ContainsKey(ctl)) _sources[ctl].ActionType = value; else { CslaActionExtenderProperties props = new CslaActionExtenderProperties(); props.ActionType = value; _sources.Add(ctl, props); } }
public CslaFormAction GetActionType(ToolStripButton ctl) { if (_sources.ContainsKey(ctl)) return _sources[ctl].ActionType; return CslaActionExtenderProperties.ActionTypeDefault; }
private Form GetParentForm(ToolStripButton thisToolStripButton) { return GetParentForm(thisToolStripButton.GetCurrentParent()); }
/// <summary> /// Method invoked when the target control is clicked. /// </summary> /// <param name="sender">Object originating action.</param> /// <param name="e">Arguments.</param> protected void OnClick(object sender, EventArgs e) { ToolStripButton ctl = (ToolStripButton)sender; CslaActionExtenderProperties props = _sources[ctl]; if (props.ActionType != CslaFormAction.None) { try { #if WEBGUI var pendingUserInput = false; #endif bool raiseClicked = true; CslaActionCancelEventArgs args = new CslaActionCancelEventArgs(false, props.CommandName); OnClicking(args); if (!args.Cancel) { ISavable savableObject = null; ITrackStatus trackableObject = null; BindingSource source = null; var sourceObjectError = false; if (_dataSource != null) { source = _dataSource as BindingSource; if (source != null) { savableObject = source.DataSource as ISavable; trackableObject = source.DataSource as ITrackStatus; } else { OnErrorEncountered(new ErrorEncounteredEventArgs(props.CommandName, new InvalidCastException(Resources.ActionExtenderInvalidBindingSourceCast))); sourceObjectError = true; } if (savableObject == null || trackableObject == null) { OnErrorEncountered(new ErrorEncounteredEventArgs(props.CommandName, new InvalidCastException(Resources.ActionExtenderInvalidBusinessObjectBaseCast))); sourceObjectError = true; } } if (!sourceObjectError) { #if !WEBGUI DialogResult diagResult; #endif switch (props.ActionType) { case CslaFormAction.Save: raiseClicked = ExecuteSaveAction(savableObject, trackableObject, props); break; // case CslaFormAction.Save case CslaFormAction.Cancel: #if !WEBGUI diagResult = DialogResult.Yes; if (_warnOnCancel && trackableObject.IsDirty) { diagResult = MessageBox.Show( _warnOnCancelMessage, Resources.Warning, MessageBoxButtons.YesNo, MessageBoxIcon.Warning); } if (diagResult == DialogResult.Yes) { _bindingSourceTree.Cancel(savableObject); } #else if (_warnOnCancel && trackableObject.IsDirty) { pendingUserInput = true; ConfirmCancel(savableObject, props.CommandName); } else { _bindingSourceTree.Cancel(savableObject); } #endif break; // case CslaFormAction.Cancel case CslaFormAction.Close: #if !WEBGUI diagResult = DialogResult.Yes; if (trackableObject.IsDirty || trackableObject.IsNew) { if (_warnIfCloseOnDirty) { diagResult = MessageBox.Show( _dirtyWarningMessage + Environment.NewLine + Resources.ActionExtenderCloseConfirmation, Resources.Warning, MessageBoxButtons.YesNo, MessageBoxIcon.Warning); } } if (diagResult == DialogResult.Yes) { _bindingSourceTree.Close(); _closeForm = true; } #else if (trackableObject.IsDirty || trackableObject.IsNew) { if (_warnIfCloseOnDirty) { pendingUserInput = true; ConfirmClose(props.CommandName); } } else { _bindingSourceTree.Close(); _closeForm = true; } #endif break; // case CslaFormAction.Close case CslaFormAction.Validate: if (savableObject is BusinessBase) { BusinessBase businessObject = savableObject as BusinessBase; if (!businessObject.IsValid) { // todo: add child broken rules string brokenRules = string.Empty; foreach (var brokenRule in businessObject.GetBrokenRules()) { var lambdaBrokenRule = brokenRule; var friendlyName = PropertyInfoManager.GetRegisteredProperties(businessObject.GetType()).Find( c => c.Name == lambdaBrokenRule.Property).FriendlyName; brokenRules += string.Format("{0}: {1}{2}", friendlyName, brokenRule, Environment.NewLine); } #if !WEBGUI MessageBox.Show(brokenRules, Resources.ActionExtenderErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); #else MessageBox.Show(brokenRules, Resources.ActionExtenderErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error, messageBoxClosedHandler, false); #endif } else { #if !WEBGUI MessageBox.Show(_objectIsValidMessage, Resources.ActionExtenderInformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information); #else MessageBox.Show(_objectIsValidMessage, Resources.ActionExtenderInformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information, messageBoxClosedHandler, false); #endif } } break; //case CslaFormAction.Validate } // switch (props.ActionType) // raiseClicked is true if // ActionType == CslaFormAction.Save and everything is ok if (raiseClicked) { if (props.ActionType == CslaFormAction.Save && source != null) { if (props.RebindAfterSave) { // For some strange reason, this has to be done down here. // Putting it in the Select Case AfterSave... does not work. _bindingSourceTree.ResetBindings(false); InitializeControls(true); } } #if !WEBGUI else { if (props.ActionType == CslaFormAction.Cancel) { InitializeControls(true); } } OnClicked(new CslaActionEventArgs(props.CommandName)); #else if (!pendingUserInput) { OnClicked(new CslaActionEventArgs(props.CommandName)); } #endif } } // if (!sourceObjectError) } // if (!args.Cancel) #if !WEBGUI if (_closeForm) { CloseForm(); } #else if (!pendingUserInput) { if (_closeForm) { CloseForm(); } } #endif } catch (Exception ex) { OnErrorEncountered(new ErrorEncounteredEventArgs(props.CommandName, ex)); } } // if (props.ActionType != CslaFormAction.None) }
private void InitializeComponent() { this.components = new Container(); ComponentResourceManager manager = new ComponentResourceManager(typeof(frmCommLocationMap)); this.groupBox7 = new GroupBox(); this.label_heading = new Label(); this.label_gpsTime = new Label(); this.label_mode = new Label(); this.label_fix = new Label(); this.label_totalSVsUsed = new Label(); this.label_Speed = new Label(); this.label_HDOP = new Label(); this.label_Altitude = new Label(); this.label_Latitude = new Label(); this.label_Longitude = new Label(); this.label_ReceiverTime = new Label(); this.MapRightClickContextMenuStrip = new ContextMenuStrip(this.components); this.setMapCenterLocationHereToolStripMenuItem = new ToolStripMenuItem(); this.LatLongLabel = new Label(); this.locationViewToolStrip = new ToolStrip(); this.locationViewToolbarMapitBtn = new ToolStripButton(); this.locationViewToolbarSetRadiusBtn = new ToolStripButton(); this.locationViewToolbarClearBtn = new ToolStripButton(); this.toolStripButton_setRefLocation = new ToolStripButton(); this.statusStrip1 = new StatusStrip(); this.locationViewStatusLabel = new ToolStripStatusLabel(); this.panel_Location = new MyPanel(); this.groupBox7.SuspendLayout(); this.MapRightClickContextMenuStrip.SuspendLayout(); this.locationViewToolStrip.SuspendLayout(); this.statusStrip1.SuspendLayout(); base.SuspendLayout(); this.groupBox7.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top; this.groupBox7.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.groupBox7.BackColor = SystemColors.ControlLight; this.groupBox7.Controls.Add(this.label_heading); this.groupBox7.Controls.Add(this.label_gpsTime); this.groupBox7.Controls.Add(this.label_mode); this.groupBox7.Controls.Add(this.label_fix); this.groupBox7.Controls.Add(this.label_totalSVsUsed); this.groupBox7.Controls.Add(this.label_Speed); this.groupBox7.Controls.Add(this.label_HDOP); this.groupBox7.Controls.Add(this.label_Altitude); this.groupBox7.Controls.Add(this.label_Latitude); this.groupBox7.Controls.Add(this.label_Longitude); this.groupBox7.Controls.Add(this.label_ReceiverTime); this.groupBox7.Location = new Point(0x16, 0x22); this.groupBox7.Name = "groupBox7"; this.groupBox7.Size = new Size(0x1b9, 0x97); this.groupBox7.TabIndex = 0; this.groupBox7.TabStop = false; this.groupBox7.Text = "Position Infomation"; this.label_heading.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; this.label_heading.AutoSize = true; this.label_heading.Location = new Point(0x135, 70); this.label_heading.Name = "label_heading"; this.label_heading.Size = new Size(50, 13); this.label_heading.TabIndex = 11; this.label_heading.Text = "Heading:"; this.label_gpsTime.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; this.label_gpsTime.AutoSize = true; this.label_gpsTime.Location = new Point(0xb2, 0x15); this.label_gpsTime.Name = "label_gpsTime"; this.label_gpsTime.Size = new Size(0x5c, 13); this.label_gpsTime.TabIndex = 10; this.label_gpsTime.Text = "TOW: Week:"; this.label_mode.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; this.label_mode.AutoSize = true; this.label_mode.Location = new Point(0xb2, 0x61); this.label_mode.Name = "label_mode"; this.label_mode.Size = new Size(0x25, 13); this.label_mode.TabIndex = 9; this.label_mode.Text = "Mode:"; this.label_fix.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; this.label_fix.AutoSize = true; this.label_fix.Location = new Point(7, 0x61); this.label_fix.Name = "label_fix"; this.label_fix.Size = new Size(0x17, 13); this.label_fix.TabIndex = 8; this.label_fix.Text = "Fix:"; this.label_fix.TextAlign = ContentAlignment.MiddleRight; this.label_fix.Visible = false; this.label_totalSVsUsed.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; this.label_totalSVsUsed.AutoSize = true; this.label_totalSVsUsed.Location = new Point(7, 0x7a); this.label_totalSVsUsed.Name = "label_totalSVsUsed"; this.label_totalSVsUsed.Size = new Size(0x6b, 13); this.label_totalSVsUsed.TabIndex = 7; this.label_totalSVsUsed.Text = "Number of SVs used:"; this.label_Speed.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; this.label_Speed.AutoSize = true; this.label_Speed.Location = new Point(0xb2, 70); this.label_Speed.Name = "label_Speed"; this.label_Speed.Size = new Size(0x29, 13); this.label_Speed.TabIndex = 6; this.label_Speed.Text = "Speed:"; this.label_HDOP.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; this.label_HDOP.AutoSize = true; this.label_HDOP.Location = new Point(7, 70); this.label_HDOP.Name = "label_HDOP"; this.label_HDOP.Size = new Size(0x29, 13); this.label_HDOP.TabIndex = 5; this.label_HDOP.Text = "HDOP:"; this.label_Altitude.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; this.label_Altitude.AutoSize = true; this.label_Altitude.Location = new Point(0x135, 0x2c); this.label_Altitude.Name = "label_Altitude"; this.label_Altitude.Size = new Size(0x2d, 13); this.label_Altitude.TabIndex = 3; this.label_Altitude.Text = "Altitude:"; this.label_Latitude.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; this.label_Latitude.AutoSize = true; this.label_Latitude.Location = new Point(7, 0x2c); this.label_Latitude.Name = "label_Latitude"; this.label_Latitude.Size = new Size(0x30, 13); this.label_Latitude.TabIndex = 2; this.label_Latitude.Text = "Latitude:"; this.label_Longitude.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; this.label_Longitude.AutoSize = true; this.label_Longitude.Location = new Point(0xb2, 0x2c); this.label_Longitude.Name = "label_Longitude"; this.label_Longitude.Size = new Size(0x39, 13); this.label_Longitude.TabIndex = 1; this.label_Longitude.Text = "Longitude:"; this.label_ReceiverTime.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; this.label_ReceiverTime.AutoSize = true; this.label_ReceiverTime.Location = new Point(7, 0x15); this.label_ReceiverTime.Name = "label_ReceiverTime"; this.label_ReceiverTime.Size = new Size(0x4f, 13); this.label_ReceiverTime.TabIndex = 0; this.label_ReceiverTime.Text = "Receiver Time:"; this.MapRightClickContextMenuStrip.Items.AddRange(new ToolStripItem[] { this.setMapCenterLocationHereToolStripMenuItem }); this.MapRightClickContextMenuStrip.Name = "MapRightClickContextMenuStrip"; this.MapRightClickContextMenuStrip.Size = new Size(0xcb, 0x1a); this.setMapCenterLocationHereToolStripMenuItem.Name = "setMapCenterLocationHereToolStripMenuItem"; this.setMapCenterLocationHereToolStripMenuItem.Size = new Size(0xca, 0x16); this.setMapCenterLocationHereToolStripMenuItem.Text = "Switch to Manual Center"; this.setMapCenterLocationHereToolStripMenuItem.Click += new EventHandler(this.setMapCenterLocationHereToolStripMenuItem_Click); this.LatLongLabel.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; this.LatLongLabel.AutoSize = true; this.LatLongLabel.Location = new Point(0x1b, 0xc3); this.LatLongLabel.Name = "LatLongLabel"; this.LatLongLabel.Size = new Size(0x3a, 13); this.LatLongLabel.TabIndex = 15; this.LatLongLabel.Text = "Lat, Long: "; this.locationViewToolStrip.Items.AddRange(new ToolStripItem[] { this.locationViewToolbarMapitBtn, this.locationViewToolbarSetRadiusBtn, this.locationViewToolbarClearBtn, this.toolStripButton_setRefLocation }); this.locationViewToolStrip.Location = new Point(0, 0); this.locationViewToolStrip.Name = "locationViewToolStrip"; this.locationViewToolStrip.Size = new Size(0x1e5, 0x19); this.locationViewToolStrip.TabIndex = 0x12; this.locationViewToolStrip.Text = "toolStrip1"; this.locationViewToolbarMapitBtn.DisplayStyle = ToolStripItemDisplayStyle.Image; this.locationViewToolbarMapitBtn.Image = Resources.mapIt; this.locationViewToolbarMapitBtn.ImageTransparentColor = Color.Magenta; this.locationViewToolbarMapitBtn.Name = "locationViewToolbarMapitBtn"; this.locationViewToolbarMapitBtn.Size = new Size(0x17, 0x16); this.locationViewToolbarMapitBtn.Text = "Map Position"; this.locationViewToolbarMapitBtn.Click += new EventHandler(this.button_MapIt_Click); this.locationViewToolbarSetRadiusBtn.DisplayStyle = ToolStripItemDisplayStyle.Image; this.locationViewToolbarSetRadiusBtn.Image = Resources.Config; this.locationViewToolbarSetRadiusBtn.ImageTransparentColor = Color.Magenta; this.locationViewToolbarSetRadiusBtn.Name = "locationViewToolbarSetRadiusBtn"; this.locationViewToolbarSetRadiusBtn.Size = new Size(0x17, 0x16); this.locationViewToolbarSetRadiusBtn.Text = "Configuration"; this.locationViewToolbarSetRadiusBtn.Click += new EventHandler(this.locationViewToolbarSetRadiusBtn_Click); this.locationViewToolbarClearBtn.DisplayStyle = ToolStripItemDisplayStyle.Image; this.locationViewToolbarClearBtn.Image = Resources.DeleteHS; this.locationViewToolbarClearBtn.ImageTransparentColor = Color.Magenta; this.locationViewToolbarClearBtn.Name = "locationViewToolbarClearBtn"; this.locationViewToolbarClearBtn.Size = new Size(0x17, 0x16); this.locationViewToolbarClearBtn.Text = "Clear Data"; this.locationViewToolbarClearBtn.Click += new EventHandler(this.frmCommLocationMapClearBtn_Click); this.toolStripButton_setRefLocation.DisplayStyle = ToolStripItemDisplayStyle.Image; this.toolStripButton_setRefLocation.Image = Resources.RefLocation; this.toolStripButton_setRefLocation.ImageTransparentColor = Color.Magenta; this.toolStripButton_setRefLocation.Name = "toolStripButton_setRefLocation"; this.toolStripButton_setRefLocation.Size = new Size(0x17, 0x16); this.toolStripButton_setRefLocation.Text = "Set Reference Location"; this.toolStripButton_setRefLocation.Click += new EventHandler(this.toolStripButton_setRefLocation_Click); this.statusStrip1.Items.AddRange(new ToolStripItem[] { this.locationViewStatusLabel }); this.statusStrip1.Location = new Point(0, 0x1b9); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Size = new Size(0x1e5, 0x16); this.statusStrip1.TabIndex = 0x13; this.statusStrip1.Text = "Status"; this.locationViewStatusLabel.DisplayStyle = ToolStripItemDisplayStyle.Text; this.locationViewStatusLabel.Name = "locationViewStatusLabel"; this.locationViewStatusLabel.Size = new Size(0x26, 0x11); this.locationViewStatusLabel.Text = "Status"; this.panel_Location.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; this.panel_Location.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.panel_Location.Location = new Point(0x16, 0xd9); this.panel_Location.Name = "panel_Location"; this.panel_Location.Size = new Size(0x1b9, 210); this.panel_Location.TabIndex = 7; this.panel_Location.Paint += new PaintEventHandler(this.panel_Location_Paint); this.panel_Location.MouseMove += new MouseEventHandler(this.panel_Location_MouseMove); this.panel_Location.MouseClick += new MouseEventHandler(this.panel_Location_MouseClick); this.panel_Location.Resize += new EventHandler(this.panel_Location_Resize); base.AutoScaleDimensions = new SizeF(6f, 13f); base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScroll = true; this.BackColor = SystemColors.Control; base.ClientSize = new Size(0x1e5, 0x1cf); base.Controls.Add(this.statusStrip1); base.Controls.Add(this.locationViewToolStrip); base.Controls.Add(this.groupBox7); base.Controls.Add(this.panel_Location); base.Controls.Add(this.LatLongLabel); base.Icon = (Icon)manager.GetObject("$this.Icon"); base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "frmCommLocationMap"; base.ShowInTaskbar = false; base.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; base.StartPosition = FormStartPosition.Manual; this.Text = "Location View"; base.Load += new EventHandler(this.frmCommLocationMap_Load); base.LocationChanged += new EventHandler(this.frmCommLocationMap_LocationChanged); base.ResizeEnd += new EventHandler(this.frmCommLocationMap_ResizeEnd); this.groupBox7.ResumeLayout(false); this.groupBox7.PerformLayout(); this.MapRightClickContextMenuStrip.ResumeLayout(false); this.locationViewToolStrip.ResumeLayout(false); this.locationViewToolStrip.PerformLayout(); this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); base.ResumeLayout(false); base.PerformLayout(); }
public bool GetDisableWhenUseless(ToolStripButton ctl) { if (_sources.ContainsKey(ctl)) return _sources[ctl].DisableWhenUseless; return CslaActionExtenderProperties.DisableWhenUselessDefault; }
private void btnDressRent_Click(object sender, EventArgs e) { if (tspMenues.Items[tspMenues.Items.IndexOf(btnDressRent) + 1].Image == null) { while (_rentNum > 0) { tspMenues.Items.RemoveAt(tspMenues.Items.IndexOf(btnDressRent) + 1); _rentNum--; } } else { ToolStripButton toolStripButton1 = new ToolStripButton() { Text = @"订单查询", Font = new Font("微软雅黑", 11), ForeColor = Color.White, Margin = new Padding(60, 5, 0, 5), TextAlign = ContentAlignment.MiddleLeft }; toolStripButton1.Click += (o, args) => { FrmOrdersSearch frmDressRentSearch = new FrmOrdersSearch() { Dock = DockStyle.Fill, AutoSize = false, AutoScaleMode = AutoScaleMode.None }; CreateNewPage(toolStripButton1.Text, frmDressRentSearch); }; tspMenues.Items.Insert(tspMenues.Items.IndexOf(btnDressRent) + (_rentNum + 1), toolStripButton1); _rentNum++; ToolStripButton toolStripButton2 = new ToolStripButton() { Text = @"排单查询", Font = new Font("微软雅黑", 11), ForeColor = Color.White, Margin = new Padding(60, 5, 0, 5), TextAlign = ContentAlignment.MiddleLeft }; toolStripButton2.Click += (o, args) => { FrmRentList frmRentList = new FrmRentList(String.Empty) { Dock = DockStyle.Fill, AutoSize = false, AutoScaleMode = AutoScaleMode.None }; CreateNewPage(toolStripButton2.Text, frmRentList); }; tspMenues.Items.Insert(tspMenues.Items.IndexOf(btnDressRent) + (_rentNum + 1), toolStripButton2); _rentNum++; ToolStripButton toolStripButton3 = new ToolStripButton() { Text = @"出租查询", Font = new Font("微软雅黑", 11), ForeColor = Color.White, Margin = new Padding(60, 5, 0, 5), TextAlign = ContentAlignment.MiddleLeft }; toolStripButton3.Click += (o, args) => { FrmDressRentedInfo frmDressRentedInfo = new FrmDressRentedInfo() { Dock = DockStyle.Fill }; CreateNewPage(toolStripButton3.Text, frmDressRentedInfo); }; tspMenues.Items.Insert(tspMenues.Items.IndexOf(btnDressRent) + (_rentNum + 1), toolStripButton3); _rentNum++; ToolStripButton toolStripButton5 = new ToolStripButton() { Text = @"短信设置", Font = new Font("微软雅黑", 11), ForeColor = Color.White, Margin = new Padding(60, 5, 0, 5), TextAlign = ContentAlignment.MiddleLeft }; toolStripButton5.Click += (o, args) => { frmOption frmOption = new frmOption(); frmOption.ShowDialog(); }; tspMenues.Items.Insert(tspMenues.Items.IndexOf(btnDressRent) + (_rentNum + 1), toolStripButton5); _rentNum++; } }
public void SetDisableWhenUseless(ToolStripButton ctl, bool value) { if (_sources.ContainsKey(ctl)) _sources[ctl].DisableWhenUseless = value; else { CslaActionExtenderProperties props = new CslaActionExtenderProperties(); props.DisableWhenUseless = value; _sources.Add(ctl, props); } }
private void toolStripButton1_MouseDown(object sender, MouseEventArgs e) { contextTSB = (sender as ToolStripButton); }
public string GetCommandName(ToolStripButton ctl) { if (_sources.ContainsKey(ctl)) return _sources[ctl].CommandName; return CslaActionExtenderProperties.CommandNameDefault; }
/// <summary> /// Perform the action associated with the toolbar button /// for the current document. /// </summary> /// <param name="button">The toolbar button.</param> /// <returns>The result of the action or true if it doesn't exist /// (cannot fail to perfom something it can't do).</returns> public bool PerformToolbarAction(ToolStripButton button) { return(PerformAction(button.Name)); }
public void SetCommandName(ToolStripButton ctl, string value) { if (_sources.ContainsKey(ctl)) _sources[ctl].CommandName = value; else { CslaActionExtenderProperties props = new CslaActionExtenderProperties(); props.CommandName = value; _sources.Add(ctl, props); } }
public MainForm () { // // _toolStrip // _toolStrip = new ToolStrip (); _toolStrip.Renderer = new ToolStripSystemRenderer (); Controls.Add (_toolStrip); // // _toolStripButton1 // _toolStripButton1 = new ToolStripButton (); _toolStripButton1.Text = "1"; _toolStrip.Items.Add (_toolStripButton1); // // _toolStripButton2 // _toolStripButton2 = new ToolStripButton (); _toolStripButton2.Checked = true; _toolStripButton2.Text = "2"; _toolStrip.Items.Add (_toolStripButton2); // // _toolStripButton3 // _toolStripButton3 = new ToolStripButton (); _toolStripButton3.Text = "3"; _toolStrip.Items.Add (_toolStripButton3); // // _checkedGroupBox // _checkedGroupBox = new GroupBox (); _checkedGroupBox.Location = new Point (20, 35); _checkedGroupBox.Size = new Size (260, 85); _checkedGroupBox.Text = "Checked"; Controls.Add (_checkedGroupBox); // // _button1CheckBox // _button1CheckBox = new CheckBox (); _button1CheckBox.Checked = _toolStripButton1.Checked; _button1CheckBox.Location = new Point (8, 16); _button1CheckBox.Text = "1"; _checkedGroupBox.Controls.Add (_button1CheckBox); _button1CheckBox.CheckedChanged += delegate (object sender, EventArgs e) { _toolStripButton1.Checked = _button1CheckBox.Checked; }; // // _button2CheckBox // _button2CheckBox = new CheckBox (); _button2CheckBox.Checked = _toolStripButton2.Checked; _button2CheckBox.Location = new Point (8, 35); _button2CheckBox.Text = "2"; _checkedGroupBox.Controls.Add (_button2CheckBox); _button2CheckBox.CheckedChanged += delegate (object sender, EventArgs e) { _toolStripButton2.Checked = _button2CheckBox.Checked; }; // // _button3CheckBox // _button3CheckBox = new CheckBox (); _button3CheckBox.Checked = _toolStripButton3.Checked; _button3CheckBox.Location = new Point (8, 55); _button3CheckBox.Text = "3"; _checkedGroupBox.Controls.Add (_button3CheckBox); _button3CheckBox.CheckedChanged += delegate (object sender, EventArgs e) { _toolStripButton3.Checked = _button3CheckBox.Checked; }; // // MainForm // ClientSize = new Size (300, 140); Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #82151"; Load += new EventHandler (MainForm_Load); }
private void InitializeControl(ToolStripButton ctl, KeyValuePair<ToolStripButton, CslaActionExtenderProperties> pair) { if (pair.Value.DisableWhenUseless || (pair.Value.DisableWhenClean && !ctl.Enabled)) { ISavable businessObject = GetBusinessObject(); if (businessObject != null) { ITrackStatus trackableObject = businessObject as ITrackStatus; if (trackableObject != null) { if (pair.Value.ActionType == CslaFormAction.Cancel || pair.Value.DisableWhenClean) ChangeEnabled(ctl, trackableObject.IsNew || trackableObject.IsDirty || trackableObject.IsDeleted); if (pair.Value.ActionType == CslaFormAction.Save) ChangeEnabled(ctl, (trackableObject.IsNew || trackableObject.IsDirty || trackableObject.IsDeleted) && trackableObject.IsValid); } } } }
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 ChangeEnabled(ToolStripButton ctl, bool newEnabled) { // only do this if it's changed to avoid flicker if (ctl.Enabled != newEnabled) ctl.Enabled = newEnabled; }
public void InjectButton(ToolStripButton button) { rdmpTaskBar1.InjectButton(button); }
public ChildForm () { ComponentResourceManager resources = new ComponentResourceManager (typeof (MainForm)); // // _showFunctionButton // _showFunctionButton = new ToolStripButton (); _showFunctionButton.DisplayStyle = ToolStripItemDisplayStyle.Image; _showFunctionButton.Image = ((Image) (resources.GetObject ("_showFunctionButton.Image"))); _showFunctionButton.ImageTransparentColor = Color.White; _showFunctionButton.Name = "ShowFunction"; _showFunctionButton.Size = new Size (23, 22); _showFunctionButton.Text = "Show Function"; _showFunctionButton.CheckOnClick = true; // // _showContextButton // _showContextButton = new ToolStripButton (); _showContextButton.DisplayStyle = ToolStripItemDisplayStyle.Image; _showContextButton.Image = ((Image) (resources.GetObject ("_showContextButton.Image"))); _showContextButton.ImageTransparentColor = Color.Cyan; _showContextButton.Name = "ShowContext"; _showContextButton.Size = new Size (23, 22); _showContextButton.Text = "Show Context"; _showContextButton.CheckOnClick = true; // // ChildForm // AutoScaleDimensions = new SizeF (6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size (200, 150); ResumeLayout (false); PerformLayout (); Activated += new EventHandler (ChildForm_Activated); Deactivate += new EventHandler (ChildForm_Deactivate); }
private Form GetParentForm(ToolStripButton thisToolStripButton) { return(GetParentForm(thisToolStripButton.GetCurrentParent())); }
private void InitializeComponent() { this.icontainer_0 = new Container(); ComponentResourceManager manager = new ComponentResourceManager(typeof(MainForm)); this.toolStrip1 = new ToolStrip(); this.btnOpenDirectory = new ToolStripButton(); this.toolStripSeparator1 = new ToolStripSeparator(); this.btnAddFile = new ToolStripButton(); this.btnDeleteFile = new ToolStripButton(); this.toolStripSeparator2 = new ToolStripSeparator(); this.btnAddCommand = new ToolStripButton(); this.btnEditCommand = new ToolStripButton(); this.btnDeleteCommnad = new ToolStripButton(); this.toolStripSeparator3 = new ToolStripSeparator(); this.btnSaveAll = new ToolStripButton(); this.toolStripSeparator4 = new ToolStripSeparator(); this.btnFindCommand = new ToolStripButton(); this.toolStripSeparator5 = new ToolStripSeparator(); this.btnHelp = new ToolStripButton(); this.statusStrip1 = new StatusStrip(); this.labCurrentPath = new ToolStripStatusLabel(); this.labMessage = new ToolStripStatusLabel(); this.treeView1 = new TreeView(); this.imageList_0 = new ImageList(this.icontainer_0); this.splitter1 = new Splitter(); this.panel1 = new Panel(); this.txtSQL = new SyntaxHighlighterControlFix(); this.splitter2 = new Splitter(); this.txtXML = new SyntaxHighlighterControlFix(); this.contextMenuStrip1 = new ContextMenuStrip(this.icontainer_0); this.menuAdd = new ToolStripMenuItem(); this.menuEdit = new ToolStripMenuItem(); this.menuDelete = new ToolStripMenuItem(); this.menuPaste = new ToolStripMenuItem(); this.toolStripMenuItem1 = new ToolStripSeparator(); this.menuCopyName = new ToolStripMenuItem(); this.menuCopyXml = new ToolStripMenuItem(); this.toolStripMenuItem2 = new ToolStripSeparator(); this.menuGenerateCallCode = new ToolStripMenuItem(); this.fileSystemWatcher_0 = new FileSystemWatcher(); this.timer_0 = new Timer(this.icontainer_0); this.toolStrip1.SuspendLayout(); this.statusStrip1.SuspendLayout(); this.panel1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout(); this.fileSystemWatcher_0.BeginInit(); base.SuspendLayout(); this.toolStrip1.Items.AddRange(new ToolStripItem[] { this.btnOpenDirectory, this.toolStripSeparator1, this.btnAddFile, this.btnDeleteFile, this.toolStripSeparator2, this.btnAddCommand, this.btnEditCommand, this.btnDeleteCommnad, this.toolStripSeparator3, this.btnSaveAll, this.toolStripSeparator4, this.btnFindCommand, this.toolStripSeparator5, this.btnHelp }); this.toolStrip1.Location = new Point(0, 0); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Size = new Size(0x39b, 0x19); this.toolStrip1.TabIndex = 0; this.toolStrip1.Text = "toolStrip1"; // this.btnOpenDirectory.Image = Resources.openfolderHS; this.btnOpenDirectory.ImageTransparentColor = Color.Magenta; this.btnOpenDirectory.Name = "btnOpenDirectory"; this.btnOpenDirectory.Size = new Size(0x5c, 0x16); this.btnOpenDirectory.Text = "打开目录(&D)"; this.btnOpenDirectory.Click += new EventHandler(this.btnOpenDirectory_Click); this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new Size(6, 0x19); //this.btnAddFile.Image = Resources.NewFolderHS; this.btnAddFile.ImageTransparentColor = Color.Magenta; this.btnAddFile.Name = "btnAddFile"; this.btnAddFile.Size = new Size(0x5d, 0x16); this.btnAddFile.Text = "新增文件(&N)"; this.btnAddFile.Click += new EventHandler(this.btnAddFile_Click); //this.btnDeleteFile.Image = Resources.DeleteFolderHS; this.btnDeleteFile.ImageTransparentColor = Color.Magenta; this.btnDeleteFile.Name = "btnDeleteFile"; this.btnDeleteFile.Size = new Size(0x4b, 0x16); this.btnDeleteFile.Text = "删除文件"; this.btnDeleteFile.Click += new EventHandler(this.btnDeleteFile_Click); this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new Size(6, 0x19); // this.btnAddCommand.Image = Resources.NewDocumentHS; this.btnAddCommand.ImageTransparentColor = Color.Magenta; this.btnAddCommand.Name = "btnAddCommand"; this.btnAddCommand.Size = new Size(0x5b, 0x16); this.btnAddCommand.Text = "新增命令(&C)"; this.btnAddCommand.Click += new EventHandler(this.menuAdd_Click); //this.btnEditCommand.Image = (Image) manager.GetObject("btnEditCommand.Image"); this.btnEditCommand.ImageTransparentColor = Color.Magenta; this.btnEditCommand.Name = "btnEditCommand"; this.btnEditCommand.Size = new Size(90, 0x16); this.btnEditCommand.Text = "修改命令(&E)"; this.btnEditCommand.Click += new EventHandler(this.menuEdit_Click); // this.btnDeleteCommnad.Image = Resources.DeleteHS; this.btnDeleteCommnad.ImageTransparentColor = Color.Magenta; this.btnDeleteCommnad.Name = "btnDeleteCommnad"; this.btnDeleteCommnad.Size = new Size(0x4b, 0x16); this.btnDeleteCommnad.Text = "删除命令"; this.btnDeleteCommnad.Click += new EventHandler(this.menuDelete_Click); this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Size = new Size(6, 0x19); // this.btnSaveAll.Image = Resources.SaveAllHS; this.btnSaveAll.ImageTransparentColor = Color.Magenta; this.btnSaveAll.Name = "btnSaveAll"; this.btnSaveAll.Size = new Size(0x72, 0x16); this.btnSaveAll.Text = "保存所有修改(&S)"; this.btnSaveAll.Click += new EventHandler(this.btnSaveAll_Click); this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Size = new Size(6, 0x19); // this.btnFindCommand.Image = Resources.FindHS; this.btnFindCommand.ImageTransparentColor = Color.Magenta; this.btnFindCommand.Name = "btnFindCommand"; this.btnFindCommand.Size = new Size(0x59, 0x16); this.btnFindCommand.Text = "查找命令(&F)"; this.btnFindCommand.Click += new EventHandler(this.btnFindCommand_Click); this.toolStripSeparator5.Name = "toolStripSeparator5"; this.toolStripSeparator5.Size = new Size(6, 0x19); this.btnHelp.DisplayStyle = ToolStripItemDisplayStyle.Image; // this.btnHelp.Image = Resources.Help; this.btnHelp.ImageTransparentColor = Color.Magenta; this.btnHelp.Name = "btnHelp"; this.btnHelp.Size = new Size(0x17, 0x16); this.btnHelp.Text = "帮助页面"; this.btnHelp.ToolTipText = "查看帮助页面"; this.btnHelp.Click += new EventHandler(this.btnHelp_Click); this.statusStrip1.Items.AddRange(new ToolStripItem[] { this.labCurrentPath, this.labMessage }); this.statusStrip1.Location = new Point(0, 0x1dd); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Size = new Size(0x39b, 0x18); this.statusStrip1.TabIndex = 1; this.statusStrip1.Text = "statusStrip1"; this.labCurrentPath.BorderSides = ToolStripStatusLabelBorderSides.All; this.labCurrentPath.BorderStyle = Border3DStyle.SunkenOuter; this.labCurrentPath.ForeColor = Color.Tomato; this.labCurrentPath.IsLink = true; this.labCurrentPath.LinkBehavior = LinkBehavior.NeverUnderline; this.labCurrentPath.LinkColor = Color.Tomato; this.labCurrentPath.Name = "labCurrentPath"; this.labCurrentPath.Size = new Size(0x61, 0x13); this.labCurrentPath.Text = "labCurrentPath"; this.labCurrentPath.TextAlign = ContentAlignment.MiddleLeft; this.labCurrentPath.Click += new EventHandler(this.labCurrentPath_Click); this.labMessage.Name = "labMessage"; this.labMessage.Size = new Size(0x32b, 0x13); this.labMessage.Spring = true; this.labMessage.Text = "Ready."; this.labMessage.TextAlign = ContentAlignment.MiddleLeft; this.treeView1.Dock = DockStyle.Left; this.treeView1.ImageIndex = 0; this.treeView1.ImageList = this.imageList_0; this.treeView1.Location = new Point(0, 0x19); this.treeView1.Name = "treeView1"; this.treeView1.SelectedImageIndex = 0; this.treeView1.Size = new Size(0xe3, 0x1c4); this.treeView1.TabIndex = 2; this.treeView1.NodeMouseDoubleClick += new TreeNodeMouseClickEventHandler(this.treeView1_NodeMouseDoubleClick); this.treeView1.AfterSelect += new TreeViewEventHandler(this.treeView1_AfterSelect); this.treeView1.NodeMouseClick += new TreeNodeMouseClickEventHandler(this.treeView1_NodeMouseClick); this.treeView1.KeyDown += new KeyEventHandler(this.treeView1_KeyDown); this.imageList_0.ColorDepth = ColorDepth.Depth8Bit; this.imageList_0.ImageSize = new Size(0x10, 0x10); this.imageList_0.TransparentColor = Color.Transparent; this.splitter1.Location = new Point(0xe3, 0x19); this.splitter1.Name = "splitter1"; this.splitter1.Size = new Size(7, 0x1c4); this.splitter1.TabIndex = 3; this.splitter1.TabStop = false; this.panel1.Controls.Add(this.txtSQL); this.panel1.Controls.Add(this.splitter2); this.panel1.Controls.Add(this.txtXML); this.panel1.Dock = DockStyle.Fill; this.panel1.Location = new Point(0xea, 0x19); this.panel1.Name = "panel1"; this.panel1.Size = new Size(0x2b1, 0x1c4); this.panel1.TabIndex = 4; this.txtSQL.Dock = DockStyle.Fill; this.txtSQL.Location = new Point(0, 0); this.txtSQL.Name = "txtSQL"; this.txtSQL.Size = new Size(0x2b1, 0xc0); this.txtSQL.TabIndex = 2; this.splitter2.Dock = DockStyle.Bottom; this.splitter2.Location = new Point(0, 0xc0); this.splitter2.Name = "splitter2"; this.splitter2.Size = new Size(0x2b1, 7); this.splitter2.TabIndex = 1; this.splitter2.TabStop = false; this.txtXML.Dock = DockStyle.Bottom; this.txtXML.SetLanguage("xml"); this.txtXML.Location = new Point(0, 0xc7); this.txtXML.Name = "txtXML"; this.txtXML.Size = new Size(0x2b1, 0xfd); this.txtXML.TabIndex = 0; this.contextMenuStrip1.Items.AddRange(new ToolStripItem[] { this.menuAdd, this.menuEdit, this.menuDelete, this.menuPaste, this.toolStripMenuItem1, this.menuCopyName, this.menuCopyXml, this.toolStripMenuItem2, this.menuGenerateCallCode }); this.contextMenuStrip1.Name = "contextMenuStrip1"; this.contextMenuStrip1.Size = new Size(0xb3, 170); this.contextMenuStrip1.Opening += new CancelEventHandler(this.contextMenuStrip1_Opening); // this.menuAdd.Image = Resources.NewDocumentHS; this.menuAdd.Name = "menuAdd"; this.menuAdd.Size = new Size(0xb2, 0x16); this.menuAdd.Text = "新增命令"; this.menuAdd.Click += new EventHandler(this.menuAdd_Click); //this.menuEdit.Image = Resources.EditTableHS; this.menuEdit.Name = "menuEdit"; this.menuEdit.Size = new Size(0xb2, 0x16); this.menuEdit.Text = "修改命令"; this.menuEdit.Click += new EventHandler(this.menuEdit_Click); // this.menuDelete.Image = Resources.DeleteHS; this.menuDelete.Name = "menuDelete"; this.menuDelete.Size = new Size(0xb2, 0x16); this.menuDelete.Text = "删除命令"; this.menuDelete.Click += new EventHandler(this.menuDelete_Click); // this.menuPaste.Image = Resources.PasteHS; this.menuPaste.Name = "menuPaste"; this.menuPaste.Size = new Size(0xb2, 0x16); this.menuPaste.Text = "粘贴命令"; this.menuPaste.Click += new EventHandler(this.menuPaste_Click); this.toolStripMenuItem1.Name = "toolStripMenuItem1"; this.toolStripMenuItem1.Size = new Size(0xaf, 6); // this.menuCopyName.Image = Resources.CopyHS; this.menuCopyName.Name = "menuCopyName"; this.menuCopyName.Size = new Size(0xb2, 0x16); this.menuCopyName.Text = "复制名称 Ctrl-C"; this.menuCopyName.Click += new EventHandler(this.menuCopyName_Click); this.menuCopyXml.Name = "menuCopyXml"; this.menuCopyXml.Size = new Size(0xb2, 0x16); this.menuCopyXml.Text = "复制节点XML"; this.menuCopyXml.Click += new EventHandler(this.menuCopyXml_Click); this.toolStripMenuItem2.Name = "toolStripMenuItem2"; this.toolStripMenuItem2.Size = new Size(0xaf, 6); // this.menuGenerateCallCode.Image = Resources.Bitmap_0; this.menuGenerateCallCode.Name = "menuGenerateCallCode"; this.menuGenerateCallCode.Size = new Size(0xb2, 0x16); this.menuGenerateCallCode.Text = "生成调用代码 F12"; this.menuGenerateCallCode.Click += new EventHandler(this.menuGenerateCallCode_Click); this.fileSystemWatcher_0.EnableRaisingEvents = true; this.fileSystemWatcher_0.SynchronizingObject = this; this.fileSystemWatcher_0.Deleted += new FileSystemEventHandler(this.fileSystemWatcher_0_Changed); this.fileSystemWatcher_0.Created += new FileSystemEventHandler(this.fileSystemWatcher_0_Changed); this.fileSystemWatcher_0.Changed += new FileSystemEventHandler(this.fileSystemWatcher_0_Changed); this.timer_0.Enabled = true; this.timer_0.Interval = 500; this.timer_0.Tick += new EventHandler(this.timer_0_Tick); base.AutoScaleDimensions = new SizeF(6f, 12f); base.AutoScaleMode = AutoScaleMode.Font; base.ClientSize = new Size(0x39b, 0x1f5); base.Controls.Add(this.panel1); base.Controls.Add(this.splitter1); base.Controls.Add(this.treeView1); base.Controls.Add(this.statusStrip1); base.Controls.Add(this.toolStrip1); this.MinimumSize = new Size(700, 400); base.Name = "MainForm"; this.Text = "FastDBEngine XmlCommandTool"; base.WindowState = FormWindowState.Maximized; base.Load += new EventHandler(this.MainForm_Load); base.FormClosing += new FormClosingEventHandler(this.MainForm_FormClosing); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); this.panel1.ResumeLayout(false); this.contextMenuStrip1.ResumeLayout(false); this.fileSystemWatcher_0.EndInit(); base.ResumeLayout(false); base.PerformLayout(); }
private ToolStripItem ToolStripItemHelper(ToolStripItem returnItem, ToolStripItemXmlElement itemEle) { switch (itemEle.ToolBarControlType) { case ToolStripItemType.Button: { ToolStripButton item = new ToolStripButton(this.ToSimpleText(itemEle.TextString)); item.Name = itemEle.Fucation; item.DisplayStyle = itemEle.ToolBarDisplayStyle; returnItem = item; break; } case ToolStripItemType.Label: { ToolStripLabel item = new ToolStripLabel(itemEle.TextString); item.Name = itemEle.Fucation; item.DisplayStyle = itemEle.ToolBarDisplayStyle; returnItem = item; break; } case ToolStripItemType.SplitButton: { ToolStripSplitButton item = new ToolStripSplitButton(itemEle.TextString); BuildToolStripItemSubMethod(itemEle, item, DropControlType.SplitButton); item.Name = itemEle.Fucation; item.DisplayStyle = itemEle.ToolBarDisplayStyle; returnItem = item; break; } case ToolStripItemType.DropDownButton: { ToolStripDropDownButton item = new ToolStripDropDownButton(itemEle.TextString); BuildToolStripItemSubMethod(itemEle, item, DropControlType.DropDownButton); item.Name = itemEle.Fucation; item.DisplayStyle = itemEle.ToolBarDisplayStyle; returnItem = item; break; } case ToolStripItemType.ComboBox: { ToolStripComboBox item = new ToolStripComboBox(); item.Name = itemEle.Fucation; item.DisplayStyle = itemEle.ToolBarDisplayStyle; this.FillComboBoxValue(item, itemEle); returnItem = item; break; } case ToolStripItemType.TextBox: { ToolStripTextBox item = new ToolStripTextBox(); item.Name = itemEle.Fucation; item.DisplayStyle = itemEle.ToolBarDisplayStyle; returnItem = item; break; } case ToolStripItemType.ProgressBar: { ToolStripProgressBar item = new ToolStripProgressBar(); item.Name = itemEle.Fucation; item.DisplayStyle = itemEle.ToolBarDisplayStyle; returnItem = item; break; } case ToolStripItemType.MenuItem: { ToolStripMenuItem item = new ToolStripMenuItem(itemEle.TextString); BuildToolStripItemSubMethod(itemEle, item, DropControlType.MenuItem); item.Name = itemEle.Fucation; item.DisplayStyle = itemEle.MenuDisplayStyle; returnItem = item; break; } case ToolStripItemType.StatusLabel: { ToolStripStatusLabel item = new ToolStripStatusLabel(itemEle.TextString); item.Name = itemEle.Fucation; item.DisplayStyle = itemEle.ToolBarDisplayStyle; returnItem = item; break; } case ToolStripItemType.Separator: { ToolStripSeparator item = new ToolStripSeparator(); returnItem = item; break; } } return(returnItem); }
public Form1() { InitializeComponent(); this.backStage1.VisibleFullText = true; this.sizeComboBox.Validated += SizeComboBox_Validated; this.fontComboBox.Validated += FontComboBox_Validated; this.wordribbon.MenuButtonClick += Wordribbon_MenuButtonClick; this.treeNavigator3.Visible = false; this.treeNavigator2.SelectionChanged += treeNavigator1_SelectionChanged; #if NETCORE this.richTextBox1.LoadFile("..//..//..//temp.rtf"); InfoTabLabelUpdate("..//..//..//temp.rtf"); #else this.richTextBox1.LoadFile("..//..//temp.rtf"); InfoTabLabelUpdate("..//..//temp.rtf"); #endif this.rtbpanel.AutoScroll = true; this.rtbpanel.Dock = DockStyle.Fill; this.richTextBox1.Height = 1600; this.wordribbon.SelectedTab = this.insertTab; this.trackBarItem1.TrackBarExControl.Style = TrackBarEx.Theme.Office2016Colorful; this.printDocument.PrintPage += PrintDocument_PrintPage; StoreToGroupView(); this.treeNavigator1.SelectedItem = this.recenttreeMenuItem; this.treeNavigator1.SelectedItem = this.SaveAsPCtreeMenuItem; this.groupView1.BackColor = Color.FromArgb(241, 241, 241); this.groupView1.HighlightItemColor = Color.FromArgb(197, 197, 197); this.groupView2.BackColor = Color.FromArgb(241, 241, 241); this.groupView2.HighlightItemColor = Color.FromArgb(197, 197, 197); drives = Directory.GetLogicalDrives(); this.WindowState = FormWindowState.Maximized; foreach (string printer in System.Drawing.Printing.PrinterSettings.InstalledPrinters) { this.printerComboBox.Items.Add(printer); } foreach (object page in print.PrinterSettings.PaperSizes) { this.pageSizecomboBox.Items.Add(page); } this.collatedcomboBox.Items.Add("UnCollated"); this.collatedcomboBox.Items.Add("Collated"); this.orientationComboBox.Items.Add("Portrait Orientation"); this.orientationComboBox.Items.Add("Landscape Orientation"); this.collatedcomboBox.SelectedIndex = 0; this.orientationComboBox.SelectedIndex = 0; this.pageSizecomboBox.SelectedIndex = 0; this.printerComboBox.SelectedIndex = 1; foreach (FontFamily oneFontFamily in FontFamily.Families) { fontComboBox.Items.Add(oneFontFamily.Name); } sizeComboBox.Text = this.richTextBox1.Font.Size.ToString(); fontComboBox.Text = this.richTextBox1.Font.FontFamily.Name; fontComboBox.ComboBox.TextBox.SelectionStart = 0; splitContainerAdv1.IsSplitterFixed = true; this.colorpicker1.Picked += Colorpicker1_Picked; this.colorpicker2.Picked += Colorpicker2_Picked; ToolStripButton saveItem = new ToolStripButton(Resources.Save16flat); QuickButtonReflectable quick = new QuickButtonReflectable(saveItem); this.wordribbon.Header.AddQuickItem(quick); this.wordribbon.TouchMode = true; indentText = this.richTextBox1.SelectionIndent; this.wordribbon.MenuColor = ColorTranslator.FromHtml("#2a579a"); richTextBox1.SelectionStart = 0; richTextBox1.SelectedText = "\n\n"; richTextBox1.SelectAll(); richTextBox1.SelectionIndent = 50; richTextBox1.SelectionRightIndent = 50; richTextBox1.SelectionLength = 0; richTextBox1.DeselectAll(); this.wordribbon.QuickPanelVisible = true; this.wordribbon.ThemeName = "Office2019Colorful"; this.Load += Form1_Load; }
InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Objects)); this.m_tvObjs = new System.Windows.Forms.TreeView(); this.m_cntxMenuObjId = new System.Windows.Forms.ContextMenu(); this.m_mnuItemCopy = new System.Windows.Forms.MenuItem(); this.m_mnuItemBrowseReflection = new System.Windows.Forms.MenuItem(); this.m_bnOK = new System.Windows.Forms.Button(); this.m_lvData = new System.Windows.Forms.ListView(); this.m_lvCol_label = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.m_lvCol_value = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.listViewContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); this.toolStripButton2 = new System.Windows.Forms.ToolStripButton(); this.toolStripButton3 = new System.Windows.Forms.ToolStripButton(); this.m_printDialog = new System.Windows.Forms.PrintDialog(); this.m_printDocument = new System.Drawing.Printing.PrintDocument(); this.m_printPreviewDialog = new System.Windows.Forms.PrintPreviewDialog(); this.listViewContextMenuStrip.SuspendLayout(); this.toolStrip1.SuspendLayout(); this.SuspendLayout(); // // m_tvObjs // this.m_tvObjs.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.m_tvObjs.ContextMenu = this.m_cntxMenuObjId; this.m_tvObjs.HideSelection = false; this.m_tvObjs.Location = new System.Drawing.Point(14, 30); this.m_tvObjs.Name = "m_tvObjs"; this.m_tvObjs.Size = new System.Drawing.Size(298, 622); this.m_tvObjs.TabIndex = 0; this.m_tvObjs.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.TreeNodeSelected); this.m_tvObjs.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.TreeNodeSelected); // // m_cntxMenuObjId // this.m_cntxMenuObjId.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.m_mnuItemCopy, this.m_mnuItemBrowseReflection }); // // m_mnuItemCopy // this.m_mnuItemCopy.Index = 0; this.m_mnuItemCopy.Text = "Copy"; this.m_mnuItemCopy.Click += new System.EventHandler(this.ContextMenuClick_Copy); // // m_mnuItemBrowseReflection // this.m_mnuItemBrowseReflection.Index = 1; this.m_mnuItemBrowseReflection.Text = "Browse Using Reflection..."; this.m_mnuItemBrowseReflection.Click += new System.EventHandler(this.ContextMenuClick_BrowseReflection); // // m_bnOK // this.m_bnOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.m_bnOK.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.m_bnOK.FlatStyle = System.Windows.Forms.FlatStyle.System; this.m_bnOK.Location = new System.Drawing.Point(397, 659); this.m_bnOK.Name = "m_bnOK"; this.m_bnOK.Size = new System.Drawing.Size(90, 24); this.m_bnOK.TabIndex = 2; this.m_bnOK.Text = "OK"; // // m_lvData // this.m_lvData.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.m_lvData.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.m_lvCol_label, this.m_lvCol_value }); this.m_lvData.ContextMenuStrip = this.listViewContextMenuStrip; this.m_lvData.FullRowSelect = true; this.m_lvData.GridLines = true; this.m_lvData.HideSelection = false; this.m_lvData.Location = new System.Drawing.Point(341, 30); this.m_lvData.Name = "m_lvData"; this.m_lvData.ShowItemToolTips = true; this.m_lvData.Size = new System.Drawing.Size(524, 622); this.m_lvData.TabIndex = 3; this.m_lvData.UseCompatibleStateImageBehavior = false; this.m_lvData.View = System.Windows.Forms.View.Details; this.m_lvData.Click += new System.EventHandler(this.DataItemSelected); this.m_lvData.DoubleClick += new System.EventHandler(this.DataItemSelected); // // m_lvCol_label // this.m_lvCol_label.Text = "Field"; this.m_lvCol_label.Width = 200; // // m_lvCol_value // this.m_lvCol_value.Text = "Value"; this.m_lvCol_value.Width = 300; // // listViewContextMenuStrip // this.listViewContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.copyToolStripMenuItem }); this.listViewContextMenuStrip.Name = "listViewContextMenuStrip"; this.listViewContextMenuStrip.Size = new System.Drawing.Size(107, 26); // // copyToolStripMenuItem // this.copyToolStripMenuItem.Image = global::RevitLookup.Properties.Resources.Copy; this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; this.copyToolStripMenuItem.Size = new System.Drawing.Size(106, 22); this.copyToolStripMenuItem.Text = "Copy"; this.copyToolStripMenuItem.Click += new System.EventHandler(this.CopyToolStripMenuItem_Click); // // toolStrip1 // this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripButton1, this.toolStripButton2, this.toolStripButton3 }); this.toolStrip1.Location = new System.Drawing.Point(0, 0); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Size = new System.Drawing.Size(879, 25); this.toolStrip1.TabIndex = 4; // // toolStripButton1 // this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripButton1.Image = global::RevitLookup.Properties.Resources.Print; this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButton1.Name = "toolStripButton1"; this.toolStripButton1.Size = new System.Drawing.Size(23, 22); this.toolStripButton1.Text = "Print"; this.toolStripButton1.Click += new System.EventHandler(this.PrintMenuItem_Click); // // toolStripButton2 // this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripButton2.Image = global::RevitLookup.Properties.Resources.Preview; this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButton2.Name = "toolStripButton2"; this.toolStripButton2.Size = new System.Drawing.Size(23, 22); this.toolStripButton2.Text = "Print Preview"; this.toolStripButton2.Click += new System.EventHandler(this.PrintPreviewMenuItem_Click); // // toolStripButton3 // this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripButton3.Image = global::RevitLookup.Properties.Resources.Copy; this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButton3.Name = "toolStripButton3"; this.toolStripButton3.Size = new System.Drawing.Size(23, 22); this.toolStripButton3.Text = "Copy To Clipboard"; this.toolStripButton3.Click += new System.EventHandler(this.ContextMenuClick_Copy); // // m_printDialog // this.m_printDialog.Document = this.m_printDocument; this.m_printDialog.UseEXDialog = true; // // m_printDocument // this.m_printDocument.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.PrintDocument_PrintPage); // // m_printPreviewDialog // this.m_printPreviewDialog.AutoScrollMargin = new System.Drawing.Size(0, 0); this.m_printPreviewDialog.AutoScrollMinSize = new System.Drawing.Size(0, 0); this.m_printPreviewDialog.ClientSize = new System.Drawing.Size(400, 300); this.m_printPreviewDialog.Document = this.m_printDocument; this.m_printPreviewDialog.Enabled = true; this.m_printPreviewDialog.Icon = ((System.Drawing.Icon)(resources.GetObject("m_printPreviewDialog.Icon"))); this.m_printPreviewDialog.Name = "m_printPreviewDialog"; this.m_printPreviewDialog.Visible = false; // // Objects // this.AutoScaleBaseSize = new System.Drawing.Size(6, 16); this.CancelButton = this.m_bnOK; this.ClientSize = new System.Drawing.Size(879, 689); this.Controls.Add(this.toolStrip1); this.Controls.Add(this.m_lvData); this.Controls.Add(this.m_tvObjs); this.Controls.Add(this.m_bnOK); this.Font = new System.Drawing.Font("΢ÈíÑźÚ", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; this.MinimumSize = new System.Drawing.Size(780, 215); this.Name = "Objects"; this.ShowInTaskbar = false; this.Text = "Snoop Objects"; this.listViewContextMenuStrip.ResumeLayout(false); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); }
/// <summary> /// This method is required for Windows Forms designer support. /// Do not change the method contents inside the source code editor. The Forms designer might /// not be able to load this method if it was changed manually. /// </summary> private void InitializeComponent() { this.layoutsListView = new System.Windows.Forms.ListView(); this.toolStrip = new PluginCore.Controls.ToolStripEx(); this.loadStripButton = new System.Windows.Forms.ToolStripButton(); this.deleteStripButton = new System.Windows.Forms.ToolStripButton(); this.saveStripButton = new System.Windows.Forms.ToolStripButton(); this.settingStripButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator(); this.toolStrip.SuspendLayout(); this.SuspendLayout(); // // layoutsListView // this.layoutsListView.BorderStyle = System.Windows.Forms.BorderStyle.None; this.layoutsListView.Dock = System.Windows.Forms.DockStyle.Fill; this.layoutsListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; this.layoutsListView.MultiSelect = false; this.layoutsListView.Name = "layoutsListView"; this.layoutsListView.Size = new System.Drawing.Size(297, 256); this.layoutsListView.TabIndex = 11; this.layoutsListView.UseCompatibleStateImageBehavior = false; this.layoutsListView.View = System.Windows.Forms.View.List; this.layoutsListView.DoubleClick += new System.EventHandler(this.LayoutsListViewDoubleClick); this.layoutsListView.SelectedIndexChanged += new System.EventHandler(this.LayoutsListViewSelectedIndexChanged); // // toolStrip // this.toolStrip.CanOverflow = false; this.toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.loadStripButton, this.deleteStripButton, this.saveStripButton, this.toolStripSeparator, this.settingStripButton }); this.toolStrip.Name = "toolStrip"; this.toolStrip.Dock = System.Windows.Forms.DockStyle.Top; this.toolStrip.Padding = new System.Windows.Forms.Padding(1, 1, 2, 2); this.toolStrip.Size = new System.Drawing.Size(297, 25); this.toolStrip.TabIndex = 13; // // loadStripButton // this.loadStripButton.Margin = new System.Windows.Forms.Padding(1, 1, 0, 1); this.loadStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.loadStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.loadStripButton.Name = "loadStripButton"; this.loadStripButton.Size = new System.Drawing.Size(23, 22); this.loadStripButton.ToolTipText = "Load Layout"; this.loadStripButton.Click += new System.EventHandler(this.LoadButtonClick); // // deleteStripButton // this.deleteStripButton.Margin = new System.Windows.Forms.Padding(0, 1, 0, 1); this.deleteStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.deleteStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.deleteStripButton.Name = "deleteStripButton"; this.deleteStripButton.Size = new System.Drawing.Size(23, 22); this.deleteStripButton.ToolTipText = "Delete Layout"; this.deleteStripButton.Click += new System.EventHandler(this.DeleteButtonClick); // // saveStripButton // this.saveStripButton.Margin = new System.Windows.Forms.Padding(0, 1, 0, 1); this.saveStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.saveStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.saveStripButton.Name = "saveStripButton"; this.saveStripButton.Size = new System.Drawing.Size(23, 22); this.saveStripButton.ToolTipText = "Save Current..."; this.saveStripButton.Click += new System.EventHandler(this.SaveButtonClick); // // settingStripButton // this.settingStripButton.Margin = new System.Windows.Forms.Padding(0, 1, 0, 1); this.settingStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.settingStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.settingStripButton.Name = "settingsStripButton"; this.settingStripButton.Size = new System.Drawing.Size(23, 22); this.settingStripButton.ToolTipText = "Show Settings..."; this.settingStripButton.Click += new System.EventHandler(this.SettingsButtonClick); // // toolStripSeparator // this.toolStripSeparator.Name = "toolStripSeparator"; this.toolStripSeparator.Size = new System.Drawing.Size(6, 25); this.toolStripSeparator.Margin = new System.Windows.Forms.Padding(0, 0, 1, 0); // // PluginUI // this.Name = "PluginUI"; this.Controls.Add(this.layoutsListView); this.Controls.Add(this.toolStrip); this.Size = new System.Drawing.Size(299, 283); this.Load += new System.EventHandler(this.FormLoaded); this.toolStrip.ResumeLayout(false); this.toolStrip.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); }
private void btnDressManage_Click(object sender, EventArgs e) { if (tspMenues.Items[tspMenues.Items.IndexOf(btnDressManage) + 1].Image == null) { while (_dressNum > 0) { tspMenues.Items.RemoveAt(tspMenues.Items.IndexOf(btnDressManage) + 1); _dressNum--; } } else { ToolStripButton toolStripButton1 = new ToolStripButton { Text = @"礼服建档", Font = new Font("微软雅黑", 11), ForeColor = Color.White, Margin = new Padding(60, 5, 0, 5), TextAlign = ContentAlignment.MiddleLeft }; toolStripButton1.Click += (o, args) => { new FrmNewDress().ShowDialog(); }; tspMenues.Items.Insert(tspMenues.Items.IndexOf(btnDressManage) + (_dressNum + 1), toolStripButton1); _dressNum++; ToolStripButton toolStripButton3 = new ToolStripButton { Text = @"礼服修改", Font = new Font("微软雅黑", 11), ForeColor = Color.White, Margin = new Padding(60, 5, 0, 5), TextAlign = ContentAlignment.MiddleLeft }; toolStripButton3.Click += (o, args) => { new FrmDressModify().ShowDialog(); }; tspMenues.Items.Insert(tspMenues.Items.IndexOf(btnDressManage) + (_dressNum + 1), toolStripButton3); _dressNum++; ToolStripButton toolStripButton4 = new ToolStripButton() { Text = @"跨馆设置", Font = new Font("微软雅黑", 11), ForeColor = Color.White, Margin = new Padding(60, 5, 0, 5), TextAlign = ContentAlignment.MiddleLeft }; toolStripButton4.Click += (o, args) => { new FrmCrossReservation().ShowDialog(); }; tspMenues.Items.Insert(tspMenues.Items.IndexOf(btnDressManage) + (_dressNum + 1), toolStripButton4); _dressNum++; if (Information.CurrentUser.UserPower.Contains(Powers.礼服.高级删除)) { ToolStripButton toolStripButton6 = new ToolStripButton() { Text = @"场馆管理", Font = new Font("微软雅黑", 11), ForeColor = Color.White, Margin = new Padding(60, 5, 0, 5), TextAlign = ContentAlignment.MiddleLeft }; toolStripButton6.Click += (o, args) => { FrmVenue frmVenue = new FrmVenue() { Dock = DockStyle.Fill, AutoSize = false, AutoScaleMode = AutoScaleMode.None }; CreateNewPage(toolStripButton6.Text, frmVenue); }; tspMenues.Items.Insert(tspMenues.Items.IndexOf(btnDressManage) + (_dressNum + 1), toolStripButton6); _dressNum++; } ToolStripButton toolStripButton7 = new ToolStripButton() { Text = @"礼服匹配", Font = new Font("微软雅黑", 11), ForeColor = Color.White, Margin = new Padding(60, 5, 0, 5), TextAlign = ContentAlignment.MiddleLeft }; toolStripButton7.Click += (o, args) => { new FrmSceneDress().ShowDialog(); }; tspMenues.Items.Insert(tspMenues.Items.IndexOf(btnDressManage) + (_dressNum + 1), toolStripButton7); _dressNum++; ToolStripButton toolStripButton8 = new ToolStripButton() { Text = @"小件管理", Font = new Font("微软雅黑", 11), ForeColor = Color.White, Margin = new Padding(60, 5, 0, 5), TextAlign = ContentAlignment.MiddleLeft }; toolStripButton8.Click += (o, args) => { new FrmSmallGoods().ShowDialog(); }; tspMenues.Items.Insert(tspMenues.Items.IndexOf(btnDressManage) + (_dressNum + 1), toolStripButton8); _dressNum++; } }
private void contextMenuRecord_Opening(object sender, CancelEventArgs e) { var records = this.PluginTree.SelectedRecords; int nrecords = records.Count(); if (nrecords == 0) { e.Cancel = true; return; } int nparents = records.Select(x => x.Parent).Distinct().Count(); bool anyPlugins = records.Any(x => x is Plugin); if (nparents > 1) { this.contextMenuRecordEdit.Visible = false; this.contextMenuRecordCopy.Enabled = false; this.contextMenuRecordCopy.ToolTipText = Resources.CannotCopyNodesFromDifferentParents; this.contextMenuRecordCopyTo.Enabled = false; this.contextMenuRecordCopyTo.ToolTipText = Resources.CannotCopyNodesFromDifferentParents; } else if (anyPlugins) { this.contextMenuRecordEdit.Visible = false; this.contextMenuRecordCopy.Enabled = false; this.contextMenuRecordCopy.ToolTipText = Resources.CannotCopyPlugin; this.contextMenuRecordCopyTo.Enabled = false; this.contextMenuRecordCopyTo.ToolTipText = Resources.CannotCopyPlugin; } else { this.contextMenuRecordEdit.Visible = nrecords == 1; this.contextMenuRecordCopy.Enabled = true; this.contextMenuRecordCopy.ToolTipText = Resources.Copy_Record_to_Clipboard; this.contextMenuRecordCopyTo.Enabled = this.PluginTree.SelectedObjects.Count > 0; this.contextMenuRecordCopyTo.ToolTipText = null; } this.contextMenuRecordAddMaster.Visible = false; this.contextMenuRecordCopyTo.DropDownItems.Clear(); if (nparents != 1) { return; } var srcRecord = records.First(); var srcPlugin = this.GetPluginFromNode(srcRecord); if (this.contextMenuRecordCopyTo.Enabled) { foreach (Plugin plugin in PluginList.All.Records) { if (plugin == null) { continue; } if (srcPlugin.Equals(plugin)) { continue; } var tsi = new ToolStripButton(plugin.Name); tsi.Tag = new object[] { records.ToArray(), plugin }; var sz = TextRenderer.MeasureText(plugin.Name, this.contextMenuRecordCopyTo.Font); if (sz.Width > tsi.Width) { tsi.Width = sz.Width; } tsi.AutoSize = true; this.contextMenuRecordCopyTo.DropDownItems.Add(tsi); } } // only allow master selectio when single plugin is selected if (nrecords == 1 && srcRecord is Plugin) { string[] masters = srcPlugin.GetMasters(); Array.Sort(masters, StringComparer.InvariantCultureIgnoreCase); foreach (var item in this.contextMenuRecordAddMaster.DropDownItems.OfType <ToolStripButton>().Where(x => !x.Equals(this.browseToolStripMenuItem)).ToArray()) { this.contextMenuRecordAddMaster.DropDownItems.Remove(item); } foreach (Plugin plugin in PluginList.All.Records) { if (plugin == null) { continue; } if (srcPlugin.Equals(plugin)) { continue; // ignore self } if (Array.BinarySearch(masters, plugin.Name, StringComparer.InvariantCultureIgnoreCase) >= 0) { // ignore masters continue; } var tsi = new ToolStripButton(plugin.Name); tsi.Tag = new object[] { srcRecord, plugin }; var sz = TextRenderer.MeasureText(plugin.Name, this.contextMenuRecordCopyTo.Font); if (sz.Width > tsi.Width) { tsi.Width = sz.Width; } tsi.AutoSize = true; this.contextMenuRecordAddMaster.DropDownItems.Add(tsi); } this.contextMenuRecordAddMaster.Visible = true; } }
InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Parameters)); this.m_tvObjs = new System.Windows.Forms.TreeView(); this.m_cntxMenuObjId = new System.Windows.Forms.ContextMenu(); this.m_mnuItemCopy = new System.Windows.Forms.MenuItem(); this.m_mnuItemBrowseReflection = new System.Windows.Forms.MenuItem(); this.m_bnOK = new System.Windows.Forms.Button(); this.m_lvData = new System.Windows.Forms.ListView(); this.m_lvCol_label = new System.Windows.Forms.ColumnHeader(); this.m_lvCol_value = new System.Windows.Forms.ColumnHeader(); this.listViewContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.m_bnParamEnums = new System.Windows.Forms.Button(); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); this.toolStripButton2 = new System.Windows.Forms.ToolStripButton(); this.toolStripButton3 = new System.Windows.Forms.ToolStripButton(); this.m_printDialog = new System.Windows.Forms.PrintDialog(); this.m_printDocument = new System.Drawing.Printing.PrintDocument(); this.m_printPreviewDialog = new System.Windows.Forms.PrintPreviewDialog(); this.m_bnParamEnumsMap = new System.Windows.Forms.Button(); this.listViewContextMenuStrip.SuspendLayout(); this.toolStrip1.SuspendLayout(); this.SuspendLayout(); // // m_tvObjs // this.m_tvObjs.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.m_tvObjs.ContextMenu = this.m_cntxMenuObjId; this.m_tvObjs.HideSelection = false; this.m_tvObjs.Location = new System.Drawing.Point(11, 38); this.m_tvObjs.Name = "m_tvObjs"; this.m_tvObjs.Size = new System.Drawing.Size(248, 415); this.m_tvObjs.TabIndex = 0; this.m_tvObjs.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.TreeNodeSelected); this.m_tvObjs.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.TreeNodeSelected); // // m_cntxMenuObjId // this.m_cntxMenuObjId.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.m_mnuItemCopy, this.m_mnuItemBrowseReflection }); // // m_mnuItemCopy // this.m_mnuItemCopy.Index = 0; this.m_mnuItemCopy.Text = "Copy"; this.m_mnuItemCopy.Click += new System.EventHandler(this.ContextMenuClick_Copy); // // m_mnuItemBrowseReflection // this.m_mnuItemBrowseReflection.Index = 1; this.m_mnuItemBrowseReflection.Text = "Browse Using Reflection..."; this.m_mnuItemBrowseReflection.Click += new System.EventHandler(this.ContextMenuClick_BrowseReflection); // // m_bnOK // this.m_bnOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.m_bnOK.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.m_bnOK.FlatStyle = System.Windows.Forms.FlatStyle.System; this.m_bnOK.Location = new System.Drawing.Point(476, 459); this.m_bnOK.Name = "m_bnOK"; this.m_bnOK.Size = new System.Drawing.Size(75, 23); this.m_bnOK.TabIndex = 2; this.m_bnOK.Text = "OK"; // // m_lvData // this.m_lvData.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.m_lvData.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.m_lvCol_label, this.m_lvCol_value }); this.m_lvData.ContextMenuStrip = this.listViewContextMenuStrip; this.m_lvData.FullRowSelect = true; this.m_lvData.GridLines = true; this.m_lvData.Location = new System.Drawing.Point(275, 38); this.m_lvData.Name = "m_lvData"; this.m_lvData.Size = new System.Drawing.Size(504, 415); this.m_lvData.TabIndex = 3; this.m_lvData.UseCompatibleStateImageBehavior = false; this.m_lvData.View = System.Windows.Forms.View.Details; this.m_lvData.DoubleClick += new System.EventHandler(this.DataItemSelected); this.m_lvData.Click += new System.EventHandler(this.DataItemSelected); // // m_lvCol_label // this.m_lvCol_label.Text = "Field"; this.m_lvCol_label.Width = 200; // // m_lvCol_value // this.m_lvCol_value.Text = "Value"; this.m_lvCol_value.Width = 300; // // listViewContextMenuStrip // this.listViewContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.copyToolStripMenuItem }); this.listViewContextMenuStrip.Name = "listViewContextMenuStrip"; this.listViewContextMenuStrip.Size = new System.Drawing.Size(103, 26); // // copyToolStripMenuItem // this.copyToolStripMenuItem.Image = global::RevitLookup.Properties.Resources.COPY; this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; this.copyToolStripMenuItem.Size = new System.Drawing.Size(102, 22); this.copyToolStripMenuItem.Text = "Copy"; this.copyToolStripMenuItem.Click += new System.EventHandler(this.CopyToolStripMenuItem_Click); // // m_bnParamEnums // this.m_bnParamEnums.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.m_bnParamEnums.Location = new System.Drawing.Point(11, 459); this.m_bnParamEnums.Name = "m_bnParamEnums"; this.m_bnParamEnums.Size = new System.Drawing.Size(130, 23); this.m_bnParamEnums.TabIndex = 4; this.m_bnParamEnums.Text = "Built-in Enums Snoop..."; this.m_bnParamEnums.UseVisualStyleBackColor = true; this.m_bnParamEnums.Click += new System.EventHandler(this.OnBnEnumSnoop); // // toolStrip1 // this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripButton1, this.toolStripButton2, this.toolStripButton3 }); this.toolStrip1.Location = new System.Drawing.Point(0, 0); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Size = new System.Drawing.Size(800, 25); this.toolStrip1.TabIndex = 5; this.toolStrip1.Text = "toolStrip1"; // // toolStripButton1 // this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripButton1.Image = global::RevitLookup.Properties.Resources.Print; this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButton1.Name = "toolStripButton1"; this.toolStripButton1.Size = new System.Drawing.Size(23, 22); this.toolStripButton1.Text = "Print"; this.toolStripButton1.Click += new System.EventHandler(this.PrintMenuItem_Click); // // toolStripButton2 // this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripButton2.Image = global::RevitLookup.Properties.Resources.Preview; this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButton2.Name = "toolStripButton2"; this.toolStripButton2.Size = new System.Drawing.Size(23, 22); this.toolStripButton2.Text = "Print Preview"; this.toolStripButton2.Click += new System.EventHandler(this.PrintPreviewMenuItem_Click); // // toolStripButton3 // this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripButton3.Image = global::RevitLookup.Properties.Resources.COPY; this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButton3.Name = "toolStripButton3"; this.toolStripButton3.Size = new System.Drawing.Size(23, 22); this.toolStripButton3.Text = "Copy To Clipboard"; this.toolStripButton3.Click += new System.EventHandler(this.ContextMenuClick_Copy); // // m_printDialog // this.m_printDialog.Document = this.m_printDocument; this.m_printDialog.UseEXDialog = true; // // m_printDocument // this.m_printDocument.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.PrintDocument_PrintPage); // // m_printPreviewDialog // this.m_printPreviewDialog.AutoScrollMargin = new System.Drawing.Size(0, 0); this.m_printPreviewDialog.AutoScrollMinSize = new System.Drawing.Size(0, 0); this.m_printPreviewDialog.ClientSize = new System.Drawing.Size(400, 300); this.m_printPreviewDialog.Document = this.m_printDocument; this.m_printPreviewDialog.Enabled = true; this.m_printPreviewDialog.Icon = ((System.Drawing.Icon)(resources.GetObject("m_printPreviewDialog.Icon"))); this.m_printPreviewDialog.Name = "m_printPreviewDialog"; this.m_printPreviewDialog.Visible = false; // // m_bnParamEnumsMap // this.m_bnParamEnumsMap.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.m_bnParamEnumsMap.Location = new System.Drawing.Point(153, 459); this.m_bnParamEnumsMap.Name = "m_bnParamEnumsMap"; this.m_bnParamEnumsMap.Size = new System.Drawing.Size(130, 23); this.m_bnParamEnumsMap.TabIndex = 6; this.m_bnParamEnumsMap.Text = "Built-in Enums Map..."; this.m_bnParamEnumsMap.UseVisualStyleBackColor = true; this.m_bnParamEnumsMap.Click += new System.EventHandler(this.OnBnEnumMap); // // Parameters // this.AcceptButton = this.m_bnOK; this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.CancelButton = this.m_bnOK; this.ClientSize = new System.Drawing.Size(800, 489); this.Controls.Add(this.toolStrip1); this.Controls.Add(this.m_bnParamEnumsMap); this.Controls.Add(this.m_bnParamEnums); this.Controls.Add(this.m_lvData); this.Controls.Add(this.m_bnOK); this.Controls.Add(this.m_tvObjs); this.MaximizeBox = false; this.MinimizeBox = false; this.MinimumSize = new System.Drawing.Size(650, 200); this.Name = "Parameters"; this.ShowInTaskbar = false; this.Text = "Snoop Parameters"; this.listViewContextMenuStrip.ResumeLayout(false); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); BaseForm.LoadDockStates(); warningForm = new WarningForm(); warningForm.UpdateVisible(false); ///<Behnam> // Adding a tool bar button for each type of inputs. foreach (var id in new FileContainer().AllID) { if (id != FileContainer.MaizeVarietyID && id != FileContainer.MaizeNonVarietyID) { if (id == FileContainer.ManagementID) { toolStripInput.Items.Add(new ToolStripSeparator()); } if (id == FileContainer.NonVarietyID) { toolStripInput.Items.Add(new ToolStripSeparator()); } if (id == FileContainer.RunID) { toolStripInput.Items.Add(new ToolStripSeparator()); } toolStripInput.Items.Add(new ToolStripButton(id, null, OnToolStripInputIDClick) { Tag = id }); if (id == FileContainer.RunOptionID) { // Adding the folder run button mode. toolStripInput.Items.Add(new ToolStripButton("Full-factorial run", null, FolderRun)); toolStripInput.Items.Add(new ToolStripSeparator()); } } } ///</Behnam> warningButton = new ToolStripButton("Warning (0)", null, OnToolStripWarningClick) { Alignment = ToolStripItemAlignment.Right }; toolStripInput.Items.Add(warningButton); toolStripInput.Items.Add(new ToolStripSeparator { Alignment = ToolStripItemAlignment.Right }); projectFileBindingSource1.DataSource = ProjectFile.ThisArray; if (Settings.Default.LastProjectFile != "?\\?") { try { workerControl1.LoadProjectFile(Settings.Default.LastProjectFile); } catch (Exception ex) { ex.Show("Loading startup project"); } } ///<Behnam> // var formatToolStripComboBox = new ToolStripComboBox("Output version") { Alignment = ToolStripItemAlignment.Right ,AutoSize = false, Width = 55 }; // var formatComboBox = (ComboBox)formatToolStripComboBox.Control; // formatComboBox.Items.Add(OutputVersion.V13); // formatComboBox.Items.Add(OutputVersion.V15); // formatComboBox.Items.Add(OutputVersion.Cus); // toolStripInput.Items.Add(formatToolStripComboBox); // toolStripInput.Items.Add(new ToolStripLabel("Output version:") { Alignment = ToolStripItemAlignment.Right }); // toolStripInput.Items.Add(new ToolStripSeparator { Alignment = ToolStripItemAlignment.Right }); // formatComboBox.DataBindings.Add(new Binding("SelectedItem", projectFileBindingSource1, "OutputVersion", true, DataSourceUpdateMode.OnPropertyChanged)); // formatComboBox.SelectedIndexChanged += formatComboBox_SelectedIndexChanged; ///</Behnam> Icon = Icon.FromHandle(Resources.siriusQualityLogo2.GetHicon()); warningForm.Show(); switch (WindowState) { case FormWindowState.Minimized: WindowState = FormWindowState.Normal; break; } this.EnsureFitsInDesktop(); if (trial) { this.Text = " SiriusQuality ( Trial Mode)"; } }
public MenuItemCollectionEditorDialog(System.Web.UI.WebControls.Menu menu, MenuDesigner menuDesigner) : base(menu.Site) { this._webMenu = menu; this._menuDesigner = menuDesigner; this._treeViewPanel = new System.Windows.Forms.Panel(); this._treeView = new System.Windows.Forms.TreeView(); this._treeViewToolBar = new ToolStrip(); ToolStripRenderer toolStripRenderer = UIServiceHelper.GetToolStripRenderer(base.ServiceProvider); if (toolStripRenderer != null) { this._treeViewToolBar.Renderer = toolStripRenderer; } this._propertyGrid = new VsPropertyGrid(base.ServiceProvider); this._okButton = new System.Windows.Forms.Button(); this._cancelButton = new System.Windows.Forms.Button(); this._propertiesLabel = new System.Windows.Forms.Label(); this._nodesLabel = new System.Windows.Forms.Label(); this._addRootButton = base.CreatePushButton(System.Design.SR.GetString("MenuItemCollectionEditor_AddRoot"), 3); this._addChildButton = base.CreatePushButton(System.Design.SR.GetString("MenuItemCollectionEditor_AddChild"), 2); this._removeButton = base.CreatePushButton(System.Design.SR.GetString("MenuItemCollectionEditor_Remove"), 4); this._moveUpButton = base.CreatePushButton(System.Design.SR.GetString("MenuItemCollectionEditor_MoveUp"), 5); this._moveDownButton = base.CreatePushButton(System.Design.SR.GetString("MenuItemCollectionEditor_MoveDown"), 6); this._indentButton = base.CreatePushButton(System.Design.SR.GetString("MenuItemCollectionEditor_Indent"), 1); this._unindentButton = base.CreatePushButton(System.Design.SR.GetString("MenuItemCollectionEditor_Unindent"), 0); this._toolBarSeparator = new ToolStripSeparator(); this._treeViewPanel.SuspendLayout(); base.SuspendLayout(); this._treeViewPanel.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; this._treeViewPanel.BackColor = SystemColors.ControlDark; this._treeViewPanel.Controls.Add(this._treeView); this._treeViewPanel.DockPadding.Left = 1; this._treeViewPanel.DockPadding.Right = 1; this._treeViewPanel.DockPadding.Bottom = 1; this._treeViewPanel.DockPadding.Top = 1; this._treeViewPanel.Location = new Point(12, 0x36); this._treeViewPanel.Name = "_treeViewPanel"; this._treeViewPanel.Size = new Size(0xe3, 0xe9); this._treeViewPanel.TabIndex = 1; this._treeView.BorderStyle = System.Windows.Forms.BorderStyle.None; this._treeView.Dock = DockStyle.Fill; this._treeView.ImageIndex = -1; this._treeView.HideSelection = false; this._treeView.Location = new Point(1, 1); this._treeView.Name = "_treeView"; this._treeView.SelectedImageIndex = -1; this._treeView.TabIndex = 0; this._treeView.AfterSelect += new TreeViewEventHandler(this.OnTreeViewAfterSelect); this._treeView.KeyDown += new KeyEventHandler(this.OnTreeViewKeyDown); this._treeViewToolBar.Items.AddRange(new ToolStripItem[] { this._addRootButton, this._addChildButton, this._removeButton, this._toolBarSeparator, this._moveUpButton, this._moveDownButton, this._unindentButton, this._indentButton }); this._treeViewToolBar.Location = new Point(12, 0x1c); this._treeViewToolBar.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; this._treeViewToolBar.AutoSize = false; this._treeViewToolBar.Size = new Size(0xe3, 0x1a); this._treeViewToolBar.CanOverflow = false; Padding padding = this._treeViewToolBar.Padding; padding.Left = 2; this._treeViewToolBar.Padding = padding; this._treeViewToolBar.Name = "_treeViewToolBar"; this._treeViewToolBar.ShowItemToolTips = true; this._treeViewToolBar.GripStyle = ToolStripGripStyle.Hidden; this._treeViewToolBar.TabIndex = 1; this._treeViewToolBar.TabStop = true; this._treeViewToolBar.ItemClicked += new ToolStripItemClickedEventHandler(this.OnTreeViewToolBarButtonClick); this._propertyGrid.Anchor = AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Top; this._propertyGrid.CommandsVisibleIfAvailable = true; this._propertyGrid.LargeButtons = false; this._propertyGrid.LineColor = SystemColors.ScrollBar; this._propertyGrid.Location = new Point(260, 0x1c); this._propertyGrid.Name = "_propertyGrid"; this._propertyGrid.PropertySort = PropertySort.Alphabetical; this._propertyGrid.Size = new Size(0xcc, 0x103); this._propertyGrid.TabIndex = 3; this._propertyGrid.Text = System.Design.SR.GetString("MenuItemCollectionEditor_PropertyGrid"); this._propertyGrid.ToolbarVisible = true; this._propertyGrid.ViewBackColor = SystemColors.Window; this._propertyGrid.ViewForeColor = SystemColors.WindowText; this._propertyGrid.PropertyValueChanged += new PropertyValueChangedEventHandler(this.OnPropertyGridPropertyValueChanged); this._propertyGrid.Site = this._webMenu.Site; this._okButton.Anchor = AnchorStyles.Right | AnchorStyles.Bottom; this._okButton.FlatStyle = FlatStyle.System; this._okButton.Location = new Point(0x135, 0x128); this._okButton.Name = "_okButton"; this._okButton.Size = new Size(0x4b, 0x17); this._okButton.TabIndex = 9; this._okButton.Text = System.Design.SR.GetString("MenuItemCollectionEditor_OK"); this._okButton.Click += new EventHandler(this.OnOkButtonClick); this._cancelButton.Anchor = AnchorStyles.Right | AnchorStyles.Bottom; this._cancelButton.FlatStyle = FlatStyle.System; this._cancelButton.Location = new Point(0x185, 0x128); this._cancelButton.Name = "_cancelButton"; this._cancelButton.Size = new Size(0x4b, 0x17); this._cancelButton.TabIndex = 10; this._cancelButton.Text = System.Design.SR.GetString("MenuItemCollectionEditor_Cancel"); this._cancelButton.Click += new EventHandler(this.OnCancelButtonClick); this._propertiesLabel.Anchor = AnchorStyles.Right | AnchorStyles.Top; this._propertiesLabel.Location = new Point(260, 12); this._propertiesLabel.Name = "_propertiesLabel"; this._propertiesLabel.Size = new Size(0xcc, 14); this._propertiesLabel.TabIndex = 2; this._propertiesLabel.Text = System.Design.SR.GetString("MenuItemCollectionEditor_Properties"); this._nodesLabel.Location = new Point(12, 12); this._nodesLabel.Name = "_nodesLabel"; this._nodesLabel.Size = new Size(100, 14); this._nodesLabel.TabIndex = 0; this._nodesLabel.Text = System.Design.SR.GetString("MenuItemCollectionEditor_Nodes"); ImageList list = new ImageList { ImageSize = new Size(0x10, 0x10), TransparentColor = Color.Magenta }; list.Images.AddStrip(new Bitmap(base.GetType(), "Commands.bmp")); this._treeViewToolBar.ImageList = list; base.ClientSize = new Size(0x1de, 0x14b); base.CancelButton = this._cancelButton; base.Controls.AddRange(new Control[] { this._nodesLabel, this._propertiesLabel, this._cancelButton, this._okButton, this._propertyGrid, this._treeViewPanel, this._treeViewToolBar }); base.FormBorderStyle = FormBorderStyle.FixedDialog; this.MinimumSize = new Size(0x1e4, 0x14b); base.Name = "TreeNodeEditor"; base.SizeGripStyle = SizeGripStyle.Hide; this.Text = System.Design.SR.GetString("MenuItemCollectionEditor_Title"); this._treeViewPanel.ResumeLayout(false); base.InitializeForm(); base.ResumeLayout(false); }
private ToolStripButton CreateButton(Command c) { var btn = new ToolStripButton (); btn.DisplayStyle = ToolStripItemDisplayStyle.Text; btn.Text = c.Name; btn.TextAlign = System.Drawing.ContentAlignment.MiddleRight; btn.Click += c.Event; return btn; }
private void tsb_MouseDown(object sender, MouseEventArgs e) { contextTSB = null; }
public MainForm () { ComponentResourceManager resources = new ComponentResourceManager (typeof (MainForm)); SuspendLayout (); // // _toolStrip // _toolStrip = new ToolStrip (); _toolStrip.Location = new Point (0, 24); _toolStrip.Size = new Size (632, 25); _toolStrip.TabIndex = 1; _toolStrip.Text = "ToolStrip"; Controls.Add (_toolStrip); // // _separatorBar // _separatorBar = new ToolStripSeparator (); // // _newButton // _newButton = new ToolStripButton (); _newButton.DisplayStyle = ToolStripItemDisplayStyle.Image; _newButton.Image = ((Image) (resources.GetObject ("_newButton.Image"))); _newButton.ImageTransparentColor = Color.Black; _newButton.Text = "New"; _toolStrip.Items.Add (_newButton); // // _openButton // _openButton = new ToolStripButton (); _openButton.DisplayStyle = ToolStripItemDisplayStyle.Image; _openButton.Image = ((Image) (resources.GetObject ("_openButton.Image"))); _openButton.ImageTransparentColor = Color.Black; _openButton.Text = "Open"; _toolStrip.Items.Add (_openButton); _toolStrip.Items.Add (_separatorBar); // // _textBox // _textBox = new ToolStripTextBox (); _toolStrip.Items.Add (_textBox); _toolStrip.Items.Add (new ToolStripSeparator ()); // // _comboBox // _comboBox = new ToolStripComboBox (); _toolStrip.Items.Add (_comboBox); // // _toolStripEnabledCheckBox // _toolStripEnabledCheckBox = new CheckBox (); _toolStripEnabledCheckBox.Checked = true; _toolStripEnabledCheckBox.Location = new Point (8, 75); _toolStripEnabledCheckBox.Size = new Size (70, 20); _toolStripEnabledCheckBox.Text = "Enabled"; _toolStripEnabledCheckBox.CheckedChanged += new EventHandler (ToolStripEnabledCheckBox_CheckedChanged); Controls.Add (_toolStripEnabledCheckBox); // // MainForm // AutoScaleDimensions = new SizeF (6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size (300, 100); Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #82651"; Load += new EventHandler (MainForm_Load); ResumeLayout (false); PerformLayout (); }
/// <summary> /// Determine if a toolbar button is enabled. This uses the registered /// ActionState handlers to determine if the button should be /// enabled when the document is active. /// </summary> /// <param name="button">The toolbar button.</param> /// <returns>True if the button is enabled.</returns> /// public bool IsToolbarButtonEnabled(ToolStripButton button) { return(IsActionEnabled(button.Name)); }
/// <summary> /// Creates a menu item for the plugin and adds a ignored key /// </summary> public MenusHelper(Image pluginImage, DebuggerManager debugManager, Settings settings) { settingObject = settings; imageList = new ImageList(); imageList.Images.Add("StartContinue", Resource.StartContinue); imageList.Images.Add("Pause", Resource.Pause); imageList.Images.Add("Stop", Resource.Stop); imageList.Images.Add("Current", Resource.Current); imageList.Images.Add("RunToCursor", Resource.RunToCursor); imageList.Images.Add("Step", Resource.Step); imageList.Images.Add("Next", Resource.Next); imageList.Images.Add("Finish", Resource.Finish); ToolStripMenuItem tempItem; ToolStripMenuItem viewMenu = (ToolStripMenuItem)PluginBase.MainForm.FindMenuItem("ViewMenu"); tempItem = new ToolStripMenuItem(TextHelper.GetString("Label.ViewBreakpointsPanel"), pluginImage, new EventHandler(this.OpenBreakPointPanel)); PluginBase.MainForm.RegisterShortcutItem("ViewMenu.ShowBreakpoints", tempItem); viewMenu.DropDownItems.Add(tempItem); tempItem = new ToolStripMenuItem(TextHelper.GetString("Label.ViewLocalVariablesPanel"), pluginImage, new EventHandler(this.OpenLocalVariablesPanel)); PluginBase.MainForm.RegisterShortcutItem("ViewMenu.ShowLocalVariables", tempItem); viewMenu.DropDownItems.Add(tempItem); tempItem = new ToolStripMenuItem(TextHelper.GetString("Label.ViewStackframePanel"), pluginImage, new EventHandler(this.OpenStackframePanel)); PluginBase.MainForm.RegisterShortcutItem("ViewMenu.ShowStackframe", tempItem); viewMenu.DropDownItems.Add(tempItem); tempItem = new ToolStripMenuItem(TextHelper.GetString("Label.ViewWatchPanel"), pluginImage, new EventHandler(this.OpenWatchPanel)); PluginBase.MainForm.RegisterShortcutItem("ViewMenu.ShowWatch", tempItem); viewMenu.DropDownItems.Add(tempItem); tempItem = new ToolStripMenuItem(TextHelper.GetString("Label.ViewImmediatePanel"), pluginImage, new EventHandler(this.OpenImmediatePanel)); PluginBase.MainForm.RegisterShortcutItem("ViewMenu.ShowImmediate", tempItem); viewMenu.DropDownItems.Add(tempItem); // Menu ToolStripMenuItem debugMenu = (ToolStripMenuItem)PluginBase.MainForm.FindMenuItem("DebugMenu"); if (debugMenu == null) { debugMenu = new ToolStripMenuItem(TextHelper.GetString("Label.Debug")); ToolStripMenuItem insertMenu = (ToolStripMenuItem)PluginBase.MainForm.FindMenuItem("InsertMenu"); Int32 idx = PluginBase.MainForm.MenuStrip.Items.IndexOf(insertMenu); if (idx < 0) { idx = PluginBase.MainForm.MenuStrip.Items.Count - 1; } PluginBase.MainForm.MenuStrip.Items.Insert(idx, debugMenu); } StartContinueMenu = new ToolStripMenuItem(TextHelper.GetString("Label.Start"), imageList.Images["StartContinue"], new EventHandler(StartContinue_Click), Keys.None); PluginBase.MainForm.RegisterShortcutItem("DebugMenu.Start", StartContinueMenu); PauseMenu = new ToolStripMenuItem(TextHelper.GetString("Label.Pause"), imageList.Images["Pause"], new EventHandler(debugManager.Pause_Click), Keys.Control | Keys.Shift | Keys.F5); PluginBase.MainForm.RegisterShortcutItem("DebugMenu.Pause", PauseMenu); StopMenu = new ToolStripMenuItem(TextHelper.GetString("Label.Stop"), imageList.Images["Stop"], new EventHandler(debugManager.Stop_Click), Keys.Shift | Keys.F5); PluginBase.MainForm.RegisterShortcutItem("DebugMenu.Stop", StopMenu); CurrentMenu = new ToolStripMenuItem(TextHelper.GetString("Label.Current"), imageList.Images["Current"], new EventHandler(debugManager.Current_Click), Keys.Shift | Keys.F10); PluginBase.MainForm.RegisterShortcutItem("DebugMenu.Current", CurrentMenu); RunToCursorMenu = new ToolStripMenuItem(TextHelper.GetString("Label.RunToCursor"), imageList.Images["RunToCursor"], new EventHandler(ScintillaHelper.RunToCursor_Click), Keys.Control | Keys.F10); PluginBase.MainForm.RegisterShortcutItem("DebugMenu.RunToCursor", RunToCursorMenu); StepMenu = new ToolStripMenuItem(TextHelper.GetString("Label.Step"), imageList.Images["Step"], new EventHandler(debugManager.Step_Click), Keys.F11); PluginBase.MainForm.RegisterShortcutItem("DebugMenu.StepInto", StepMenu); NextMenu = new ToolStripMenuItem(TextHelper.GetString("Label.Next"), imageList.Images["Next"], new EventHandler(debugManager.Next_Click), Keys.F10); PluginBase.MainForm.RegisterShortcutItem("DebugMenu.StepOver", NextMenu); FinishMenu = new ToolStripMenuItem(TextHelper.GetString("Label.Finish"), imageList.Images["Finish"], new EventHandler(debugManager.Finish_Click), Keys.Shift | Keys.F11); PluginBase.MainForm.RegisterShortcutItem("DebugMenu.StepOut", FinishMenu); ToggleBreakPointMenu = new ToolStripMenuItem(TextHelper.GetString("Label.ToggleBreakpoint"), null, new EventHandler(ScintillaHelper.ToggleBreakPoint_Click), Keys.F9); PluginBase.MainForm.RegisterShortcutItem("DebugMenu.ToggleBreakpoint", ToggleBreakPointMenu); DeleteAllBreakPointsMenu = new ToolStripMenuItem(TextHelper.GetString("Label.DeleteAllBreakpoints"), null, new EventHandler(ScintillaHelper.DeleteAllBreakPoints_Click), Keys.Control | Keys.Shift | Keys.F9); PluginBase.MainForm.RegisterShortcutItem("DebugMenu.DeleteAllBreakpoints", DeleteAllBreakPointsMenu); ToggleBreakPointEnableMenu = new ToolStripMenuItem(TextHelper.GetString("Label.ToggleBreakpointEnabled"), null, new EventHandler(ScintillaHelper.ToggleBreakPointEnable_Click), Keys.None); PluginBase.MainForm.RegisterShortcutItem("DebugMenu.ToggleBreakpointEnabled", ToggleBreakPointEnableMenu); DisableAllBreakPointsMenu = new ToolStripMenuItem(TextHelper.GetString("Label.DisableAllBreakpoints"), null, new EventHandler(ScintillaHelper.DisableAllBreakPoints_Click), Keys.None); PluginBase.MainForm.RegisterShortcutItem("DebugMenu.DisableAllBreakpoints", DisableAllBreakPointsMenu); EnableAllBreakPointsMenu = new ToolStripMenuItem(TextHelper.GetString("Label.EnableAllBreakpoints"), null, new EventHandler(ScintillaHelper.EnableAllBreakPoints_Click), Keys.None); PluginBase.MainForm.RegisterShortcutItem("DebugMenu.EnableAllBreakpoints", EnableAllBreakPointsMenu); StartRemoteDebuggingMenu = new ToolStripMenuItem(TextHelper.GetString("Label.StartRemoteDebugging"), null, new EventHandler(StartRemote_Click), Keys.None); PluginBase.MainForm.RegisterShortcutItem("DebugMenu.StartRemoteDebugging", StartRemoteDebuggingMenu); debugItems = new List <ToolStripItem>(new ToolStripItem[] { StartContinueMenu, PauseMenu, StopMenu, new ToolStripSeparator(), CurrentMenu, RunToCursorMenu, StepMenu, NextMenu, FinishMenu, new ToolStripSeparator(), ToggleBreakPointMenu, DeleteAllBreakPointsMenu, ToggleBreakPointEnableMenu, DisableAllBreakPointsMenu, EnableAllBreakPointsMenu, new ToolStripSeparator(), StartRemoteDebuggingMenu }); debugMenu.DropDownItems.AddRange(debugItems.ToArray()); // ToolStrip m_ToolStripSeparator = new ToolStripSeparator(); m_ToolStripSeparator.Margin = new Padding(1, 0, 0, 0); StartContinueButton = new ToolStripButton(TextHelper.GetString("Label.Start"), imageList.Images["StartContinue"], new EventHandler(StartContinue_Click)); StartContinueButton.DisplayStyle = ToolStripItemDisplayStyle.Image; PauseButton = new ToolStripButton(TextHelper.GetString("Label.Pause"), imageList.Images["Pause"], new EventHandler(debugManager.Pause_Click)); PauseButton.DisplayStyle = ToolStripItemDisplayStyle.Image; StopButton = new ToolStripButton(TextHelper.GetString("Label.Stop"), imageList.Images["Stop"], new EventHandler(debugManager.Stop_Click)); StopButton.DisplayStyle = ToolStripItemDisplayStyle.Image; CurrentButton = new ToolStripButton(TextHelper.GetString("Label.Current"), imageList.Images["Current"], new EventHandler(debugManager.Current_Click)); CurrentButton.DisplayStyle = ToolStripItemDisplayStyle.Image; RunToCursorButton = new ToolStripButton(TextHelper.GetString("Label.RunToCursor"), imageList.Images["RunToCursor"], new EventHandler(ScintillaHelper.RunToCursor_Click)); RunToCursorButton.DisplayStyle = ToolStripItemDisplayStyle.Image; StepButton = new ToolStripButton(TextHelper.GetString("Label.Step"), imageList.Images["Step"], new EventHandler(debugManager.Step_Click)); StepButton.DisplayStyle = ToolStripItemDisplayStyle.Image; NextButton = new ToolStripButton(TextHelper.GetString("Label.Next"), imageList.Images["Next"], new EventHandler(debugManager.Next_Click)); NextButton.DisplayStyle = ToolStripItemDisplayStyle.Image; FinishButton = new ToolStripButton(TextHelper.GetString("Label.Finish"), imageList.Images["Finish"], new EventHandler(debugManager.Finish_Click)); FinishButton.DisplayStyle = ToolStripItemDisplayStyle.Image; m_ToolStripButtons = new ToolStripItem[] { m_ToolStripSeparator, StartContinueButton, PauseButton, StopButton, new ToolStripSeparator(), CurrentButton, RunToCursorButton, StepButton, NextButton, FinishButton }; // Events PluginMain.debugManager.StateChangedEvent += UpdateMenuState; }
private void toolSetController_ToolChanged(object sender, ToolEventArgs e) { ToolStripButton button = FindToolStripButton(e.Tool); button.Image = toolSetController.SelectedTool.SmallIcon; }
private void InitializeComponent() { this.components = (IContainer) new Container(); ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(GamePicker)); this.gameLogos = new ImageList(this.components); this.callbackTimer = new System.Windows.Forms.Timer(this.components); this.toolStrip1 = new ToolStrip(); this.refreshGamesButton = new ToolStripButton(); this.toolStripSeparator1 = new ToolStripSeparator(); this.addGameText = new ToolStripTextBox(); this.addGameButton = new ToolStripButton(); this.toolStripSeparator2 = new ToolStripSeparator(); this.filterButton = new ToolStripDropDownButton(); this.filterGamesMenuitem = new ToolStripMenuItem(); this.filterDemosMenuItem = new ToolStripMenuItem(); this.filterModsMenuItem = new ToolStripMenuItem(); this.filterJunkMenuItem = new ToolStripMenuItem(); this.gameList = new DoubleBufferedListView(); this.statusStrip1 = new StatusStrip(); this.pickerStatusLabel = new ToolStripStatusLabel(); this.downloadStatusLabel = new ToolStripStatusLabel(); this.toolStrip1.SuspendLayout(); this.statusStrip1.SuspendLayout(); this.SuspendLayout(); this.gameLogos.ColorDepth = ColorDepth.Depth8Bit; this.gameLogos.ImageSize = new Size(184, 69); this.gameLogos.TransparentColor = Color.Transparent; this.callbackTimer.Enabled = true; this.callbackTimer.Tick += new EventHandler(this.OnTimer); this.toolStrip1.Items.AddRange(new ToolStripItem[6] { (ToolStripItem)this.refreshGamesButton, (ToolStripItem)this.toolStripSeparator1, (ToolStripItem)this.addGameText, (ToolStripItem)this.addGameButton, (ToolStripItem)this.toolStripSeparator2, (ToolStripItem)this.filterButton }); this.toolStrip1.Location = new Point(0, 0); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Size = new Size(742, 25); this.toolStrip1.TabIndex = 1; this.toolStrip1.Text = "toolStrip1"; this.refreshGamesButton.Image = (Image)Resources.Refresh; this.refreshGamesButton.ImageTransparentColor = Color.Magenta; this.refreshGamesButton.Name = "refreshGamesButton"; this.refreshGamesButton.Size = new Size(105, 22); this.refreshGamesButton.Text = "Refresh Games"; this.refreshGamesButton.Click += new EventHandler(this.OnRefresh); this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new Size(6, 25); this.addGameText.Name = "addGameText"; this.addGameText.Size = new Size(100, 25); this.addGameButton.Image = (Image)Resources.Search; this.addGameButton.ImageTransparentColor = Color.Magenta; this.addGameButton.Name = "addGameButton"; this.addGameButton.Size = new Size(83, 22); this.addGameButton.Text = "Add Game"; this.addGameButton.Click += new EventHandler(this.OnAddGame); this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new Size(6, 25); this.filterButton.DisplayStyle = ToolStripItemDisplayStyle.Image; this.filterButton.DropDownItems.AddRange(new ToolStripItem[4] { (ToolStripItem)this.filterGamesMenuitem, (ToolStripItem)this.filterDemosMenuItem, (ToolStripItem)this.filterModsMenuItem, (ToolStripItem)this.filterJunkMenuItem }); this.filterButton.Image = (Image)Resources.Filter; this.filterButton.ImageTransparentColor = Color.Magenta; this.filterButton.Name = "filterButton"; this.filterButton.Size = new Size(29, 22); this.filterButton.Text = "Game filtering"; this.filterGamesMenuitem.Checked = true; this.filterGamesMenuitem.CheckOnClick = true; this.filterGamesMenuitem.CheckState = CheckState.Checked; this.filterGamesMenuitem.Name = "filterGamesMenuitem"; this.filterGamesMenuitem.Size = new Size(152, 22); this.filterGamesMenuitem.Text = "Show &games"; this.filterGamesMenuitem.CheckedChanged += new EventHandler(this.OnFilterUpdate); this.filterDemosMenuItem.CheckOnClick = true; this.filterDemosMenuItem.Name = "filterDemosMenuItem"; this.filterDemosMenuItem.Size = new Size(152, 22); this.filterDemosMenuItem.Text = "Show &demos"; this.filterDemosMenuItem.CheckedChanged += new EventHandler(this.OnFilterUpdate); this.filterModsMenuItem.CheckOnClick = true; this.filterModsMenuItem.Name = "filterModsMenuItem"; this.filterModsMenuItem.Size = new Size(152, 22); this.filterModsMenuItem.Text = "Show &mods"; this.filterModsMenuItem.CheckedChanged += new EventHandler(this.OnFilterUpdate); this.filterJunkMenuItem.CheckOnClick = true; this.filterJunkMenuItem.Name = "filterJunkMenuItem"; this.filterJunkMenuItem.Size = new Size(152, 22); this.filterJunkMenuItem.Text = "Show &junk"; this.filterJunkMenuItem.CheckedChanged += new EventHandler(this.OnFilterUpdate); this.gameList.BackColor = Color.Black; this.gameList.Dock = DockStyle.Fill; this.gameList.ForeColor = Color.White; this.gameList.LargeImageList = this.gameLogos; this.gameList.Location = new Point(0, 25); this.gameList.MultiSelect = false; this.gameList.Name = "gameList"; this.gameList.Size = new Size(742, 245); this.gameList.SmallImageList = this.gameLogos; this.gameList.Sorting = SortOrder.Ascending; this.gameList.TabIndex = 0; this.gameList.TileSize = new Size(184, 69); this.gameList.UseCompatibleStateImageBehavior = false; this.gameList.ItemActivate += new EventHandler(this.OnSelectGame); this.statusStrip1.Items.AddRange(new ToolStripItem[2] { (ToolStripItem)this.pickerStatusLabel, (ToolStripItem)this.downloadStatusLabel }); this.statusStrip1.Location = new Point(0, 270); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Size = new Size(742, 22); this.statusStrip1.TabIndex = 2; this.statusStrip1.Text = "statusStrip"; this.pickerStatusLabel.Name = "pickerStatusLabel"; this.pickerStatusLabel.Size = new Size(727, 17); this.pickerStatusLabel.Spring = true; this.pickerStatusLabel.TextAlign = ContentAlignment.MiddleLeft; this.downloadStatusLabel.Image = (Image)Resources.Download; this.downloadStatusLabel.Name = "downloadStatusLabel"; this.downloadStatusLabel.Size = new Size(111, 17); this.downloadStatusLabel.Text = "Download status"; this.downloadStatusLabel.Visible = false; this.AutoScaleDimensions = new SizeF(6f, 13f); this.AutoScaleMode = AutoScaleMode.Font; this.ClientSize = new Size(742, 292); this.Controls.Add((Control)this.gameList); this.Controls.Add((Control)this.statusStrip1); this.Controls.Add((Control)this.toolStrip1); this.Icon = (Icon)componentResourceManager.GetObject("$this.Icon"); this.Name = nameof(GamePicker); this.Text = "Steam Achievement Manager 6.3 | Pick a game... Any game..."; this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); }
private void InitializeComponent() { this.icontainer_0 = new Container(); this.panel1 = new Panel(); this.groupBox2 = new GroupBox(); this.listView1 = new ListView(); this.columnHeader_0 = new ColumnHeader(); this.columnHeader_1 = new ColumnHeader(); this.columnHeader_2 = new ColumnHeader(); this.columnHeader_3 = new ColumnHeader(); this.imageList_0 = new ImageList(this.icontainer_0); this.toolStrip1 = new ToolStrip(); this.btnAdd = new ToolStripButton(); this.btnEdit = new ToolStripButton(); this.btnDelete = new ToolStripButton(); this.panel2 = new Panel(); this.btnImport = new Button(); this.btnCancel = new Button(); this.btnOK = new Button(); this.groupBox1 = new GroupBox(); this.cboCommandType = new ComboBox(); this.label3 = new Label(); this.txtDataBase = new TextBox(); this.label2 = new Label(); this.txtName = new TextBox(); this.label1 = new Label(); this.splitter1 = new Splitter(); this.txtCode = new SyntaxHighlighterControl(); this.label4 = new Label(); this.nudTimeout = new NumericUpDown(); this.panel1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.toolStrip1.SuspendLayout(); this.panel2.SuspendLayout(); this.groupBox1.SuspendLayout(); this.nudTimeout.BeginInit(); base.SuspendLayout(); this.panel1.Controls.Add(this.groupBox2); this.panel1.Controls.Add(this.panel2); this.panel1.Controls.Add(this.groupBox1); this.panel1.Dock = DockStyle.Right; this.panel1.Location = new Point(0x296, 3); this.panel1.Name = "panel1"; this.panel1.Size = new Size(0x189, 0x214); this.panel1.TabIndex = 0; this.groupBox2.Controls.Add(this.listView1); this.groupBox2.Controls.Add(this.toolStrip1); this.groupBox2.Dock = DockStyle.Fill; this.groupBox2.Location = new Point(0, 0x73); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new Size(0x189, 0x176); this.groupBox2.TabIndex = 2; this.groupBox2.TabStop = false; this.groupBox2.Text = "命令参数"; this.listView1.Columns.AddRange(new ColumnHeader[] { this.columnHeader_0, this.columnHeader_1, this.columnHeader_2, this.columnHeader_3 }); this.listView1.Dock = DockStyle.Fill; this.listView1.FullRowSelect = true; this.listView1.HideSelection = false; this.listView1.Location = new Point(3, 0x2a); this.listView1.MultiSelect = false; this.listView1.Name = "listView1"; this.listView1.Size = new Size(0x183, 0x149); this.listView1.SmallImageList = this.imageList_0; this.listView1.TabIndex = 1; this.listView1.UseCompatibleStateImageBehavior = false; this.listView1.View = View.Details; this.listView1.ItemActivate += new EventHandler(this.btnEdit_Click); this.listView1.Resize += new EventHandler(this.listView1_Resize); this.columnHeader_0.Text = "Name"; this.columnHeader_0.Width = 0x8e; this.columnHeader_1.Text = "Type"; this.columnHeader_1.Width = 0x54; this.columnHeader_2.Text = "Direction"; this.columnHeader_2.Width = 0x4e; this.columnHeader_3.Text = "Size"; this.columnHeader_3.TextAlign = HorizontalAlignment.Right; this.columnHeader_3.Width = 0x37; this.imageList_0.ColorDepth = ColorDepth.Depth8Bit; this.imageList_0.ImageSize = new Size(0x10, 0x10); this.imageList_0.TransparentColor = Color.Transparent; this.toolStrip1.Items.AddRange(new ToolStripItem[] { this.btnAdd, this.btnEdit, this.btnDelete }); this.toolStrip1.Location = new Point(3, 0x11); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Size = new Size(0x183, 0x19); this.toolStrip1.TabIndex = 0; this.toolStrip1.Text = "toolStrip1"; //this.btnAdd.Image = Resources.NewDocumentHS; this.btnAdd.ImageTransparentColor = Color.Magenta; this.btnAdd.Name = "btnAdd"; this.btnAdd.Size = new Size(0x33, 0x16); this.btnAdd.Text = "新增"; this.btnAdd.Click += new EventHandler(this.btnAdd_Click); // this.btnEdit.Image = Resources.EditTableHS; this.btnEdit.ImageTransparentColor = Color.Magenta; this.btnEdit.Name = "btnEdit"; this.btnEdit.Size = new Size(0x33, 0x16); this.btnEdit.Text = "修改"; this.btnEdit.Click += new EventHandler(this.btnEdit_Click); //this.btnDelete.Image = Resources.DeleteHS; this.btnDelete.ImageTransparentColor = Color.Magenta; this.btnDelete.Name = "btnDelete"; this.btnDelete.Size = new Size(0x33, 0x16); this.btnDelete.Text = "删除"; this.btnDelete.Click += new EventHandler(this.btnDelete_Click); this.panel2.Controls.Add(this.btnImport); this.panel2.Controls.Add(this.btnCancel); this.panel2.Controls.Add(this.btnOK); this.panel2.Dock = DockStyle.Bottom; this.panel2.Location = new Point(0, 0x1e9); this.panel2.Name = "panel2"; this.panel2.Size = new Size(0x189, 0x2b); this.panel2.TabIndex = 1; this.btnImport.Location = new Point(7, 10); this.btnImport.Name = "btnImport"; this.btnImport.Size = new Size(100, 0x17); this.btnImport.TabIndex = 2; this.btnImport.Text = "从剪切板导入"; this.btnImport.UseVisualStyleBackColor = true; this.btnImport.Visible = false; this.btnImport.Click += new EventHandler(this.btnImport_Click); this.btnCancel.Anchor = AnchorStyles.Right | AnchorStyles.Top; this.btnCancel.DialogResult = DialogResult.Cancel; this.btnCancel.Location = new Point(0x12d, 10); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new Size(0x4b, 0x17); this.btnCancel.TabIndex = 1; this.btnCancel.Text = "取消(&C)"; this.btnCancel.UseVisualStyleBackColor = true; this.btnOK.Anchor = AnchorStyles.Right | AnchorStyles.Top; this.btnOK.Location = new Point(0xce, 10); this.btnOK.Name = "btnOK"; this.btnOK.Size = new Size(0x4b, 0x17); this.btnOK.TabIndex = 0; this.btnOK.Text = "确定(&K)"; this.btnOK.UseVisualStyleBackColor = true; this.btnOK.Click += new EventHandler(this.btnOK_Click); this.groupBox1.Controls.Add(this.nudTimeout); this.groupBox1.Controls.Add(this.label4); this.groupBox1.Controls.Add(this.cboCommandType); this.groupBox1.Controls.Add(this.label3); this.groupBox1.Controls.Add(this.txtDataBase); this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.txtName); this.groupBox1.Controls.Add(this.label1); this.groupBox1.Dock = DockStyle.Top; this.groupBox1.Location = new Point(0, 0); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new Size(0x189, 0x73); this.groupBox1.TabIndex = 0; this.groupBox1.TabStop = false; this.groupBox1.Text = "基本信息"; this.cboCommandType.DropDownStyle = ComboBoxStyle.DropDownList; this.cboCommandType.FormattingEnabled = true; this.cboCommandType.Location = new Point(0x3e, 0x4c); this.cboCommandType.Name = "cboCommandType"; this.cboCommandType.Size = new Size(0xae, 20); this.cboCommandType.TabIndex = 5; this.label3.AutoSize = true; this.label3.Location = new Point(10, 80); this.label3.Name = "label3"; this.label3.Size = new Size(0x1d, 12); this.label3.TabIndex = 4; this.label3.Text = "类型"; this.txtDataBase.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top; this.txtDataBase.Font = new Font("Courier New", 9f, FontStyle.Regular, GraphicsUnit.Point, 0); this.txtDataBase.Location = new Point(0x3e, 0x2d); this.txtDataBase.Name = "txtDataBase"; this.txtDataBase.Size = new Size(0x13e, 0x15); this.txtDataBase.TabIndex = 3; this.label2.AutoSize = true; this.label2.Location = new Point(10, 50); this.label2.Name = "label2"; this.label2.Size = new Size(0x29, 12); this.label2.TabIndex = 2; this.label2.Text = "数据库"; this.txtName.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top; this.txtName.Font = new Font("Courier New", 9f, FontStyle.Regular, GraphicsUnit.Point, 0); this.txtName.Location = new Point(0x3e, 0x12); this.txtName.Name = "txtName"; this.txtName.Size = new Size(0x13e, 0x15); this.txtName.TabIndex = 1; this.label1.AutoSize = true; this.label1.ForeColor = Color.Red; this.label1.Location = new Point(10, 0x17); this.label1.Name = "label1"; this.label1.Size = new Size(0x23, 12); this.label1.TabIndex = 0; this.label1.Text = "名称*"; this.splitter1.Dock = DockStyle.Right; this.splitter1.Location = new Point(0x28f, 3); this.splitter1.Name = "splitter1"; this.splitter1.Size = new Size(7, 0x214); this.splitter1.TabIndex = 1; this.splitter1.TabStop = false; this.txtCode.Dock = DockStyle.Fill; this.txtCode.Location = new Point(3, 3); this.txtCode.Name = "txtCode"; this.txtCode.method_6(false); this.txtCode.Size = new Size(0x28c, 0x214); this.txtCode.TabIndex = 2; this.label4.AutoSize = true; this.label4.Location = new Point(0xf3, 80); this.label4.Name = "label4"; this.label4.Size = new Size(0x35, 12); this.label4.TabIndex = 6; this.label4.Text = "超时(秒)"; this.nudTimeout.Font = new Font("Courier New", 9f); this.nudTimeout.Location = new Point(0x12d, 0x4c); int[] bits = new int[4]; bits[0] = 0x186a0; this.nudTimeout.Maximum = new decimal(bits); this.nudTimeout.Name = "nudTimeout"; this.nudTimeout.Size = new Size(0x4f, 0x15); this.nudTimeout.TabIndex = 7; bits = new int[4]; bits[0] = 30; this.nudTimeout.Value = new decimal(bits); base.AutoScaleDimensions = new SizeF(6f, 12f); base.AutoScaleMode = AutoScaleMode.Font; base.CancelButton = this.btnCancel; base.ClientSize = new Size(0x422, 0x21a); base.Controls.Add(this.txtCode); base.Controls.Add(this.splitter1); base.Controls.Add(this.panel1); base.MinimizeBox = false; base.Name = "EditCommandDialog"; base.Padding = new Padding(3); base.ShowIcon = false; base.ShowInTaskbar = false; base.StartPosition = FormStartPosition.CenterScreen; this.Text = "新增命令"; base.Load += new EventHandler(this.EditCommandDialog_Load); base.Shown += new EventHandler(this.EditCommandDialog_Shown); this.panel1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); this.panel2.ResumeLayout(false); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.nudTimeout.EndInit(); base.ResumeLayout(false); }
private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmCDescuentos)); this.dataGridView1 = new System.Windows.Forms.DataGridView(); this.Cuenta = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.tsbAgregar = new System.Windows.Forms.ToolStripButton(); this.tsbGuardar = new System.Windows.Forms.ToolStripButton(); this.tsbEliminar = new System.Windows.Forms.ToolStripButton(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); this.toolStrip1.SuspendLayout(); this.SuspendLayout(); // // dataGridView1 // this.dataGridView1.AllowUserToAddRows = false; this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.Control; this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.Cuenta }); this.dataGridView1.Location = new System.Drawing.Point(12, 32); this.dataGridView1.Name = "dataGridView1"; this.dataGridView1.ReadOnly = true; this.dataGridView1.Size = new System.Drawing.Size(303, 280); this.dataGridView1.TabIndex = 2; this.dataGridView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView_TeclaSupr_Eliminar); // // Cuenta // this.Cuenta.HeaderText = "Cuenta"; this.Cuenta.Name = "Cuenta"; this.Cuenta.ReadOnly = true; // // toolStrip1 // this.toolStrip1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.toolStrip1.AutoSize = false; this.toolStrip1.BackgroundImage = global::VMXTRASPIVA.Properties.Resources.background_image; this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None; this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tsbAgregar, this.tsbGuardar, this.tsbEliminar }); this.toolStrip1.Location = new System.Drawing.Point(-4, -1); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Padding = new System.Windows.Forms.Padding(8, 0, 1, 0); this.toolStrip1.Size = new System.Drawing.Size(336, 30); this.toolStrip1.TabIndex = 3; this.toolStrip1.Text = "toolStrip1"; // // tsbAgregar // this.tsbAgregar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.tsbAgregar.Image = global::VMXTRASPIVA.Properties.Resources.search; this.tsbAgregar.ImageTransparentColor = System.Drawing.Color.Magenta; this.tsbAgregar.Name = "tsbAgregar"; this.tsbAgregar.Size = new System.Drawing.Size(23, 27); this.tsbAgregar.Text = "Buscar"; this.tsbAgregar.Click += new System.EventHandler(this.button_Cuenta_Click); // // tsbGuardar // this.tsbGuardar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.tsbGuardar.Image = global::VMXTRASPIVA.Properties.Resources.save; this.tsbGuardar.ImageTransparentColor = System.Drawing.Color.Magenta; this.tsbGuardar.Name = "tsbGuardar"; this.tsbGuardar.Size = new System.Drawing.Size(23, 27); this.tsbGuardar.Text = "toolStripButton2"; this.tsbGuardar.ToolTipText = "Guardar"; this.tsbGuardar.Click += new System.EventHandler(this.button_Guardar_Click); // // tsbEliminar // this.tsbEliminar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.tsbEliminar.Image = global::VMXTRASPIVA.Properties.Resources.delete; this.tsbEliminar.ImageTransparentColor = System.Drawing.Color.Magenta; this.tsbEliminar.Name = "tsbEliminar"; this.tsbEliminar.Size = new System.Drawing.Size(23, 27); this.tsbEliminar.Text = "toolStripButton1"; this.tsbEliminar.ToolTipText = "Eliminar"; this.tsbEliminar.Click += new System.EventHandler(this.button_Eliminar_Click); // // frmCDescuentos // this.BackColor = System.Drawing.Color.White; this.ClientSize = new System.Drawing.Size(327, 324); this.Controls.Add(this.toolStrip1); this.Controls.Add(this.dataGridView1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.Name = "frmCDescuentos"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Cuenta Descuentos"; ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); this.ResumeLayout(false); }
void OnSearchOptionButtonClick(object sender, EventArgs e) { ToolStripButton button = sender as ToolStripButton; CurrentSearchOption = ButtonToSearchOptionMap[button]; // And update the selected search option }
public void ErrorDisplay_Plugins_life_cycle_events() { // test #1: Asks ErrorBrowser to register an instance of IErrorDisplay // // - check the process calls successively IErrorDisplay's // properties & methods. // // - when registering an IErrorDisplay for the first time, ErrorBrowser // should select the instance automatically. DynamicMock mockTraceDisplay = MockHelper.NewMockIErrorRenderer("raw", 1); DynamicMock mockSourceDisplay = MockHelper.NewMockIErrorRenderer("browser", 2); ToolStripButton tracePlugin = new ToolStripButton(); // ToolStripItem[] traceOptions = new ToolStripItem[] { }; Control traceContent = new TextBox(); mockTraceDisplay.SetReturnValue("Text", "Displays the actual stack trace"); // looks like Mock needs a bit enhancements to handle multiple calls mockTraceDisplay.ExpectAndReturn("get_PluginItem", tracePlugin); mockTraceDisplay.ExpectAndReturn("get_PluginItem", tracePlugin); mockTraceDisplay.ExpectAndReturn("get_PluginItem", tracePlugin); mockTraceDisplay.ExpectAndReturn("get_Content", traceContent); mockTraceDisplay.Expect("OnStackTraceChanged", new object[] { _errorBrowser.StackTraceSource }); _errorBrowser.RegisterDisplay((IErrorDisplay)mockTraceDisplay.MockInstance); mockTraceDisplay.Verify(); Assert.That(_errorBrowser.SelectedDisplay, Is.Not.Null); Assert.That(_errorBrowser.SelectedDisplay, Is.SameAs(mockTraceDisplay.MockInstance)); Assert.That(_errorBrowser.LayoutPanel.Content, Is.EqualTo(traceContent)); // test #2: Asks ErrorBrowser to register another instance of IErrorDisplay // // - Selection should not change ToolStripItem sourcePluginItem = new ToolStripButton(); Control sourceContent = new Button(); mockSourceDisplay.SetReturnValue("Text", "Displays source code context"); mockSourceDisplay.ExpectAndReturn("get_PluginItem", sourcePluginItem); mockSourceDisplay.ExpectAndReturn("get_PluginItem", sourcePluginItem); _errorBrowser.RegisterDisplay((IErrorDisplay)mockSourceDisplay.MockInstance); mockSourceDisplay.Verify(); Assert.That(_errorBrowser.SelectedDisplay, Is.Not.Null); Assert.That(_errorBrowser.SelectedDisplay, Is.SameAs(mockTraceDisplay.MockInstance)); // test #3: changes current selection mockTraceDisplay.ExpectAndReturn("get_PluginItem", tracePlugin); mockSourceDisplay.ExpectAndReturn("get_PluginItem", sourcePluginItem); mockSourceDisplay.ExpectAndReturn("get_Content", sourceContent); _errorBrowser.Toolbar.SelectedDisplay = (IErrorDisplay)mockSourceDisplay.MockInstance; mockSourceDisplay.Verify(); mockTraceDisplay.Verify(); Assert.That(_errorBrowser.Toolbar.SelectedDisplay, Is.SameAs(mockSourceDisplay.MockInstance)); Assert.That(_errorBrowser.LayoutPanel.Content, Is.EqualTo(sourceContent)); // test #4: changing ErrorSource update all renderers string stack = "à test() C:\\file.cs:ligne 1"; mockTraceDisplay.Expect("OnStackTraceChanged", new object[] { stack }); mockSourceDisplay.Expect("OnStackTraceChanged", new object[] { stack }); _errorBrowser.StackTraceSource = stack; Assert.That(_errorBrowser.LayoutPanel.Content, Is.TypeOf(typeof(Button))); mockSourceDisplay.Verify(); mockTraceDisplay.Verify(); // clears all renderers _errorBrowser.ClearAll(); Assert.That(_errorBrowser.Toolbar.Count, Is.EqualTo(0)); Assert.That(_errorBrowser.LayoutPanel.Option, Is.Not.Null); Assert.That(_errorBrowser.LayoutPanel.Option, Is.TypeOf(typeof(Panel))); Assert.That(_errorBrowser.LayoutPanel.Content, Is.Not.Null); Assert.That(_errorBrowser.LayoutPanel.Content, Is.TypeOf(typeof(Panel))); return; }