Example #1
0
        /// <summary>
        /// Processes Windows messages.
        /// </summary>
        /// <param name="msg">The Windows Message to process.</param>
        protected override void WndProc(ref Message msg)
        {
            // Test for the left mouse down windows message
            if (msg.Msg == (int)Win32.Msgs.WM_LBUTTONDOWN)
            {
                Crownwood.DotNetMagic.Controls.WizardControl wizardControl = this.SelectionService.PrimarySelection as Crownwood.DotNetMagic.Controls.WizardControl;

                // Check we have a valid object reference
                if (wizardControl != null)
                {
                    Crownwood.DotNetMagic.Controls.TabControl tabControl = wizardControl.TabControl;

                    // Check we have a valid object reference
                    if (tabControl != null)
                    {
                        // Extract the mouse position
                        int xPos = (short)((uint)msg.LParam & 0x0000FFFFU);
                        int yPos = (short)(((uint)msg.LParam & 0xFFFF0000U) >> 16);

                        Point screenCoord = wizardControl.PointToScreen(new Point(xPos, yPos));
                        Point clientCoord = tabControl.PointToClient(screenCoord);

                        // Ask the TabControl to change tabs according to mouse message
                        tabControl.ExternalMouseTest(msg.HWnd, clientCoord);
                    }
                }
            }
            else
            {
                if (msg.Msg == (int)Win32.Msgs.WM_LBUTTONDBLCLK)
                {
                    Crownwood.DotNetMagic.Controls.WizardControl wizardControl = this.SelectionService.PrimarySelection as Crownwood.DotNetMagic.Controls.WizardControl;

                    // Check we have a valid object reference
                    if (wizardControl != null)
                    {
                        Crownwood.DotNetMagic.Controls.TabControl tabControl = wizardControl.TabControl;

                        // Check we have a valid object reference
                        if (tabControl != null)
                        {
                            // Extract the mouse position
                            int xPos = (short)((uint)msg.LParam & 0x0000FFFFU);
                            int yPos = (short)(((uint)msg.LParam & 0xFFFF0000U) >> 16);

                            Point screenCoord = wizardControl.PointToScreen(new Point(xPos, yPos));
                            Point clientCoord = tabControl.PointToClient(screenCoord);

                            // Ask the TabControl to process a double click over an arrow as a simple
                            // click of the arrow button. In which case we return immediately to prevent
                            // the base class from using the double to generate the default event
                            if (tabControl.WantDoubleClick(msg.HWnd, clientCoord))
                            {
                                return;
                            }
                        }
                    }
                }
            }

            base.WndProc(ref msg);
        }
Example #2
0
        private void wizardControl_WizardPageEnter(Crownwood.DotNetMagic.Controls.WizardPage wp, Crownwood.DotNetMagic.Controls.WizardControl wc)
        {
            if (wp.Name != "wizardFinish")
            {
                wc.ShowNextButton = Crownwood.DotNetMagic.Controls.Status.Default;
            }

            if (wp.Name == "wizardSelDraw")
            {
                if (listBox1.Items.Count == 0)
                {
                    wc.EnableNextButton = Crownwood.DotNetMagic.Controls.Status.No;
                }
                else
                {
                    wc.EnableNextButton = Crownwood.DotNetMagic.Controls.Status.Default;
                }
            }

            if (wp.Name == "wizardSelClass" && bInit == false)
            {
                string s = listBox1.Items[0].ToString();
                textBox1.Text = GetPumpName(s);
                textBox2.Text = GetPumpClass(textBox1.Text);
                textBox3.Text = FindUser(s);

                string typeX = Util.Comm.GetPumpClass(textBox2.Text);
                if (typeX.Length > 1)
                {
                    cmbPump.Text = typeX;
                    bFindType    = true;
                    label6.Text  = "Find It!";
                }

                bInit = true;
            }

            if (wp.Name == "wizardFinish")
            {
                //wc.EnableNextButton=Crownwood.DotNetMagic.Controls.Status.No;
                wc.ShowNextButton     = Crownwood.DotNetMagic.Controls.Status.No;
                wc.ShowCancelButton   = Crownwood.DotNetMagic.Controls.Status.No;
                wc.EnableFinishButton = Crownwood.DotNetMagic.Controls.Status.No;
                wc.ShowBackButton     = Crownwood.DotNetMagic.Controls.Status.No;
                IntoLibG();
                wc.EnableFinishButton = Crownwood.DotNetMagic.Controls.Status.Default;
            }
        }
Example #3
0
        private void wizardControl1_WizardPageEnter(Crownwood.DotNetMagic.Controls.WizardPage wp, Crownwood.DotNetMagic.Controls.WizardControl wc)
        {
            if (wp.Name == pageDbConnection.Name)
            {
                wizardControl1.NextButton.Visible = true;
                wizardControl1.NextButton.Enabled = false;
            }
            else if (wp.Name == pageParameters.Name)
            {
                if (userCheckList.Items.Count == 0)
                {
                    LoadDbUsers();
                }

                wizardControl1.NextButton.Visible   = false;
                wizardControl1.FinishButton.Visible = true;
                wizardControl1.FinishButton.Enabled = false;
            }
        }