Beispiel #1
0
        public MultiTextControl(IWritingSystemRepository allWritingSystems, IServiceProvider serviceProvider)
        {
            if (DesignMode)
            {
                AutoSize = false;
                // NONE OF THE FOLLOWING ACTUALLY WORKS... WISH IT DID
                Size            = new Size(this.Width, 20);
                CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;                //help it be seen
                BackColor       = Color.Maroon;
            }

            SuspendLayout();
            _allWritingSystems = allWritingSystems;
            _serviceProvider   = serviceProvider;
            components         = new Container();
            InitializeComponent();
            _inputBoxes = new List <Control>();
            //this.BackColor = System.Drawing.Color.Crimson;
            _writingSystemLabelFont = new Font(FontFamily.GenericSansSerif, 9);

            if (-1 == WidthForWritingSystemLabels)
            {
                //happens when this is from a hand-placed designer piece,
                //in which case we don't really care about aligning anyhow
                ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));                 //ws label
            }
            else
            {
                ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, WidthForWritingSystemLabels));
            }
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100));         //text
            ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));             //annotation widget

            ResumeLayout(false);
        }
Beispiel #2
0
        public void Init()
        {
            //
            // alternatives information panel
            //
            BackColor   = Color.WhiteSmoke;
            ColumnCount = 1;
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));

            Dock     = DockStyle.Fill;
            Location = new Point(4, 4);
            Margin   = new Padding(4);
            Name     = "tableLayoutMainContentAlternatives";

            Size     = new Size(760, 482);
            TabIndex = 0;
            //
            // addAlternativeButton
            //
            AddAlternativeButton.Name = "AddAlternativeButton";
            AddAlternativeButton.UseVisualStyleBackColor = true;
            AddAlternativeButton.Click += AddAlternativeButton_Click;
            AddAlternativeButton.Text   = "Add Alternative";
            AddAlternativeButton.Size   = new Size(200, 34);
            AddAlternativeButton.Margin = new Padding(0, 0, 360, 0);
            AddAlternativeButton.Anchor = AnchorStyles.Left | AnchorStyles.Top;

            UpdateRows();
        }
Beispiel #3
0
        public DetailList()
        {
#if DEBUG
            _stackAtConstruction = new StackTrace();
#endif
            InitializeComponent();
            this.SuspendLayout();
            Application.AddMessageFilter(this);

            Name = "DetailList";             //for  debugging
            ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 0));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100));
            ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 30));
            Dock         = DockStyle.Fill;
            AutoSize     = true;
            AutoSizeMode = AutoSizeMode.GrowAndShrink;
            GeckoOption  = false;

            MouseClick += OnMouseClick;

            this.ResumeLayout(false);
            //CellPaint += OnCellPaint;
            //var rand = new Random();
            //BackColor = Color.FromArgb(255, rand.Next(0, 255), rand.Next(0, 255), rand.Next(0, 255));
        }
