Example #1
0
        private void InitializeComponent()
        {
            ComponentResourceManager resources = new ComponentResourceManager(typeof(MainForm));

            WindowPanel.SuspendLayout();
            ((ISupportInitialize)(IconWindow)).BeginInit();
            NavigatorPanel.SuspendLayout();
            ((ISupportInitialize)(OtherWindowIcon)).BeginInit();
            ((ISupportInitialize)(NavigatorIcon)).BeginInit();
            ViewsPanel.SuspendLayout();
            SuspendLayout();

            // WindowPanel
            WindowPanel.BackColor = RedGreenBlue.Color3;
            WindowPanel.Controls.Add(IconWindow);
            WindowPanel.Controls.Add(MinimizedButton);
            WindowPanel.Controls.Add(RestartButton);
            WindowPanel.Controls.Add(ExitButton);
            WindowPanel.Controls.Add(TitleWindow);
            WindowPanel.Dock       = DockStyle.Top;
            WindowPanel.Location   = new Point(0, 0);
            WindowPanel.Margin     = new Padding(0);
            WindowPanel.Name       = "WindowPanel";
            WindowPanel.Size       = new Size(500, 34);
            WindowPanel.TabIndex   = 0;
            WindowPanel.MouseDown += new MouseEventHandler(MainWindow_Down);
            WindowPanel.MouseMove += new MouseEventHandler(MainWindow_Move);

            MinimizedButton.Click          += new EventHandler(MainWindow_Minimized);
            RestartButton.Click            += new EventHandler(MainWindow_Restart);
            ExitButton.Click               += new EventHandler(MainWindow_Exit);
            ButtonConstant.Click           += new EventHandler(OpenOtherWindow2);
            ButtonCodeMath.Click           += new EventHandler(OpenCodingMathRequest);
            ButtonEquationABC.Click        += new EventHandler(OpenEquationABC);
            ButtonConverterDigits.Click    += new EventHandler(OpenConvertDigits);
            ButtonNumberSystem.Click       += new EventHandler(NumberSystem_Click);
            ButtonSystemMeasure.Click      += new EventHandler(OpenSystemMeasure);
            ButtonSimpleCalculater.Click   += new EventHandler(OpenSimpleCalculater);
            ButtonDateCompute.Click        += new EventHandler(OpenDateCompute);
            ButtonValuteCompute.Click      += new EventHandler(OpenValuteCompute);
            ButtonComputeSystem.Click      += new EventHandler(OpenComputeNumSystem);
            ButtonEngineerCalculater.Click += new EventHandler(OpenEngineerCalculater);
            ButtonLogbook.Click            += new EventHandler(OpenOtherWindow1);
            ReviewButton.Click             += new EventHandler(OpenReview_Click);
            ButtonViews.Click              += new EventHandler(ViewsPanel_Click);
            ButtonSettings.Click           += new EventHandler(OpenSettingsPage);

            // MainPanel
            MainPanel.Anchor    = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Right)));
            MainPanel.BackColor = RedGreenBlue.Color2;
            MainPanel.Location  = new Point(7, 70);
            MainPanel.Margin    = new Padding(0);
            MainPanel.Name      = "MainPanel";
            MainPanel.Size      = new Size(487, 523);
            MainPanel.TabIndex  = 0;

            // NavigatorPanel
            NavigatorPanel.Controls.Add(OtherWindowTitle);
            NavigatorPanel.Controls.Add(OtherWindowIcon);
            NavigatorPanel.Controls.Add(NavigatorIcon);
            NavigatorPanel.Controls.Add(NavigatorTitle);
            NavigatorPanel.Controls.Add(ButtonLogbook);
            NavigatorPanel.Controls.Add(ReviewButton);
            NavigatorPanel.Controls.Add(ButtonViews);
            NavigatorPanel.Controls.Add(ButtonSettings);
            NavigatorPanel.Controls.Add(ButtonConstant);
            NavigatorPanel.Dock     = DockStyle.Top;
            NavigatorPanel.Location = new Point(0, 34);
            NavigatorPanel.Margin   = new Padding(0);
            NavigatorPanel.Name     = "NavigatorPanel";
            NavigatorPanel.Size     = new Size(500, 36);
            NavigatorPanel.TabIndex = 0;

            // OtherWindow
            OtherWindow.Anchor    = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left)));
            OtherWindow.BackColor = RedGreenBlue.Color2;
            OtherWindow.Location  = new Point(7, 70);
            OtherWindow.Margin    = new Padding(0);
            OtherWindow.Name      = "OtherWindow";
            OtherWindow.Size      = new Size(242, 523);
            OtherWindow.TabIndex  = 0;

            // ViewsPanel
            ViewsPanel.BackColor = RedGreenBlue.Color3;
            ViewsPanel.Controls.Add(ButtonCodeMath);
            ViewsPanel.Controls.Add(LabelPanelViews);
            ViewsPanel.Controls.Add(ButtonSystemMeasure);
            ViewsPanel.Controls.Add(ButtonConverterDigits);
            ViewsPanel.Controls.Add(ButtonEquationABC);
            ViewsPanel.Controls.Add(ButtonSimpleCalculater);
            ViewsPanel.Controls.Add(ButtonDateCompute);
            ViewsPanel.Controls.Add(ButtonValuteCompute);
            ViewsPanel.Controls.Add(ButtonComputeSystem);
            ViewsPanel.Controls.Add(ButtonNumberSystem);
            ViewsPanel.Controls.Add(ButtonEngineerCalculater);
            ViewsPanel.Dock        = DockStyle.Right;
            ViewsPanel.Location    = new Point(500, 70);
            ViewsPanel.Margin      = new Padding(0);
            ViewsPanel.MaximumSize = new Size(270, 530);
            ViewsPanel.Name        = "ViewsPanel";
            ViewsPanel.Size        = new Size(0, 530);
            ViewsPanel.TabIndex    = 0;

            // MainForm
            AutoScaleDimensions = new SizeF(96F, 96F);
            AutoScaleMode       = AutoScaleMode.Dpi;
            BackColor           = RedGreenBlue.Color1;
            ClientSize          = new Size(500, 600);
            Controls.Add(ViewsPanel);
            Controls.Add(MainPanel);
            Controls.Add(NavigatorPanel);
            Controls.Add(WindowPanel);
            Controls.Add(OtherWindow);
            Font            = new Font("Ubuntu Light", 12F, FontStyle.Regular, GraphicsUnit.Point, 204);
            ForeColor       = SystemColors.Control;
            FormBorderStyle = FormBorderStyle.None;
            Icon            = ((Icon)(resources.GetObject("$this.Icon")));
            Margin          = new Padding(4, 5, 4, 5);
            MaximumSize     = new Size(750, 600);
            MinimumSize     = new Size(500, 600);
            Name            = "MainForm";
            StartPosition   = FormStartPosition.CenterScreen;
            FormClosed     += new FormClosedEventHandler(MainWindow_Closed);
            Load           += new EventHandler(MainWindow_Load);
            KeyDown        += new KeyEventHandler(MainWindow_KeyDown);
            WindowPanel.ResumeLayout(false);
            ((ISupportInitialize)(IconWindow)).EndInit();
            NavigatorPanel.ResumeLayout(false);
            ((ISupportInitialize)(OtherWindowIcon)).EndInit();
            ((ISupportInitialize)(NavigatorIcon)).EndInit();
            ViewsPanel.ResumeLayout(false);
            ResumeLayout(false);
        }
