private void Redraw() { if (myTextButtons != null) { foreach (var btn in myTextButtons) { myNumCtnr.Remove(btn); } m_SelectedButton = null; } var numsToShow = Math.Min(m_TotalPages, (int)Math.Floor((double)m_Width / 15)); myTextButtons = new UIClickableLabel[numsToShow]; var stride = 0; for (int i = 0; i < numsToShow; i++) { var btn = new UIClickableLabel() { X = i * ItemSize, Caption = (i + 1).ToString(), Size = new Microsoft.Xna.Framework.Vector2(ItemSize, ItemSize), CaptionStyle = TextStyle }; myTextButtons[i] = btn; myTextButtons[i].OnButtonClick += new ButtonClickDelegate(UIPaginationBar_OnButtonClick); myNumCtnr.Add(myTextButtons[i]); } SetSize(m_Width, m_Height); SelectedPage = m_SelectedPage; }
private void Redraw() { if (myTextButtons != null) { foreach (var btn in myTextButtons) { myNumCtnr.Remove(btn); } m_SelectedButton = null; } var numsToShow = Math.Min(m_TotalPages, (int)Math.Floor((double)m_Width / 15)); myTextButtons = new UIClickableLabel[numsToShow]; for (int i = 0; i < numsToShow; i++) { var btn = new UIClickableLabel() { X = i * ItemSize, Caption = (i + 1).ToString(), Size = new Microsoft.Xna.Framework.Vector2(ItemSize, ItemSize), CaptionStyle = TextStyle }; myTextButtons[i] = btn; myTextButtons[i].OnButtonClick += new ButtonClickDelegate(UIPaginationBar_OnButtonClick); myNumCtnr.Add(myTextButtons[i]); } SetSize(m_Width, m_Height); SelectedPage = m_SelectedPage; }