Esempio n. 1
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (!disposing)
            {
                return;
            }

            Label        = null;
            OKButton     = null;
            CancelButton = null;
            NoButton     = null;
            YesButton    = null;
            Buttons      = 0;

            for (int i = 0; i < Program.Form.Controls.Count; i++)
            {
                TextBox T = (TextBox)Program.Form.Controls[i];
                if (T != null && T.Tag != null)
                {
                    ((MirTextBox)T.Tag).DialogChanged();
                }
            }
        }
Esempio n. 2
0
        public MirMessageBox1(string message, MirMessageBoxButtons1 b = MirMessageBoxButtons1.OK)
        {
            DrawImage  = true;
            ForeColour = Color.White;
            Buttons    = b;
            Modal      = true;
            Movable    = false;

            Index   = 990;
            Library = Libraries.Prguse;

            Location = new Point((Settings.ScreenWidth - Size.Width) / 2, (Settings.ScreenHeight - Size.Height) / 2);


            Label = new MirLabel
            {
                AutoSize = false,
                // DrawFormat = StringFormatFlags.FitBlackBox,
                Location = new Point(35 - 20, 35 - 16),
                Size     = new Size(390, 110),
                Parent   = this,
                Text     = message
            };


            switch (Buttons)
            {
            case MirMessageBoxButtons1.OK:
                OKButton = new MirButton
                {
                    HoverIndex   = 201,
                    Index        = 200,
                    Library      = Libraries.Title,
                    Location     = new Point(340, 157),
                    Parent       = this,
                    PressedIndex = 202,
                };
                OKButton.Click += (o, e) => Dispose();
                break;

            case MirMessageBoxButtons1.OKCancel:
                OKButton = new MirButton
                {
                    HoverIndex   = 201,
                    Index        = 200,
                    Library      = Libraries.Title,
                    Location     = new Point(250, 157),
                    Parent       = this,
                    PressedIndex = 202,
                };
                OKButton.Click += (o, e) => Dispose();
                CancelButton    = new MirButton
                {
                    HoverIndex   = 204,
                    Index        = 203,
                    Library      = Libraries.Title,
                    Location     = new Point(340, 157),
                    Parent       = this,
                    PressedIndex = 205,
                };
                CancelButton.Click += (o, e) => Dispose();
                break;

            case MirMessageBoxButtons1.YesNo:     // 116
                YesButton = new MirButton
                {
                    HoverIndex   = 117,
                    Index        = 116,
                    Library      = Libraries.Title,
                    Location     = new Point(250 - 30 - 50 - 15, 157 - 50 - 15 + 4),
                    Parent       = this,
                    PressedIndex = 118,
                };
                YesButton.Click += (o, e) => Dispose();
                NoButton         = new MirButton
                {
                    HoverIndex   = 184,
                    Index        = 183,
                    Library      = Libraries.Title,
                    Location     = new Point(340 - 30 - 50 - 25 - 10, 157 - 50 - 15 + 4),
                    Parent       = this,
                    PressedIndex = 185,
                };
                NoButton.Click += (o, e) => Dispose();
                break;

            case MirMessageBoxButtons1.YesNoCancel:
                YesButton = new MirButton
                {
                    HoverIndex   = 207,
                    Index        = 206,
                    Library      = Libraries.Title,
                    Location     = new Point(160, 157),
                    Parent       = this,
                    PressedIndex = 208,
                };
                YesButton.Click += (o, e) => Dispose();
                NoButton         = new MirButton
                {
                    HoverIndex   = 211,
                    Index        = 210,
                    Library      = Libraries.Title,
                    Location     = new Point(250, 157),
                    Parent       = this,
                    PressedIndex = 212,
                };
                NoButton.Click += (o, e) => Dispose();
                CancelButton    = new MirButton
                {
                    HoverIndex   = 204,
                    Index        = 203,
                    Library      = Libraries.Title,
                    Location     = new Point(340, 157),
                    Parent       = this,
                    PressedIndex = 205,
                };
                CancelButton.Click += (o, e) => Dispose();
                break;

            case MirMessageBoxButtons1.Cancel:
                CancelButton = new MirButton
                {
                    HoverIndex   = 204,
                    Index        = 203,
                    Library      = Libraries.Title,
                    Location     = new Point(340, 157),
                    Parent       = this,
                    PressedIndex = 205,
                };
                CancelButton.Click += (o, e) => Dispose();
                break;
            }
        }