Beispiel #4
0
        public RealPlayerGrid(PlayerManager mgr, int row, int column)
        {
            this.RowCount    = row;
            this.ColumnCount = column;

            // 设置行属性
            float rowHeight   = 100 / row;
            float columnWidth = 100 / column;

            for (int i = 0; i < row; i++)
            {
                RowStyles.Add(new RowStyle(SizeType.Percent, rowHeight));
            }
            for (int i = 0; i < column; i++)
            {
                ColumnStyles.Add(new ColumnStyle(SizeType.Percent, columnWidth));
            }

            // 添加播放器
            for (int r = 0; r < RowCount; r++)
            {
                for (int c = 0; c < ColumnCount; c++)
                {
                    FormRealPlayer player = new FormRealPlayer(mgr);
                    player.Dock            = DockStyle.Fill;
                    player.FormBorderStyle = FormBorderStyle.None;
                    player.TopLevel        = false;
                    this.Controls.Add(player, c, r);
                    player.setGrid(this, c, r);
                    player.Show();
                }
            }
        }
        /// <summary>
        /// Initialization and setup method
        /// </summary>
        /// <param name="name"></param>
        private void InitializeLowerTableLayout(string name)
        {
            Name = name;

            Dock = DockStyle.Fill;

            Location = new Point(0, 0);
            Size     = new Size(334, 327);
            Margin   = new Padding(6);

            ColumnCount = 4;
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));

            RowCount = 7;
            RowStyles.Add(new RowStyle(SizeType.Percent, 14.28571F));
            RowStyles.Add(new RowStyle(SizeType.Percent, 14.28571F));
            RowStyles.Add(new RowStyle(SizeType.Percent, 14.28571F));
            RowStyles.Add(new RowStyle(SizeType.Percent, 14.28571F));
            RowStyles.Add(new RowStyle(SizeType.Percent, 14.28571F));
            RowStyles.Add(new RowStyle(SizeType.Percent, 14.28571F));
            RowStyles.Add(new RowStyle(SizeType.Percent, 14.28571F));

            TabIndex = 0;

            SuspendLayout();
            ResumeLayout(false);
            PerformLayout();
        }
        public void alterRowAndColumnCount()
        {
            ColumnStyles.Clear();
            RowStyles.Clear();
            var count = Controls.Count;

            if (count != 0)
            {
                ColumnCount = (int)Math.Floor(Math.Log(count, 2)) + 1;
                RowCount    = (int)Math.Ceiling((double)count / ColumnCount);
                for (int i = 1; i <= this.RowCount; i++)
                {
                    //RowStyles.Add(new RowStyle(SizeType.AutoSize, StudentCell.MINIMUM_SIZE.Height));
                    RowStyles.Add(new RowStyle()
                    {
                        Height = 100 / RowCount, SizeType = SizeType.Percent
                    });
                }
                for (int i = 1; i <= this.ColumnCount; i++)
                {
                    //ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, Width / ColumnCount));
                    ColumnStyles.Add(new ColumnStyle()
                    {
                        Width = 100 / ColumnCount, SizeType = SizeType.Percent
                    });
                }
            }
        }
 protected FileOverviewTableLayoutPanel(int rowCount)
 {
     Name = "overviewTableLayoutPanel";
     SuspendLayout();
     DirectoryNameLabel   = CreateLabel("directoryNameLabel");
     DirectoryNameTextBox = CreateTextBox("directoryNameTextBox");
     FileNameLabel        = CreateLabel("fileNameLabel");
     FileNameTextBox      = CreateTextBox("fileNameTextBox");
     AutoSize             = true;
     Dock        = DockStyle.Fill;
     ColumnCount = 2;
     rowCount    = (RowCount = (rowCount < 4) ? 4 : RowCount) - 1;
     ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50.0f));
     ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50.0f));
     for (int i = 0; i < rowCount; i++)
     {
         RowStyles.Add(new RowStyle());
     }
     RowStyles.Add(new RowStyle(SizeType.Percent, 100.0f));
     Controls.Add(DirectoryNameLabel, 0, 0);
     SetColumnSpan(DirectoryNameLabel, 2);
     Controls.Add(DirectoryNameTextBox, 0, 1);
     SetColumnSpan(DirectoryNameTextBox, 2);
     Controls.Add(FileNameLabel, 0, 2);
     Controls.Add(FileNameLabel, 0, 3);
 }
