Example #1
0
        public Mouse(WaywardForm form)
        {
            this.form = form;

            /*cursorImage = new PictureBox();
            *  cursorImage.Image = Properties.Resources.QuillCursor1;
            *  form.Controls.Add(cursorImage);*/

            form.game.DoUpdate += Update;
        }
Example #2
0
        public Page(WaywardForm form, PageType type)
        {
            this.form = form;

            switch (type)
            {
            case PageType.Blank:
                control = new BlankPage(this);
                break;

            case PageType.Descriptive:
                control = new DescriptivePage(this);
                break;

            case PageType.Input:
                control = new InputPage(this);
                break;
            }

            if (control == null)
            {
                return;
            }
            initialBorderColor = control.BackColor;

            List <Control> allControls = Utility.GetAllControlsRecurs(new List <Control>(), control);

            foreach (Control ctrl in allControls)
            {
                if (!ctrl.CausesValidation)
                {
                    continue;
                }

                ctrl.MouseEnter += OnMouseEnter;
                ctrl.MouseLeave += OnMouseLeave;
                ctrl.MouseDown  += OnMouseDown;
                ctrl.MouseUp    += OnMouseUp;
            }

            form.Controls.Add(control);
        }