예제 #1
0
        /// <summary>
        /// Constructs the scoring table, including the inner fields.
        /// </summary>
        private Widget CreateScoreTable(string title)
        {
            // The Table
            Frame frame = new Frame(title);

            // Add the entries as needed
            Table table = new Table((uint)HighScoreTable.MaximumEntries, 4, false);

            table.ColumnSpacing = 10;
            table.RowSpacing    = 2;
            frame.Add(table);

            for (uint row = 0; row < HighScoreTable.MaximumEntries; row++)
            {
                // Create the fields
                HighScoreWindowEntry e = new HighScoreWindowEntry();
                entries.Add(e);
                e.Name.Xalign    = 0;
                e.UtcWhen.Xalign = 0;
                e.Word.Xalign    = 0;
                e.Score.Xalign   = 1;

                // Add the name
                table.Attach(
                    e.Name,
                    0,
                    1,
                    row,
                    row + 1,
                    AttachOptions.Fill | AttachOptions.Expand,
                    AttachOptions.Fill | AttachOptions.Expand,
                    0,
                    0);

                /*
                 * // Add the time
                 * table.Attach(e.UtcWhen,
                 *      1, 2, row, row + 1,
                 *      AttachOptions.Fill, AttachOptions.Fill,
                 *      0, 0);
                 */

                // Add the word
                table.Attach(
                    e.Word,
                    1,
                    2,
                    row,
                    row + 1,
                    AttachOptions.Fill | AttachOptions.Expand,
                    AttachOptions.Fill | AttachOptions.Expand,
                    0,
                    0);

                // Add the score
                table.Attach(
                    e.Score, 2, 3, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            }

            // Return the frame
            return(frame);
        }
예제 #2
0
        /// <summary>
        /// Constructs the scoring table, including the inner fields.
        /// </summary>
        private Widget CreateScoreTable(string title)
        {
            // The Table
            Frame frame = new Frame(title);

            // Add the entries as needed
            Table table = new Table((uint) HighScoreTable.MaximumEntries, 4, false);
            table.ColumnSpacing = 10;
            table.RowSpacing = 2;
            frame.Add(table);

            for (uint row = 0; row < HighScoreTable.MaximumEntries; row++)
            {
                // Create the fields
                HighScoreWindowEntry e = new HighScoreWindowEntry();
                entries.Add(e);
                e.Name.Xalign = 0;
                e.UtcWhen.Xalign = 0;
                e.Word.Xalign = 0;
                e.Score.Xalign = 1;

                // Add the name
                table.Attach(
                    e.Name,
                    0,
                    1,
                    row,
                    row + 1,
                    AttachOptions.Fill | AttachOptions.Expand,
                    AttachOptions.Fill | AttachOptions.Expand,
                    0,
                    0);

                /*
                // Add the time
                table.Attach(e.UtcWhen,
                    1, 2, row, row + 1,
                    AttachOptions.Fill, AttachOptions.Fill,
                    0, 0);
                */

                // Add the word
                table.Attach(
                    e.Word,
                    1,
                    2,
                    row,
                    row + 1,
                    AttachOptions.Fill | AttachOptions.Expand,
                    AttachOptions.Fill | AttachOptions.Expand,
                    0,
                    0);

                // Add the score
                table.Attach(
                    e.Score, 2, 3, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            }

            // Return the frame
            return frame;
        }