Beispiel #8
0
        public ObjectiveList(string fileName, EditObjectivePanel_Delegate ed)
        {
            AutoScroll  = true;
            RowCount    = 0;
            Dock        = DockStyle.Fill;
            ColumnCount = 3;
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 10f));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 80f));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 10f));

            _savePoint        = fileName;
            _filterType       = Objective.ObjectiveType.ALL;
            _sortType         = SortType.DEFAULT;
            _aToz             = true;
            _prioritySortType = Objective.Priority.ALL;

            _objectives = FileManager.DeserializeData(_savePoint).Select(d => new ObjectiveViewPanel(d, ed, () => DeleteObjective(d))).ToList();
            _objectives.RemoveAll(p => !p.Displayed.Persist && p.Displayed.DueBy < DateTime.Now);
            _objectives.ForEach(o => {
                if (o.Displayed.Repeat)
                {
                    while (o.Displayed.DueBy < DateTime.Now)
                    {
                        o.Displayed.DueBy += TimeSpan.FromDays(1);
                    }
                }
            });

            _editDelegate = ed;
            UpdateShownObjectives();
        }
Beispiel #9
0
            public void SetData()
            {
                ColumnCount = columns;
                RowCount    = rows;
                Day day = null;

                for (int i = 0; i < 50; i++)
                {
                    days[i] = new Day();
                }
                for (int i = 0; i < ColumnCount; i++)
                {
                    ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
                }
                for (int i = 0; i < RowCount; i++)
                {
                    RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
                }


                for (int row = 0; row < RowCount; row++)
                {
                    for (int col = 0; col < ColumnCount; col++)
                    {
                        day = new Day();
                        days[row * 7 + col] = day;
                    }
                }
            }
Beispiel #10
0
 private void AddLayoutColumns()
 {
     ColumnCount = 3;
     ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 40));
     ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 20));
     ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 40));
 }
        public void Add(Control control, bool fill = false)
        {
            var sizeType = fill ? SizeType.Percent : SizeType.AutoSize;

            if (isVertical)
            {
                Controls.Add(control, 0, next);

                RowStyles.Add(new RowStyle {
                    Height   = 100.0f,
                    SizeType = sizeType
                });

                Trace.Assert(RowStyles.Count == next + 1);
            }
            else
            {
                Controls.Add(control, next, 0);

                ColumnStyles.Add(new ColumnStyle {
                    Width    = 100.0f,
                    SizeType = sizeType
                });
            }
            next++;
        }
Beispiel #12
0
        /// <summary>
        /// Adds a new column. The column width is calculated based on the given <paramref name="value"/>.
        /// <list type="bullet">
        ///     <item>Auto - The width is calculated automatically.</item>
        ///     <item>* - The column grabs all available space.</item>
        ///     <item>125 - The column has a fixed width of 125.</item>
        /// </list>
        /// </summary>
        /// <param name="value">Value of column definition</param>
        /// <exception cref="ArgumentNullException">If <paramref name="value"/> is NULL or empty</exception>
        /// <exception cref="FormatException">If <paramref name="value"/> cannot be parsed</exception>
        void IGridPanel.AddColumnDefinition(string value)
        {
            ColumnDefinition columnDefinition = new ColumnDefinition(value);
            ColumnStyle      columnStyle      = new ColumnStyle();
            SizeBehavior     mode             = columnDefinition.Mode;

            columnStyle.SizeType = mode == SizeBehavior.Auto
                ? SizeType.AutoSize
                : (mode == SizeBehavior.Fill ? SizeType.Percent : SizeType.Absolute);

            if (columnStyle.SizeType == SizeType.Percent)
            {
                columnStyle.Width = 1.0f;
            }

            if (columnStyle.SizeType == SizeType.Absolute)
            {
                columnStyle.Width = columnDefinition.Width;
            }

            ColumnStyles.Add(columnStyle);

            if (ColumnStyles.Count > ColumnCount)
            {
                ((IGridPanel)this).GridColumns++;
            }
        }
