Ejemplo n.º 1
0
        public Control GetButton() {
            button = new BitmapButton();
            //button.AutoSize = true;
            //button.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            button.Height = Height;
            button.Width = Width;
            button.TextAlign = ContentAlignment.MiddleCenter;
            button.Font = Config.MenuFont;
            button.Text = Label;
            button.ForeColor = Config.MenuTextColor;
            button.Margin = new Padding(0, 0, 0, 3);
            button.Cursor = Cursors.Hand;
            button.ButtonStyle = FrameBorderRenderer.StyleType.DarkHive; 
            //button.Dock = Dock;
            if (Icon != null) {
                button.Image = Icon;
                //button.ImageAlign = ContentAlignment.MiddleLeft;
                button.TextAlign = ContentAlignment.MiddleCenter;
                button.TextImageRelation = TextImageRelation.ImageBeforeText;
            }
            button.Click += (sender, args) =>
                { Program.MainWindow.navigationControl.SwitchTab(TargetPath); };
            return button;

        }
Ejemplo n.º 2
0
 public Control GetButton()
 {
     button = new BitmapButton();
     //button.AutoSize = true;
     //button.AutoSizeMode = AutoSizeMode.GrowAndShrink;
     button.Height      = Height;
     button.Width       = Width;
     button.TextAlign   = ContentAlignment.MiddleCenter;
     button.Font        = Config.MenuFont;
     button.Text        = Label;
     button.ForeColor   = Config.MenuTextColor;
     button.Margin      = new Padding(0, 0, 0, 3);
     button.Cursor      = Cursors.Hand;
     button.ButtonStyle = FrameBorderRenderer.StyleType.DarkHive;
     //button.Dock = Dock;
     if (Icon != null)
     {
         button.Image = Icon;
         //button.ImageAlign = ContentAlignment.MiddleLeft;
         button.TextAlign         = ContentAlignment.MiddleCenter;
         button.TextImageRelation = TextImageRelation.ImageBeforeText;
     }
     button.Click += (sender, args) =>
     { Program.MainWindow.navigationControl.SwitchTab(TargetPath); };
     return(button);
 }
