Esempio n. 1
0
        private void openModelesslyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PreferencesDialogue prefdlg = new PreferencesDialogue();

            prefdlg.Apply   += new EventHandler(infoGrab_Apply);
            prefdlg.closing += new EventHandler(revert_Info);
            prefdlg.Show(this);
        }
Esempio n. 2
0
        private void revert_Info(object sender, EventArgs e) //Reverting info to default values
        {
            PreferencesDialogue prefdlg = sender as PreferencesDialogue;

            this.eWidth    = this.defaultEllipseWidth;
            this.eRatio    = this.defaultEllipseRatio;
            this.recHeight = this.defaultRectangleHeight;
            this.recRatio  = this.defaultRectangleRatio;
        }
Esempio n. 3
0
        void infoGrab_Apply(object sender, EventArgs e)     //Grabbing All info inputted in the Preferences Dialog
        {
            PreferencesDialogue prefdlg = sender as PreferencesDialogue;

            this.eWidth    = prefdlg.ElipseWidth;
            this.eRatio    = prefdlg.ElipseRatio;
            this.recHeight = prefdlg.RectangularHeight;
            this.recRatio  = prefdlg.RectangleRatio;
            //Change for getting the values of the Custom Child
        }
Esempio n. 4
0
        private void openModallyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (PreferencesDialogue prefdlg = new PreferencesDialogue())
            {
                prefdlg.ShowDialog();

                this.eWidth    = prefdlg.ElipseWidth;
                this.eRatio    = prefdlg.ElipseRatio;
                this.recHeight = prefdlg.RectangularHeight;
                this.recRatio  = prefdlg.RectangleRatio;
            }
        }
Esempio n. 5
0
 private void openModelesslyToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (modelessDlg == null || modelessDlg.IsDisposed)
     {
         modelessDlg = createPrefDialogue(); //Change this when you have the Preferences Dialog working, this is just a test to see if it works.
         this.Update();                      //Check if this is the correct code for updating the properties of the Form.
         modelessDlg.Show(this);
     }
     else
     {
         modelessDlg.Activate();
     }
 }
Esempio n. 6
0
        PreferencesDialogue createPrefDialogue()
        {
            //creates pref dialogue and initializes it with current (or default values)
            PreferencesDialogue prefdlg = new PreferencesDialogue();

            prefdlg.ElipseWidth       = this.eWidth;
            prefdlg.ElipseRatio       = this.eRatio;
            prefdlg.RectangularHeight = this.recHeight;
            prefdlg.RectangleRatio    = this.recRatio;
            prefdlg.Apply            += infoGrab_Apply;
            prefdlg.GotFocus         += Prefdlg_GotFocus;
            prefdlg.Activated        += Prefdlg_Activated;
            return(prefdlg);
        }