Beispiel #13
0
        public Cart(Data data)
        {
            Dock        = DockStyle.Fill;
            ColumnCount = 3;
            RowCount    = 2;
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.333F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.333F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.333F));
            RowStyles.Add(new RowStyle(SizeType.Percent, 100));
            RowStyles.Add(new RowStyle(SizeType.Absolute, 140));



            this.data = data;

            this.data.cart.ForEach(p => totalCost += p.Cost);

            cartGrid = CreateCartGrid();
            SetColumnSpan(cartGrid, 3);
            Controls.Add(cartGrid);

            checkOutCalculationsCorner = CreateCheckoutCalculationsCorner();
            SetColumnSpan(checkOutCalculationsCorner, 3);
            Controls.Add(checkOutCalculationsCorner);
        }
        private void Init()
        {
            BackColor   = Color.WhiteSmoke;
            ColumnCount = 1;
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
            //Controls.Add(Documents[0],0,0);
            Dock     = DockStyle.Fill;
            Location = new Point(4, 4);
            Size     = new Size(760, 482);
            Margin   = new Padding(4);
            Name     = "tableLayoutMainContentDocuments";
            //
            // addDocumentButton
            //
            AddDocumentButton.Name = "AddDocumentButton";
            AddDocumentButton.UseVisualStyleBackColor = true;
            AddDocumentButton.Click += AddDocumentButton_Click;
            AddDocumentButton.Text   = "Add File";
            AddDocumentButton.Size   = new Size(200, 34);
            AddDocumentButton.Margin = new Padding(0, 0, 360, 0);
            AddDocumentButton.Anchor = AnchorStyles.Left | AnchorStyles.Top;


            UpdateRows();
        }
Beispiel #15
0
        public BoardPanel(Board i_Board)
        {
            m_Board = i_Board;

            int size = m_Board.Size;

            m_Cells = new CellBox[size, size];

            for (int i = 0; i < size; i++)
            {
                ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, CellBox.ItemSize));
            }

            for (int i = 0; i < size; i++)
            {
                RowStyles.Add(new RowStyle(SizeType.Absolute, CellBox.ItemSize));
            }

            for (int row = 0; row < size; row++)
            {
                for (int col = 0; col < size; col++)
                {
                    CellBox cell = new CellBox(m_Board.GetCell(row, col), new EventHandler(OnCellClicked));
                    m_Cells[row, col] = cell;
                    Controls.Add(cell, col, row);
                }
            }

            Padding = new Padding(0);
            Size    = new Size(size * CellBox.ItemSize, size * CellBox.ItemSize);
        }
        private void Render()
        {
            SuspendLayout();
            checkboxGroups = new List <CheckBoxGroup>();
            List <Group> presentGroups = Attendance.GetPresent(question.Game);

            RowCount = 2;
            RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
            RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
            ColumnCount = 4;
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
            int row = 0, col = 0;

            foreach (Group group in presentGroups)
            {
                if (col == 4)
                {
                    row = 1;
                    col = 0;
                }
                CheckBoxGroup checkboxGroup = new CheckBoxGroup(group.ID, group.Name);
                checkboxGroups.Add(checkboxGroup);
                Controls.Add(checkboxGroup, col, row);
                col++;
            }
            ResumeLayout(false);
            PerformLayout();
        }
Beispiel #17
0
        /// <summary>
        /// Initialization and setup method
        /// </summary>
        /// <param name="name"></param>
        public void InitializeTable(string name)
        {
            //Table name
            Name = name;

            //Column count & tab index
            ColumnCount = 3;
            TabIndex    = 0;

            //Column Styles
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 37.5F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 37.5F));

            //Row Styles
            RowStyles.Add(new RowStyle(System.Windows.Forms.SizeType.Percent, 100F));

            //Location and other settings
            Dock     = DockStyle.Fill;
            Location = new Point(0, 0);
            Size     = new Size(764, 40);

            //Suspended layout
            SuspendLayout();

            //Resume layout
            ResumeLayout(false);
        }
