Exemplo n.º 1
0
        /*
         * OnLoad
         */

        /// <summary>
        /// Raises the <see cref="E:System.Windows.Forms.Form.Load"></see> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"></see> that contains the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            _canvasSizeToolStrip.CanvasSize          = Settings.Default.MainForm_CanvasSize;
            _canvasSizeToolStrip.MaintainAspectRatio = Settings.Default.MainForm_MaintainCanvasSizeAspectRatio;

            Location    = Settings.Default.MainForm_Location;
            Size        = Settings.Default.MainForm_Size;
            WindowState = Settings.Default.MainForm_State;

            MenuItemCheckedTracker.ChangeChecked(ZoomGroup, _100zoomButton);

            StringCollection expressionHistory = Settings.Default.MainForm_ExpressionHistory;

            if (expressionHistory != null)
            {
                foreach (String expression in expressionHistory)
                {
                    AddExpressionToHistory(expression);
                }
            }

            SetPropertiesFormVisible(Settings.Default.PropertiesForm_Visible);
            SetToolboxFormVisible(Settings.Default.ToolboxForm_Visible);
            SetOutputFormVisible(Settings.Default.OutputForm_Visible);

            _splashStarter.HideSplashScreen();
            Activate();
        }
Exemplo n.º 2
0
        /*
         * OnLoad
         */

        /// <summary>
        /// Raises the <see cref="E:System.Windows.Forms.Form.Load"></see> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"></see> that contains the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            _canvasSizeToolStrip.CanvasSize          = Settings.Default.MainForm_CanvasSize;
            _canvasSizeToolStrip.MaintainAspectRatio = Settings.Default.MainForm_MaintainCanvasSizeAspectRatio;

            Location    = Settings.Default.MainForm_Location;
            Size        = Settings.Default.MainForm_Size;
            WindowState = Settings.Default.MainForm_State;

            MenuItemCheckedTracker.ChangeChecked(ZoomGroup, _100zoomButton);

            SetPropertiesFormVisible(Settings.Default.PropertiesForm_Visible);
            SetToolboxFormVisible(Settings.Default.ToolboxForm_Visible);
            SetOutputFormVisible(Settings.Default.OutputForm_Visible);
        }
Exemplo n.º 3
0
        private void _zoomPercent_Click(Object sender, EventArgs e)
        {
            Debug.Assert(sender is ToolStripMenuItem, "sender is ToolStripMenuItem");
            ToolStripMenuItem menuItem = sender as ToolStripMenuItem;

            if (menuItem != null)
            {
                MenuItemCheckedTracker.ChangeChecked(ZoomGroup, menuItem);
                Canvas activeCanvas = _tabbedMdi.ActiveCanvas;

                if (activeCanvas != null)
                {
                    Single scaleFactor;

                    if (menuItem.Tag == null || !Single.TryParse(menuItem.Tag.ToString(), out scaleFactor))
                    {
                        scaleFactor = 1;
                    }

                    activeCanvas.Scale = scaleFactor;
                }
            }
        }