Пример #1
0
        public Window(Manager manager)
            : base(manager)
        {
            CheckLayer(Skin, lrWindow);
            CheckLayer(Skin, lrCaption);
            CheckLayer(Skin, lrFrameTop);
            CheckLayer(Skin, lrFrameLeft);
            CheckLayer(Skin, lrFrameRight);
            CheckLayer(Skin, lrFrameBottom);
            CheckLayer(Manager.Skin.Controls[skButton], lrButton);
            CheckLayer(Manager.Skin.Controls[skShadow], lrShadow);

            SetDefaultSize(640, 480);
            SetMinimumSize(100, 75);

            btnClose = new Button(manager);
            btnClose.Skin = new SkinControl(Manager.Skin.Controls[skButton]);
            btnClose.Init();
            btnClose.Detached = true;
            btnClose.CanFocus = false;
            btnClose.Text = null;
            btnClose.Click += new EventHandler(btnClose_Click);
            btnClose.SkinChanged += new EventHandler(btnClose_SkinChanged);

            AdjustMargins();

            AutoScroll = true;
            Movable = true;
            Resizable = true;
            Center();

            Add(btnClose, false);

            oldAlpha = Alpha;
        }
Пример #2
0
        public ComboBox(Manager manager)
            : base(manager)
        {
            Height = 20;
            Width = 64;
            ReadOnly = true;

            btnDown = new Button(Manager);
            btnDown.Init();
            btnDown.Skin = new SkinControl(Manager.Skin.Controls["ComboBox.Button"]);
            btnDown.CanFocus = false;
            btnDown.Click += new EventHandler(btnDown_Click);
            Add(btnDown, false);

            lstCombo = new ListBox(Manager);
            lstCombo.Init();
            lstCombo.HotTrack = true;
            lstCombo.Detached = true;
            lstCombo.Visible = false;
            lstCombo.Click += new EventHandler(lstCombo_Click);
            lstCombo.FocusLost += new EventHandler(lstCombo_FocusLost);
            lstCombo.Items = items;
            manager.Input.MouseDown += new MouseEventHandler(Input_MouseDown);
        }