Beispiel #18
0
        public PostControl(PostModel i_Post, int i_ColumnIdx = 0, int i_RowIdx = 0)
        {
            Name = i_Post.UserName;

            AutoSize    = true;
            ColumnCount = 2; // Num of prop for display
            ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 200F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 200F));

            Padding = new Padding(10, 10, 10, 10);
            Margin  = new Padding(10, 10, 10, 0);

            PictureBox picBox = new PictureBox {
                Image = i_Post.UserImg
            };

            Controls.Add(picBox, i_ColumnIdx++, i_RowIdx);
            foreach (KeyValuePair <string, string> propertyForDisplay in i_Post.GetPropertiesForDisplay())
            {
                Controls.Add(new Label {
                    Font = new Font(AppUtil.sr_FontFamily, AppConfigService.GetInstance().LabelFontSize), Text = propertyForDisplay.Value, AutoSize = true
                }, i_ColumnIdx, i_RowIdx);
                i_ColumnIdx++;
            }
        }
Beispiel #19
0
        //private buttons_class buttons;
        //System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;


        /// <summary>
        /// Quick little summary of what I'm about to do, why I'm going to do it,
        /// and we'll see if it makes sense.
        ///
        /// What this will be:  A little 12to15-key keypad, with a clear and an enter
        /// hopefully tied-to some common control
        ///
        /// How to get this done.  The first thing that jumps-out at a person is,
        /// "hey, we could use buttons, and that would be AWESOME."
        ///
        /// The next thing, do a table layout of sorts.  Each button takes
        /// up the full thing.  Shouldn't be too bad.
        ///
        ///
        /// </summary>

        public PSI_Keypad()
        {
            bool enable_accumulator_display = true;

            // 4 is enough for normal keypad
            local_rows    = enable_accumulator_display?5:4;
            local_columns = 3;             //someday in the near future, we may change this.

            gs = new GlareSet("default");
            gs.attrib.Primary   = Color.Blue;          // Color.FromArgb( 64, Color.Blue );
            gs.attrib.Secondary = Color.SkyBlue;
            gs.attrib.TextColor = Color.White;

            InitializeComponent();

            if (enable_accumulator_display)
            {
                accumulator = new TextBox();
                Controls.Add(accumulator, 0, 0);
                SetColumnSpan(accumulator, 3);
                accumulator.Dock = DockStyle.Fill;
            }

            ColumnCount = local_columns;
            for (int i = 0; i < local_columns; i++)
            {
                ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F / (float)local_columns));
            }
            Location = new System.Drawing.Point(0, 0);
            Name     = "tableLayoutPanel1";
            RowCount = local_rows;
            if (enable_accumulator_display)
            {
                RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F / (float)(local_rows * 2)));
            }
            for (int i = enable_accumulator_display ? 1 : 0; i < local_rows; i++)
            {
                RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F / (float)local_rows));
            }
            Size     = this.Size;         //new System.Drawing.Size(529, 419);
            TabIndex = 0;

            //And now, for the buttons
            button_grid = new PSI_Button[local_columns, local_rows];

            for (int i = 0; i < local_columns; i++)
            {
                for (int j = enable_accumulator_display ? 1 : 0; j < local_rows; j++)
                {
                    button_grid[i, j] = new PSI_Button(this.Parent as Canvas);
                    Controls.Add(button_grid[i, j], i, j);
                    this.button_grid[i, j].Dock     = System.Windows.Forms.DockStyle.Fill;
                    this.button_grid[i, j].Name     = "button" + i.ToString() + j.ToString();
                    this.button_grid[i, j].TabIndex = 0;
                    this.button_grid[i, j].Text     = i.ToString() + "," + j.ToString();
                    //this.button_grid[i, j].UseVisualStyleBackColor = true;
                }
            }
        }
 public PlayingView(Level level)
 {
     this.level = level;
     coins      = new Label {
         Text = "Монеты: " + level.PlayerCoins, Dock = DockStyle.Fill
     };
     swordsmanButton = new Button {
         Text = "Мечник (" + new Swordsman(true).Cost + ")", Dock = DockStyle.Fill
     };
     archerButton = new Button {
         Text = "Лучник (" + new Archer(true).Cost + ")", Dock = DockStyle.Fill
     };
     magicianButton = new Button {
         Text = "Маг (" + new Magician(true).Cost + ")", Dock = DockStyle.Fill
     };
     gameInterface = new TableLayoutPanel();
     gameInterface.RowStyles.Add(new RowStyle(SizeType.Percent, 100));
     gameInterface.RowStyles.Add(new RowStyle(SizeType.Percent, 100));
     gameInterface.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 100));
     gameInterface.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33f));
     gameInterface.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33f));
     gameInterface.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33f));
     gameInterface.Controls.Add(coins, 0, 0);
     gameInterface.Controls.Add(swordsmanButton, 1, 0);
     gameInterface.Controls.Add(archerButton, 2, 0);
     gameInterface.Controls.Add(magicianButton, 3, 0);
     gameInterface.Dock   = DockStyle.Fill;
     gameInterface.Margin = Padding.Empty;
     gameField            = new GameField(level);
     ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100));
     RowStyles.Add(new RowStyle(SizeType.Absolute, 100));
     RowStyles.Add(new RowStyle(SizeType.Percent, 100f));
     Dock = DockStyle.Fill;
     Controls.Add(gameInterface, 0, 0);
     Controls.Add(gameField, 0, 1);
     swordsmanButton.Click   += (s, a) => level.BuyCharacter(new Swordsman(true));
     archerButton.Click      += (s, a) => level.BuyCharacter(new Archer(true));
     magicianButton.Click    += (s, a) => level.BuyCharacter(new Magician(true));
     level.PlayerCoinsChange += (coins) => this.coins.Text = "Монеты: " + coins;
     level.Message           += (message) => MessageBox.Show(message);
     timer          = new Timer();
     timer.Interval = 100;
     timer.Tick    += (s, e) => level.DoNextStep();
     timer.Start();
     level.EndWin += (win) =>
     {
         timer.Stop();
         if (win)
         {
             MessageBox.Show("Вы победили!");
         }
         else
         {
             MessageBox.Show("Вы проиграли(");
         }
     };
 }
