comparison FrmMain.cs @ 49:93b3d23147ba

Fixes #160: Army tree is visible when no army is available * Show/hide Army Tree depending on whether we have an army or not Also: * Tidy up FrmArmyTree code to remove "ht" prefix on dictionaries and to fix some mistmatches of naming conventions
author IBBoard <dev@ibboard.co.uk>
date Mon, 14 Sep 2009 20:43:52 +0000
parents 1576f669b3eb
children d6ff354a5d84
comparison
equal deleted inserted replaced
48:cf644b2c65e6 49:93b3d23147ba
140 140
141 sbErrorPanel.Color = Color.Red; 141 sbErrorPanel.Color = Color.Red;
142 142
143 armyTree = new FrmArmyTree(CommandStack); 143 armyTree = new FrmArmyTree(CommandStack);
144 armyTree.MdiParent = this; 144 armyTree.MdiParent = this;
145 armyTree.Show();
146 armyTree.StartPosition = FormStartPosition.Manual; 145 armyTree.StartPosition = FormStartPosition.Manual;
147 armyTree.Location = new Point(this.DisplayRectangle.Width - armyTree.Width - 10, 10); 146 armyTree.Location = new Point(this.DisplayRectangle.Width - armyTree.Width - 10, 10);
148 ControlTranslator.TranslateControl(armyTree); 147 ControlTranslator.TranslateControl(armyTree);
149 148
150 // hack to load default files 149 // hack to load default files
849 { 848 {
850 miSaveArmyAs.Enabled = false; 849 miSaveArmyAs.Enabled = false;
851 miCloseArmy.Enabled = false; 850 miCloseArmy.Enabled = false;
852 miExportArmyAs.Enabled = false; 851 miExportArmyAs.Enabled = false;
853 DisableCategoryButtons(); 852 DisableCategoryButtons();
853 armyTree.Hide();
854 } 854 }
855 else 855 else
856 { 856 {
857 newArmy.UnitAdded += UnitAddedMethod; 857 newArmy.UnitAdded += UnitAddedMethod;
858 newArmy.UnitRemoved += UnitRemovedMethod; 858 newArmy.UnitRemoved += UnitRemovedMethod;
860 //TODO: Clear all buttons 860 //TODO: Clear all buttons
861 miSaveArmyAs.Enabled = true; 861 miSaveArmyAs.Enabled = true;
862 miCloseArmy.Enabled = true; 862 miCloseArmy.Enabled = true;
863 miExportArmyAs.Enabled = true; 863 miExportArmyAs.Enabled = true;
864 EnableCategoryButtons(); 864 EnableCategoryButtons();
865 armyTree.Show();
865 866
866 if (newArmy.Race.HasCategoryOverrides()) 867 if (newArmy.Race.HasCategoryOverrides())
867 { 868 {
868 RemoveCategoryButtons(); 869 RemoveCategoryButtons();
869 AddCategoryButtons(newArmy.Race.Categories); 870 AddCategoryButtons(newArmy.Race.Categories);