protected void AddColumn(int index, ref int x, int y, int columnNumber, string value)
        {
            TrackerColumn column = Columns[columnNumber];

            AddImageTiled(x, y, column.Width, 20, 0x0BBC);
            AddLabelCropped(x + 2, y, column.Width - 4, 20, BlackHue, value);

            x += column.Width + 1;
        }
示例#2
0
        private void AddPriorityColumn(int index, ref int x, int y, int columnNumber, TrackerPriority priority)
        {
            TrackerColumn column = Columns[columnNumber];

            AddImageTiled(x, y, column.Width, 20, 0x0BBC);
            AddImage(x - 14, y - 2, 30063);
            AddImage(x - 14, y - 2, priority.GumpId);

            x += column.Width + 1;
        }
        private void Initialize(int page)
        {
            m_Page = page;

            int count = m_Entries.Count - (page * MaxRows);

            if (count < 0)
            {
                count = 0;
            }
            else if (count > MaxRows)
            {
                count = MaxRows;
            }

            int lastIndex = (page * MaxRows) + count - 1;

            if (lastIndex >= 0 && lastIndex < m_Entries.Count && m_Entries[lastIndex] == null)
            {
                --count;
            }

            int bottomHeight = 30;
            int totalHeight  = 1 + (21 * (count + 1)) + bottomHeight + 21;

            AddPage(0);

            AddBackground(0, 0, TotalWidth + (BorderSize * 2), totalHeight + (BorderSize * 2), 0x13BE);               // Background
            AddImageTiled(BorderSize, BorderSize, TotalWidth - 1, (totalHeight - bottomHeight), 0x0A40);              // Offset Gump (Border Lines)

            int x = BorderSize + 1;
            int y = BorderSize + 1;

            int headerWidth = TotalWidth - 45;

            // Create Previous Button Area
            AddImageTiled(x, y, 20, 20, 0xE14);

            if (page > 0)
            {
                AddButton(x + 2, y + 2, 0x15E3, 0x15E7, 1, GumpButtonType.Reply, 0);
            }

            x += 21;

            // Create Header Center
            AddImageTiled(x, y, headerWidth, 20, 0xE14);
            AddHtml(x, y + 1, headerWidth, 20, String.Format("<BASEFONT COLOR={0}><CENTER>{1}</CENTER></BASEFONT>", WhiteColor, GetTitle(m_Page + 1)), false, false);

            x += headerWidth + 1;

            AddImageTiled(x, y, 20, 20, 0xE14);
            AddImageTiled(x, y + 21, 20, 20, 0xE14);

            // Create Next Button Area
            if ((page + 1) * MaxRows < m_Entries.Count)
            {
                AddButton(x + 2, y + 2, 0x15E1, 0x15E5, 2, GumpButtonType.Reply, 1);
            }

            x = BorderSize + 1;

            y += 21;

            // Generate all Columns
            for (int i = 0; i < Columns.Length; i++)
            {
                TrackerColumn col = Columns[i];
                AddImageTiled(x, y, col.Width, 20, 0x0BBC);
                AddHtml(x, y, col.Width, 20, String.Format("<BASEFONT COLOR={0}><CENTER>{1}</CENTER></BASEFONT>", col.Color, col.Text), false, false);

                x += col.Width + 1;                 // Move to next column
            }

            int total = 0;

            for (int i = 0, index = page * MaxRows; i < count && index < m_Entries.Count; ++i, ++index, ++total)
            {
                x  = BorderSize + 1;
                y += 21;

                T entry = m_Entries[index];

                if (entry == null)
                {
                    AddImageTiled(x, y, TotalWidth - 24, 20, 0x0BBC);
                    AddImageTiled(TotalWidth - 17, y, 20, 20, 0x0E14);
                }
                else
                {
                    DisplayLayout(i, ref x, y, entry);

                    AddImageTiled(x, y, 20, 20, 0x0E14);
                    AddButton(x + 2, y + 2, 0x15E1, 0x15E5, i + 100, GumpButtonType.Reply, 0);
                }
            }

            /*int diff = MaxRows - total;
             * for ( int i = 0; i < diff; i++ )
             * {
             *      x = BorderSize + 1;
             *      y += 21;
             *
             *      AddImageTiled( x, y, TotalWidth - 24, 20, 0x0BBC );
             *      AddImageTiled( TotalWidth - 17, y, 20, 20, 0x0E14 );
             * }*/

            y += 25;
            x  = BorderSize + 1;
            if (ShowAddIssue)
            {
                AddLabel(x + 5, y, WhiteHue, "Add Issue");
                AddButton(x + 72, y, 0x0FBD, 0x0FBE, 3, GumpButtonType.Reply, 0);                   // Add Issue
            }

            AddLabel(TotalWidth - 47, y, WhiteHue, "Cancel");
            AddButton(TotalWidth - 85, y, 4017, 4018, 0, GumpButtonType.Reply, 0);               // Cancel
        }