コード例 #1
0
ファイル: JournalGump.cs プロジェクト: gautamabudha/UltimaXNA
        public JournalGump()
            : base(0, 0)
        {
            IsMovable = true;

            AddControl(m_Background = new ExpandableScroll(this, 0, 0, 300));
            m_Background.TitleGumpID = 0x82A;

            AddControl(m_ScrollBar = new ScrollBar(this));
            m_ScrollBar.IsVisible = false;
        }
コード例 #2
0
 void onClickClosedList(AControl control, int x, int y, MouseButton button)
 {
     m_listOpen = true;
     m_openResizePic = new ResizePic(Owner, X, Y, 3000, m_width, m_Font.Height * m_visibleItems + 8);
     m_openResizePic.MouseClickEvent += onClickOpenList;
     m_openResizePic.MouseOverEvent += onMouseOverOpenList;
     m_openResizePic.MouseOutEvent += onMouseOutOpenList;
     ((Gump)Owner).AddControl(m_openResizePic, this.Page);
     // only show the scrollbar if we need to scroll
     if (m_visibleItems < m_items.Count)
     {
         m_openScrollBar = new ScrollBar(Owner, X + m_width - 20, Y + 4, m_Font.Height * m_visibleItems, (m_canBeNull ? -1 : 0), m_items.Count - m_visibleItems, Index);
         ((Gump)Owner).AddControl(m_openScrollBar, this.Page);
     }
     m_openLabels = new TextLabelAscii[m_visibleItems];
     for (int i = 0; i < m_visibleItems; i++)
     {
         m_openLabels[i] = new TextLabelAscii(Owner, X + 4, Y + 5 + m_Font.Height * i, 1106, 1, string.Empty);
         ((Gump)Owner).AddControl(m_openLabels[i], this.Page);
     }
 }
コード例 #3
0
ファイル: MacroDropDownList.cs プロジェクト: msx752/UltimaXNA
        private void onClickClosedList(AControl control, int x, int y, MouseButton button)
        {
            if (Items.Count > 0)
            {
                m_IsListOpen = true;
                m_openResizePic = new ResizePic(Parent, X, Y, 3000, m_Width, m_Font.Height * m_visibleItems + 8);
                m_openResizePic.GumpLocalID = GumpLocalID;
                m_openResizePic.MouseClickEvent += onClickOpenList;
                m_openResizePic.MouseOverEvent += onMouseOverOpenList;
                m_openResizePic.MouseOutEvent += onMouseOutOpenList;
                ((Gump)Parent).AddControl(m_openResizePic, Page);

                if (m_visibleItems > Items.Count)
                {
                    m_visibleItems = Items.Count;
                }

                // only show the scrollbar if we need to scroll
                if (m_visibleItems < Items.Count)
                {
                    m_openScrollBar = new ScrollBar(Parent, X + m_Width - 20, Y + 4, m_Font.Height * m_visibleItems, (m_CanBeNull ? -1 : 0), Items.Count - m_visibleItems, Index);
                    ((Gump)Parent).AddControl(m_openScrollBar, Page);
                }
                m_openLabels = new TextLabelAscii[m_visibleItems];
                for (int i = 0; i < m_visibleItems; i++)
                {
                    m_openLabels[i] = new TextLabelAscii(Parent, X + 4, Y + 5 + m_Font.Height * i, 1, 1106, string.Empty);
                    ((Gump)Parent).AddControl(m_openLabels[i], Page);
                }
            }
        }