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); }
/// <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(); }
/// <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(); }
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; }