comparison FrmMainWindow.cs @ 36:d68992a831df

Fixes #182: Make GTK# more like WinForms UI * Remove "Change Game System" option * Delete "Change Game System" dialogs * Add game system selection to army creation
author IBBoard <dev@ibboard.co.uk>
date Sat, 16 Jan 2010 16:36:12 +0000
parents 441cfc410987
children a32b6bb7f1eb 4a33b3012100
comparison
equal deleted inserted replaced
35:1b603f97e7de 36:d68992a831df
358 protected virtual void OnExitActivated(object sender, System.EventArgs e) 358 protected virtual void OnExitActivated(object sender, System.EventArgs e)
359 { 359 {
360 Application.Quit(); 360 Application.Quit();
361 } 361 }
362 362
363 protected virtual void OnChangeGameSystemActivated(object sender, System.EventArgs e)
364 {
365 ChangeCurrentGameSystem();
366 }
367
368 protected virtual void OnCreateArmyActivated(object sender, System.EventArgs e) 363 protected virtual void OnCreateArmyActivated(object sender, System.EventArgs e)
369 { 364 {
370 CreateNewArmy(); 365 CreateNewArmy();
371 } 366 }
372 367
442 437
443 private void OnGameSystemChanged(GameSystem oldSys, GameSystem newSys) 438 private void OnGameSystemChanged(GameSystem oldSys, GameSystem newSys)
444 { 439 {
445 system = newSys; 440 system = newSys;
446 SetAppTitle(); 441 SetAppTitle();
447 miCreateArmy.Sensitive = system!=null;
448 newArmyButton.Sensitive = system!=null;
449 RemoveCategoryButtons(); 442 RemoveCategoryButtons();
450 443
451 if (system!=null) 444 if (system!=null)
452 { 445 {
453 AddCategoryButtons(system.Categories); 446 AddCategoryButtons(system.Categories);
880 } 873 }
881 874
882 newArmy.Destroy(); 875 newArmy.Destroy();
883 } 876 }
884 877
885 private void ChangeCurrentGameSystem()
886 {
887 logger.Debug("Changing game system");
888 FrmChangeGameSystem dialog = new FrmChangeGameSystem(this);
889 ResponseType type = (ResponseType)dialog.Run();
890 dialog.Hide();
891
892 if (type == ResponseType.Ok)
893 {
894 WarFoundryCore.CurrentGameSystem = dialog.SelectedSystem;
895 }
896 else
897 {
898 logger.Debug("Game system change cancelled");
899 }
900
901 dialog.Destroy();
902 }
903
904 protected virtual void undoTBButtonActivated (object sender, System.EventArgs e) 878 protected virtual void undoTBButtonActivated (object sender, System.EventArgs e)
905 { 879 {
906 CommandStack.Undo(); 880 CommandStack.Undo();
907 } 881 }
908 882