void onClickClosedList(int x, int y, MouseButton button) { m_listOpen = true; m_openResizePic = new ResizePic(m_owner, Page, X, Y, 3000, m_width, ASCIIText.Fonts[1].Height * m_visibleItems + 8); m_openResizePic.OnMouseClick = onClickOpenList; m_openResizePic.OnMouseOver = onMouseOverOpenList; m_openResizePic.OnMouseOut = onMouseOutOpenList; ((Gump)m_owner).AddControl(m_openResizePic); // only show the scrollbar if we need to scroll if (m_visibleItems < m_items.Count) { m_openScrollBar = new ScrollBar(m_owner, Page, X + m_width - 20, Y + 4, ASCIIText.Fonts[1].Height * m_visibleItems, (m_canBeNull ? -1 : 0), m_items.Count - m_visibleItems, Index); ((Gump)m_owner).AddControl(m_openScrollBar); } m_openLabels = new TextLabelAscii[m_visibleItems]; for (int i = 0; i < m_visibleItems; i++) { m_openLabels[i] = new TextLabelAscii(m_owner, Page, X + 4, Y + 5 + ASCIIText.Fonts[1].Height * i, 1107, 1, string.Empty); ((Gump)m_owner).AddControl(m_openLabels[i]); } }
public override void Update(GameTime gameTime) { m_hrefOver = -1; // this value is changed every frame if we mouse over a region. if (m_textChanged) { m_textChanged = false; m_textRenderer.Text = Text; } HandlesMouseInput = (m_textRenderer.HREFRegions.Count > 0); if (HasScrollbar) { if (m_scrollbar == null) AddControl(m_scrollbar = new ScrollBar(this, 0)); m_scrollbar.X = Width - 15; m_scrollbar.Y = 0; m_scrollbar.Width = 15; m_scrollbar.Height = Height; m_scrollbar.MinValue = 0; m_scrollbar.MaxValue = m_textRenderer.Height - Height; ScrollY = m_scrollbar.Value; } base.Update(gameTime); }