Example #2
0
        private void CreateStorageObjects()
        {
            // Create the page print specific delegate
            _needPagePaint = new NeedPaintHandler(OnNeedPagePaint);

            // Create state storage objects
            _stateCommon = new PaletteNavigatorRedirect(this, Redirector, _needPagePaint);
            _stateDisabled = new PaletteNavigator(_stateCommon, _needPagePaint);
            _stateNormal = new PaletteNavigator(_stateCommon, _needPagePaint);
            _stateTracking = new PaletteNavigatorOtherEx(_stateCommon, _needPagePaint);
            _statePressed = new PaletteNavigatorOtherEx(_stateCommon, _needPagePaint);
            _stateSelected = new PaletteNavigatorOther(_stateCommon, _needPagePaint);
            _stateFocus = new PaletteNavigatorOtherRedirect(Redirector, Redirector, Redirector,
                                                            Redirector, Redirector, _needPagePaint);

            // Create other storage objects
            _bar = new NavigatorBar(this, NeedPaintDelegate);
            _button = new NavigatorButton(this, NeedPaintDelegate);
            _group = new NavigatorGroup(this, NeedPaintDelegate);
            _header = new NavigatorHeader(this, NeedPaintDelegate);
            _outlook = new NavigatorOutlook(this, NeedPaintDelegate);
            _panel = new NavigatorPanel(this, NeedPaintDelegate);
            _popupPages = new NavigatorPopupPages(this, NeedPaintDelegate);
            _stack = new NavigatorStack(this, NeedPaintDelegate);
            _toolTips = new NavigatorToolTips(this, NeedPaintDelegate);

            // Need to know when the context button is about to show a context menu, so we
            // can then populate it with the correct set of values dependant on the current pages
            _button.ContextButton.KryptonContextMenu.Opening += new CancelEventHandler(OnOpeningContextMenu);
        }