/// <summary> /// Draws /// </summary> /// <param name="e"></param> protected override void OnInitialize(PaintEventArgs e) { UpdateContent(); // translate into document coordinates Matrix oldMat = e.Graphics.Transform; Matrix mat = new Matrix(); e.Graphics.Transform = mat; foreach (DirectoryItem item in _items) { if (ControlRectangle.IntersectsWith(item.Bounds)) { item.Draw(e); } } e.Graphics.Transform = oldMat; base.OnInitialize(e); }
internal override void Update(GameTime gameTime) { _renderBackgroundColor = _backgroundColor; _renderBackgroundTexture = _backgroundImage; _renderTextColor = _textColor; if (ControlRectangle.Contains(input.Get().MouseXCoordinate(), input.Get().MouseYCoordinate())) { // mouse over _renderBackgroundTexture = _backgroundImageMouseover; _renderBackgroundColor = _backgroundColorMouseover; _renderTextColor = _textColorMouseover; } if (Focused) { if (input.Get().IsLeftMouseButtonDown()) { _renderBackgroundColor = _backgroundColorClicked; _renderBackgroundTexture = _backgroundImageClicked; _renderTextColor = _textColorClick; event_MousePress(); if (input.Get().IsLeftMouseButtonDown(true)) { event_Click(); } } } switch (_fontSize) { case Controls.FontSize.Small: _renderSpriteFont = ContentLibrary.UIFont_Small; break; case Controls.FontSize.Smaller: _renderSpriteFont = ContentLibrary.UIFont_Smaller; break; } }