Пример #1
0
        /*
         * All the following methods work in a similar way.
         *
         * The GUI/Dialogs directory contains all dialogs which take a settings
         * object and stores it.  The user manipulates GUI widgets which update
         * these settings in the dialog's state.  On the condition that the user
         * presses the OK the settings from the dialog are stored into the active
         * document's setting.  Settings are persisted between saved documents,
         * the serialization of documents saves their settings as well as the point
         * data.
         *
         */

        public void Coordinates_Click(object sender, System.EventArgs args)
        {
            CoordinatesDialog dlg = new CoordinatesDialog(ActiveDocument.CoordSettings);

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                CoordSettings newSettings = ActiveDocument.CoordSettings;

                newSettings.frame       = dlg.Frame;
                newSettings.thetaUnits  = dlg.Units;
                newSettings.xThetaScale = dlg.XThetaScale;
                newSettings.yRScale     = dlg.YRScale;

                ActiveDocument.CoordSettings = newSettings;
            }
        }
Пример #2
0
        /*
         * All the following methods work in a similar way.
         * 
         * The GUI/Dialogs directory contains all dialogs which take a settings
         * object and stores it.  The user manipulates GUI widgets which update
         * these settings in the dialog's state.  On the condition that the user 
         * presses the OK the settings from the dialog are stored into the active
         * document's setting.  Settings are persisted between saved documents,
         * the serialization of documents saves their settings as well as the point
         * data.
         * 
        */

        public void Coordinates_Click(object sender, System.EventArgs args)
        {
            CoordinatesDialog dlg = new CoordinatesDialog(ActiveDocument.CoordSettings);

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                CoordSettings newSettings = ActiveDocument.CoordSettings;

                newSettings.frame = dlg.Frame;
                newSettings.thetaUnits = dlg.Units;
                newSettings.xThetaScale = dlg.XThetaScale;
                newSettings.yRScale = dlg.YRScale;

                ActiveDocument.CoordSettings = newSettings;
            }
        }