Exemplo n.º 1
0
 private void Init()
 {
     _mmanager = new MenuManager();
     _dmanager = new DisplayManager(_mmanager);
     this.MainMenuStrip = _mmanager.Menu;
     this.Controls.Add(_dmanager);
     this.Controls.Add(this.MainMenuStrip); //weird.. this doesn't happen automatically?
     this.Resize += HandleResize;
     _mmanager.MenuAction += OnMenuAction;
 }
Exemplo n.º 2
0
 private void OnMenuAction(object sender, MenuManager.MenuActionEventArgs e)
 {
     if (e.Action == MenuManager.MenuActionType.FileClose) {
         FileHandler.Close();
     }
     else if (e.Action == MenuManager.MenuActionType.FileExit) {
         Application.Exit();
     }
     else if (e.Action == MenuManager.MenuActionType.FileOpen) {
         LoadFile();
     }
     else if (e.Action == MenuManager.MenuActionType.HelpAbout) {
         //TODO show about
     }
 }
Exemplo n.º 3
0
 public DisplayManager(MenuManager mmanager)
 {
     _mmanager = mmanager;
     Init();
 }
Exemplo n.º 4
0
 private void UpdateWidth(object sender, MenuManager.SpinnerChangedEventArgs e)
 {
     CanvasWidth = e.SpinnerValue;
     this.Refresh();
 }