Beispiel #21
0
 public QuadSplitControl()
 {
     MinimumViewSize = 2;
     _resizing       = _inH = _inV = false;
     RowCount        = ColumnCount = 2;
     ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50));
     ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50));
     RowStyles.Add(new RowStyle(SizeType.Percent, 50));
     RowStyles.Add(new RowStyle(SizeType.Percent, 50));
 }
Beispiel #22
0
 public PluginView()
 {
     AutoScroll  = true;
     BackColor   = SystemColors.Window;
     ColumnCount = 1;
     ColumnStyles.Add(new ColumnStyle());
     Padding  = new Padding(0, 0, 6, 0);
     RowCount = 1;
     RowStyles.Add(new RowStyle());
     BorderStyle     = BorderStyle.FixedSingle;
     VisibleChanged += PluginView_VisibleChanged;
 }
Beispiel #23
0
 public void clearProperties()
 {
     SuspendLayout();
     Controls.Clear();
     ColumnCount = 1;
     RowCount    = 0;
     ColumnStyles.Clear();
     ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
     RowStyles.Clear();
     RowStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
     ResumeLayout();
 }
        InitializeComponent()
        {
            SuspendLayout();

            Size = new Size(600, 450);
            Font = Properties.Settings.Default.DisplayFont;

            ColumnCount = 1;
            RowCount    = 3;

            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));

            rowHeader = new RowStyle(SizeType.AutoSize);
            RowStyles.Add(rowHeader);

            rowSentence = new RowStyle(SizeType.AutoSize);
            RowStyles.Add(rowSentence);

            rowChallenge = new RowStyle(SizeType.AutoSize);
            RowStyles.Add(rowChallenge);

            lblHeader = new Label()
            {
                Name     = "lblHeader",
                AutoSize = true,
                Font     = new Font(Font.FontFamily, 32, FontStyle.Bold,
                                    GraphicsUnit.Pixel),
                MaximumSize = new Size(Width, 0)
            };
            Controls.Add(lblHeader, 0, 0);

            lblSentence = new Label()
            {
                Name     = "lblSentence",
                Font     = new Font(Font, FontStyle.Italic),
                AutoSize = true,
            };
            lblSentence.Margin = new Padding(lblSentence.Margin.Left,
                                             lblSentence.Margin.Top + 24, lblSentence.Margin.Right,
                                             lblSentence.Margin.Bottom + 24);
            Controls.Add(lblSentence, 0, 1);

            flpChallenge = new FlowLayoutPanel()
            {
                Name = "flpChallenge",
                Dock = DockStyle.Fill
            };
            Controls.Add(flpChallenge, 0, 2);

            ResumeLayout(false);
        }
