Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        // *********** Menu Updates **********

        public override void OnScalingChanged()
        {
            base.OnScalingChanged();
            if (MenuPanel != null)
            {
                MenuPanel.UpdateScalingMenu(ScaleFactor);
            }
        }
Esempio n. 3
0
 protected override void OnWindowStateChanged(EventArgs e)
 {
     base.OnWindowStateChanged(e);
     if (MenuPanel != null)
     {
         MenuPanel.UpdateWindowStateMenu(this.WindowState);
     }
 }
Esempio n. 4
0
        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);
            }
        }
Esempio n. 5
0
 // *** IStatusPresenter Proxy Implementation ***
 public override void OnDeviceChanged(Devices currentDevice)
 {
     base.OnDeviceChanged(currentDevice);
     if (currentDevice == Devices.Mobile)
     {
         LeftSideBarVisible = false;
     }
     if (MenuPanel != null)
     {
         MenuPanel.UpdateDeviceMenu(currentDevice);
     }
 }
Esempio n. 6
0
        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();
            }
        }
Esempio n. 7
0
 protected virtual void OnLeftSideBarVisibleChanged()
 {
     MenuPanel.UpdateMenuBarsVisible(LeftSideBarVisible, MenuPanel.ToolBar.Visible, StatusBar.Visible);
 }