Ejemplo n.º 3
0
        public Control GetButton() {
            button = new BitmapButton();
            button.SoundType = SoundPalette.SoundType.Click;
            //button.AutoSize = true;
            //button.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            button.Height = Height;
            button.Width = Width;
            button.TextAlign = ContentAlignment.MiddleCenter;
            //button.Text = Label;
            button.Margin = new Padding(0, 0, 0, 3);
            button.Cursor = Cursors.Hand;
            button.Margin = new Padding(5,0,0,5);
            //button.Dock = Dock;
            if (Icon != null) {
                button.Image = Icon;
                //button.ImageAlign = ContentAlignment.MiddleLeft;
                button.TextAlign = ContentAlignment.MiddleCenter;
                button.TextImageRelation = TextImageRelation.ImageBeforeText;
            }
            button.Click += (sender, args) => {
                var navigator = Program.MainWindow.navigationControl;
                var panel = Program.MainWindow.panelRight;
                if (navigator.CurrentNavigatable == navigator.GetNavigatableFromPath(TargetPath)) panel.Visible = !panel.Visible;
                else panel.Visible = true;
                if (panel.Visible) {
                    Program.MainWindow.navigationControl.SwitchTab(TargetPath);
                }
                else {
                    Program.MainWindow.navigationControl.Path = "";
                }
            };

            Program.ToolTip.SetText(button, Label);

            return button;

        }
        private void CreateTopRightMiniIcons(FlowLayoutPanel miniIconPanel) {
            urlBox = new ZklTextBox
            {
                Size = new Size(110, 20),
                TabIndex = 1,
                Font = Config.GeneralFontSmall,
                Margin = new Padding(10)
            };
            urlBox.KeyDown += urlBox_KeyDown;
            urlBox.MouseDown += urlBox_MouseDown;

            var minMaxButton = new BitmapButton
            {
                ButtonStyle = FrameBorderRenderer.StyleType.IconOnly,
                SoundType = SoundPalette.SoundType.Click,
                Height = TopRightMiniIconSize,
                Width = TopRightMiniIconSize,
                Image = Buttons.win_max.GetResizedWithCache(TopRightMiniIconSize, TopRightMiniIconSize)
            };
            minMaxButton.Click += (sender, args) =>
            { Program.MainWindow?.SwitchFullscreenState(); };

            var exitButton = new BitmapButton()
            {
                ButtonStyle = FrameBorderRenderer.StyleType.IconOnly,
                SoundType = SoundPalette.SoundType.Click,
                Height = TopRightMiniIconSize,
                Width = TopRightMiniIconSize,
                Image = Buttons.exit.GetResizedWithCache(TopRightMiniIconSize, TopRightMiniIconSize),
            };
            exitButton.Click += (sender, args) => Program.MainWindow?.Exit();

            var backButton = new BitmapButton()
            {
                ButtonStyle = FrameBorderRenderer.StyleType.IconOnly,
                SoundType = SoundPalette.SoundType.Click,
                Height = TopRightMiniIconSize,
                Width = TopRightMiniIconSize,
                Image = Buttons.left.GetResizedWithCache(TopRightMiniIconSize, TopRightMiniIconSize),
            };
            backButton.Click += (sender, args) => { NavigateBack(); };

            var forwardImage = Buttons.left.GetResizedWithCache(TopRightMiniIconSize, TopRightMiniIconSize);
            forwardImage.RotateFlip(RotateFlipType.RotateNoneFlipX);
            var forwardButton = new BitmapButton()
            {
                ButtonStyle = FrameBorderRenderer.StyleType.IconOnly,
                SoundType = SoundPalette.SoundType.Click,
                Height = TopRightMiniIconSize,
                Width = TopRightMiniIconSize,
                Image = forwardImage,
            };
            forwardButton.Click += (sender, args) => { NavigateForward(); };

            sndButton = new BitmapButton()
            {
                ButtonStyle = FrameBorderRenderer.StyleType.IconOnly,
                SoundType = SoundPalette.SoundType.Click,
                Height = TopRightMiniIconSize,
                Width = TopRightMiniIconSize,
                Image = Buttons.soundOn.GetResizedWithCache(TopRightMiniIconSize, TopRightMiniIconSize),
            };
            sndButton.Click += (sender, args) => Program.MainWindow?.SwitchMusicOnOff();

            var settingsButton = new BitmapButton()
            {
                ButtonStyle = FrameBorderRenderer.StyleType.IconOnly,
                SoundType = SoundPalette.SoundType.Click,
                Height = TopRightMiniIconSize,
                Width = TopRightMiniIconSize,
                Image = Buttons.settings.GetResizedWithCache(TopRightMiniIconSize, TopRightMiniIconSize),
            };
            settingsButton.Click += (sender, args) => { Path = "settings"; };

            Program.ToolTip.SetText(exitButton,"Exit");
            Program.ToolTip.SetText(minMaxButton, "Fullscreen on/off");
            Program.ToolTip.SetText(settingsButton, "Settings");
            Program.ToolTip.SetText(sndButton, "Music on/off");
            Program.ToolTip.SetText(forwardButton, "Forward");
            Program.ToolTip.SetText(backButton, "Back");

            miniIconPanel.Controls.Add(exitButton);
            miniIconPanel.Controls.Add(minMaxButton);
            miniIconPanel.Controls.Add(settingsButton);
            miniIconPanel.Controls.Add(sndButton);
            miniIconPanel.Controls.Add(urlBox);
            miniIconPanel.Controls.Add(forwardButton);
            miniIconPanel.Controls.Add(backButton);
        }
        private void CreateTopRightMiniIcons(FlowLayoutPanel miniIconPanel)
        {
            urlBox = new ZklTextBox
            {
                Size     = new Size(110, 20),
                TabIndex = 1,
                Font     = Config.GeneralFontSmall,
                Margin   = new Padding(10)
            };
            urlBox.KeyDown   += urlBox_KeyDown;
            urlBox.MouseDown += urlBox_MouseDown;

            var minMaxButton = new BitmapButton
            {
                ButtonStyle = FrameBorderRenderer.StyleType.IconOnly,
                SoundType   = SoundPalette.SoundType.Click,
                Height      = TopRightMiniIconSize,
                Width       = TopRightMiniIconSize,
                Image       = Buttons.win_max.GetResizedWithCache(TopRightMiniIconSize, TopRightMiniIconSize)
            };

            minMaxButton.Click += (sender, args) =>
            { Program.MainWindow?.SwitchFullscreenState(); };

            var exitButton = new BitmapButton()
            {
                ButtonStyle = FrameBorderRenderer.StyleType.IconOnly,
                SoundType   = SoundPalette.SoundType.Click,
                Height      = TopRightMiniIconSize,
                Width       = TopRightMiniIconSize,
                Image       = Buttons.exit.GetResizedWithCache(TopRightMiniIconSize, TopRightMiniIconSize),
            };

            exitButton.Click += (sender, args) => Program.MainWindow?.Exit();

            var backButton = new BitmapButton()
            {
                ButtonStyle = FrameBorderRenderer.StyleType.IconOnly,
                SoundType   = SoundPalette.SoundType.Click,
                Height      = TopRightMiniIconSize,
                Width       = TopRightMiniIconSize,
                Image       = Buttons.left.GetResizedWithCache(TopRightMiniIconSize, TopRightMiniIconSize),
            };

            backButton.Click += (sender, args) => { NavigateBack(); };

            var forwardImage = Buttons.left.GetResizedWithCache(TopRightMiniIconSize, TopRightMiniIconSize);

            forwardImage.RotateFlip(RotateFlipType.RotateNoneFlipX);
            var forwardButton = new BitmapButton()
            {
                ButtonStyle = FrameBorderRenderer.StyleType.IconOnly,
                SoundType   = SoundPalette.SoundType.Click,
                Height      = TopRightMiniIconSize,
                Width       = TopRightMiniIconSize,
                Image       = forwardImage,
            };

            forwardButton.Click += (sender, args) => { NavigateForward(); };

            sndButton = new BitmapButton()
            {
                ButtonStyle = FrameBorderRenderer.StyleType.IconOnly,
                SoundType   = SoundPalette.SoundType.Click,
                Height      = TopRightMiniIconSize,
                Width       = TopRightMiniIconSize,
                Image       = Buttons.soundOn.GetResizedWithCache(TopRightMiniIconSize, TopRightMiniIconSize),
            };
            sndButton.Click += (sender, args) => Program.MainWindow?.SwitchMusicOnOff();

            var settingsButton = new BitmapButton()
            {
                ButtonStyle = FrameBorderRenderer.StyleType.IconOnly,
                SoundType   = SoundPalette.SoundType.Click,
                Height      = TopRightMiniIconSize,
                Width       = TopRightMiniIconSize,
                Image       = Buttons.settings.GetResizedWithCache(TopRightMiniIconSize, TopRightMiniIconSize),
            };

            settingsButton.Click += (sender, args) => { Path = "settings"; };

            Program.ToolTip.SetText(exitButton, "Exit");
            Program.ToolTip.SetText(minMaxButton, "Fullscreen on/off");
            Program.ToolTip.SetText(settingsButton, "Settings");
            Program.ToolTip.SetText(sndButton, "Music on/off");
            Program.ToolTip.SetText(forwardButton, "Forward");
            Program.ToolTip.SetText(backButton, "Back");

            miniIconPanel.Controls.Add(exitButton);
            miniIconPanel.Controls.Add(minMaxButton);
            miniIconPanel.Controls.Add(settingsButton);
            miniIconPanel.Controls.Add(sndButton);
            miniIconPanel.Controls.Add(urlBox);
            miniIconPanel.Controls.Add(forwardButton);
            miniIconPanel.Controls.Add(backButton);
        }