Changeset 511
- Timestamp:
- 03/06/10 11:33:28 (6 months ago)
- Location:
- IBBoard.WarFoundry.GUI.WinForms/trunk
- Files:
-
- 2 modified
-
FrmMain.cs (modified) (19 diffs)
-
FrmMain.resx (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
IBBoard.WarFoundry.GUI.WinForms/trunk/FrmMain.cs
r507 r511 67 67 private IBBoard.Windows.Forms.ColorableStatusBar statusBar; 68 68 private System.Windows.Forms.Timer statusBarTimer; 69 private MenuStrip menuStrip 1;69 private MenuStrip menuStrip; 70 70 private ToolStripMenuItem menuFile; 71 71 private ToolStripMenuItem miNewArmy; … … 91 91 private ToolStripSplitButton bttnUndo; 92 92 private ToolStripSplitButton bttnRedo; 93 private ToolStripContainer toolStripContainer; 93 private ToolStrip catToolStrip; 94 private ToolStripPanel toolStripPanel; 94 95 private ToolStripMenuItem miAbout; 95 96 … … 120 121 121 122 InitializeComponent(); 123 toolStripPanel.Join(mainToolStrip, 0, 0); 124 toolStripPanel.Join(catToolStrip, 1, 0); 122 125 123 126 Preferences = new Preferences("WarFoundry"); … … 131 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 137 ControlTranslator.TranslateControls(Controls); … … 225 224 this.saveArmyDialog = new System.Windows.Forms.SaveFileDialog(); 226 225 this.statusBarTimer = new System.Windows.Forms.Timer(this.components); 227 this.menuStrip 1= new System.Windows.Forms.MenuStrip();226 this.menuStrip = new System.Windows.Forms.MenuStrip(); 228 227 this.menuFile = new System.Windows.Forms.ToolStripMenuItem(); 229 228 this.miNewArmy = new System.Windows.Forms.ToolStripMenuItem(); … … 250 249 this.bttnUndo = new System.Windows.Forms.ToolStripSplitButton(); 251 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 252 this.statusBar = new IBBoard.Windows.Forms.ColorableStatusBar(); 254 253 this.sbMainPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel(); 255 254 this.sbErrorPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel(); 256 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 258 this.mainToolStrip.SuspendLayout(); 259 this.toolStripContainer.TopToolStripPanel.SuspendLayout(); 260 this.toolStripContainer.SuspendLayout(); 261 ((System.ComponentModel.ISupportInitialize)(this.sbMainPanel)).BeginInit(); 262 ((System.ComponentModel.ISupportInitialize)(this.sbErrorPanel)).BeginInit(); 263 ((System.ComponentModel.ISupportInitialize)(this.sbPointsPanel)).BeginInit(); 259 ((System.ComponentModel.ISupportInitialize) (this.sbMainPanel)).BeginInit(); 260 ((System.ComponentModel.ISupportInitialize) (this.sbErrorPanel)).BeginInit(); 261 ((System.ComponentModel.ISupportInitialize) (this.sbPointsPanel)).BeginInit(); 264 262 this.SuspendLayout(); 265 263 // 266 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 267 this.buttonIcons.TransparentColor = System.Drawing.Color.Transparent; 270 268 this.buttonIcons.Images.SetKeyName(0, ""); … … 285 283 this.statusBarTimer.Tick += new System.EventHandler(this.statusBarTimer_Tick); 286 284 // 287 // menuStrip 1288 // 289 this.menuStrip 1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {285 // menuStrip 286 // 287 this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 290 288 this.menuFile, 291 289 this.menuEdit, 292 290 this.menuHelp}); 293 this.menuStrip 1.Location = new System.Drawing.Point(0, 0);294 this.menuStrip 1.Name = "menuStrip1";295 this.menuStrip 1.Size = new System.Drawing.Size(790, 24);296 this.menuStrip 1.TabIndex = 6;297 this.menuStrip 1.Text = "menuStrip1";291 this.menuStrip.Location = new System.Drawing.Point(0, 0); 292 this.menuStrip.Name = "menuStrip"; 293 this.menuStrip.Size = new System.Drawing.Size(790, 24); 294 this.menuStrip.TabIndex = 6; 295 this.menuStrip.Text = "menuStrip1"; 298 296 // 299 297 // menuFile … … 442 440 this.bttnUndo, 443 441 this.bttnRedo}); 444 this.mainToolStrip.Location = new System.Drawing.Point( 3, 0);442 this.mainToolStrip.Location = new System.Drawing.Point(0, 24); 445 443 this.mainToolStrip.Name = "mainToolStrip"; 446 this.mainToolStrip.Size = new System.Drawing.Size(1 51, 25);444 this.mainToolStrip.Size = new System.Drawing.Size(182, 25); 447 445 this.mainToolStrip.TabIndex = 8; 448 446 // … … 454 452 this.bttnNewArmy.Name = "bttnNewArmy"; 455 453 this.bttnNewArmy.Size = new System.Drawing.Size(23, 22); 456 this.bttnNewArmy.Text = " toolStripButton1";454 this.bttnNewArmy.Text = "new army"; 457 455 this.bttnNewArmy.Click += new System.EventHandler(this.miNewArmy_Click); 458 456 // … … 464 462 this.bttnOpenArmy.Name = "bttnOpenArmy"; 465 463 this.bttnOpenArmy.Size = new System.Drawing.Size(23, 22); 466 this.bttnOpenArmy.Text = " toolStripButton2";464 this.bttnOpenArmy.Text = "open army"; 467 465 this.bttnOpenArmy.Click += new System.EventHandler(this.miOpenArmy_Click); 468 466 // … … 475 473 this.bttnSaveArmy.Name = "bttnSaveArmy"; 476 474 this.bttnSaveArmy.Size = new System.Drawing.Size(23, 22); 477 this.bttnSaveArmy.Text = " toolStripButton3";475 this.bttnSaveArmy.Text = "save army"; 478 476 this.bttnSaveArmy.Click += new System.EventHandler(this.miSaveArmy_Click); 479 477 // … … 481 479 // 482 480 this.toolStripSeparator3.Name = "toolStripSeparator3"; 483 this.toolStripSeparator3.Size = new System.Drawing.Size(6, 2 5);481 this.toolStripSeparator3.Size = new System.Drawing.Size(6, 23); 484 482 // 485 483 // bttnUndo … … 491 489 this.bttnUndo.Name = "bttnUndo"; 492 490 this.bttnUndo.Size = new System.Drawing.Size(32, 22); 493 this.bttnUndo.Text = " toolStripSplitButton1";491 this.bttnUndo.Text = "undo"; 494 492 this.bttnUndo.Click += new System.EventHandler(this.miUndo_Click); 495 493 // … … 502 500 this.bttnRedo.Name = "bttnRedo"; 503 501 this.bttnRedo.Size = new System.Drawing.Size(32, 22); 504 this.bttnRedo.Text = " toolStripSplitButton2";502 this.bttnRedo.Text = "redo"; 505 503 this.bttnRedo.Click += new System.EventHandler(this.miRedo_Click); 506 504 // 507 // toolStripContainer 508 // 509 this.toolStripContainer.BottomToolStripPanelVisible = false; 510 // 511 // toolStripContainer.ContentPanel 512 // 513 this.toolStripContainer.ContentPanel.Enabled = false; 514 this.toolStripContainer.ContentPanel.Size = new System.Drawing.Size(790, 1); 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); 505 // catToolStrip 506 // 507 this.catToolStrip.Dock = System.Windows.Forms.DockStyle.None; 508 this.catToolStrip.Location = new System.Drawing.Point(161, 24); 509 this.catToolStrip.Name = "catToolStrip"; 510 this.catToolStrip.Size = new System.Drawing.Size(111, 25); 511 this.catToolStrip.TabIndex = 9; 512 this.catToolStrip.Visible = false; 526 513 // 527 514 // statusBar … … 562 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 560 // FrmMain 565 561 // 566 562 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); 567 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 567 this.Controls.Add(this.statusBar); 570 this.Controls.Add(this.menuStrip 1);571 this.Icon = ((System.Drawing.Icon) (resources.GetObject("$this.Icon")));568 this.Controls.Add(this.menuStrip); 569 this.Icon = ((System.Drawing.Icon) (resources.GetObject("$this.Icon"))); 572 570 this.IsMdiContainer = true; 573 this.MainMenuStrip = this.menuStrip 1;571 this.MainMenuStrip = this.menuStrip; 574 572 this.Menu = this.mainMenu; 575 573 this.Name = "FrmMain"; 576 574 this.Text = "WarFoundry"; 577 575 this.Load += new System.EventHandler(this.FrmMain_Load); 578 this.menuStrip 1.ResumeLayout(false);579 this.menuStrip 1.PerformLayout();576 this.menuStrip.ResumeLayout(false); 577 this.menuStrip.PerformLayout(); 580 578 this.mainToolStrip.ResumeLayout(false); 581 579 this.mainToolStrip.PerformLayout(); 582 this.toolStripContainer.TopToolStripPanel.ResumeLayout(false); 583 this.toolStripContainer.TopToolStripPanel.PerformLayout(); 584 this.toolStripContainer.ResumeLayout(false); 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(); 580 ((System.ComponentModel.ISupportInitialize) (this.sbMainPanel)).EndInit(); 581 ((System.ComponentModel.ISupportInitialize) (this.sbErrorPanel)).EndInit(); 582 ((System.ComponentModel.ISupportInitialize) (this.sbPointsPanel)).EndInit(); 589 583 this.ResumeLayout(false); 590 584 this.PerformLayout(); … … 963 957 if (categoryButtons!=null) 964 958 { 965 for (int i = 0; i<categoryButtons.Length; i++) 966 { 967 //this.Invoke(new ToolBarButtonDelegate(toolBar.Buttons.Remove), new object[]{categoryButtons[i]}); 968 } 959 this.Invoke(new MethodInvoker(catToolStrip.Items.Clear)); 969 960 } 970 961 } … … 974 965 int catCount = cats.Length; 975 966 Category cat; 976 categoryButtons = new ToolStripButton[catCount + 1];967 categoryButtons = new ToolStripButton[catCount]; 977 968 978 969 ToolStripButton button; … … 984 975 button.Text = cat.Name; 985 976 button.Tag = cat; 986 //button.ImageIndex = 6;977 button.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.list_add; 987 978 button.Enabled = false; 988 979 categoryButtons[i] = button; 989 980 } 990 981 991 //TODO: add buttons to ToolStrip in toolStripContainer.TopToolStrip 992 //this.Invoke(new ToolBarButtonRangeDelegate(toolBar.Buttons.AddRange), new object[] { categoryButtons }); 982 this.Invoke(new ArrayMethodInvoker<ToolStripButton>(catToolStrip.Items.AddRange), new object[]{ categoryButtons }); 993 983 } 994 984 995 985 private void EnableCategoryButtons() 996 986 { 987 catToolStrip.Visible = true; 997 988 SetCategoryButtonState(true); 998 989 } … … 1000 991 private void DisableCategoryButtons() 1001 992 { 993 catToolStrip.Visible = false; 1002 994 SetCategoryButtonState(false); 1003 995 } -
IBBoard.WarFoundry.GUI.WinForms/trunk/FrmMain.resx
r507 r511 253 253 <value>707, 17</value> 254 254 </metadata> 255 <metadata name="menuStrip 1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">255 <metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 256 256 <value>835, 17</value> 257 257 </metadata> 258 258 <metadata name="mainToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 259 259 <value>17, 54</value> 260 </metadata> 261 <metadata name="catToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 262 <value>138, 54</value> 260 263 </metadata> 261 264 <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
WarFoundry - Development