public ApplicationWindow(string caption, int width, int height) : base(caption, width, height) { Name = "ApplicationWindow"; MainMenu = new GuiMenu("mainmenu"); MenuPanel = AddChild(new MenuPanel(MainMenu)); MenuPanel.WebsiteTitle = "Visit the Kroll-Software Website.."; MenuPanel.WebsiteURL = "http://www.kroll-software.ch"; StatusPanel = AddChild(new Panel("statuspanel", Docking.Bottom)); StatusBar = StatusPanel.AddChild(new StatusBar("mainstatusbar")); MainSplitter = AddChild(new ComplexSplitContainer("mainsplitter", Docking.Fill, new DarkGradientPanelWidgetStyle())); MainSplitter.PanelBottomCollapsed = true; MainSplitter.PanelRightCollapsed = true; MainSplitter.SplitterLeft.Distance = 200; TabMain = MainSplitter.PanelCenter.AddChild(new TabContainer("maintabs")); TabMain.Dock = Docking.Fill; /******/ LeftSideMenu = MainSplitter.PanelLeft.AddChild(new SideMenuContainer("leftmenu", MenuPanel.MainMenu)); LeftSideMenu.Dock = Docking.Fill; LeftSideMenu.MenuBar.Close += (object sender, EventArgs e) => this.LeftSideBarVisible = false; MainSplitter.SplitterLeft.MinDistanceNear = LeftSideMenu.MinSize.Width; MenuPanel.InitMenu(); //initialized = true; }
// *********** Menu Updates ********** public override void OnScalingChanged() { base.OnScalingChanged(); if (MenuPanel != null) { MenuPanel.UpdateScalingMenu(ScaleFactor); } }
protected override void OnWindowStateChanged(EventArgs e) { base.OnWindowStateChanged(e); if (MenuPanel != null) { MenuPanel.UpdateWindowStateMenu(this.WindowState); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); MenuPanel.UpdateMenuBarsVisible(LeftSideBarVisible, MenuPanel.ToolBar.Visible, StatusBar.Visible); if (Controller != null && StatusBar != null) { Controller.Subscribe(StatusBar.RootControllerObserver); } }
// *** IStatusPresenter Proxy Implementation *** public override void OnDeviceChanged(Devices currentDevice) { base.OnDeviceChanged(currentDevice); if (currentDevice == Devices.Mobile) { LeftSideBarVisible = false; } if (MenuPanel != null) { MenuPanel.UpdateDeviceMenu(currentDevice); } }
public override void OnLoadSettings() { base.OnLoadSettings(); if (WindowState != WindowState.Minimized) { ConfigurationService.Instance.ConfigFile.Do(cfg => { MainSplitter.PanelLeftCollapsed = cfg.GetSetting(Name, "MainSplitter.PanelLeftCollapsed", MainSplitter.PanelLeftCollapsed).SafeBool(); MainSplitter.SplitterLeft.Distance = cfg.GetSetting(Name, "MainSplitter.SplitterLeft", MainSplitter.SplitterLeft.Distance).SafeFloat(); MainSplitter.PanelRightCollapsed = cfg.GetSetting(Name, "MainSplitter.PanelRightCollapsed", MainSplitter.PanelRightCollapsed).SafeBool(); MainSplitter.SplitterRight.Distance = cfg.GetSetting(Name, "MainSplitter.SplitterRight", MainSplitter.SplitterRight.Distance).SafeFloat(); MainSplitter.PanelBottomCollapsed = cfg.GetSetting(Name, "MainSplitter.PanelBottomCollapsed", MainSplitter.PanelBottomCollapsed).SafeBool(); MainSplitter.SplitterBottom.Distance = cfg.GetSetting(Name, "MainSplitter.SplitterBottom", MainSplitter.SplitterBottom.Distance).SafeFloat(); MenuPanel.MenuBar.Visible = cfg.GetSetting(Name, "MenuBar.Visible", MenuPanel.MenuBar.Visible).SafeBool(); MenuPanel.ToolBar.Visible = cfg.GetSetting(Name, "ToolBar.Visible", MenuPanel.ToolBar.Visible).SafeBool(); StatusBar.Visible = cfg.GetSetting(Name, "StatusBar.Visible", StatusBar.Visible).SafeBool(); }); MenuPanel.UpdateMenus(); LeftSideMenu.Init(); } }
protected virtual void OnLeftSideBarVisibleChanged() { MenuPanel.UpdateMenuBarsVisible(LeftSideBarVisible, MenuPanel.ToolBar.Visible, StatusBar.Visible); }