comparison FrmMain.cs @ 126:25c989ef2a8d

Re #88: Complete initial WinForms UI * Swap ToolStripContainer for ToolStripPanel to work with MDI * Populate category/unit creation tool strip Still needs work to make sure that cat/unit strip ends up after the main strip
author IBBoard <dev@ibboard.co.uk>
date Sat, 06 Mar 2010 16:33:28 +0000
parents 4acfce15b222
children c89d0cb4b893
comparison
equal deleted inserted replaced
125:581a72dcb549 126:25c989ef2a8d
64 private IBBoard.Windows.Forms.ColorableStatusBarPanel sbPointsPanel; 64 private IBBoard.Windows.Forms.ColorableStatusBarPanel sbPointsPanel;
65 private System.Windows.Forms.ContextMenu undoMenu; 65 private System.Windows.Forms.ContextMenu undoMenu;
66 private System.Windows.Forms.ContextMenu redoMenu; 66 private System.Windows.Forms.ContextMenu redoMenu;
67 private IBBoard.Windows.Forms.ColorableStatusBar statusBar; 67 private IBBoard.Windows.Forms.ColorableStatusBar statusBar;
68 private System.Windows.Forms.Timer statusBarTimer; 68 private System.Windows.Forms.Timer statusBarTimer;
69 private MenuStrip menuStrip1; 69 private MenuStrip menuStrip;
70 private ToolStripMenuItem menuFile; 70 private ToolStripMenuItem menuFile;
71 private ToolStripMenuItem miNewArmy; 71 private ToolStripMenuItem miNewArmy;
72 private ToolStripMenuItem miOpenArmy; 72 private ToolStripMenuItem miOpenArmy;
73 private ToolStripMenuItem miSaveArmy; 73 private ToolStripMenuItem miSaveArmy;
74 private ToolStripMenuItem miSaveArmyAs; 74 private ToolStripMenuItem miSaveArmyAs;
88 private ToolStripButton bttnOpenArmy; 88 private ToolStripButton bttnOpenArmy;
89 private ToolStripButton bttnSaveArmy; 89 private ToolStripButton bttnSaveArmy;
90 private ToolStripSeparator toolStripSeparator3; 90 private ToolStripSeparator toolStripSeparator3;
91 private ToolStripSplitButton bttnUndo; 91 private ToolStripSplitButton bttnUndo;
92 private ToolStripSplitButton bttnRedo; 92 private ToolStripSplitButton bttnRedo;
93 private ToolStripContainer toolStripContainer; 93 private ToolStrip catToolStrip;
94 private ToolStripPanel toolStripPanel;
94 private ToolStripMenuItem miAbout; 95 private ToolStripMenuItem miAbout;
95 96
96 /// <summary> 97 /// <summary>
97 /// The main entry point for the application. 98 /// The main entry point for the application.
98 /// </summary> 99 /// </summary>
117 { 118 {
118 this.Closing+=new CancelEventHandler(FrmMain_Closing); 119 this.Closing+=new CancelEventHandler(FrmMain_Closing);
119 CommandStack.CommandStackUpdated += new MethodInvoker(commandStack_CommandStackUpdated); 120 CommandStack.CommandStackUpdated += new MethodInvoker(commandStack_CommandStackUpdated);
120 121
121 InitializeComponent(); 122 InitializeComponent();
123 toolStripPanel.Join(mainToolStrip, 0, 0);
124 toolStripPanel.Join(catToolStrip, 1, 0);
122 125
123 Preferences = new Preferences("WarFoundry"); 126 Preferences = new Preferences("WarFoundry");
124 try 127 try
125 { 128 {
126 Translation.InitialiseTranslations(Constants.ExecutablePath, Preferences["language"].ToString()); 129 Translation.InitialiseTranslations(Constants.ExecutablePath, Preferences["language"].ToString());
128 catch (TranslationLoadException ex) 131 catch (TranslationLoadException ex)
129 { 132 {
130 log.Error("Translation loading failed for language " + Preferences["language"].ToString(), ex); 133 log.Error("Translation loading failed for language " + Preferences["language"].ToString(), ex);
131 MessageBox.Show(this, "Translation loading failed for language " + Preferences["language"].ToString(), "Translation failure", MessageBoxButtons.OK, MessageBoxIcon.Error); 134 MessageBox.Show(this, "Translation loading failed for language " + Preferences["language"].ToString(), "Translation failure", MessageBoxButtons.OK, MessageBoxIcon.Error);
132 } 135 }
133
134 //pnlRight.Left = ClientSize.Width - pnlRight.Width - 2;
135 //pnlRight.Top = toolBar.Height + 5;
136 //pnlRight.Height = ClientRectangle.Bottom - statusBar.Height - pnlRight.Top - 3;
137 136
138 ControlTranslator.TranslateControls(Controls); 137 ControlTranslator.TranslateControls(Controls);
139 ControlTranslator.TranslateComponents(components.Components); 138 ControlTranslator.TranslateComponents(components.Components);
140 ControlTranslator.TranslateComponent(openArmyDialog); 139 ControlTranslator.TranslateComponent(openArmyDialog);
141 ControlTranslator.TranslateComponent(saveArmyDialog); 140 ControlTranslator.TranslateComponent(saveArmyDialog);
222 this.buttonIcons = new System.Windows.Forms.ImageList(this.components); 221 this.buttonIcons = new System.Windows.Forms.ImageList(this.components);
223 this.mainMenu = new System.Windows.Forms.MainMenu(this.components); 222 this.mainMenu = new System.Windows.Forms.MainMenu(this.components);
224 this.openArmyDialog = new System.Windows.Forms.OpenFileDialog(); 223 this.openArmyDialog = new System.Windows.Forms.OpenFileDialog();
225 this.saveArmyDialog = new System.Windows.Forms.SaveFileDialog(); 224 this.saveArmyDialog = new System.Windows.Forms.SaveFileDialog();
226 this.statusBarTimer = new System.Windows.Forms.Timer(this.components); 225 this.statusBarTimer = new System.Windows.Forms.Timer(this.components);
227 this.menuStrip1 = new System.Windows.Forms.MenuStrip(); 226 this.menuStrip = new System.Windows.Forms.MenuStrip();
228 this.menuFile = new System.Windows.Forms.ToolStripMenuItem(); 227 this.menuFile = new System.Windows.Forms.ToolStripMenuItem();
229 this.miNewArmy = new System.Windows.Forms.ToolStripMenuItem(); 228 this.miNewArmy = new System.Windows.Forms.ToolStripMenuItem();
230 this.miOpenArmy = new System.Windows.Forms.ToolStripMenuItem(); 229 this.miOpenArmy = new System.Windows.Forms.ToolStripMenuItem();
231 this.miSaveArmy = new System.Windows.Forms.ToolStripMenuItem(); 230 this.miSaveArmy = new System.Windows.Forms.ToolStripMenuItem();
232 this.miSaveArmyAs = new System.Windows.Forms.ToolStripMenuItem(); 231 this.miSaveArmyAs = new System.Windows.Forms.ToolStripMenuItem();
247 this.bttnOpenArmy = new System.Windows.Forms.ToolStripButton(); 246 this.bttnOpenArmy = new System.Windows.Forms.ToolStripButton();
248 this.bttnSaveArmy = new System.Windows.Forms.ToolStripButton(); 247 this.bttnSaveArmy = new System.Windows.Forms.ToolStripButton();
249 this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); 248 this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
250 this.bttnUndo = new System.Windows.Forms.ToolStripSplitButton(); 249 this.bttnUndo = new System.Windows.Forms.ToolStripSplitButton();
251 this.bttnRedo = new System.Windows.Forms.ToolStripSplitButton(); 250 this.bttnRedo = new System.Windows.Forms.ToolStripSplitButton();
252 this.toolStripContainer = new System.Windows.Forms.ToolStripContainer(); 251 this.catToolStrip = new System.Windows.Forms.ToolStrip();
253 this.statusBar = new IBBoard.Windows.Forms.ColorableStatusBar(); 252 this.statusBar = new IBBoard.Windows.Forms.ColorableStatusBar();
254 this.sbMainPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel(); 253 this.sbMainPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel();
255 this.sbErrorPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel(); 254 this.sbErrorPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel();
256 this.sbPointsPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel(); 255 this.sbPointsPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel();
257 this.menuStrip1.SuspendLayout(); 256 this.toolStripPanel = new System.Windows.Forms.ToolStripPanel();
257 this.menuStrip.SuspendLayout();
258 this.mainToolStrip.SuspendLayout(); 258 this.mainToolStrip.SuspendLayout();
259 this.toolStripContainer.TopToolStripPanel.SuspendLayout(); 259 ((System.ComponentModel.ISupportInitialize) (this.sbMainPanel)).BeginInit();
260 this.toolStripContainer.SuspendLayout(); 260 ((System.ComponentModel.ISupportInitialize) (this.sbErrorPanel)).BeginInit();
261 ((System.ComponentModel.ISupportInitialize)(this.sbMainPanel)).BeginInit(); 261 ((System.ComponentModel.ISupportInitialize) (this.sbPointsPanel)).BeginInit();
262 ((System.ComponentModel.ISupportInitialize)(this.sbErrorPanel)).BeginInit();
263 ((System.ComponentModel.ISupportInitialize)(this.sbPointsPanel)).BeginInit();
264 this.SuspendLayout(); 262 this.SuspendLayout();
265 // 263 //
266 // buttonIcons 264 // buttonIcons
267 // 265 //
268 this.buttonIcons.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("buttonIcons.ImageStream"))); 266 this.buttonIcons.ImageStream = ((System.Windows.Forms.ImageListStreamer) (resources.GetObject("buttonIcons.ImageStream")));
269 this.buttonIcons.TransparentColor = System.Drawing.Color.Transparent; 267 this.buttonIcons.TransparentColor = System.Drawing.Color.Transparent;
270 this.buttonIcons.Images.SetKeyName(0, ""); 268 this.buttonIcons.Images.SetKeyName(0, "");
271 this.buttonIcons.Images.SetKeyName(1, ""); 269 this.buttonIcons.Images.SetKeyName(1, "");
272 this.buttonIcons.Images.SetKeyName(2, ""); 270 this.buttonIcons.Images.SetKeyName(2, "");
273 this.buttonIcons.Images.SetKeyName(3, ""); 271 this.buttonIcons.Images.SetKeyName(3, "");
282 // statusBarTimer 280 // statusBarTimer
283 // 281 //
284 this.statusBarTimer.Interval = 5000; 282 this.statusBarTimer.Interval = 5000;
285 this.statusBarTimer.Tick += new System.EventHandler(this.statusBarTimer_Tick); 283 this.statusBarTimer.Tick += new System.EventHandler(this.statusBarTimer_Tick);
286 // 284 //
287 // menuStrip1 285 // menuStrip
288 // 286 //
289 this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 287 this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
290 this.menuFile, 288 this.menuFile,
291 this.menuEdit, 289 this.menuEdit,
292 this.menuHelp}); 290 this.menuHelp});
293 this.menuStrip1.Location = new System.Drawing.Point(0, 0); 291 this.menuStrip.Location = new System.Drawing.Point(0, 0);
294 this.menuStrip1.Name = "menuStrip1"; 292 this.menuStrip.Name = "menuStrip";
295 this.menuStrip1.Size = new System.Drawing.Size(790, 24); 293 this.menuStrip.Size = new System.Drawing.Size(790, 24);
296 this.menuStrip1.TabIndex = 6; 294 this.menuStrip.TabIndex = 6;
297 this.menuStrip1.Text = "menuStrip1"; 295 this.menuStrip.Text = "menuStrip1";
298 // 296 //
299 // menuFile 297 // menuFile
300 // 298 //
301 this.menuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 299 this.menuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
302 this.miNewArmy, 300 this.miNewArmy,
439 this.bttnOpenArmy, 437 this.bttnOpenArmy,
440 this.bttnSaveArmy, 438 this.bttnSaveArmy,
441 this.toolStripSeparator3, 439 this.toolStripSeparator3,
442 this.bttnUndo, 440 this.bttnUndo,
443 this.bttnRedo}); 441 this.bttnRedo});
444 this.mainToolStrip.Location = new System.Drawing.Point(3, 0); 442 this.mainToolStrip.Location = new System.Drawing.Point(0, 24);
445 this.mainToolStrip.Name = "mainToolStrip"; 443 this.mainToolStrip.Name = "mainToolStrip";
446 this.mainToolStrip.Size = new System.Drawing.Size(151, 25); 444 this.mainToolStrip.Size = new System.Drawing.Size(182, 25);
447 this.mainToolStrip.TabIndex = 8; 445 this.mainToolStrip.TabIndex = 8;
448 // 446 //
449 // bttnNewArmy 447 // bttnNewArmy
450 // 448 //
451 this.bttnNewArmy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; 449 this.bttnNewArmy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
452 this.bttnNewArmy.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.document_new; 450 this.bttnNewArmy.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.document_new;
453 this.bttnNewArmy.ImageTransparentColor = System.Drawing.Color.Magenta; 451 this.bttnNewArmy.ImageTransparentColor = System.Drawing.Color.Magenta;
454 this.bttnNewArmy.Name = "bttnNewArmy"; 452 this.bttnNewArmy.Name = "bttnNewArmy";
455 this.bttnNewArmy.Size = new System.Drawing.Size(23, 22); 453 this.bttnNewArmy.Size = new System.Drawing.Size(23, 22);
456 this.bttnNewArmy.Text = "toolStripButton1"; 454 this.bttnNewArmy.Text = "new army";
457 this.bttnNewArmy.Click += new System.EventHandler(this.miNewArmy_Click); 455 this.bttnNewArmy.Click += new System.EventHandler(this.miNewArmy_Click);
458 // 456 //
459 // bttnOpenArmy 457 // bttnOpenArmy
460 // 458 //
461 this.bttnOpenArmy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; 459 this.bttnOpenArmy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
462 this.bttnOpenArmy.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.document_open; 460 this.bttnOpenArmy.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.document_open;
463 this.bttnOpenArmy.ImageTransparentColor = System.Drawing.Color.Magenta; 461 this.bttnOpenArmy.ImageTransparentColor = System.Drawing.Color.Magenta;
464 this.bttnOpenArmy.Name = "bttnOpenArmy"; 462 this.bttnOpenArmy.Name = "bttnOpenArmy";
465 this.bttnOpenArmy.Size = new System.Drawing.Size(23, 22); 463 this.bttnOpenArmy.Size = new System.Drawing.Size(23, 22);
466 this.bttnOpenArmy.Text = "toolStripButton2"; 464 this.bttnOpenArmy.Text = "open army";
467 this.bttnOpenArmy.Click += new System.EventHandler(this.miOpenArmy_Click); 465 this.bttnOpenArmy.Click += new System.EventHandler(this.miOpenArmy_Click);
468 // 466 //
469 // bttnSaveArmy 467 // bttnSaveArmy
470 // 468 //
471 this.bttnSaveArmy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; 469 this.bttnSaveArmy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
472 this.bttnSaveArmy.Enabled = false; 470 this.bttnSaveArmy.Enabled = false;
473 this.bttnSaveArmy.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.document_save; 471 this.bttnSaveArmy.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.document_save;
474 this.bttnSaveArmy.ImageTransparentColor = System.Drawing.Color.Magenta; 472 this.bttnSaveArmy.ImageTransparentColor = System.Drawing.Color.Magenta;
475 this.bttnSaveArmy.Name = "bttnSaveArmy"; 473 this.bttnSaveArmy.Name = "bttnSaveArmy";
476 this.bttnSaveArmy.Size = new System.Drawing.Size(23, 22); 474 this.bttnSaveArmy.Size = new System.Drawing.Size(23, 22);
477 this.bttnSaveArmy.Text = "toolStripButton3"; 475 this.bttnSaveArmy.Text = "save army";
478 this.bttnSaveArmy.Click += new System.EventHandler(this.miSaveArmy_Click); 476 this.bttnSaveArmy.Click += new System.EventHandler(this.miSaveArmy_Click);
479 // 477 //
480 // toolStripSeparator3 478 // toolStripSeparator3
481 // 479 //
482 this.toolStripSeparator3.Name = "toolStripSeparator3"; 480 this.toolStripSeparator3.Name = "toolStripSeparator3";
483 this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25); 481 this.toolStripSeparator3.Size = new System.Drawing.Size(6, 23);
484 // 482 //
485 // bttnUndo 483 // bttnUndo
486 // 484 //
487 this.bttnUndo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; 485 this.bttnUndo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
488 this.bttnUndo.Enabled = false; 486 this.bttnUndo.Enabled = false;
489 this.bttnUndo.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.edit_undo; 487 this.bttnUndo.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.edit_undo;
490 this.bttnUndo.ImageTransparentColor = System.Drawing.Color.Magenta; 488 this.bttnUndo.ImageTransparentColor = System.Drawing.Color.Magenta;
491 this.bttnUndo.Name = "bttnUndo"; 489 this.bttnUndo.Name = "bttnUndo";
492 this.bttnUndo.Size = new System.Drawing.Size(32, 22); 490 this.bttnUndo.Size = new System.Drawing.Size(32, 22);
493 this.bttnUndo.Text = "toolStripSplitButton1"; 491 this.bttnUndo.Text = "undo";
494 this.bttnUndo.Click += new System.EventHandler(this.miUndo_Click); 492 this.bttnUndo.Click += new System.EventHandler(this.miUndo_Click);
495 // 493 //
496 // bttnRedo 494 // bttnRedo
497 // 495 //
498 this.bttnRedo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; 496 this.bttnRedo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
499 this.bttnRedo.Enabled = false; 497 this.bttnRedo.Enabled = false;
500 this.bttnRedo.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.edit_redo; 498 this.bttnRedo.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.edit_redo;
501 this.bttnRedo.ImageTransparentColor = System.Drawing.Color.Magenta; 499 this.bttnRedo.ImageTransparentColor = System.Drawing.Color.Magenta;
502 this.bttnRedo.Name = "bttnRedo"; 500 this.bttnRedo.Name = "bttnRedo";
503 this.bttnRedo.Size = new System.Drawing.Size(32, 22); 501 this.bttnRedo.Size = new System.Drawing.Size(32, 22);
504 this.bttnRedo.Text = "toolStripSplitButton2"; 502 this.bttnRedo.Text = "redo";
505 this.bttnRedo.Click += new System.EventHandler(this.miRedo_Click); 503 this.bttnRedo.Click += new System.EventHandler(this.miRedo_Click);
506 // 504 //
507 // toolStripContainer 505 // catToolStrip
508 // 506 //
509 this.toolStripContainer.BottomToolStripPanelVisible = false; 507 this.catToolStrip.Dock = System.Windows.Forms.DockStyle.None;
510 // 508 this.catToolStrip.Location = new System.Drawing.Point(161, 24);
511 // toolStripContainer.ContentPanel 509 this.catToolStrip.Name = "catToolStrip";
512 // 510 this.catToolStrip.Size = new System.Drawing.Size(111, 25);
513 this.toolStripContainer.ContentPanel.Enabled = false; 511 this.catToolStrip.TabIndex = 9;
514 this.toolStripContainer.ContentPanel.Size = new System.Drawing.Size(790, 1); 512 this.catToolStrip.Visible = false;
515 this.toolStripContainer.ContentPanel.Visible = false;
516 this.toolStripContainer.LeftToolStripPanelVisible = false;
517 this.toolStripContainer.Location = new System.Drawing.Point(0, 24);
518 this.toolStripContainer.Name = "toolStripContainer";
519 this.toolStripContainer.RightToolStripPanelVisible = false;
520 this.toolStripContainer.Size = new System.Drawing.Size(790, 26);
521 this.toolStripContainer.TabIndex = 11;
522 //
523 // toolStripContainer.TopToolStripPanel
524 //
525 this.toolStripContainer.TopToolStripPanel.Controls.Add(this.mainToolStrip);
526 // 513 //
527 // statusBar 514 // statusBar
528 // 515 //
529 this.statusBar.Location = new System.Drawing.Point(0, 546); 516 this.statusBar.Location = new System.Drawing.Point(0, 546);
530 this.statusBar.Name = "statusBar"; 517 this.statusBar.Name = "statusBar";
559 this.sbPointsPanel.Name = "sbPointsPanel"; 546 this.sbPointsPanel.Name = "sbPointsPanel";
560 this.sbPointsPanel.Style = System.Windows.Forms.StatusBarPanelStyle.OwnerDraw; 547 this.sbPointsPanel.Style = System.Windows.Forms.StatusBarPanelStyle.OwnerDraw;
561 this.sbPointsPanel.ToolTipText = "current points total"; 548 this.sbPointsPanel.ToolTipText = "current points total";
562 this.sbPointsPanel.Width = 150; 549 this.sbPointsPanel.Width = 150;
563 // 550 //
551 // toolStripPanel
552 //
553 this.toolStripPanel.Dock = System.Windows.Forms.DockStyle.Top;
554 this.toolStripPanel.Location = new System.Drawing.Point(0, 24);
555 this.toolStripPanel.Name = "toolStripPanel";
556 this.toolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal;
557 this.toolStripPanel.RowMargin = new System.Windows.Forms.Padding(3, 0, 0, 0);
558 this.toolStripPanel.Size = new System.Drawing.Size(790, 0);
559 //
564 // FrmMain 560 // FrmMain
565 // 561 //
566 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); 562 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
567 this.ClientSize = new System.Drawing.Size(790, 568); 563 this.ClientSize = new System.Drawing.Size(790, 568);
568 this.Controls.Add(this.toolStripContainer); 564 this.Controls.Add(this.mainToolStrip);
565 this.Controls.Add(this.toolStripPanel);
566 this.Controls.Add(this.catToolStrip);
569 this.Controls.Add(this.statusBar); 567 this.Controls.Add(this.statusBar);
570 this.Controls.Add(this.menuStrip1); 568 this.Controls.Add(this.menuStrip);
571 this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 569 this.Icon = ((System.Drawing.Icon) (resources.GetObject("$this.Icon")));
572 this.IsMdiContainer = true; 570 this.IsMdiContainer = true;
573 this.MainMenuStrip = this.menuStrip1; 571 this.MainMenuStrip = this.menuStrip;
574 this.Menu = this.mainMenu; 572 this.Menu = this.mainMenu;
575 this.Name = "FrmMain"; 573 this.Name = "FrmMain";
576 this.Text = "WarFoundry"; 574 this.Text = "WarFoundry";
577 this.Load += new System.EventHandler(this.FrmMain_Load); 575 this.Load += new System.EventHandler(this.FrmMain_Load);
578 this.menuStrip1.ResumeLayout(false); 576 this.menuStrip.ResumeLayout(false);
579 this.menuStrip1.PerformLayout(); 577 this.menuStrip.PerformLayout();
580 this.mainToolStrip.ResumeLayout(false); 578 this.mainToolStrip.ResumeLayout(false);
581 this.mainToolStrip.PerformLayout(); 579 this.mainToolStrip.PerformLayout();
582 this.toolStripContainer.TopToolStripPanel.ResumeLayout(false); 580 ((System.ComponentModel.ISupportInitialize) (this.sbMainPanel)).EndInit();
583 this.toolStripContainer.TopToolStripPanel.PerformLayout(); 581 ((System.ComponentModel.ISupportInitialize) (this.sbErrorPanel)).EndInit();
584 this.toolStripContainer.ResumeLayout(false); 582 ((System.ComponentModel.ISupportInitialize) (this.sbPointsPanel)).EndInit();
585 this.toolStripContainer.PerformLayout();
586 ((System.ComponentModel.ISupportInitialize)(this.sbMainPanel)).EndInit();
587 ((System.ComponentModel.ISupportInitialize)(this.sbErrorPanel)).EndInit();
588 ((System.ComponentModel.ISupportInitialize)(this.sbPointsPanel)).EndInit();
589 this.ResumeLayout(false); 583 this.ResumeLayout(false);
590 this.PerformLayout(); 584 this.PerformLayout();
591 585
592 } 586 }
593 #endregion 587 #endregion
960 954
961 private void RemoveCategoryButtons() 955 private void RemoveCategoryButtons()
962 { 956 {
963 if (categoryButtons!=null) 957 if (categoryButtons!=null)
964 { 958 {
965 for (int i = 0; i<categoryButtons.Length; i++) 959 this.Invoke(new MethodInvoker(catToolStrip.Items.Clear));
966 {
967 //this.Invoke(new ToolBarButtonDelegate(toolBar.Buttons.Remove), new object[]{categoryButtons[i]});
968 }
969 } 960 }
970 } 961 }
971 962
972 private void AddCategoryButtons(Category[] cats) 963 private void AddCategoryButtons(Category[] cats)
973 { 964 {
974 int catCount = cats.Length; 965 int catCount = cats.Length;
975 Category cat; 966 Category cat;
976 categoryButtons = new ToolStripButton[catCount + 1]; 967 categoryButtons = new ToolStripButton[catCount];
977 968
978 ToolStripButton button; 969 ToolStripButton button;
979 970
980 for (int i = 0; i < catCount; i++) 971 for (int i = 0; i < catCount; i++)
981 { 972 {
982 cat = cats[i]; 973 cat = cats[i];
983 button = new ToolStripButton(); 974 button = new ToolStripButton();
984 button.Text = cat.Name; 975 button.Text = cat.Name;
985 button.Tag = cat; 976 button.Tag = cat;
986 //button.ImageIndex = 6; 977 button.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.list_add;
987 button.Enabled = false; 978 button.Enabled = false;
988 categoryButtons[i] = button; 979 categoryButtons[i] = button;
989 } 980 }
990 981
991 //TODO: add buttons to ToolStrip in toolStripContainer.TopToolStrip 982 this.Invoke(new ArrayMethodInvoker<ToolStripButton>(catToolStrip.Items.AddRange), new object[]{ categoryButtons });
992 //this.Invoke(new ToolBarButtonRangeDelegate(toolBar.Buttons.AddRange), new object[] { categoryButtons });
993 } 983 }
994 984
995 private void EnableCategoryButtons() 985 private void EnableCategoryButtons()
996 { 986 {
987 catToolStrip.Visible = true;
997 SetCategoryButtonState(true); 988 SetCategoryButtonState(true);
998 } 989 }
999 990
1000 private void DisableCategoryButtons() 991 private void DisableCategoryButtons()
1001 { 992 {
993 catToolStrip.Visible = false;
1002 SetCategoryButtonState(false); 994 SetCategoryButtonState(false);
1003 } 995 }
1004 996
1005 private void SetCategoryButtonState(bool state) 997 private void SetCategoryButtonState(bool state)
1006 { 998 {