Beispiel #25
0
 // Sets up the grid with the appropriate dimensions
 private void SetupGridStyles()
 {
     // Loops through each column
     for (uint i = 0; i < ColumnCount; i++)
     {
         // Adds a column style which gives each column an equal amount of space
         ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100 / ColumnCount));
     }
     // Loops through each row
     for (uint i = 0; i < RowCount; i++)
     {
         // Adds a row style which gives each column an equal amount of space
         RowStyles.Add(new RowStyle(SizeType.Percent, 100 / RowCount));
     }
 }
Beispiel #26
0
 /// <summary>
 /// Initializes a new instance of the ByteViewer class.
 /// </summary>
 public KryptonByteViewer()
 {
     SuspendLayout();
     CellBorderStyle = TableLayoutPanelCellBorderStyle.Inset;
     ColumnCount     = 1;
     ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f));
     RowCount = 1;
     RowStyles.Add(new RowStyle(SizeType.Percent, 100f));
     InitUI();
     ResumeLayout();
     _displayMode   = DisplayMode.Hexdump;
     DoubleBuffered = true;
     SetStyle(ControlStyles.ResizeRedraw, value: true);
     SetBytes(new byte[] { });
 }
Beispiel #27
0
 private void InitializeComponent()
 {
     SuspendLayout();
     //
     // GroupScore
     //
     Anchor      = AnchorStyles.None;
     AutoSize    = true;
     BackColor   = Color.Black;
     ColumnCount = 1;
     ColumnStyles.Add(new ColumnStyle());
     Margin = new Padding(5);
     ResumeLayout(false);
     PerformLayout();
 }
 void nomalizeColStyles()
 {   // set all rows to absolute and the last one to percent=100!
     if (colWidths.Length <= 0)
     {
         return;
     }
     colWidths = GetColumnWidths();
     ColumnStyles.Clear();
     for (int i = 0; i < ColumnCount - 1; i++)
     {
         ColumnStyle cs = new ColumnStyle(SizeType.Absolute, colWidths[i]);
         ColumnStyles.Add(cs);
     }
     ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100));
     isNormalCol = true;
 }
Beispiel #29
0
        private void InitOnSide(Control control, string text)
        {
            ColumnStyles.Add(new ColumnStyle());
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 80));

            var label = new Label
            {
                Text      = text,
                AutoSize  = true,
                Anchor    = AnchorStyles.Left,
                TextAlign = ContentAlignment.MiddleLeft
            };

            Controls.Add(label, 0, 0);
            Controls.Add(control, 1, 0);
        }
Beispiel #30
0
 private void ResetLayout()
 {
     RowCount    = _configuration.Rows;
     ColumnCount = _configuration.Columns;
     ColumnStyles.Clear();
     RowStyles.Clear();
     for (var i = 0; i < ColumnCount; i++)
     {
         ColumnStyles.Add(new ColumnStyle(SizeType.Percent, (int)(100m / ColumnCount)));
     }
     for (var i = 0; i < RowCount; i++)
     {
         RowStyles.Add(new RowStyle(SizeType.Percent, (int)(100m / RowCount)));
     }
     ResetViews();
 }