Ejemplo n.º 1
0
        public override bool MouseDown(MouseButtonEventArgs e)
        {
            if (Disposing || !Visible)
            {
                return(false);
            }

            if (closeButton.MouseDown(e))
            {
                return(true);
            }

            if (base.MouseDown(e))
            {
                return(true);
            }

            if (titleArea.Translated(Position).Contains(e.X, e.Y))
            {
                draggingOffset = new Vector2(e.X, e.Y) - Position;
                dragging       = true;
                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
        /// <inheritdoc />
        public override void Draw()
        {
            _listboxLeft.SetTransformToRect(_clientAreaLeft.Translated(Position));
            _listboxMain.SetTransformToRect(_clientAreaMain.Translated(Position));
            _listboxRight.SetTransformToRect(_clientAreaRight.Translated(Position));

            _listboxLeft.Draw();
            _listboxMain.Draw();
            _listboxRight.Draw();

            _selectedLabel.Draw();

            base.Draw();

            // drop down covers children, prob want a better way to do this
            _dropDown.Draw();
        }
Ejemplo n.º 3
0
        /// <inheritdoc />
        protected override void DrawContents()
        {
            _buttonLeft.Color  = _drawColor;
            _buttonMain.Color  = _drawColor;
            _buttonRight.Color = _drawColor;

            _buttonLeft.SetTransformToRect(_clientAreaLeft.Translated(Position));
            _buttonMain.SetTransformToRect(_clientAreaMain.Translated(Position));
            _buttonRight.SetTransformToRect(_clientAreaRight.Translated(Position));
            _buttonLeft.Draw();
            _buttonMain.Draw();
            _buttonRight.Draw();

            _buttonLeft.Color  = Color.White;
            _buttonMain.Color  = Color.White;
            _buttonRight.Color = Color.White;

            Label.Draw();
        }
Ejemplo n.º 4
0
        protected override void Initialize()
        {
            base.Initialize();

            var _resMgr         = IoCManager.Resolve <IResourceCache>();
            var handsBoxTexture = _resMgr.GetResource <TextureResource>("Textures/UserInterface/handsbox.png");

            handBox = new StyleBoxTexture()
            {
                Texture = handsBoxTexture,
            };
            handBox.SetMargin(StyleBox.Margin.All, 6);
            inactiveHandBox = new StyleBoxTexture(handBox)
            {
                Modulate = _inactiveColor,
            };
            SetMarginsPreset(LayoutPreset.CenterBottom);
            SetAnchorPreset(LayoutPreset.CenterBottom);

            handL = new Box2i(0, 0, BOX_SIZE, BOX_SIZE);
            handR = handL.Translated(new Vector2i(BOX_SIZE + BOX_SPACING, 0));
            SS14.Shared.Log.Logger.Debug($"{handL}, {handR}");
            MouseFilter = MouseFilterMode.Stop;
        }