Example #1
0
        public static Size MeasureFlowLayout(FlowLayoutPanel panel)
        {
            panel.ResumeLayout(false);
            panel.PerformLayout();

            var     count = panel.Controls.Count;
            Control lastItem;

            if (count != 0)
            {
                switch (panel.FlowDirection)
                {
                case FlowDirection.TopDown:
                case FlowDirection.BottomUp:
                    lastItem = panel.Controls[count - 1];
                    return(new Size(panel.Width, lastItem.Location.Y + lastItem.Height));


                case FlowDirection.LeftToRight:
                case FlowDirection.RightToLeft:
                    lastItem = panel.Controls[count - 1];
                    return(new Size(lastItem.Location.X + lastItem.Width, panel.Height));
                }
            }

            return(new Size(panel.Width, panel.Height));
        }
Example #2
0
        private FlowLayoutPanel CreateButtons(EntrySettings settings)
        {
            var flow = new FlowLayoutPanel();

            flow.Width         = this.notesCtrl.Width + 10;
            flow.Height        = 50;
            flow.AutoSize      = false;
            flow.FlowDirection = FlowDirection.LeftToRight;
            flow.WrapContents  = true;
            flow.Margin        = new Padding(0);

            int index = 0;

            foreach (var entry in settings.entries)
            {
                flow.Controls.Add(CreateSSHButton(index, entry.title));
                index += 1;
            }

            var btnAdd = CreateNormalButton("Add");

            btnAdd.Click += OnAddButtonClick;
            flow.Controls.Add(btnAdd);
            flow.ResumeLayout(false);
            flow.PerformLayout();

            return(flow);
        }
Example #3
0
        internal static void PopulatePanel(List <MudData.FormulaAction> actions, FlowLayoutPanel panel, string archetypeName)
        {
            foreach (var action in actions)
            {
                var editor = new ScriptActionEditControl(action, archetypeName);
                panel.Controls.Add(editor);
            }

            panel.PerformLayout();
            Utilities.ResizeControls(panel);
            panel.Refresh();
        }
Example #4
0
 private void Resized()
 {
     layout.PerformLayout();
     if (labels.Any())
     {
         Height = layout.Height = labels.Last().Bottom - labels.First().Top;
     }
     else
     {
         Height = 1;
     }
 }
Example #5
0
        private void button3_Click(object sender, EventArgs e)
        {
            FlowLayoutPanel dlasiPole = new FlowLayoutPanel();

            dlasiPole.Name     = "flowLayoutPanel";
            dlasiPole.Size     = new Size(204, 89);
            dlasiPole.Location = new Point(posledniVytvoreny.Location.X + posledniVytvoreny.Size.Width, posledniVytvoreny.Location.Y);
            Controls.Add(dlasiPole);
            Size = new Size(Size.Width + posledniVytvoreny.Width, Size.Height);
            nahodTamKomponenty(dlasiPole);

            dlasiPole.ResumeLayout(false);
            dlasiPole.PerformLayout();

            posledniVytvoreny = dlasiPole;
        }
        public void Add(Control c, String text, String toolTip = null)
        {
            String da = GetDownArrow();
            String ua = GetUpArrow();

            var cb = new CheckBox {
                Appearance = Appearance.Button, Text = da + text, AutoSize = true, Anchor = AnchorStyles.Left | AnchorStyles.Right
            };

            cb.Margin = new System.Windows.Forms.Padding(0);
            var c2 = new Control2(cb, c)
            {
                Anchor = AnchorStyles.Left | AnchorStyles.Right
            };                                                                                    // anchor is required to fill to sides

            if (ContentPadding.HasValue)
            {
                c2.Padding = ContentPadding.Value;
            }

            if (!String.IsNullOrEmpty(toolTip))
            {
                tips.SetToolTip(cb, toolTip);
            }

            //c2.BackColor = Color.Purple;
            host.Controls.Add(cb);
            host.Controls.Add(c2);
            cb.CheckedChanged += delegate {
                host.PerformLayout();
                GetFirstFocus(c).Focus();

                if (OnlyOneOpen)
                {
                    if (lastChecked != null && cb.Checked && c2 != lastChecked)
                    {
                        lastChecked.cb.Checked = false;
                    }

                    lastChecked = c2;
                }

                String a = (cb.Checked ? GetUpArrow() : GetDownArrow());
                cb.Text = a + text;
            };
        }
 public static void AddDriveInfoWrapper(MainForm owner, FlowLayoutPanel panel, DriveInfoData driveInfo)
 {
     if (panel.InvokeRequired)
     {
         panel.Invoke(new AddDriveInfoWrapperDelegate(AddDriveInfoWrapper), owner, panel, driveInfo);
     }
     else
     {
         var control = new DriveInfoProgress(owner, driveInfo);
         //control.Anchor = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left) | AnchorStyles.Right)));
         control.Width = panel.Width - 10;
         control.Left  = 5;
         control.Top   = (panel.Controls.Count * control.Height) + 4;
         panel.Controls.Add(control);
         panel.PerformLayout();
     }
 }
Example #8
0
        List <Label> movingLabels = new List <Label>();   // moving meaning the moving of the price

        public SideMenu()
        {
            //
            // flowLayoutPanel1
            //
            flowLayoutPanel = new FlowLayoutPanel();

            flowLayoutPanel.SuspendLayout();

            flowLayoutPanel.AutoScroll = true;
            flowLayoutPanel.Location   = new Point(10, 75);
            flowLayoutPanel.Name       = "flowLayoutPanel1";
            flowLayoutPanel.Size       = new Size(165, 500);
            flowLayoutPanel.BackColor  = Color.LightGray;
            flowLayoutPanel.TabIndex   = 9;
            flowLayoutPanel.ResumeLayout(true);
            flowLayoutPanel.PerformLayout();
        }
Example #9
0
        public void InitGameFromSaveSheet()
        {
            SaveManager.LoadGameDataFromSaveFile();

            foreach (var p in Game.Instance.Players)
            {
                CharacterBoard chb = new CharacterBoard(p);
                _characterPanelFlPanel.Controls.Add(chb);
            }

            _characterPanelFlPanel.ResumeLayout(false);
            _characterPanelFlPanel.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();
            ActionManager.InitActionButtonPanel();
            LocationCardsPanel.RefreshMapLayout();
            SaveManager.Save();

            //start game chain
            Game.Instance.ProcessMorningStuff();
        }
Example #10
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormGoTo));
     lblDec           = new System.Windows.Forms.Label();
     btnCancel        = new System.Windows.Forms.Button();
     btnOK            = new System.Windows.Forms.Button();
     nup              = new System.Windows.Forms.NumericUpDown();
     label2           = new System.Windows.Forms.Label();
     line             = new System.Windows.Forms.Panel();
     flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
     rbHex            = new System.Windows.Forms.RadioButton();
     rbDec            = new System.Windows.Forms.RadioButton();
     lblHex           = new System.Windows.Forms.Label();
     txtHex           = new System.Windows.Forms.TextBox();
     ((System.ComponentModel.ISupportInitialize)(nup)).BeginInit();
     flowLayoutPanel1.SuspendLayout();
     SuspendLayout();
     //
     // lblDec
     //
     resources.ApplyResources(lblDec, "lblDec");
     lblDec.Name = "lblDec";
     //
     // btnCancel
     //
     resources.ApplyResources(btnCancel, "btnCancel");
     btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
     btnCancel.Name         = "btnCancel";
     btnCancel.Click       += new System.EventHandler(btnCancel_Click);
     //
     // btnOK
     //
     resources.ApplyResources(btnOK, "btnOK");
     btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
     btnOK.Name         = "btnOK";
     btnOK.Click       += new System.EventHandler(btnOK_Click);
     //
     // nup
     //
     resources.ApplyResources(nup, "nup");
     nup.Minimum = new decimal(new int[] {
         1,
         0,
         0,
         0
     });
     nup.Name  = "nup";
     nup.Value = new decimal(new int[] {
         1,
         0,
         0,
         0
     });
     //
     // label2
     //
     label2.ForeColor = System.Drawing.Color.Blue;
     resources.ApplyResources(label2, "label2");
     label2.Name = "label2";
     //
     // line
     //
     resources.ApplyResources(line, "line");
     line.BackColor = System.Drawing.Color.LightGray;
     line.Name      = "line";
     //
     // flowLayoutPanel1
     //
     resources.ApplyResources(flowLayoutPanel1, "flowLayoutPanel1");
     flowLayoutPanel1.Controls.Add(btnCancel);
     flowLayoutPanel1.Controls.Add(btnOK);
     flowLayoutPanel1.Name = "flowLayoutPanel1";
     //
     // rbHex
     //
     resources.ApplyResources(rbHex, "rbHex");
     rbHex.Checked = true;
     rbHex.Name    = "rbHex";
     rbHex.TabStop = true;
     rbHex.UseVisualStyleBackColor = true;
     rbHex.Click += new System.EventHandler(rbDec_Click);
     //
     // rbDec
     //
     resources.ApplyResources(rbDec, "rbDec");
     rbDec.Name = "rbDec";
     rbDec.UseVisualStyleBackColor = true;
     rbDec.Click += new System.EventHandler(rbDec_Click);
     //
     // lblHex
     //
     resources.ApplyResources(lblHex, "lblHex");
     lblHex.Name = "lblHex";
     //
     // txtHex
     //
     resources.ApplyResources(txtHex, "txtHex");
     txtHex.Name = "txtHex";
     //
     // FormGoTo
     //
     resources.ApplyResources(this, "$this");
     AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
     BackColor     = System.Drawing.SystemColors.Control;
     Controls.Add(txtHex);
     Controls.Add(lblHex);
     Controls.Add(rbDec);
     Controls.Add(rbHex);
     Controls.Add(flowLayoutPanel1);
     Controls.Add(line);
     Controls.Add(label2);
     Controls.Add(nup);
     Controls.Add(lblDec);
     FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
     MaximizeBox     = false;
     MinimizeBox     = false;
     Name            = "FormGoTo";
     ShowInTaskbar   = false;
     Activated      += new System.EventHandler(FormGoTo_Activated);
     Shown          += new System.EventHandler(FormGoTo_Shown);
     ((System.ComponentModel.ISupportInitialize)(nup)).EndInit();
     flowLayoutPanel1.ResumeLayout(false);
     flowLayoutPanel1.PerformLayout();
     ResumeLayout(false);
     PerformLayout();
 }
Example #11
0
        protected void InitializeComponent()
        {
            Add("name", new string('W', 15), (ApplicationConfig s) => Tuple.Create(s.DisplayName, s.ColorName, s.FontSizeTitle), "{}");
            Add("hc_sc", "HARDCORE", (ApplicationConfig s) => Tuple.Create(s.DisplayHardcoreSoftcore, s.ColorHardcoreSoftcore, s.FontSize), "{}");
            Add("exp_classic", "EXPANSION", (ApplicationConfig s) => Tuple.Create(s.DisplayExpansionClassic, s.ColorExpansionClassic, s.FontSize), "{}");
            Add("playersx", "8", (ApplicationConfig s) => Tuple.Create(s.DisplayPlayersX, s.ColorPlayersX, s.FontSize), "/players {}");
            Add("seed", "4294967295", (ApplicationConfig s) => Tuple.Create(s.DisplaySeed, s.ColorSeed, s.FontSize), "SEED: {}");
            Add("deaths", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayDeathCounter, s.ColorDeaths, s.FontSize), "DEATHS: {}");
            Add("runs", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayGameCounter, s.ColorGameCounter, s.FontSize), "RUNS: {}");
            Add("chars", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayCharCounter, s.ColorCharCounter, s.FontSize), "CHARS: {}");
            Add("gold", "2500000", (ApplicationConfig s) => Tuple.Create(s.DisplayGold, s.ColorGold, s.FontSize), "GOLD: {}");
            Add("mf", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayMagicFind, s.ColorMagicFind, s.FontSize), "MF:", "{}");
            Add("monstergold", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayMonsterGold, s.ColorMonsterGold, s.FontSize), "EMG:", "{}");
            Add("atd", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayAttackerSelfDamage, s.ColorAttackerSelfDamage, s.FontSize), "ATD:", "{}");
            Add("lvl", "99", (ApplicationConfig s) => Tuple.Create(s.DisplayLevel, s.ColorLevel, s.FontSize), "LVL:", "{}");
            Add("str", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayBaseStats, s.ColorBaseStats, s.FontSize), "STR:", "{}");
            Add("vit", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayBaseStats, s.ColorBaseStats, s.FontSize), "VIT:", "{}");
            Add("dex", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayBaseStats, s.ColorBaseStats, s.FontSize), "DEX:", "{}");
            Add("ene", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayBaseStats, s.ColorBaseStats, s.FontSize), "ENE:", "{}");
            Add("ias", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayAdvancedStats, s.ColorAdvancedStats, s.FontSize), "IAS:", "{}");
            Add("frw", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayAdvancedStats, s.ColorAdvancedStats, s.FontSize), "FRW:", "{}");
            Add("fcr", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayAdvancedStats, s.ColorAdvancedStats, s.FontSize), "FCR:", "{}");
            Add("fhr", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayAdvancedStats, s.ColorAdvancedStats, s.FontSize), "FHR:", "{}");
            Add("cold", "100", (ApplicationConfig s) => Tuple.Create(s.DisplayResistances, s.ColorColdRes, s.FontSize), "COLD:", "{}");
            Add("ligh", "100", (ApplicationConfig s) => Tuple.Create(s.DisplayResistances, s.ColorLightningRes, s.FontSize), "LIGH:", "{}");
            Add("pois", "100", (ApplicationConfig s) => Tuple.Create(s.DisplayResistances, s.ColorPoisonRes, s.FontSize), "POIS:", "{}");
            Add("fire", "100", (ApplicationConfig s) => Tuple.Create(s.DisplayResistances, s.ColorFireRes, s.FontSize), "FIRE:", "{}");
            Add("norm", "100", (ApplicationConfig s) => Tuple.Create(s.DisplayDifficultyPercentages, s.ColorDifficultyPercentages, s.FontSize), "NORM:", "{}%");
            Add("nm", "100", (ApplicationConfig s) => Tuple.Create(s.DisplayDifficultyPercentages, s.ColorDifficultyPercentages, s.FontSize), "NM:", "{}%");
            Add("hell", "100", (ApplicationConfig s) => Tuple.Create(s.DisplayDifficultyPercentages, s.ColorDifficultyPercentages, s.FontSize), "HELL:", "{}%");

            table = new TableLayoutPanel();
            table.SuspendLayout();
            table.AutoSize    = true;
            table.ColumnCount = 2;
            table.ColumnStyles.Add(new ColumnStyle());
            table.ColumnStyles.Add(new ColumnStyle());
            table.RowCount = 0;

            foreach (KeyValuePair <string, Def> pair in def)
            {
                table.RowCount++;
                table.RowStyles.Add(new RowStyle(SizeType.AutoSize));

                for (int i = 0; i < pair.Value.labels.Length; i++)
                {
                    table.Controls.Add(pair.Value.labels[i], i, table.RowCount - 1);
                    if (i > 0)
                    {
                        pair.Value.labels[i].TextAlign = ContentAlignment.TopRight;
                    }
                }
                if (pair.Value.labels.Length == 1)
                {
                    table.SetColumnSpan(pair.Value.labels[0], table.ColumnCount);
                }
            }

            table.ResumeLayout(false);
            table.PerformLayout();

            panelRuneDisplay              = new FlowLayoutPanel();
            panelRuneDisplay.Anchor       = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            panelRuneDisplay.AutoSize     = true;
            panelRuneDisplay.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            panelRuneDisplay.MaximumSize  = new Size(28, 0);
            panelRuneDisplay.MinimumSize  = new Size(28, 28);

            outerLeftRightPanel = new FlowLayoutPanel();
            outerLeftRightPanel.SuspendLayout();
            outerLeftRightPanel.AutoSize     = true;
            outerLeftRightPanel.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            outerLeftRightPanel.Controls.Add(panelRuneDisplay);
            outerLeftRightPanel.Controls.Add(table);

            SuspendLayout();
            AutoScaleDimensions = new SizeF(6F, 13F);
            AutoScaleMode       = AutoScaleMode.Font;
            AutoSize            = true;
            AutoSizeMode        = AutoSizeMode.GrowAndShrink;
            Margin    = new Padding(0);
            BackColor = Color.Black;
            Controls.Add(this.outerLeftRightPanel);
            outerLeftRightPanel.ResumeLayout(false);
            outerLeftRightPanel.PerformLayout();
            ResumeLayout(false);
            PerformLayout();

            RunePanels = new[]
            {
                panelRuneDisplay
            };
        }
Example #12
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources =
         new System.ComponentModel.ComponentResourceManager(typeof(FormFind));
     txtFind          = new System.Windows.Forms.TextBox();
     rbString         = new System.Windows.Forms.RadioButton();
     rbHex            = new System.Windows.Forms.RadioButton();
     label1           = new System.Windows.Forms.Label();
     btnOK            = new System.Windows.Forms.Button();
     btnCancel        = new System.Windows.Forms.Button();
     groupBox1        = new System.Windows.Forms.GroupBox();
     lblPercent       = new System.Windows.Forms.Label();
     lblFinding       = new System.Windows.Forms.Label();
     chkMatchCase     = new System.Windows.Forms.CheckBox();
     timerPercent     = new System.Windows.Forms.Timer(components);
     timer            = new System.Windows.Forms.Timer(components);
     hexFind          = new HexBox();
     flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
     rdoAnnotations   = new System.Windows.Forms.RadioButton();
     flowLayoutPanel1.SuspendLayout();
     SuspendLayout();
     //
     // txtFind
     //
     resources.ApplyResources(txtFind, "txtFind");
     txtFind.Name         = "txtFind";
     txtFind.TextChanged += new EventHandler(txtString_TextChanged);
     //
     // rbString
     //
     rbString.Checked = true;
     resources.ApplyResources(rbString, "rbString");
     rbString.Name    = "rbString";
     rbString.TabStop = true;
     //
     // rbHex
     //
     resources.ApplyResources(rbHex, "rbHex");
     rbHex.Name = "rbHex";
     //
     // label1
     //
     resources.ApplyResources(label1, "label1");
     label1.ForeColor = System.Drawing.Color.Blue;
     label1.Name      = "label1";
     //
     // btnOK
     //
     resources.ApplyResources(btnOK, "btnOK");
     btnOK.Name   = "btnOK";
     btnOK.Click += new EventHandler(btnOK_Click);
     //
     // btnCancel
     //
     resources.ApplyResources(btnCancel, "btnCancel");
     btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
     btnCancel.Name         = "btnCancel";
     btnCancel.Click       += new EventHandler(btnCancel_Click);
     //
     // groupBox1
     //
     resources.ApplyResources(groupBox1, "groupBox1");
     groupBox1.Name    = "groupBox1";
     groupBox1.TabStop = false;
     //
     // lblPercent
     //
     resources.ApplyResources(lblPercent, "lblPercent");
     lblPercent.Name = "lblPercent";
     //
     // lblFinding
     //
     resources.ApplyResources(lblFinding, "lblFinding");
     lblFinding.ForeColor = System.Drawing.Color.Blue;
     lblFinding.Name      = "lblFinding";
     //
     // chkMatchCase
     //
     resources.ApplyResources(chkMatchCase, "chkMatchCase");
     chkMatchCase.Name = "chkMatchCase";
     chkMatchCase.UseVisualStyleBackColor = true;
     //
     // timerPercent
     //
     timerPercent.Tick += new EventHandler(timerPercent_Tick);
     //
     // timer
     //
     timer.Interval = 50;
     timer.Tick    += new EventHandler(timer_Tick);
     //
     // hexFind
     //
     resources.ApplyResources(hexFind, "hexFind");
     hexFind.BlrColor           = System.Drawing.Color.FromArgb(255, 255, 100);
     hexFind.BranchOffsetColor  = System.Drawing.Color.Plum;
     hexFind.ColumnDividerColor = System.Drawing.Color.Empty;
     hexFind.CommandColor       = System.Drawing.Color.FromArgb(200, 255, 200);
     hexFind.InfoForeColor      = System.Drawing.Color.Empty;
     hexFind.LinkedBranchColor  = System.Drawing.Color.Orange;
     hexFind.Name                 = "hexFind";
     hexFind.SectionEditor        = null;
     hexFind.SelectedColor        = System.Drawing.Color.FromArgb(200, 255, 255);
     hexFind.ShadowSelectionColor = System.Drawing.Color.FromArgb(100, 60, 188, 255);
     //
     // flowLayoutPanel1
     //
     flowLayoutPanel1.Controls.Add(label1);
     flowLayoutPanel1.Controls.Add(groupBox1);
     resources.ApplyResources(flowLayoutPanel1, "flowLayoutPanel1");
     flowLayoutPanel1.Name = "flowLayoutPanel1";
     //
     // rdoAnnotations
     //
     resources.ApplyResources(rdoAnnotations, "rdoAnnotations");
     rdoAnnotations.Name = "rdoAnnotations";
     //
     // FormFind
     //
     AcceptButton = btnOK;
     resources.ApplyResources(this, "$this");
     BackColor    = System.Drawing.SystemColors.Control;
     CancelButton = btnCancel;
     Controls.Add(rdoAnnotations);
     Controls.Add(flowLayoutPanel1);
     Controls.Add(chkMatchCase);
     Controls.Add(lblPercent);
     Controls.Add(lblFinding);
     Controls.Add(btnCancel);
     Controls.Add(btnOK);
     Controls.Add(rbHex);
     Controls.Add(rbString);
     Controls.Add(txtFind);
     Controls.Add(hexFind);
     FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
     MaximizeBox     = false;
     MinimizeBox     = false;
     Name            = "FormFind";
     ShowIcon        = false;
     ShowInTaskbar   = false;
     Activated      += new EventHandler(FormFind_Activated);
     flowLayoutPanel1.ResumeLayout(false);
     flowLayoutPanel1.PerformLayout();
     ResumeLayout(false);
     PerformLayout();
 }
Example #13
0
 private void Initialize_NewECWindow_Componnents()
 {
     NewEC_Window_button1          = new Button();
     NewEC_Window_label1           = new Label();
     NewEC_Window_label2           = new Label();
     NewEC_Window_label3           = new Label();
     NewEC_Window_flowLayoutPanel1 = new FlowLayoutPanel();
     NewEC_Window_textBox1         = new TextBox();
     NewEC_Window_textBox2         = new TextBox();
     NewEC_Window_textBox3         = new TextBox();
     NewEC_Window = new Form();
     NewEC_Window_flowLayoutPanel1.SuspendLayout();
     //
     // button1
     //
     NewEC_Window_button1.Location = new Point(77, 77);
     NewEC_Window_button1.Name     = "NewEC_Window_button1";
     NewEC_Window_button1.Size     = new Size(122, 30);
     NewEC_Window_button1.TabIndex = 1;
     NewEC_Window_button1.Text     = "Add";
     NewEC_Window_button1.UseVisualStyleBackColor = true;
     NewEC_Window_button1.Click += new EventHandler(this.NewEC_Window_ValidateClick);
     //
     // label1
     //
     NewEC_Window_label1.Location  = new Point(13, 0);
     NewEC_Window_label1.Name      = "NewEC_Window_label1";
     NewEC_Window_label1.Size      = new Size(70, 20);
     NewEC_Window_label1.TabIndex  = 2;
     NewEC_Window_label1.Text      = "Start frame";
     NewEC_Window_label1.TextAlign = ContentAlignment.MiddleCenter;
     //
     // label2
     //
     NewEC_Window_label2.Location  = new Point(89, 0);
     NewEC_Window_label2.Name      = "NewEC_Window_label2";
     NewEC_Window_label2.Size      = new Size(70, 20);
     NewEC_Window_label2.TabIndex  = 3;
     NewEC_Window_label2.Text      = "End frame";
     NewEC_Window_label2.TextAlign = ContentAlignment.MiddleCenter;
     //
     // label3
     //
     NewEC_Window_label3.Location  = new Point(165, 0);
     NewEC_Window_label3.Name      = "NewEC_Window_label3";
     NewEC_Window_label3.Size      = new Size(70, 20);
     NewEC_Window_label3.TabIndex  = 4;
     NewEC_Window_label3.Text      = "Type";
     NewEC_Window_label3.TextAlign = ContentAlignment.MiddleCenter;
     //
     // flowLayoutPanel1
     //
     NewEC_Window_flowLayoutPanel1.BorderStyle = BorderStyle.FixedSingle;
     NewEC_Window_flowLayoutPanel1.Controls.Add(NewEC_Window_label1);
     NewEC_Window_flowLayoutPanel1.Controls.Add(NewEC_Window_label2);
     NewEC_Window_flowLayoutPanel1.Controls.Add(NewEC_Window_label3);
     NewEC_Window_flowLayoutPanel1.Controls.Add(NewEC_Window_textBox1);
     NewEC_Window_flowLayoutPanel1.Controls.Add(NewEC_Window_textBox2);
     NewEC_Window_flowLayoutPanel1.Controls.Add(NewEC_Window_textBox3);
     NewEC_Window_flowLayoutPanel1.Location = new Point(13, 12);
     NewEC_Window_flowLayoutPanel1.Name     = "NewEC_Window_flowLayoutPanel1";
     NewEC_Window_flowLayoutPanel1.Padding  = new Padding(10, 0, 0, 0);
     NewEC_Window_flowLayoutPanel1.Size     = new Size(249, 56);
     NewEC_Window_flowLayoutPanel1.TabIndex = 5;
     //
     // textBox1
     //
     NewEC_Window_textBox1.BorderStyle  = BorderStyle.FixedSingle;
     NewEC_Window_textBox1.Location     = new Point(13, 23);
     NewEC_Window_textBox1.Name         = "NewEC_Window_textBox1";
     NewEC_Window_textBox1.Size         = new Size(70, 20);
     NewEC_Window_textBox1.TabIndex     = 5;
     NewEC_Window_textBox1.TextChanged += new EventHandler(ShortTextboxTextChanged);
     NewEC_Window_textBox1.Text         = "0";
     //
     // textBox2
     //
     NewEC_Window_textBox2.BorderStyle  = BorderStyle.FixedSingle;
     NewEC_Window_textBox2.Location     = new Point(89, 23);
     NewEC_Window_textBox2.Name         = "NewEC_Window_textBox2";
     NewEC_Window_textBox2.Size         = new Size(70, 20);
     NewEC_Window_textBox2.TabIndex     = 6;
     NewEC_Window_textBox2.TextChanged += new EventHandler(ShortTextboxTextChanged);
     NewEC_Window_textBox2.Text         = "0";
     //
     // textBox3
     //
     NewEC_Window_textBox3.BorderStyle  = BorderStyle.FixedSingle;
     NewEC_Window_textBox3.Location     = new Point(165, 23);
     NewEC_Window_textBox3.Name         = "NewEC_Window_textBox3";
     NewEC_Window_textBox3.Size         = new Size(70, 20);
     NewEC_Window_textBox3.TabIndex     = 7;
     NewEC_Window_textBox3.TextChanged += new EventHandler(ShortTextboxTextChanged);
     NewEC_Window_textBox3.Text         = "0";
     //
     // MainForm
     //
     NewEC_Window.AutoScaleDimensions = new SizeF(6F, 13F);
     NewEC_Window.AutoScaleMode       = AutoScaleMode.Font;
     NewEC_Window.ClientSize          = new Size(273, 116);
     NewEC_Window.Controls.Add(NewEC_Window_flowLayoutPanel1);
     NewEC_Window.Controls.Add(NewEC_Window_button1);
     NewEC_Window.FormBorderStyle = FormBorderStyle.FixedToolWindow;
     NewEC_Window.MaximizeBox     = false;
     NewEC_Window.MaximumSize     = new Size(289, 150);
     NewEC_Window.MinimizeBox     = false;
     NewEC_Window.MinimumSize     = new Size(289, 150);
     NewEC_Window.Name            = "NewEC_Window";
     NewEC_Window.ShowInTaskbar   = false;
     NewEC_Window.SizeGripStyle   = SizeGripStyle.Hide;
     NewEC_Window.StartPosition   = FormStartPosition.CenterParent;
     NewEC_Window.Text            = "Add";
     NewEC_Window_flowLayoutPanel1.ResumeLayout(false);
     NewEC_Window_flowLayoutPanel1.PerformLayout();
 }
Example #14
0
        /// <summary>
        ///
        /// </summary>
        private void InitializeComponent()
        {
            ComponentResourceManager resources = new ComponentResourceManager(typeof(InvoiceClient));

            components         = new Container();
            buttonView         = new FlatButton();
            buttonDelete       = new FlatButton();
            buttonExit         = new FlatButton();
            transactionsLayout = new Panel();
            flowLayoutPanel1   = new FlowLayoutPanel();
            notifyIcon         = new NotifyIcon(components);
            listView           = new ListView();
            transactionsLayout.SuspendLayout();
            flowLayoutPanel1.SuspendLayout();
            SuspendLayout();
            //
            // buttonView
            //
            buttonView.Font     = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Bold, GraphicsUnit.Point, 0);
            buttonView.Location = new Point(0, 4);
            buttonView.Margin   = new Padding(0, 4, 2, 4);
            buttonView.Name     = "buttonView";
            buttonView.Size     = new Size(128, 32);
            buttonView.TabIndex = 0;
            buttonView.Text     = "View";
            buttonView.Click   += new EventHandler(ButtonView_Click);
            //
            // buttonDelete
            //
            buttonDelete.Location = new Point(132, 4);
            buttonDelete.Margin   = new Padding(2, 4, 2, 4);
            buttonDelete.Name     = "buttonDelete";
            buttonDelete.Size     = new Size(131, 32);
            buttonDelete.TabIndex = 1;
            buttonDelete.Text     = "Delete";
            buttonDelete.Click   += new EventHandler(ButtonDelete_Click);
            //
            // buttonExit
            //
            buttonExit.DialogResult = DialogResult.Cancel;
            buttonExit.Font         = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Bold, GraphicsUnit.Point, 0);
            buttonExit.Location     = new Point(267, 4);
            buttonExit.Margin       = new Padding(2, 4, 0, 4);
            buttonExit.Name         = "buttonExit";
            buttonExit.Size         = new Size(128, 32);
            buttonExit.TabIndex     = 2;
            buttonExit.Text         = "Exit";
            buttonExit.Click       += new EventHandler(ButtonExit_Click);
            //
            // transactionsLayout
            //
            transactionsLayout.BackColor = SystemColors.ControlDark;
            transactionsLayout.Controls.Add(flowLayoutPanel1);
            transactionsLayout.Controls.Add(listView);
            transactionsLayout.Dock     = DockStyle.Fill;
            transactionsLayout.Location = new Point(0, 0);
            transactionsLayout.Name     = "transactionsLayout";
            transactionsLayout.Padding  = new Padding(4);
            transactionsLayout.Size     = new Size(404, 461);
            //
            // flowLayoutPanel1
            //
            flowLayoutPanel1.BackColor = Color.Transparent;
            flowLayoutPanel1.Controls.Add(buttonView);
            flowLayoutPanel1.Controls.Add(buttonDelete);
            flowLayoutPanel1.Controls.Add(buttonExit);
            flowLayoutPanel1.Dock     = DockStyle.Bottom;
            flowLayoutPanel1.Location = new Point(4, 421);
            flowLayoutPanel1.Margin   = new Padding(0);
            flowLayoutPanel1.Name     = "flowLayoutPanel1";
            flowLayoutPanel1.Size     = new Size(396, 36);
            //
            // listView
            //
            listView.BackColor = SystemColors.ControlLight;
            listView.Columns.AddRange(new ColumnHeader[]
            {
                new ColumnHeader
                {
                    Text = "Date", Width = 100
                },
                new ColumnHeader
                {
                    Text = "Identifier", Width = 290
                }
            });
            listView.Dock                  = DockStyle.Fill;
            listView.FullRowSelect         = true;
            listView.GridLines             = true;
            listView.Location              = new Point(4, 4);
            listView.Name                  = "listView";
            listView.Size                  = new Size(396, 453);
            listView.TabIndex              = 3;
            listView.View                  = View.Details;
            listView.HeaderStyle           = ColumnHeaderStyle.Nonclickable;
            listView.SelectedIndexChanged += new EventHandler(ListView_SelectedIndexChanged);
            listView.MouseDoubleClick     += new MouseEventHandler(ListView_MouseDoubleClick);
            //
            // InvoiceClient
            //
            AcceptButton = buttonView;
            ClientSize   = new Size(404, 461);
            Controls.Add(transactionsLayout);
            FormBorderStyle    = FormBorderStyle.FixedSingle;
            Icon               = Resources.librettoIcon;
            MaximizeBox        = false;
            Name               = "InvoiceClient";
            StartPosition      = FormStartPosition.CenterScreen;
            Text               = "Libretto Invoices";
            Load              += new EventHandler(InvoiceClient_Load);
            notifyIcon.Text    = Text;
            notifyIcon.Visible = true;
            notifyIcon.Icon    = Resources.librettoIcon;
            transactionsLayout.ResumeLayout(false);
            flowLayoutPanel1.ResumeLayout(false);
            flowLayoutPanel1.PerformLayout();
            ResumeLayout(false);
        }
 private void InitializeComponent()
 {
     System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle  = new System.Windows.Forms.DataGridViewCellStyle();
     System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
     l_GDSNO               = new System.Windows.Forms.Label();
     l_goodsInfo           = new System.Windows.Forms.Label();
     dataGridView1         = new System.Windows.Forms.DataGridView();
     flowLayoutPanel2      = new System.Windows.Forms.FlowLayoutPanel();
     l_goodsContent        = new System.Windows.Forms.Label();
     flowLayoutPanel1      = new System.Windows.Forms.FlowLayoutPanel();
     cb_adjustType         = new System.Windows.Forms.ComboBox();
     btn_plus              = new System.Windows.Forms.Button();
     btn_minus             = new System.Windows.Forms.Button();
     tb_adjustCount        = new System.Windows.Forms.TextBox();
     btn_enter             = new System.Windows.Forms.Button();
     label3                = new System.Windows.Forms.Label();
     label2                = new System.Windows.Forms.Label();
     panel3                = new System.Windows.Forms.Panel();
     label1                = new System.Windows.Forms.Label();
     panel2                = new System.Windows.Forms.Panel();
     label33               = new System.Windows.Forms.Label();
     panel22               = new System.Windows.Forms.Panel();
     tableLayoutPanel2     = new System.Windows.Forms.TableLayoutPanel();
     l_inventoryCountTotal = new System.Windows.Forms.Label();
     l_title               = new System.Windows.Forms.Label();
     btn_close             = new System.Windows.Forms.Button();
     Column1               = new System.Windows.Forms.DataGridViewTextBoxColumn();
     Column2               = new System.Windows.Forms.DataGridViewTextBoxColumn();
     Column4               = new System.Windows.Forms.DataGridViewTextBoxColumn();
     Column3               = new System.Windows.Forms.DataGridViewTextBoxColumn();
     ((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
     flowLayoutPanel2.SuspendLayout();
     flowLayoutPanel1.SuspendLayout();
     panel3.SuspendLayout();
     panel2.SuspendLayout();
     panel22.SuspendLayout();
     tableLayoutPanel2.SuspendLayout();
     SuspendLayout();
     l_GDSNO.AutoSize                            = true;
     l_GDSNO.Font                                = new System.Drawing.Font("微軟正黑體", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 136);
     l_GDSNO.ForeColor                           = System.Drawing.Color.Gray;
     l_GDSNO.Location                            = new System.Drawing.Point(10, 5);
     l_GDSNO.Margin                              = new System.Windows.Forms.Padding(10, 5, 3, 0);
     l_GDSNO.Name                                = "l_GDSNO";
     l_GDSNO.Size                                = new System.Drawing.Size(28, 20);
     l_GDSNO.TabIndex                            = 55;
     l_GDSNO.Text                                = "{0}";
     l_goodsInfo.Anchor                          = System.Windows.Forms.AnchorStyles.Left;
     l_goodsInfo.AutoSize                        = true;
     l_goodsInfo.Font                            = new System.Drawing.Font("微軟正黑體", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 136);
     l_goodsInfo.Location                        = new System.Drawing.Point(10, 25);
     l_goodsInfo.Margin                          = new System.Windows.Forms.Padding(10, 0, 3, 0);
     l_goodsInfo.Name                            = "l_goodsInfo";
     l_goodsInfo.Size                            = new System.Drawing.Size(28, 20);
     l_goodsInfo.TabIndex                        = 57;
     l_goodsInfo.Text                            = "{0}";
     dataGridView1.AllowUserToAddRows            = false;
     dataGridView1.AllowUserToDeleteRows         = false;
     dataGridView1.AllowUserToResizeColumns      = false;
     dataGridView1.AllowUserToResizeRows         = false;
     dataGridView1.BackgroundColor               = System.Drawing.Color.White;
     dataGridView1.BorderStyle                   = System.Windows.Forms.BorderStyle.None;
     dataGridView1.ColumnHeadersBorderStyle      = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
     dataGridViewCellStyle.Alignment             = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
     dataGridViewCellStyle.BackColor             = System.Drawing.Color.FromArgb(102, 102, 102);
     dataGridViewCellStyle.Font                  = new System.Drawing.Font("微軟正黑體", 15f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
     dataGridViewCellStyle.ForeColor             = System.Drawing.Color.White;
     dataGridViewCellStyle.Padding               = new System.Windows.Forms.Padding(6);
     dataGridViewCellStyle.SelectionBackColor    = System.Drawing.SystemColors.Highlight;
     dataGridViewCellStyle.SelectionForeColor    = System.Drawing.SystemColors.HighlightText;
     dataGridViewCellStyle.WrapMode              = System.Windows.Forms.DataGridViewTriState.True;
     dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle;
     dataGridView1.ColumnHeadersHeightSizeMode   = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
     dataGridView1.Columns.AddRange(Column1, Column2, Column4, Column3);
     dataGridViewCellStyle2.Alignment          = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
     dataGridViewCellStyle2.BackColor          = System.Drawing.SystemColors.Window;
     dataGridViewCellStyle2.Font               = new System.Drawing.Font("微軟正黑體", 15f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
     dataGridViewCellStyle2.ForeColor          = System.Drawing.SystemColors.ControlText;
     dataGridViewCellStyle2.Padding            = new System.Windows.Forms.Padding(6);
     dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.White;
     dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.Black;
     dataGridViewCellStyle2.WrapMode           = System.Windows.Forms.DataGridViewTriState.False;
     dataGridView1.DefaultCellStyle            = dataGridViewCellStyle2;
     dataGridView1.EnableHeadersVisualStyles   = false;
     dataGridView1.Location           = new System.Drawing.Point(47, 235);
     dataGridView1.MultiSelect        = false;
     dataGridView1.Name               = "dataGridView1";
     dataGridView1.ReadOnly           = true;
     dataGridView1.RowHeadersVisible  = false;
     dataGridView1.RowTemplate.Height = 35;
     dataGridView1.ScrollBars         = System.Windows.Forms.ScrollBars.Vertical;
     dataGridView1.Size               = new System.Drawing.Size(811, 260);
     dataGridView1.TabIndex           = 58;
     flowLayoutPanel2.Controls.Add(l_GDSNO);
     flowLayoutPanel2.Controls.Add(l_goodsInfo);
     flowLayoutPanel2.Controls.Add(l_goodsContent);
     flowLayoutPanel2.Dock          = System.Windows.Forms.DockStyle.Fill;
     flowLayoutPanel2.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
     flowLayoutPanel2.Location      = new System.Drawing.Point(164, 1);
     flowLayoutPanel2.Margin        = new System.Windows.Forms.Padding(0);
     flowLayoutPanel2.Name          = "flowLayoutPanel2";
     flowLayoutPanel2.Size          = new System.Drawing.Size(646, 71);
     flowLayoutPanel2.TabIndex      = 23;
     l_goodsContent.AutoSize        = true;
     l_goodsContent.Font            = new System.Drawing.Font("微軟正黑體", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 136);
     l_goodsContent.ForeColor       = System.Drawing.Color.Gray;
     l_goodsContent.Location        = new System.Drawing.Point(10, 45);
     l_goodsContent.Margin          = new System.Windows.Forms.Padding(10, 0, 3, 0);
     l_goodsContent.Name            = "l_goodsContent";
     l_goodsContent.Size            = new System.Drawing.Size(28, 20);
     l_goodsContent.TabIndex        = 56;
     l_goodsContent.Text            = "{0}";
     flowLayoutPanel1.Controls.Add(cb_adjustType);
     flowLayoutPanel1.Controls.Add(btn_plus);
     flowLayoutPanel1.Controls.Add(btn_minus);
     flowLayoutPanel1.Controls.Add(tb_adjustCount);
     flowLayoutPanel1.Controls.Add(btn_enter);
     flowLayoutPanel1.Controls.Add(label3);
     flowLayoutPanel1.Dock               = System.Windows.Forms.DockStyle.Fill;
     flowLayoutPanel1.Location           = new System.Drawing.Point(164, 118);
     flowLayoutPanel1.Margin             = new System.Windows.Forms.Padding(0);
     flowLayoutPanel1.Name               = "flowLayoutPanel1";
     flowLayoutPanel1.Size               = new System.Drawing.Size(646, 63);
     flowLayoutPanel1.TabIndex           = 22;
     cb_adjustType.DropDownStyle         = System.Windows.Forms.ComboBoxStyle.DropDownList;
     cb_adjustType.Font                  = new System.Drawing.Font("微軟正黑體", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 136);
     cb_adjustType.FormattingEnabled     = true;
     cb_adjustType.Location              = new System.Drawing.Point(10, 3);
     cb_adjustType.Margin                = new System.Windows.Forms.Padding(10, 3, 3, 3);
     cb_adjustType.Name                  = "cb_adjustType";
     cb_adjustType.Size                  = new System.Drawing.Size(166, 28);
     cb_adjustType.TabIndex              = 0;
     cb_adjustType.SelectedValueChanged += new System.EventHandler(cb_adjustType_SelectedValueChanged);
     btn_plus.BackColor                  = System.Drawing.Color.White;
     btn_plus.Location = new System.Drawing.Point(182, 3);
     btn_plus.Name     = "btn_plus";
     btn_plus.Size     = new System.Drawing.Size(40, 31);
     btn_plus.TabIndex = 45;
     btn_plus.Text     = "+";
     btn_plus.UseVisualStyleBackColor = false;
     btn_plus.Click     += new System.EventHandler(btn_plus_Click);
     btn_minus.BackColor = System.Drawing.SystemColors.ButtonShadow;
     btn_minus.Location  = new System.Drawing.Point(228, 3);
     btn_minus.Name      = "btn_minus";
     btn_minus.Size      = new System.Drawing.Size(40, 31);
     btn_minus.TabIndex  = 46;
     btn_minus.Text      = "-";
     btn_minus.UseVisualStyleBackColor = false;
     btn_minus.Click                  += new System.EventHandler(btn_minus_Click);
     tb_adjustCount.Font               = new System.Drawing.Font("微軟正黑體", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 136);
     tb_adjustCount.Location           = new System.Drawing.Point(274, 3);
     tb_adjustCount.Name               = "tb_adjustCount";
     tb_adjustCount.Size               = new System.Drawing.Size(311, 29);
     tb_adjustCount.TabIndex           = 1;
     tb_adjustCount.Text               = "請輸入調整數字";
     tb_adjustCount.Enter             += new System.EventHandler(tb_adjustCount_Enter);
     tb_adjustCount.KeyPress          += new System.Windows.Forms.KeyPressEventHandler(digitOnly_KeyPress);
     tb_adjustCount.KeyUp             += new System.Windows.Forms.KeyEventHandler(tb_adjustCount_KeyUp);
     tb_adjustCount.Leave             += new System.EventHandler(tb_adjustCount_Leave);
     btn_enter.FlatStyle               = System.Windows.Forms.FlatStyle.Flat;
     btn_enter.Font                    = new System.Drawing.Font("微軟正黑體", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 136);
     btn_enter.Image                   = POS_Client.Properties.Resources.ic_input_black_24dp_1x;
     btn_enter.Location                = new System.Drawing.Point(591, 3);
     btn_enter.Name                    = "btn_enter";
     btn_enter.Size                    = new System.Drawing.Size(48, 29);
     btn_enter.TabIndex                = 2;
     btn_enter.UseVisualStyleBackColor = true;
     btn_enter.Click                  += new System.EventHandler(btn_enter_Click);
     label3.AutoSize                   = true;
     label3.Font      = new System.Drawing.Font("微軟正黑體", 9f);
     label3.ForeColor = System.Drawing.Color.Red;
     label3.Location  = new System.Drawing.Point(10, 37);
     label3.Margin    = new System.Windows.Forms.Padding(10, 0, 3, 0);
     label3.Name      = "label3";
     label3.Size      = new System.Drawing.Size(600, 16);
     label3.TabIndex  = 3;
     label3.Text      = "*請輸入數字,正負數值請點選「+ / -」按鈕,預設為「-」扣除。將依輸入正負數字增加或扣除目前庫存數字";
     label2.AutoSize  = true;
     label2.Font      = new System.Drawing.Font("微軟正黑體", 12f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 136);
     label2.ForeColor = System.Drawing.Color.White;
     label2.Location  = new System.Drawing.Point(85, 21);
     label2.Name      = "label2";
     label2.Size      = new System.Drawing.Size(74, 21);
     label2.TabIndex  = 0;
     label2.Text      = "庫存調整";
     panel3.BackColor = System.Drawing.Color.FromArgb(102, 102, 102);
     panel3.Controls.Add(label2);
     panel3.Dock      = System.Windows.Forms.DockStyle.Fill;
     panel3.Location  = new System.Drawing.Point(1, 118);
     panel3.Margin    = new System.Windows.Forms.Padding(0);
     panel3.Name      = "panel3";
     panel3.Size      = new System.Drawing.Size(162, 63);
     panel3.TabIndex  = 19;
     label1.AutoSize  = true;
     label1.Font      = new System.Drawing.Font("微軟正黑體", 12f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 136);
     label1.ForeColor = System.Drawing.Color.White;
     label1.Location  = new System.Drawing.Point(85, 20);
     label1.Name      = "label1";
     label1.Size      = new System.Drawing.Size(74, 21);
     label1.TabIndex  = 0;
     label1.Text      = "商品名稱";
     panel2.BackColor = System.Drawing.Color.FromArgb(102, 102, 102);
     panel2.Controls.Add(label1);
     panel2.Dock       = System.Windows.Forms.DockStyle.Fill;
     panel2.Location   = new System.Drawing.Point(1, 1);
     panel2.Margin     = new System.Windows.Forms.Padding(0);
     panel2.Name       = "panel2";
     panel2.Size       = new System.Drawing.Size(162, 71);
     panel2.TabIndex   = 19;
     label33.AutoSize  = true;
     label33.Font      = new System.Drawing.Font("微軟正黑體", 12f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 136);
     label33.ForeColor = System.Drawing.Color.White;
     label33.Location  = new System.Drawing.Point(85, 13);
     label33.Name      = "label33";
     label33.Size      = new System.Drawing.Size(74, 21);
     label33.TabIndex  = 0;
     label33.Text      = "現品庫存";
     panel22.BackColor = System.Drawing.Color.FromArgb(102, 102, 102);
     panel22.Controls.Add(label33);
     panel22.Dock                      = System.Windows.Forms.DockStyle.Fill;
     panel22.Location                  = new System.Drawing.Point(1, 73);
     panel22.Margin                    = new System.Windows.Forms.Padding(0);
     panel22.Name                      = "panel22";
     panel22.Size                      = new System.Drawing.Size(162, 44);
     panel22.TabIndex                  = 19;
     tableLayoutPanel2.BackColor       = System.Drawing.Color.White;
     tableLayoutPanel2.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
     tableLayoutPanel2.ColumnCount     = 2;
     tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 162f));
     tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100f));
     tableLayoutPanel2.Controls.Add(panel22, 0, 1);
     tableLayoutPanel2.Controls.Add(panel2, 0, 0);
     tableLayoutPanel2.Controls.Add(panel3, 0, 2);
     tableLayoutPanel2.Controls.Add(l_inventoryCountTotal, 1, 1);
     tableLayoutPanel2.Controls.Add(flowLayoutPanel1, 1, 2);
     tableLayoutPanel2.Controls.Add(flowLayoutPanel2, 1, 0);
     tableLayoutPanel2.Location = new System.Drawing.Point(47, 17);
     tableLayoutPanel2.Name     = "tableLayoutPanel2";
     tableLayoutPanel2.RowCount = 3;
     tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 40f));
     tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25f));
     tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 35f));
     tableLayoutPanel2.Size         = new System.Drawing.Size(811, 182);
     tableLayoutPanel2.TabIndex     = 57;
     l_inventoryCountTotal.Anchor   = System.Windows.Forms.AnchorStyles.Left;
     l_inventoryCountTotal.AutoSize = true;
     l_inventoryCountTotal.Font     = new System.Drawing.Font("微軟正黑體", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 136);
     l_inventoryCountTotal.Location = new System.Drawing.Point(174, 85);
     l_inventoryCountTotal.Margin   = new System.Windows.Forms.Padding(10, 0, 3, 0);
     l_inventoryCountTotal.Name     = "l_inventoryCountTotal";
     l_inventoryCountTotal.Size     = new System.Drawing.Size(28, 20);
     l_inventoryCountTotal.TabIndex = 21;
     l_inventoryCountTotal.Text     = "{0}";
     l_title.AutoSize    = true;
     l_title.Font        = new System.Drawing.Font("微軟正黑體", 14.25f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 136);
     l_title.ImageAlign  = System.Drawing.ContentAlignment.MiddleLeft;
     l_title.Location    = new System.Drawing.Point(371, 208);
     l_title.Name        = "l_title";
     l_title.Size        = new System.Drawing.Size(162, 24);
     l_title.TabIndex    = 56;
     l_title.Text        = "近期庫存調整一覽";
     l_title.TextAlign   = System.Drawing.ContentAlignment.MiddleRight;
     btn_close.BackColor = System.Drawing.Color.FromArgb(175, 175, 175);
     btn_close.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     btn_close.Font      = new System.Drawing.Font("微軟正黑體", 12f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 136);
     btn_close.ForeColor = System.Drawing.Color.White;
     btn_close.Location  = new System.Drawing.Point(390, 507);
     btn_close.Name      = "btn_close";
     btn_close.Size      = new System.Drawing.Size(124, 34);
     btn_close.TabIndex  = 55;
     btn_close.TabStop   = false;
     btn_close.Text      = "關閉";
     btn_close.UseVisualStyleBackColor = false;
     btn_close.Click         += new System.EventHandler(btn_close_Click);
     Column1.AutoSizeMode     = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
     Column1.HeaderText       = "編修日期時間";
     Column1.MinimumWidth     = 120;
     Column1.Name             = "Column1";
     Column1.ReadOnly         = true;
     Column1.Resizable        = System.Windows.Forms.DataGridViewTriState.True;
     Column1.SortMode         = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
     Column1.Width            = 120;
     Column2.AutoSizeMode     = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
     Column2.HeaderText       = "類型/理由";
     Column2.Name             = "Column2";
     Column2.ReadOnly         = true;
     Column2.SortMode         = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
     Column4.HeaderText       = "退回/回收廠商";
     Column4.Name             = "Column4";
     Column4.ReadOnly         = true;
     Column4.Width            = 300;
     Column3.AutoSizeMode     = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
     Column3.HeaderText       = "數量";
     Column3.Name             = "Column3";
     Column3.ReadOnly         = true;
     Column3.SortMode         = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
     Column3.Width            = 56;
     base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
     base.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     AutoScroll      = true;
     BackColor       = System.Drawing.Color.Silver;
     base.ClientSize = new System.Drawing.Size(904, 576);
     base.ControlBox = false;
     base.Controls.Add(dataGridView1);
     base.Controls.Add(tableLayoutPanel2);
     base.Controls.Add(l_title);
     base.Controls.Add(btn_close);
     base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
     base.Name            = "dialogInventoryAdjustment";
     base.StartPosition   = System.Windows.Forms.FormStartPosition.CenterParent;
     Text       = "frmSearchMember";
     base.Load += new System.EventHandler(dialogSellPriceLog_Load);
     ((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
     flowLayoutPanel2.ResumeLayout(false);
     flowLayoutPanel2.PerformLayout();
     flowLayoutPanel1.ResumeLayout(false);
     flowLayoutPanel1.PerformLayout();
     panel3.ResumeLayout(false);
     panel3.PerformLayout();
     panel2.ResumeLayout(false);
     panel2.PerformLayout();
     panel22.ResumeLayout(false);
     panel22.PerformLayout();
     tableLayoutPanel2.ResumeLayout(false);
     tableLayoutPanel2.PerformLayout();
     ResumeLayout(false);
     PerformLayout();
 }
Example #16
0
        public QuestFlowPanel(Point mouseLocation, int ID, EventHandler clickedEvent, EventHandler panelClickedEvent)
        {
            panel                  = new FlowLayoutPanel();
            button                 = new Button();
            events                 = new CheckedListBox();
            conditions             = new CheckedListBox();
            speaker                = new ComboBox();
            sentence               = new TextBox();
            number                 = new Label();
            nextConversationNumber = new Label();
            //
            // questFlowPanel
            //
            panel.BackColor = Color.DarkSalmon;
            panel.Controls.Add(button);
            panel.Controls.Add(speaker);
            panel.Controls.Add(sentence);
            panel.Controls.Add(events);
            panel.Controls.Add(conditions);
            panel.Controls.Add(number);
            panel.Controls.Add(nextConversationNumber);
            panel.Location = mouseLocation;
            panel.Name     = "questFlowPanel";
            panel.Size     = new Size(230, 196);
            panel.TabIndex = 0;
            panel.Click   += new EventHandler(panelClickedEvent);
            //
            // questEvents
            //
            events.FormattingEnabled = true;
            events.Name = "questEvents";
            events.HorizontalScrollbar = true;
            events.ScrollAlwaysVisible = true;
            events.Size     = new Size(106, 60);
            events.TabIndex = 1;
            //
            // questConditions
            //
            conditions.FormattingEnabled = true;
            conditions.Name = "questConditions";
            conditions.HorizontalScrollbar = true;
            conditions.ScrollAlwaysVisible = true;
            conditions.Size     = new Size(109, 60);
            conditions.TabIndex = 2;
            //
            // questSpeaker
            //
            speaker.FormattingEnabled = true;
            speaker.Name = "questSpeaker";
            speaker.Items.AddRange(new object[] {
                "player"
            });
            speaker.Size     = new Size(99, 20);
            speaker.TabIndex = 6;
            //
            // questSentence
            //
            sentence.Multiline  = true;
            sentence.Name       = "questSentence";
            sentence.ScrollBars = ScrollBars.Vertical;
            sentence.Size       = new Size(221, 72);
            sentence.TabIndex   = 0;
            //
            // questConnectButton
            //
            button.Font     = new Font("MS UI Gothic", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(128)));
            button.Name     = "questConnectButton";
            button.Size     = new Size(75, 25);
            button.TabIndex = 3;
            button.Text     = "分岐させる";
            button.UseVisualStyleBackColor = true;
            button.Click += new EventHandler(clickedEvent);
            button.Show();
            //
            // conversationNumber
            //
            number.AutoSize = true;
            number.Font     = new System.Drawing.Font("MS UI Gothic", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
            number.Location = new System.Drawing.Point(102, 175);
            number.Name     = "conversationNumber";
            number.Size     = new System.Drawing.Size(15, 15);
            number.TabIndex = 4;
            number.Text     = ID.ToString();
            //
            // nextConversationNumber
            //
            nextConversationNumber.AutoSize = true;
            nextConversationNumber.Font     = new System.Drawing.Font("MS UI Gothic", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
            nextConversationNumber.Location = new System.Drawing.Point(123, 175);
            nextConversationNumber.Name     = "nextConversationNumber";
            nextConversationNumber.Size     = new System.Drawing.Size(45, 15);
            nextConversationNumber.TabIndex = 5;
            nextConversationNumber.Text     = "Next: ";


            panel.ResumeLayout(false);
            panel.PerformLayout();
        }
Example #17
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.mainPanel               = new System.Windows.Forms.FlowLayoutPanel();
            this.label1                  = new System.Windows.Forms.Label();
            this.panel2                  = new System.Windows.Forms.Panel();
            this.textBox3                = new System.Windows.Forms.TextBox();
            this.menuStrip1              = new System.Windows.Forms.MenuStrip();
            this.fileToolStripMenuItem   = new System.Windows.Forms.ToolStripMenuItem();
            this.importToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.mainPanel.SuspendLayout();
            this.panel2.SuspendLayout();
            this.menuStrip1.SuspendLayout();
            this.SuspendLayout();
            //
            // mainPanel
            //
            this.mainPanel.AutoScroll = true;
            this.mainPanel.Controls.Add(this.label1);
            this.mainPanel.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
            this.mainPanel.Location      = new System.Drawing.Point(12, 38);
            this.mainPanel.Name          = "mainPanel";
            this.mainPanel.Size          = new System.Drawing.Size(136, 400);
            this.mainPanel.TabIndex      = 0;
            //
            // label1
            //
            this.label1.Location  = new System.Drawing.Point(3, 0);
            this.label1.Name      = "label1";
            this.label1.Size      = new System.Drawing.Size(126, 78);
            this.label1.TabIndex  = 0;
            this.label1.Text      = "MACROS";
            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;

            for (int i = 0; i < NUMBER_OF_MACROS; i++)
            {
                //
                // button0
                //
                var button0 = new Button();
                button0.Location = new System.Drawing.Point(3, 81);
                button0.Name     = "button" + i;
                button0.Size     = new System.Drawing.Size(125, 23);
                button0.TabIndex = i * 2;
                button0.Text     = "Macro" + i;
                button0.UseVisualStyleBackColor = true;
                button0.Click     += new System.EventHandler(ButtonMacro_Click);
                button0.KeyPress  += Space_key_event;
                button0.MouseDown += new MouseEventHandler(RightClick);
                this.mainPanel.Controls.Add(button0);
                buttons.Add(button0);
                //
                // panel0
                //
                var panel0 = new FlowLayoutPanel();
                panel0.SuspendLayout();
                panel0.Location = new System.Drawing.Point(3, 110);
                panel0.Name     = "panel" + i;
                panel0.Size     = new System.Drawing.Size(130, 135);
                panel0.TabIndex = i * 2 + 1;
                panel0.Hide();
                panels.Add(panel0);

                for (int j = 0; j < NUMBER_OF_COMMANDS_PER_MACRO; j++)
                {
                    //
                    // textBox1
                    //
                    var textBox1 = new TextBox();
                    textBox1.Location   = new System.Drawing.Point(3, 3);
                    textBox1.Name       = "textBox" + i + "Index" + j;
                    textBox1.Size       = new System.Drawing.Size(119, 20);
                    textBox1.TabIndex   = j;
                    textBox1.KeyPress  += Enter_key_event;
                    textBox1.LostFocus += CommandTextBoxFocusLost;

                    panel0.Controls.Add(textBox1);
                }

                //
                // execute0
                //
                var execute0 = new Button();
                execute0.Location = new System.Drawing.Point(3, 107);
                execute0.Name     = "execute" + i;
                execute0.Size     = new System.Drawing.Size(119, 23);
                execute0.TabIndex = NUMBER_OF_COMMANDS_PER_MACRO;
                execute0.Text     = "Execute" + i;
                execute0.UseVisualStyleBackColor = true;
                execute0.Click += Execute_click;

                panel0.Controls.Add(execute0);
                panel0.ResumeLayout(false);
                panel0.PerformLayout();

                this.mainPanel.Controls.Add(panel0);
            }
            //
            // panel2
            //
            this.panel2.BackColor = System.Drawing.SystemColors.Control;
            this.panel2.Controls.Add(this.textBox3);
            this.panel2.Location = new System.Drawing.Point(154, 38);
            this.panel2.Name     = "panel2";
            this.panel2.Size     = new System.Drawing.Size(634, 400);
            this.panel2.TabIndex = 1;
            //
            // textBox3
            //
            this.textBox3.BackColor  = System.Drawing.Color.Black;
            this.textBox3.ForeColor  = System.Drawing.Color.White;
            this.textBox3.Location   = new System.Drawing.Point(3, 3);
            this.textBox3.Multiline  = true;
            this.textBox3.Name       = "textBox3";
            this.textBox3.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
            this.textBox3.Size       = new System.Drawing.Size(628, 394);
            this.textBox3.TabIndex   = 0;
            this.textBox3.KeyPress  += CheckConsolePressedKey;
            this.textBox3.KeyDown   += CheckConsoleDownKey;
            //
            // menuStrip1
            //
            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                this.fileToolStripMenuItem
            });
            this.menuStrip1.Location = new System.Drawing.Point(0, 0);
            this.menuStrip1.Name     = "menuStrip1";
            this.menuStrip1.Size     = new System.Drawing.Size(800, 24);
            this.menuStrip1.TabIndex = 3;
            this.menuStrip1.Text     = "menuStrip1";
            //
            // fileToolStripMenuItem
            //
            this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
                this.importToolStripMenuItem,
                this.exportToolStripMenuItem
            });
            this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
            this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
            this.fileToolStripMenuItem.Text = "File";
            //
            // importToolStripMenuItem
            //
            this.importToolStripMenuItem.Name   = "importToolStripMenuItem";
            this.importToolStripMenuItem.Size   = new System.Drawing.Size(119, 22);
            this.importToolStripMenuItem.Text   = "Import...";
            this.importToolStripMenuItem.Click += new System.EventHandler(this.ImportToolStripMenuItem_Click);
            //
            // exportToolStripMenuItem
            //
            this.exportToolStripMenuItem.Name   = "exportToolStripMenuItem";
            this.exportToolStripMenuItem.Size   = new System.Drawing.Size(119, 22);
            this.exportToolStripMenuItem.Text   = "Export...";
            this.exportToolStripMenuItem.Click += new System.EventHandler(this.ExportToolStripMenuItem_Click);
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize          = new System.Drawing.Size(800, 450);
            this.FormBorderStyle     = FormBorderStyle.FixedSingle;
            this.MaximizeBox         = false;
            this.MinimizeBox         = false;
            this.StartPosition       = FormStartPosition.CenterParent;

            this.Controls.Add(this.panel2);
            this.Controls.Add(this.mainPanel);
            this.Controls.Add(this.menuStrip1);
            this.MainMenuStrip = this.menuStrip1;
            this.Name          = "Form1";
            this.Text          = "JollyConsole";
            this.mainPanel.ResumeLayout(false);
            this.panel2.ResumeLayout(false);
            this.panel2.PerformLayout();
            this.menuStrip1.ResumeLayout(false);
            this.menuStrip1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();
        }
Example #18
0
        private void InitMyComponent()
        {
            string textboxNameBase   = "nameResultTextBox";
            string panelNameBase     = "nameCorrectPanel";
            string linkLabelNameBase = "nameCorrectLabel";
            string buttonNameBase    = "nameCorrectBtn1";

            blueTeamFlow.SuspendLayout();
            redTeamFlow.SuspendLayout();

            for (int i = 1; i <= 16; i++)
            {
                var outerFlowLayout = new FlowLayoutPanel();
                var nameTextBox     = new TextBox();
                var nameCorrectFlow = new FlowLayoutPanel();
                var textLabel       = new Label();
                var linkLabel       = new LinkLabel();
                var nameCorrectBtn  = new Button();

                outerFlowLayout.SuspendLayout();
                nameCorrectFlow.SuspendLayout();

                (i <= 8 ? redTeamFlow : blueTeamFlow).Controls.Add(outerFlowLayout);

                outerFlowLayout.Controls.Add(nameTextBox);
                outerFlowLayout.Controls.Add(nameCorrectFlow);
                outerFlowLayout.FlowDirection = FlowDirection.TopDown;
                outerFlowLayout.Location      = new Point(3, 0);
                outerFlowLayout.Margin        = new Padding(0, 0, 0, 0);
                outerFlowLayout.Name          = "outerFlowLayoutPanel" + i;
                outerFlowLayout.Size          = new Size(274, 41);
                outerFlowLayout.TabIndex      = (i - 1) % 8;

                nameTextBox.Location = new Point(0, 0);
                nameTextBox.Margin   = new Padding(0, 0, 0, 0);
                nameTextBox.Name     = textboxNameBase + i;
                nameTextBox.Size     = new Size(271, 20);
                nameTextBox.TabIndex = 0;

                nameCorrectFlow.Controls.Add(textLabel);
                nameCorrectFlow.Controls.Add(linkLabel);
                nameCorrectFlow.Controls.Add(nameCorrectBtn);
                nameCorrectFlow.Location = new Point(3, 20);
                nameCorrectFlow.Margin   = new Padding(3, 0, 3, 0);
                nameCorrectFlow.Name     = panelNameBase + i;
                nameCorrectFlow.Size     = new Size(271, 20);
                nameCorrectFlow.TabIndex = 1;
                nameCorrectFlow.Visible  = false;

                textLabel.Anchor    = AnchorStyles.Left;
                textLabel.AutoSize  = true;
                textLabel.Location  = new Point(0, 3);
                textLabel.Margin    = new Padding(0);
                textLabel.Name      = "textLabel" + i;
                textLabel.Size      = new Size(120, 13);
                textLabel.TabIndex  = 0;
                textLabel.Text      = "Not found did you mean";
                textLabel.TextAlign = ContentAlignment.MiddleCenter;

                linkLabel.Anchor       = AnchorStyles.Left;
                linkLabel.AutoSize     = true;
                linkLabel.Location     = new Point(120, 3);
                linkLabel.Margin       = new Padding(0);
                linkLabel.Name         = linkLabelNameBase + i;
                linkLabel.Size         = new Size(41, 13);
                linkLabel.TabIndex     = 1;
                linkLabel.TabStop      = true;
                linkLabel.Text         = "[Name]";
                linkLabel.LinkClicked += new LinkLabelLinkClickedEventHandler(CorrectLinkClicked);

                nameCorrectBtn.Font      = new Font("Microsoft Sans Serif", 7F, FontStyle.Bold, GraphicsUnit.Point, 0);
                nameCorrectBtn.Location  = new Point(161, 0);
                nameCorrectBtn.Margin    = new Padding(0);
                nameCorrectBtn.Name      = buttonNameBase + i;
                nameCorrectBtn.Size      = new Size(30, 20);
                nameCorrectBtn.TabIndex  = 2;
                nameCorrectBtn.Text      = "...";
                nameCorrectBtn.TextAlign = ContentAlignment.TopCenter;
                nameCorrectBtn.UseVisualStyleBackColor = true;
                nameCorrectBtn.Click += new EventHandler(CorrectButtonClicked);

                nameCorrectFlow.ResumeLayout(false);
                nameCorrectFlow.PerformLayout();
                outerFlowLayout.ResumeLayout(false);
                outerFlowLayout.PerformLayout();

                NameTextBoxes.Add(nameTextBox);
                NameCorrectPanels.Add(nameCorrectFlow);
                NameCorrectLinkLabels.Add(linkLabel);
                NameCorrectButtons.Add(nameCorrectBtn);
            }

            redTeamFlow.ResumeLayout(false);
            redTeamFlow.PerformLayout();
            blueTeamFlow.ResumeLayout(false);
            blueTeamFlow.PerformLayout();
        }
Example #19
0
        protected void InitializeComponent()
        {
            Add("name", "WWW_WWWWWWWWW", (ApplicationConfig s) => Tuple.Create(s.DisplayName, s.ColorName, s.FontSizeTitle), "{}");
            Add("life", "9999/9999", (ApplicationConfig s) => Tuple.Create(s.DisplayLife, s.ColorLife, s.FontSize), "LIFE: {}/{}");
            Add("mana", "9999/9999", (ApplicationConfig s) => Tuple.Create(s.DisplayMana, s.ColorMana, s.FontSize), "MANA: {}/{}");
            Add("hc_sc", "HARDCORE", (ApplicationConfig s) => Tuple.Create(s.DisplayHardcoreSoftcore, s.ColorHardcoreSoftcore, s.FontSize), "{}");
            Add("exp_classic", "EXPANSION", (ApplicationConfig s) => Tuple.Create(s.DisplayExpansionClassic, s.ColorExpansionClassic, s.FontSize), "{}");
            Add("playersx", "8", (ApplicationConfig s) => Tuple.Create(s.DisplayPlayersX, s.ColorPlayersX, s.FontSize), "/players {}");
            Add("seed", "4294967295", (ApplicationConfig s) => Tuple.Create(s.DisplaySeed, s.ColorSeed, s.FontSize), "SEED: {}");
            Add("deaths", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayDeathCounter, s.ColorDeaths, s.FontSize), "DEATHS: {}");
            Add("runs", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayGameCounter, s.ColorGameCounter, s.FontSize), "RUNS: {}");
            Add("chars", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayCharCounter, s.ColorCharCounter, s.FontSize), "CHARS: {}");
            Add("gold", "2500000", (ApplicationConfig s) => Tuple.Create(s.DisplayGold, s.ColorGold, s.FontSize), "GOLD: {}");
            Add("mf", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayMagicFind, s.ColorMagicFind, s.FontSize), "MF: {}");
            Add("monstergold", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayMonsterGold, s.ColorMonsterGold, s.FontSize), "EMG: {}");
            Add("atd", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayAttackerSelfDamage, s.ColorAttackerSelfDamage, s.FontSize), "ATD: {}");
            Add("lvl", "99", (ApplicationConfig s) => Tuple.Create(s.DisplayLevel, s.ColorLevel, s.FontSize), "LVL: {}");
            Add("str", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayBaseStats, s.ColorBaseStats, s.FontSize), "STR:", "{}");
            Add("vit", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayBaseStats, s.ColorBaseStats, s.FontSize), "VIT:", "{}");
            Add("dex", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayBaseStats, s.ColorBaseStats, s.FontSize), "DEX:", "{}");
            Add("ene", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayBaseStats, s.ColorBaseStats, s.FontSize), "ENE:", "{}");
            Add("ias", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayAdvancedStats, s.ColorAdvancedStats, s.FontSize), "IAS:", "{}");
            Add("frw", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayAdvancedStats, s.ColorAdvancedStats, s.FontSize), "FRW:", "{}");
            Add("fcr", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayAdvancedStats, s.ColorAdvancedStats, s.FontSize), "FCR:", "{}");
            Add("fhr", "999", (ApplicationConfig s) => Tuple.Create(s.DisplayAdvancedStats, s.ColorAdvancedStats, s.FontSize), "FHR:", "{}");
            Add("cold", "100", (ApplicationConfig s) => Tuple.Create(s.DisplayResistances, s.ColorColdRes, s.FontSize), "COLD:", "{}");
            Add("ligh", "100", (ApplicationConfig s) => Tuple.Create(s.DisplayResistances, s.ColorLightningRes, s.FontSize), "LIGH:", "{}");
            Add("pois", "100", (ApplicationConfig s) => Tuple.Create(s.DisplayResistances, s.ColorPoisonRes, s.FontSize), "POIS:", "{}");
            Add("fire", "100", (ApplicationConfig s) => Tuple.Create(s.DisplayResistances, s.ColorFireRes, s.FontSize), "FIRE:", "{}");
            Add("norm", "100", (ApplicationConfig s) => Tuple.Create(s.DisplayDifficultyPercentages, s.ColorDifficultyPercentages, s.FontSize), "NORM:", "{}%");
            Add("nm", "100", (ApplicationConfig s) => Tuple.Create(s.DisplayDifficultyPercentages, s.ColorDifficultyPercentages, s.FontSize), "NM:", "{}%");
            Add("hell", "100", (ApplicationConfig s) => Tuple.Create(s.DisplayDifficultyPercentages, s.ColorDifficultyPercentages, s.FontSize), "HELL:", "{}%");
            Add("norm_inline", "100", (ApplicationConfig s) => Tuple.Create(s.DisplayDifficultyPercentages, s.ColorDifficultyPercentages, s.FontSize), "NO: {}%");
            Add("nm_inline", "100", (ApplicationConfig s) => Tuple.Create(s.DisplayDifficultyPercentages, s.ColorDifficultyPercentages, s.FontSize), "NM: {}%");
            Add("hell_inline", "100", (ApplicationConfig s) => Tuple.Create(s.DisplayDifficultyPercentages, s.ColorDifficultyPercentages, s.FontSize), "HE: {}%");

            // display multiple "things" in 1 row (a table with 1 row and x columns)
            TableLayoutPanel rowthing(params string[] names)
            {
                var t = new TableLayoutPanel();

                t.SuspendLayout();
                t.Anchor       = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
                t.AutoSize     = true;
                t.AutoSizeMode = AutoSizeMode.GrowAndShrink;
                t.ColumnCount  = names.Length;
                int i = 0;

                foreach (string n in names)
                {
                    t.ColumnStyles.Add(new ColumnStyle());
                    t.Controls.Add(def[n].labels[0], i++, 0);
                }
                t.Margin   = new Padding(0);
                t.RowCount = 1;
                t.RowStyles.Add(new RowStyle());
                t.ResumeLayout(false);
                return(t);
            }

            // display multiple "things" in a table. where each thing is displayed in 1 row
            // and each feature of the thing is displayed in a column
            // each thing must have the same number of columns for this to work
            TableLayoutPanel tablething(params string[] names)
            {
                var t = new TableLayoutPanel();

                t.SuspendLayout();
                t.RowCount    = 0;
                t.ColumnCount = def[names[0]].labels.Length;
                for (int i = 0; i < def[names[0]].labels.Length; i++)
                {
                    t.ColumnStyles.Add(new ColumnStyle());
                }
                foreach (string n in names)
                {
                    t.RowCount++;
                    t.RowStyles.Add(new RowStyle());
                    int c = 0;
                    foreach (Label l in def[n].labels)
                    {
                        t.Controls.Add(l, c, t.RowCount - 1);
                        c++;
                    }
                }
                t.Margin   = new Padding(0);
                t.AutoSize = true;
                t.ResumeLayout(false);
                return(t);
            }

            this.panelBaseStats        = tablething("str", "dex", "vit", "ene");
            this.panelAdvancedStats    = tablething("frw", "fhr", "fcr", "ias");
            this.panelResistances      = tablething("fire", "cold", "ligh", "pois");
            this.panelDiffPercentages  = tablething("norm", "nm", "hell");
            this.panelDiffPercentages2 = rowthing("norm_inline", "nm_inline", "hell_inline");

            this.panelRuneDisplayVertical              = new FlowLayoutPanel();
            this.panelRuneDisplayVertical.Anchor       = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            this.panelRuneDisplayVertical.AutoSize     = true;
            this.panelRuneDisplayVertical.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            this.panelRuneDisplayVertical.Margin       = new Padding(0);
            this.panelRuneDisplayVertical.MaximumSize  = new Size(28, 0);
            this.panelRuneDisplayVertical.MinimumSize  = new Size(28, 28);

            this.panelRuneDisplayHorizontal              = new FlowLayoutPanel();
            this.panelRuneDisplayHorizontal.Anchor       = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            this.panelRuneDisplayHorizontal.AutoSize     = true;
            this.panelRuneDisplayHorizontal.AutoSizeMode = AutoSizeMode.GrowAndShrink;

            this.panelStats = new FlowLayoutPanel();
            this.panelStats.SuspendLayout();
            this.panelStats.Anchor       = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            this.panelStats.AutoSize     = true;
            this.panelStats.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            this.panelStats.Controls.Add(this.panelBaseStats);
            this.panelStats.Controls.Add(this.panelAdvancedStats);
            this.panelStats.Controls.Add(this.panelResistances);
            this.panelStats.Controls.Add(this.panelDiffPercentages);
            this.panelStats.Margin = new Padding(0);

            this.flowLayoutPanel1 = new FlowLayoutPanel();
            this.flowLayoutPanel1.SuspendLayout();
            this.flowLayoutPanel1.AutoSize = true;
            this.flowLayoutPanel1.Controls.Add(def["name"].labels[0]);
            this.flowLayoutPanel1.Controls.Add(rowthing("life", "mana"));
            this.flowLayoutPanel1.Controls.Add(rowthing("hc_sc", "exp_classic", "playersx"));
            this.flowLayoutPanel1.Controls.Add(def["seed"].labels[0]);
            this.flowLayoutPanel1.Controls.Add(rowthing("lvl", "deaths", "runs", "chars"));
            this.flowLayoutPanel1.Controls.Add(rowthing("atd", "monstergold"));
            this.flowLayoutPanel1.Controls.Add(rowthing("gold", "mf"));
            this.flowLayoutPanel1.Controls.Add(panelStats);
            this.flowLayoutPanel1.Controls.Add(panelDiffPercentages2);
            this.flowLayoutPanel1.Controls.Add(panelRuneDisplayHorizontal);
            this.flowLayoutPanel1.FlowDirection = FlowDirection.TopDown;
            this.flowLayoutPanel1.Margin        = new Padding(0);

            this.outerLeftRightPanel = new FlowLayoutPanel();
            this.outerLeftRightPanel.SuspendLayout();
            this.outerLeftRightPanel.AutoSize     = true;
            this.outerLeftRightPanel.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            this.outerLeftRightPanel.Controls.Add(this.panelRuneDisplayVertical);
            this.outerLeftRightPanel.Controls.Add(this.flowLayoutPanel1);
            this.outerLeftRightPanel.Dock    = DockStyle.Fill;
            this.outerLeftRightPanel.Margin  = new Padding(0);
            this.outerLeftRightPanel.Padding = new Padding(0);

            SuspendLayout();
            AutoScaleDimensions = new SizeF(6F, 13F);
            AutoScaleMode       = AutoScaleMode.Font;
            AutoSize            = true;
            AutoSizeMode        = AutoSizeMode.GrowAndShrink;
            Margin    = new Padding(0);
            BackColor = Color.Black;
            Controls.Add(this.outerLeftRightPanel);
            Name = "HorizontalLayout";
            outerLeftRightPanel.ResumeLayout(false);
            outerLeftRightPanel.PerformLayout();
            flowLayoutPanel1.ResumeLayout(false);
            flowLayoutPanel1.PerformLayout();
            panelStats.ResumeLayout(false);
            panelBaseStats.ResumeLayout(false);
            panelBaseStats.PerformLayout();
            panelAdvancedStats.ResumeLayout(false);
            panelAdvancedStats.PerformLayout();
            panelResistances.ResumeLayout(false);
            panelResistances.PerformLayout();
            ResumeLayout(false);
            PerformLayout();

            RunePanels = new[]
            {
                panelRuneDisplayHorizontal,
                panelRuneDisplayVertical
            };
        }
Example #20
0
        private void Init()
        {
            //
            // general information panel
            //
            BackColor   = Color.WhiteSmoke;
            ColumnCount = 1;
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
            Controls.Add(flowLayoutGeneralTopic, 0, 0);
            Controls.Add(flowLayoutGeneralAuthor, 0, 1);
            Controls.Add(flowLayoutGeneralDate, 0, 2);
            Controls.Add(flowLayoutGeneralVersion, 0, 3);
            Dock     = DockStyle.Fill;
            Location = new Point(4, 4);
            Margin   = new Padding(4);
            Name     = "tableLayoutMainContentGeneral";
            RowCount = 4;
            RowStyles.Add(new RowStyle(SizeType.Percent, 10F));
            RowStyles.Add(new RowStyle(SizeType.Percent, 10F));
            RowStyles.Add(new RowStyle(SizeType.Percent, 10F));
            RowStyles.Add(new RowStyle(SizeType.Percent, 70F));
            Size     = new Size(760, 482);
            TabIndex = 20;
            //
            // flowLayoutGeneralAuthor
            //
            flowLayoutGeneralAuthor.Controls.Add(authorLabel);
            flowLayoutGeneralAuthor.Controls.Add(TextAuthor);
            flowLayoutGeneralAuthor.Dock     = DockStyle.Fill;
            flowLayoutGeneralAuthor.Location = new Point(4, 52);
            flowLayoutGeneralAuthor.Margin   = new Padding(4);
            flowLayoutGeneralAuthor.Name     = "flowLayoutGeneralAuthor";
            flowLayoutGeneralAuthor.Size     = new Size(752, 40);
            flowLayoutGeneralAuthor.TabIndex = 22;
            //
            // label2
            //
            authorLabel.AutoSize    = true;
            authorLabel.Dock        = DockStyle.Left;
            authorLabel.Font        = new Font("Calibri", 12F, FontStyle.Regular, GraphicsUnit.Point, 0);
            authorLabel.Location    = new Point(5, 6);
            authorLabel.Margin      = new Padding(5, 6, 5, 6);
            authorLabel.MinimumSize = new Size(100, 27);
            authorLabel.Name        = "label2";
            authorLabel.Size        = new Size(100, 27);
            authorLabel.TabIndex    = 15;
            authorLabel.Text        = "Author";
            authorLabel.TextAlign   = ContentAlignment.MiddleLeft;
            //
            // textAuthor
            //
            TextAuthor.Font     = new Font("Calibri", 12F, FontStyle.Regular, GraphicsUnit.Point, 0);
            TextAuthor.Location = new Point(215, 6);
            TextAuthor.Margin   = new Padding(5, 6, 5, 6);
            TextAuthor.Name     = "textAuthor";
            TextAuthor.Size     = new Size(600, 27);
            TextAuthor.TabIndex = 3;
            //
            // flowLayoutGeneralTopic
            //
            flowLayoutGeneralTopic.Controls.Add(topicLabel);
            flowLayoutGeneralTopic.Controls.Add(TextDecisionTopic);
            flowLayoutGeneralTopic.Dock     = DockStyle.Fill;
            flowLayoutGeneralTopic.Location = new Point(4, 4);
            flowLayoutGeneralTopic.Margin   = new Padding(4);
            flowLayoutGeneralTopic.Name     = "flowLayoutGeneralTopic";
            flowLayoutGeneralTopic.Size     = new Size(752, 40);
            flowLayoutGeneralTopic.TabIndex = 21;
            //
            // label1
            //
            topicLabel.AutoSize    = true;
            topicLabel.Dock        = DockStyle.Left;
            topicLabel.Font        = new Font("Calibri", 12F, FontStyle.Regular, GraphicsUnit.Point, 0);
            topicLabel.Location    = new Point(5, 6);
            topicLabel.Margin      = new Padding(5, 6, 5, 6);
            topicLabel.MinimumSize = new Size(100, 27);
            topicLabel.Name        = "label1";
            topicLabel.Size        = new Size(100, 27);
            topicLabel.TabIndex    = 16;
            topicLabel.Text        = "Topic";
            topicLabel.TextAlign   = ContentAlignment.MiddleLeft;
            //
            // textDecisionTopic
            //
            TextDecisionTopic.Font     = new Font("Calibri", 12F, FontStyle.Regular, GraphicsUnit.Point, 0);
            TextDecisionTopic.Location = new Point(215, 6);
            TextDecisionTopic.Margin   = new Padding(5, 6, 5, 6);
            TextDecisionTopic.Name     = "textDecisionTopic";
            TextDecisionTopic.Size     = new Size(600, 27);
            TextDecisionTopic.TabIndex = 2;
            //
            // flowLayoutGeneralDate
            //
            flowLayoutGeneralDate.Controls.Add(dateLabel);
            flowLayoutGeneralDate.Controls.Add(DateTimePickerCreationDate);
            flowLayoutGeneralDate.Dock     = DockStyle.Fill;
            flowLayoutGeneralDate.Location = new Point(3, 99);
            flowLayoutGeneralDate.Name     = "flowLayoutGeneralDate";
            flowLayoutGeneralDate.Size     = new Size(754, 42);
            flowLayoutGeneralDate.TabIndex = 23;
            //
            // label3
            //
            dateLabel.AutoSize    = true;
            dateLabel.Dock        = DockStyle.Left;
            dateLabel.Font        = new Font("Calibri", 12F, FontStyle.Regular, GraphicsUnit.Point, 0);
            dateLabel.Location    = new Point(5, 6);
            dateLabel.Margin      = new Padding(5, 6, 5, 6);
            dateLabel.MinimumSize = new Size(100, 27);
            dateLabel.Name        = "label3";
            dateLabel.Size        = new Size(100, 27);
            dateLabel.TabIndex    = 17;
            dateLabel.Text        = "Date";
            dateLabel.TextAlign   = ContentAlignment.MiddleLeft;
            //
            // dateTimePickerCreationDate
            //
            DateTimePickerCreationDate.Location = new Point(216, 6);
            DateTimePickerCreationDate.Margin   = new Padding(6, 6, 5, 6);
            DateTimePickerCreationDate.Name     = "dateTimePickerCreationDate";
            DateTimePickerCreationDate.Size     = new Size(600, 27);
            DateTimePickerCreationDate.TabIndex = 3;

            //
            // flowLayoutGeneralVersion
            //
            flowLayoutGeneralVersion.Controls.Add(versionLabel);
            flowLayoutGeneralVersion.Controls.Add(TextVersion);
            flowLayoutGeneralVersion.Dock     = DockStyle.Fill;
            flowLayoutGeneralVersion.Location = new Point(4, 149);
            flowLayoutGeneralVersion.Margin   = new Padding(4);
            flowLayoutGeneralVersion.Name     = "flowLayoutGeneralVersion";
            flowLayoutGeneralVersion.Size     = new Size(752, 40);
            flowLayoutGeneralVersion.TabIndex = 25;
            //
            // versionlabel
            //
            versionLabel.AutoSize    = true;
            versionLabel.Dock        = DockStyle.Left;
            versionLabel.Font        = new Font("Calibri", 12F, FontStyle.Regular, GraphicsUnit.Point, 0);
            versionLabel.Location    = new Point(5, 6);
            versionLabel.Margin      = new Padding(5, 6, 5, 6);
            versionLabel.MinimumSize = new Size(100, 27);
            versionLabel.Name        = "versionLabel";
            versionLabel.Size        = new Size(100, 27);
            versionLabel.TabIndex    = 16;
            versionLabel.Text        = "Version";
            versionLabel.TextAlign   = ContentAlignment.MiddleLeft;
            //
            // textversion
            //
            TextVersion.Font     = new Font("Calibri", 12F, FontStyle.Regular, GraphicsUnit.Point, 0);
            TextVersion.Location = new Point(215, 6);
            TextVersion.Margin   = new Padding(5, 6, 5, 6);
            TextVersion.Name     = "textDecisionVersion";
            TextVersion.Size     = new Size(600, 27);
            TextVersion.TabIndex = 2;


            flowLayoutGeneralAuthor.ResumeLayout(false);
            flowLayoutGeneralAuthor.PerformLayout();
            flowLayoutGeneralTopic.ResumeLayout(false);
            flowLayoutGeneralTopic.PerformLayout();
            flowLayoutGeneralDate.ResumeLayout(false);
            flowLayoutGeneralDate.PerformLayout();
            flowLayoutGeneralVersion.ResumeLayout(false);
            flowLayoutGeneralVersion.PerformLayout();
        }
Example #21
0
 /// <summary>
 ///
 /// </summary>
 private void InitializeComponent()
 {
     formPanel1            = new TableLayoutPanel();
     bookPanel             = new TableLayoutPanel();
     bookStockLabel        = new FlatLabel();
     bookGuidLabel         = new FlatLabel();
     bookTitleLabel        = new FlatLabel();
     bookPriceLabel        = new FlatLabel();
     bookGuid              = new TextBox();
     bookTitle             = new ComboBox();
     bookPricePanel        = new TableLayoutPanel();
     currencyLabel1        = new FlatBadge();
     bookPrice             = new Label();
     bookStockPanel        = new TableLayoutPanel();
     unitLabel1            = new FlatBadge();
     bookStock             = new Label();
     customerPanel         = new TableLayoutPanel();
     customerNamePanel     = new FlowLayoutPanel();
     customerName          = new ComboBox();
     customerNameButton    = new Button();
     customerLocationLabel = new FlatLabel();
     customerGuidLabel     = new FlatLabel();
     customerNameLabel     = new FlatLabel();
     customerEmailLabel    = new FlatLabel();
     customerGuid          = new TextBox();
     customerEmail         = new Label();
     customerLocation      = new Label();
     customerLabel         = new FlatHeader();
     bookLabel             = new FlatHeader();
     formPanel2            = new TableLayoutPanel();
     orderPanel            = new TableLayoutPanel();
     statusLabel           = new FlatLabel();
     orderQuantityLabel    = new FlatLabel();
     orderTotalPanel       = new TableLayoutPanel();
     currencyLabel2        = new FlatBadge();
     orderTotal            = new Label();
     orderTotalLabel       = new FlatLabel();
     orderQuantityPanel    = new TableLayoutPanel();
     unitLabel2            = new FlatBadge();
     orderQuantityInfo     = new Label();
     orderQuantity         = new TrackBar();
     statusPanel           = new FlowLayoutPanel();
     statusWaiting         = new RadioButton();
     statusProcessing      = new RadioButton();
     statusDispatched      = new RadioButton();
     buttonPanel           = new FlowLayoutPanel();
     buttonCancel          = new FlatButton();
     buttonConfirm         = new FlatButton();
     orderLabel            = new FlatHeader();
     formPanel1.SuspendLayout();
     bookPanel.SuspendLayout();
     bookPricePanel.SuspendLayout();
     bookStockPanel.SuspendLayout();
     customerPanel.SuspendLayout();
     customerNamePanel.SuspendLayout();
     formPanel2.SuspendLayout();
     orderPanel.SuspendLayout();
     orderTotalPanel.SuspendLayout();
     orderQuantityPanel.SuspendLayout();
     orderQuantity.BeginInit();
     statusPanel.SuspendLayout();
     buttonPanel.SuspendLayout();
     SuspendLayout();
     //
     // formPanel1
     //
     formPanel1.BackColor   = SystemColors.ControlDark;
     formPanel1.ColumnCount = 2;
     formPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
     formPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
     formPanel1.Controls.Add(customerLabel, 0, 0);
     formPanel1.Controls.Add(customerPanel, 0, 1);
     formPanel1.Controls.Add(bookLabel, 1, 0);
     formPanel1.Controls.Add(bookPanel, 1, 1);
     formPanel1.Dock     = DockStyle.Top;
     formPanel1.Location = new Point(0, 0);
     formPanel1.Name     = "formPanel1";
     formPanel1.RowCount = 2;
     formPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 27F));
     formPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
     formPanel1.Size = new Size(624, 160);
     //
     // bookPanel
     //
     bookPanel.BackColor       = Color.Gainsboro;
     bookPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
     bookPanel.ColumnCount     = 2;
     bookPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 60F));
     bookPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
     bookPanel.Controls.Add(bookGuidLabel, 0, 0);
     bookPanel.Controls.Add(bookGuid, 1, 0);
     bookPanel.Controls.Add(bookTitleLabel, 0, 1);
     bookPanel.Controls.Add(bookTitle, 1, 1);
     bookPanel.Controls.Add(bookPriceLabel, 0, 2);
     bookPanel.Controls.Add(bookPricePanel, 1, 2);
     bookPanel.Controls.Add(bookStockLabel, 0, 3);
     bookPanel.Controls.Add(bookStockPanel, 1, 3);
     bookPanel.Dock     = DockStyle.Fill;
     bookPanel.Location = new Point(312, 27);
     bookPanel.Margin   = new Padding(0);
     bookPanel.Name     = "bookPanel";
     bookPanel.Padding  = new Padding(2, 4, 4, 4);
     bookPanel.RowCount = 4;
     bookPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
     bookPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
     bookPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
     bookPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
     bookPanel.Size = new Size(312, 133);
     //
     // bookStockLabel
     //
     bookStockLabel.Location = new Point(3, 98);
     bookStockLabel.Name     = "bookStockLabel";
     bookStockLabel.Size     = new Size(60, 30);
     bookStockLabel.Text     = "Stock";
     //
     // bookGuidLabel
     //
     bookGuidLabel.Location = new Point(3, 5);
     bookGuidLabel.Name     = "bookGuidLabel";
     bookGuidLabel.Size     = new Size(60, 30);
     bookGuidLabel.Text     = "GUID";
     //
     // bookTitleLabel
     //
     bookTitleLabel.Location = new Point(3, 36);
     bookTitleLabel.Name     = "bookTitleLabel";
     bookTitleLabel.Size     = new Size(60, 30);
     bookTitleLabel.Text     = "Title";
     //
     // bookPriceLabel
     //
     bookPriceLabel.Location = new Point(3, 67);
     bookPriceLabel.Name     = "bookPriceLabel";
     bookPriceLabel.Size     = new Size(60, 30);
     bookPriceLabel.Text     = "Price";
     //
     // bookGuid
     //
     bookGuid.Anchor           = AnchorStyles.Left | AnchorStyles.Right;
     bookGuid.Enabled          = false;
     bookGuid.Location         = new Point(68, 10);
     bookGuid.Margin           = new Padding(4);
     bookGuid.Name             = "bookGuid";
     bookGuid.ReadOnly         = true;
     bookGuid.ShortcutsEnabled = false;
     bookGuid.Size             = new Size(235, 20);
     //
     // bookTitle
     //
     bookTitle.Anchor                = AnchorStyles.Left | AnchorStyles.Right;
     bookTitle.DropDownStyle         = ComboBoxStyle.DropDownList;
     bookTitle.Location              = new Point(68, 40);
     bookTitle.Margin                = new Padding(4);
     bookTitle.Name                  = "bookTitle";
     bookTitle.Size                  = new Size(235, 21);
     bookTitle.TabIndex              = 4;
     bookTitle.SelectedIndexChanged += new EventHandler(BookTitle_SelectedIndexChanged);
     //
     // bookPricePanel
     //
     bookPricePanel.ColumnCount = 2;
     bookPricePanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
     bookPricePanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 32F));
     bookPricePanel.Controls.Add(bookPrice, 0, 0);
     bookPricePanel.Controls.Add(currencyLabel1, 1, 0);
     bookPricePanel.Dock     = DockStyle.Fill;
     bookPricePanel.Location = new Point(67, 70);
     bookPricePanel.Name     = "bookPricePanel";
     bookPricePanel.RowCount = 1;
     bookPricePanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
     bookPricePanel.Size = new Size(237, 24);
     //
     // currencyLabel1
     //
     currencyLabel1.Location = new Point(208, 0);
     currencyLabel1.Name     = "currencyLabel1";
     currencyLabel1.Size     = new Size(26, 24);
     currencyLabel1.Text     = "€";
     //
     // bookPrice
     //
     bookPrice.Dock      = DockStyle.Fill;
     bookPrice.Location  = new Point(3, 0);
     bookPrice.Name      = "bookPrice";
     bookPrice.Size      = new Size(199, 24);
     bookPrice.Text      = "0,00";
     bookPrice.TextAlign = ContentAlignment.MiddleRight;
     //
     // bookStockPanel
     //
     bookStockPanel.ColumnCount = 2;
     bookStockPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
     bookStockPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 32F));
     bookStockPanel.Controls.Add(bookStock, 0, 0);
     bookStockPanel.Controls.Add(unitLabel1, 1, 0);
     bookStockPanel.Dock     = DockStyle.Fill;
     bookStockPanel.Location = new Point(67, 101);
     bookStockPanel.Name     = "bookStockPanel";
     bookStockPanel.RowCount = 1;
     bookStockPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
     bookStockPanel.Size = new Size(237, 24);
     //
     // unitLabel1
     //
     unitLabel1.Location = new Point(208, 0);
     unitLabel1.Name     = "unitLabel1";
     unitLabel1.Size     = new Size(26, 24);
     unitLabel1.Text     = "Un";
     //
     // bookStock
     //
     bookStock.Dock      = DockStyle.Fill;
     bookStock.Location  = new Point(3, 0);
     bookStock.Name      = "bookStock";
     bookStock.Size      = new Size(199, 24);
     bookStock.Text      = "0";
     bookStock.TextAlign = ContentAlignment.MiddleRight;
     //
     // customerPanel
     //
     customerPanel.BackColor       = Color.Gainsboro;
     customerPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
     customerPanel.ColumnCount     = 2;
     customerPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 60F));
     customerPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
     customerPanel.Controls.Add(customerGuidLabel, 0, 0);
     customerPanel.Controls.Add(customerGuid, 1, 0);
     customerPanel.Controls.Add(customerNameLabel, 0, 1);
     customerPanel.Controls.Add(customerNamePanel, 1, 1);
     customerPanel.Controls.Add(customerEmailLabel, 0, 2);
     customerPanel.Controls.Add(customerEmail, 1, 2);
     customerPanel.Controls.Add(customerLocationLabel, 0, 3);
     customerPanel.Controls.Add(customerLocation, 1, 3);
     customerPanel.Dock     = DockStyle.Fill;
     customerPanel.Location = new Point(0, 27);
     customerPanel.Margin   = new Padding(0);
     customerPanel.Name     = "customerPanel";
     customerPanel.Padding  = new Padding(4, 4, 2, 4);
     customerPanel.RowCount = 4;
     customerPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
     customerPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
     customerPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
     customerPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
     customerPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 20F));
     customerPanel.Size = new Size(312, 133);
     //
     // customerEmail
     //
     customerEmail.Dock      = DockStyle.Fill;
     customerEmail.Location  = new Point(70, 71);
     customerEmail.Margin    = new Padding(4);
     customerEmail.Name      = "customerEmail";
     customerEmail.Size      = new Size(235, 22);
     customerEmail.TextAlign = ContentAlignment.MiddleLeft;
     //
     // customerEmailLabel
     //
     customerEmailLabel.Location = new Point(5, 67);
     customerEmailLabel.Name     = "customerEmailLabel";
     customerEmailLabel.Size     = new Size(60, 30);
     customerEmailLabel.Text     = "E-mail";
     //
     // customerGuid
     //
     customerGuid.Anchor   = AnchorStyles.Left | AnchorStyles.Right;
     customerGuid.Enabled  = false;
     customerGuid.Location = new Point(70, 10);
     customerGuid.Margin   = new Padding(4);
     customerGuid.Name     = "customerGuid";
     customerGuid.ReadOnly = true;
     customerGuid.Size     = new Size(235, 20);
     //
     // customerGuidLabel
     //
     customerGuidLabel.Location = new Point(5, 5);
     customerGuidLabel.Name     = "customerGuidLabel";
     customerGuidLabel.Size     = new Size(60, 30);
     customerGuidLabel.Text     = "GUID";
     //
     // customerLocation
     //
     customerLocation.Dock      = DockStyle.Fill;
     customerLocation.Location  = new Point(70, 102);
     customerLocation.Margin    = new Padding(4);
     customerLocation.Name      = "customerLocation";
     customerLocation.Size      = new Size(235, 22);
     customerLocation.TextAlign = ContentAlignment.MiddleLeft;
     //
     // customerLocationLabel
     //
     customerLocationLabel.Location = new Point(5, 98);
     customerLocationLabel.Name     = "customerLocationLabel";
     customerLocationLabel.Size     = new Size(60, 30);
     customerLocationLabel.Text     = "Location";
     //
     // customerName
     //
     customerName.Anchor                = AnchorStyles.Left | AnchorStyles.Right;
     customerName.DropDownStyle         = ComboBoxStyle.DropDownList;
     customerName.Location              = new Point(0, 1);
     customerName.Margin                = new Padding(0);
     customerName.Name                  = "customerName";
     customerName.Size                  = new Size(205, 21);
     customerName.TabIndex              = 2;
     customerName.SelectedIndexChanged += new EventHandler(CustomerName_SelectedIndexChanged);
     //
     // customerNameButton
     //
     customerNameButton.Location = new Point(205, 0);
     customerNameButton.Margin   = new Padding(0);
     customerNameButton.Name     = "customerNameButton";
     customerNameButton.Size     = new Size(32, 23);
     customerNameButton.TabIndex = 3;
     customerNameButton.Text     = "...";
     customerNameButton.Click   += new EventHandler(CustomerNameButton_Click);
     //
     // customerNameLabel
     //
     customerNameLabel.Location = new Point(5, 36);
     customerNameLabel.Name     = "customerNameLabel";
     customerNameLabel.Size     = new Size(60, 30);
     customerNameLabel.Text     = "Name";
     //
     // customerNamePanel
     //
     customerNamePanel.Controls.Add(customerName);
     customerNamePanel.Controls.Add(customerNameButton);
     customerNamePanel.Dock     = DockStyle.Fill;
     customerNamePanel.Location = new Point(69, 39);
     customerNamePanel.Name     = "customerNamePanel";
     customerNamePanel.Size     = new Size(237, 24);
     //
     // customerLabel
     //
     customerLabel.Location = new Point(2, 2);
     customerLabel.Name     = "customerLabel";
     customerLabel.Size     = new Size(308, 23);
     customerLabel.Text     = "Customer";
     //
     // bookLabel
     //
     bookLabel.Location = new Point(314, 2);
     bookLabel.Name     = "bookLabel";
     bookLabel.Size     = new Size(308, 23);
     bookLabel.Text     = "Book";
     //
     // formPanel2
     //
     formPanel2.BackColor   = SystemColors.ControlDark;
     formPanel2.ColumnCount = 1;
     formPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
     formPanel2.Controls.Add(orderLabel, 0, 0);
     formPanel2.Controls.Add(orderPanel, 0, 1);
     formPanel2.Controls.Add(buttonPanel, 0, 2);
     formPanel2.Dock     = DockStyle.Fill;
     formPanel2.Location = new Point(0, 160);
     formPanel2.Name     = "formPanel2";
     formPanel2.RowCount = 3;
     formPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 27F));
     formPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
     formPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 34F));
     formPanel2.Size = new Size(624, 221);
     //
     // orderPanel
     //
     orderPanel.BackColor       = Color.Gainsboro;
     orderPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
     orderPanel.ColumnCount     = 2;
     orderPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 60F));
     orderPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
     orderPanel.Controls.Add(orderQuantityLabel, 0, 0);
     orderPanel.Controls.Add(orderQuantityPanel, 1, 0);
     orderPanel.Controls.Add(orderTotalLabel, 0, 1);
     orderPanel.Controls.Add(orderTotalPanel, 1, 1);
     orderPanel.Controls.Add(statusLabel, 0, 2);
     orderPanel.Controls.Add(statusPanel, 1, 2);
     orderPanel.Dock     = DockStyle.Fill;
     orderPanel.Location = new Point(0, 27);
     orderPanel.Margin   = new Padding(0);
     orderPanel.Name     = "orderPanel";
     orderPanel.Padding  = new Padding(4);
     orderPanel.RowCount = 3;
     orderPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 36F));
     orderPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 36F));
     orderPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
     orderPanel.Size = new Size(624, 160);
     //
     // statusLabel
     //
     statusLabel.Location = new Point(5, 79);
     statusLabel.Name     = "statusLabel";
     statusLabel.Size     = new Size(60, 76);
     statusLabel.Text     = "Status";
     //
     // orderTotalPanel
     //
     orderTotalPanel.ColumnCount = 2;
     orderTotalPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
     orderTotalPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 32F));
     orderTotalPanel.Controls.Add(currencyLabel2, 1, 0);
     orderTotalPanel.Controls.Add(orderTotal, 0, 0);
     orderTotalPanel.Dock     = DockStyle.Fill;
     orderTotalPanel.Location = new Point(69, 45);
     orderTotalPanel.Name     = "orderTotalPanel";
     orderTotalPanel.RowCount = 1;
     orderTotalPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
     orderTotalPanel.Size = new Size(547, 30);
     //
     // currencyLabel2
     //
     currencyLabel2.Location = new Point(518, 0);
     currencyLabel2.Name     = "currencyLabel2";
     currencyLabel2.Size     = new Size(26, 30);
     currencyLabel2.Text     = "€";
     //
     // orderTotal
     //
     orderTotal.AutoSize  = true;
     orderTotal.Dock      = DockStyle.Fill;
     orderTotal.Location  = new Point(3, 0);
     orderTotal.Name      = "orderTotal";
     orderTotal.Size      = new Size(509, 30);
     orderTotal.Text      = "0,00";
     orderTotal.TextAlign = ContentAlignment.MiddleRight;
     //
     // orderTotalLabel
     //
     orderTotalLabel.Location = new Point(5, 42);
     orderTotalLabel.Name     = "orderTotalLabel";
     orderTotalLabel.Size     = new Size(60, 36);
     orderTotalLabel.Text     = "Total";
     //
     // orderQuantity
     //
     orderQuantity.Dock      = DockStyle.Fill;
     orderQuantity.Location  = new Point(3, 3);
     orderQuantity.Maximum   = 100;
     orderQuantity.Minimum   = 1;
     orderQuantity.Name      = "orderQuantity";
     orderQuantity.Size      = new Size(461, 24);
     orderQuantity.TabIndex  = 5;
     orderQuantity.TickStyle = TickStyle.None;
     orderQuantity.Value     = 1;
     orderQuantity.Scroll   += new EventHandler(OrderQuantity_Scroll);
     //
     // orderQuantityInfo
     //
     orderQuantityInfo.Dock      = DockStyle.Fill;
     orderQuantityInfo.Location  = new Point(470, 0);
     orderQuantityInfo.Name      = "orderQuantityInfo";
     orderQuantityInfo.Size      = new Size(42, 30);
     orderQuantityInfo.Text      = "1";
     orderQuantityInfo.TextAlign = ContentAlignment.MiddleRight;
     //
     // orderQuantityLabel
     //
     orderQuantityLabel.Location = new Point(5, 5);
     orderQuantityLabel.Name     = "orderQuantityLabel";
     orderQuantityLabel.Size     = new Size(60, 36);
     orderQuantityLabel.Text     = "Quantity";
     //
     // orderQuantityPanel
     //
     orderQuantityPanel.ColumnCount = 3;
     orderQuantityPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
     orderQuantityPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 48F));
     orderQuantityPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 32F));
     orderQuantityPanel.Controls.Add(orderQuantity, 0, 0);
     orderQuantityPanel.Controls.Add(orderQuantityInfo, 1, 0);
     orderQuantityPanel.Controls.Add(unitLabel2, 2, 0);
     orderQuantityPanel.Dock     = DockStyle.Fill;
     orderQuantityPanel.Location = new Point(69, 8);
     orderQuantityPanel.Name     = "orderQuantityPanel";
     orderQuantityPanel.RowCount = 1;
     orderQuantityPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
     orderQuantityPanel.Size = new Size(547, 30);
     //
     // unitLabel2
     //
     unitLabel2.Location = new Point(518, 0);
     unitLabel2.Name     = "unitLabel2";
     unitLabel2.Size     = new Size(26, 30);
     unitLabel2.Text     = "Un";
     //
     // statusPanel
     //
     statusPanel.Controls.Add(statusWaiting);
     statusPanel.Controls.Add(statusProcessing);
     statusPanel.Controls.Add(statusDispatched);
     statusPanel.Dock          = DockStyle.Fill;
     statusPanel.FlowDirection = FlowDirection.TopDown;
     statusPanel.Location      = new Point(69, 82);
     statusPanel.Name          = "statusPanel";
     statusPanel.Size          = new Size(547, 70);
     //
     // statusWaiting
     //
     statusWaiting.Location = new Point(3, 3);
     statusWaiting.Name     = "statusWaiting";
     statusWaiting.Size     = new Size(113, 17);
     statusWaiting.TabIndex = 6;
     statusWaiting.Text     = "Waiting Expedition";
     //
     // statusProcessing
     //
     statusProcessing.Checked  = true;
     statusProcessing.Location = new Point(3, 26);
     statusProcessing.Name     = "statusProcessing";
     statusProcessing.Size     = new Size(106, 17);
     statusProcessing.TabIndex = 7;
     statusProcessing.Text     = "Pending Confirmation";
     //
     // statusDispatched
     //
     statusDispatched.Location = new Point(3, 49);
     statusDispatched.Name     = "statusDispatched";
     statusDispatched.Size     = new Size(114, 17);
     statusDispatched.TabIndex = 8;
     statusDispatched.Text     = "Dispatch Complete";
     //
     // buttonPanel
     //
     buttonPanel.BackColor = SystemColors.ControlDark;
     buttonPanel.Controls.Add(buttonCancel);
     buttonPanel.Controls.Add(buttonConfirm);
     buttonPanel.Dock          = DockStyle.Fill;
     buttonPanel.FlowDirection = FlowDirection.RightToLeft;
     buttonPanel.Location      = new Point(0, 187);
     buttonPanel.Margin        = new Padding(0);
     buttonPanel.Name          = "buttonPanel";
     buttonPanel.Padding       = new Padding(2);
     buttonPanel.Size          = new Size(624, 34);
     //
     // buttonCancel
     //
     buttonCancel.DialogResult = DialogResult.Cancel;
     buttonCancel.Location     = new Point(492, 5);
     buttonCancel.Margin       = new Padding(2, 3, 0, 3);
     buttonCancel.Name         = "buttonCancel";
     buttonCancel.Size         = new Size(128, 24);
     buttonCancel.TabIndex     = 1;
     buttonCancel.Text         = "Cancel";
     //
     // buttonConfirm
     //
     buttonConfirm.Location = new Point(360, 5);
     buttonConfirm.Margin   = new Padding(0, 3, 2, 3);
     buttonConfirm.Name     = "buttonConfirm";
     buttonConfirm.Size     = new Size(128, 24);
     buttonConfirm.TabIndex = 0;
     buttonConfirm.Text     = "Dispatch";
     buttonConfirm.Click   += new EventHandler(ButtonConfirm_Click);
     //
     // orderLabel
     //
     orderLabel.Location = new Point(2, 2);
     orderLabel.Name     = "orderLabel";
     orderLabel.Size     = new Size(620, 23);
     orderLabel.Text     = "Order";
     //
     // OrderForm
     //
     AcceptButton = buttonConfirm;
     CancelButton = buttonCancel;
     ClientSize   = new Size(624, 381);
     Controls.Add(formPanel2);
     Controls.Add(formPanel1);
     Name = "OrderForm";
     Text = "Place Order";
     formPanel1.ResumeLayout(false);
     formPanel1.PerformLayout();
     bookPanel.ResumeLayout(false);
     bookPanel.PerformLayout();
     bookPricePanel.ResumeLayout(false);
     bookPricePanel.PerformLayout();
     bookStockPanel.ResumeLayout(false);
     bookStockPanel.PerformLayout();
     customerPanel.ResumeLayout(false);
     customerPanel.PerformLayout();
     customerNamePanel.ResumeLayout(false);
     formPanel2.ResumeLayout(false);
     formPanel2.PerformLayout();
     orderPanel.ResumeLayout(false);
     orderPanel.PerformLayout();
     orderTotalPanel.ResumeLayout(false);
     orderTotalPanel.PerformLayout();
     orderQuantityPanel.ResumeLayout(false);
     orderQuantityPanel.PerformLayout();
     orderQuantity.EndInit();
     statusPanel.ResumeLayout(false);
     statusPanel.PerformLayout();
     buttonPanel.ResumeLayout(false);
     ResumeLayout(false);
 }
Example #22
0
        protected void populate(DirectoryInfo path)
        {
            loading = false;
            Thread.Sleep(100);
            loading = true;
            this.runOnUiThread(() => {
                Text = path.FullName;
                if (!backButton.Visible)
                {
                    backButton.Visible = true;
                }
                loadingImage.Visible = true;
                setAnimations(false);
                Invalidate();
            });
            currentPath = path.FullName;
            //SuspendLayout();
            list.Controls.Clear();
            F.async(() => {
                try {
                    MouseEventHandler click = delegate(object o, MouseEventArgs args) {
                        try {
                            if ((ModifierKeys & Keys.Control) != Keys.Control && (ModifierKeys & Keys.Shift) != Keys.Shift)
                            {
                                foreach (Control c in list.Controls)
                                {
                                    if (c is FolderButton)
                                    {
                                        ((FolderButton)c).setSelected(false);
                                    }
                                }
                            }
                            if ((ModifierKeys & Keys.Shift) == Keys.Shift)
                            {
                                if (mostRecent == -1)
                                {
                                    goto selectSingle;
                                }
                                int curr = list.Controls.IndexOf((Control)o);
                                if (curr > mostRecent)
                                {
                                    for (int i = mostRecent; i <= curr; i++)
                                    {
                                        ((FolderButton)list.Controls[i]).setSelected();
                                    }
                                }
                                else
                                {
                                    for (int i = mostRecent; i >= curr; i--)
                                    {
                                        ((FolderButton)list.Controls[i]).setSelected();
                                    }
                                }
                            }
                            else if (o is FolderButton)
                            {
                                goto selectSingle;
                            }
                            return;

                            selectSingle:
                            ((FolderButton)o).setSelected();
                            mostRecent = list.Controls.IndexOf((Control)o);
                        } catch (Exception e) {
                        }
                    };
                    IEnumerable <string> items = Directory.EnumerateFileSystemEntries(path.FullName, "*", SearchOption.TopDirectoryOnly);
                    byte x = 0;
                    foreach (string info in items)
                    {
                        if (x++ >= 5)
                        {
                            this.runOnUiThread(() => {
                                list.PerformLayout();
                            });
                            x = 0;
                        }
                        if (!loading)
                        {
                            return;
                        }
                        Thread.Sleep(5);
                        this.runOnUiThread(() => {
                            try {
                                FolderButton button      = new FolderButton(info);
                                button.AutoSize          = true;
                                button.showAnimations    = false;
                                button.MinimumSize       = new Size(Math.Max(500, (Width - 50) / 2), button.MinimumSize.Height);
                                button.MouseClick       += click;
                                button.MouseDoubleClick += delegate(object o, MouseEventArgs args) {
                                    if (args.Button == MouseButtons.Left)
                                    {
                                        if (File.Exists(info))
                                        {
                                            this._(() => { ((FolderButton)o).setSelected(false); });
                                            Process.Start(info);
                                        }
                                        else
                                        {
                                            populate(info);
                                        }
                                    }
                                };
                                list.Controls.Add(button);
                                add(button, false);
                            } catch (Exception e) {
                            }
                        });
                    }
                } catch (Exception) {
                }
                this.runOnUiThread(() => {
                    loadingImage.Hide();
                    setAnimations();
                });
            });
        }
        private static void CreateFieldsFromDataset(FlowLayoutPanel panel, Dataset dataset)
        {
            // Prevent running if dataset is null
            if (dataset == null)
            {
                return;
            }

            // Suspend the layout to prevent re-renders
            panel.SuspendLayout();
            // Clear the panel before removing any previous text box
            panel.Controls.Clear();

            // Initialize the List in which we'll save every control to add
            List <Control> controls = new List <Control>();

            // Create every text box for each header
            for (int i = 0; i < dataset.Headers.Count; ++i)
            {
                // Save a copy of the current index and the label text
                int    staticIndex = i;
                string header      = dataset.Headers[i];
                // Create the TextBox and assign its value
                TextBox textBox = new TextBox();
                textBox.Text      = header;
                textBox.MaxLength = 30;
                // Create the event handler
                textBox.TextChanged += new EventHandler((object sender, EventArgs e) => {
                    TextBox senderTextBox        = sender as TextBox;
                    dataset.Headers[staticIndex] = senderTextBox.Text;
                });
                // Add it to the controls List
                controls.Add(textBox);
            }

            // Set the last item of the Controls to break the flow
            panel.SetFlowBreak(controls[controls.Count - 1], true);

            foreach (Row row in dataset)
            {
                // Initialize an empty List of Labels
                List <Label> labels = new List <Label>();
                // Iterate over each feature
                foreach (Feature feature in row)
                {
                    // Create the Label and assign its value
                    Label label = new Label();
                    label.Text = feature.ToString();
                    // Add to the local Label list
                    labels.Add(label);
                }
                // Set the last item of the Controls to break the flow
                panel.SetFlowBreak(labels[labels.Count - 1], true);
                // Add every label in this iteration to the List
                controls.AddRange(labels);
            }

            // Display every new control in the UI
            panel.Controls.AddRange(controls.ToArray());

            // Re-render panels
            panel.ResumeLayout(false);
            panel.PerformLayout();
        }
Example #24
0
        private void InitializeComponent()
        {
            components = new Container();
            var componentResourceManager = new ComponentResourceManager(typeof(Visf));

            label1              = new Label();
            toolStrip1          = new ToolStrip();
            tsbExpBlenderpy     = new ToolStripButton();
            toolStripSeparator1 = new ToolStripSeparator();
            lCntVert            = new ToolStripLabel();
            toolStripLabel1     = new ToolStripLabel();
            lCntTris            = new ToolStripLabel();
            toolStripLabel2     = new ToolStripLabel();
            toolStripSeparator2 = new ToolStripSeparator();
            tslMdls             = new ToolStripLabel();
            tsbShowColl         = new ToolStripButton();
            tsbBallGame         = new ToolStripButton();
            flppos              = new FlowLayoutPanel();
            label2              = new Label();
            eyeX          = new NumericUpDown();
            eyeY          = new NumericUpDown();
            eyeZ          = new NumericUpDown();
            label3        = new Label();
            fov           = new NumericUpDown();
            label4        = new Label();
            yaw           = new NumericUpDown();
            pitch         = new NumericUpDown();
            roll          = new NumericUpDown();
            cbFog         = new CheckBox();
            cbVertexColor = new CheckBox();
            timerRun      = new Timer(components);
            label5        = new Label();
            label6        = new Label();
            p1            = new UC();
            timerBall     = new Timer(components);
            toolStrip1.SuspendLayout();
            flppos.SuspendLayout();
            ((ISupportInitialize)eyeX).BeginInit();
            ((ISupportInitialize)eyeY).BeginInit();
            ((ISupportInitialize)eyeZ).BeginInit();
            ((ISupportInitialize)fov).BeginInit();
            ((ISupportInitialize)yaw).BeginInit();
            ((ISupportInitialize)pitch).BeginInit();
            ((ISupportInitialize)roll).BeginInit();
            base.SuspendLayout();
            label1.Anchor   = (AnchorStyles.Bottom | AnchorStyles.Left);
            label1.AutoSize = true;
            label1.Location = new Point(12, 674);
            label1.Name     = "label1";
            label1.Size     = new Size(193, 48);
            label1.TabIndex = 1;
            label1.Text     =
                "* Mouse wheel: Zoom\r\n* Left btn drag: Rotate\r\n* Right btn drag: Move forward/back\r\n* Middle btn: toss ball";
            toolStrip1.Items.AddRange(new ToolStripItem[]
            {
                tsbExpBlenderpy,
                toolStripSeparator1,
                lCntVert,
                toolStripLabel1,
                lCntTris,
                toolStripLabel2,
                toolStripSeparator2,
                tslMdls,
                tsbShowColl,
                tsbBallGame
            });
            toolStrip1.Location   = new Point(0, 0);
            toolStrip1.Name       = "toolStrip1";
            toolStrip1.Size       = new Size(885, 25);
            toolStrip1.TabIndex   = 2;
            toolStrip1.Text       = "toolStrip1";
            tsbExpBlenderpy.Image = (Image)componentResourceManager.GetObject("tsbExpBlenderpy.Image");
            tsbExpBlenderpy.ImageTransparentColor = Color.Magenta;
            tsbExpBlenderpy.Name              = "tsbExpBlenderpy";
            tsbExpBlenderpy.Size              = new Size(169, 22);
            tsbExpBlenderpy.Text              = "Export to blender script ";
            tsbExpBlenderpy.Click            += tsbExpBlenderpy_Click;
            toolStripSeparator1.Name          = "toolStripSeparator1";
            toolStripSeparator1.Size          = new Size(6, 25);
            lCntVert.Name                     = "lCntVert";
            lCntVert.Size                     = new Size(15, 22);
            lCntVert.Text                     = "0";
            toolStripLabel1.Name              = "toolStripLabel1";
            toolStripLabel1.Size              = new Size(62, 22);
            toolStripLabel1.Text              = "vertices, ";
            lCntTris.Name                     = "lCntTris";
            lCntTris.Size                     = new Size(15, 22);
            lCntTris.Text                     = "0";
            toolStripLabel2.Name              = "toolStripLabel2";
            toolStripLabel2.Size              = new Size(31, 22);
            toolStripLabel2.Text              = "tris.";
            toolStripSeparator2.Name          = "toolStripSeparator2";
            toolStripSeparator2.Size          = new Size(6, 25);
            tslMdls.Name                      = "tslMdls";
            tslMdls.Size                      = new Size(53, 22);
            tslMdls.Text                      = "Models:";
            tsbShowColl.CheckOnClick          = true;
            tsbShowColl.Image                 = (Image)componentResourceManager.GetObject("tsbShowColl.Image");
            tsbShowColl.ImageTransparentColor = Color.Magenta;
            tsbShowColl.Name                  = "tsbShowColl";
            tsbShowColl.Size                  = new Size(75, 22);
            tsbShowColl.Text                  = "Collision";
            tsbShowColl.Click                += tsbShowColl_Click;
            tsbBallGame.CheckOnClick          = true;
            tsbBallGame.Image                 = (Image)componentResourceManager.GetObject("tsbBallGame.Image");
            tsbBallGame.ImageTransparentColor = Color.Magenta;
            tsbBallGame.Name                  = "tsbBallGame";
            tsbBallGame.Size                  = new Size(86, 22);
            tsbBallGame.Text                  = "Ball game";
            tsbBallGame.Click                += tsbBallGame_Click;
            flppos.Anchor                     = (AnchorStyles.Bottom | AnchorStyles.Left);
            flppos.Controls.Add(label2);
            flppos.Controls.Add(eyeX);
            flppos.Controls.Add(eyeY);
            flppos.Controls.Add(eyeZ);
            flppos.Controls.Add(label3);
            flppos.Controls.Add(fov);
            flppos.Controls.Add(label4);
            flppos.Controls.Add(yaw);
            flppos.Controls.Add(pitch);
            flppos.Controls.Add(roll);
            flppos.Controls.Add(cbFog);
            flppos.Controls.Add(cbVertexColor);
            flppos.Location = new Point(12, 641);
            flppos.Name     = "flppos";
            flppos.Size     = new Size(873, 30);
            flppos.TabIndex = 3;
            label2.AutoSize = true;
            label2.Location = new Point(3, 0);
            label2.Name     = "label2";
            label2.Size     = new Size(60, 12);
            label2.TabIndex = 0;
            label2.Text     = "eye (x y z)";
            eyeX.Location   = new Point(69, 3);
            NumericUpDown arg_7C6_0 = eyeX;
            var           array     = new int[4];

            array[0]          = 64000;
            arg_7C6_0.Maximum = new decimal(array);
            eyeX.Minimum      = new decimal(new[]
            {
                64000,
                0,
                0,
                -2147483648
            });
            eyeX.Name          = "eyeX";
            eyeX.Size          = new Size(59, 19);
            eyeX.TabIndex      = 1;
            eyeX.TextAlign     = HorizontalAlignment.Right;
            eyeX.ValueChanged += eyeX_ValueChanged;
            eyeY.Location      = new Point(134, 3);
            NumericUpDown arg_87A_0 = eyeY;
            var           array2    = new int[4];

            array2[0]         = 64000;
            arg_87A_0.Maximum = new decimal(array2);
            eyeY.Minimum      = new decimal(new[]
            {
                64000,
                0,
                0,
                -2147483648
            });
            eyeY.Name      = "eyeY";
            eyeY.Size      = new Size(59, 19);
            eyeY.TabIndex  = 2;
            eyeY.TextAlign = HorizontalAlignment.Right;
            NumericUpDown arg_905_0 = eyeY;
            var           array3    = new int[4];

            array3[0]          = 500;
            arg_905_0.Value    = new decimal(array3);
            eyeY.ValueChanged += eyeX_ValueChanged;
            eyeZ.Location      = new Point(199, 3);
            NumericUpDown arg_955_0 = eyeZ;
            var           array4    = new int[4];

            array4[0]         = 64000;
            arg_955_0.Maximum = new decimal(array4);
            eyeZ.Minimum      = new decimal(new[]
            {
                64000,
                0,
                0,
                -2147483648
            });
            eyeZ.Name          = "eyeZ";
            eyeZ.Size          = new Size(59, 19);
            eyeZ.TabIndex      = 3;
            eyeZ.TextAlign     = HorizontalAlignment.Right;
            eyeZ.ValueChanged += eyeX_ValueChanged;
            label3.AutoSize    = true;
            label3.Location    = new Point(264, 0);
            label3.Name        = "label3";
            label3.Size        = new Size(21, 12);
            label3.TabIndex    = 4;
            label3.Text        = "fov";
            fov.Location       = new Point(291, 3);
            NumericUpDown arg_A6F_0 = fov;
            var           array5    = new int[4];

            array5[0]         = 180;
            arg_A6F_0.Maximum = new decimal(array5);
            fov.Name          = "fov";
            fov.Size          = new Size(59, 19);
            fov.TabIndex      = 5;
            fov.TextAlign     = HorizontalAlignment.Right;
            NumericUpDown arg_ACB_0 = fov;
            var           array6    = new int[4];

            array6[0]         = 70;
            arg_ACB_0.Value   = new decimal(array6);
            fov.ValueChanged += eyeX_ValueChanged;
            label4.AutoSize   = true;
            label4.Location   = new Point(356, 0);
            label4.Name       = "label4";
            label4.Size       = new Size(125, 12);
            label4.TabIndex   = 6;
            label4.Text       = "rotation (yaw pitch roll)";
            yaw.Location      = new Point(487, 3);
            NumericUpDown arg_B7D_0 = yaw;
            var           array7    = new int[4];

            array7[0]         = 36000;
            arg_B7D_0.Maximum = new decimal(array7);
            yaw.Minimum       = new decimal(new[]
            {
                36000,
                0,
                0,
                -2147483648
            });
            yaw.Name          = "yaw";
            yaw.Size          = new Size(59, 19);
            yaw.TabIndex      = 7;
            yaw.TextAlign     = HorizontalAlignment.Right;
            yaw.ValueChanged += eyeX_ValueChanged;
            pitch.Location    = new Point(552, 3);
            NumericUpDown arg_C35_0 = pitch;
            var           array8    = new int[4];

            array8[0]         = 36000;
            arg_C35_0.Maximum = new decimal(array8);
            pitch.Minimum     = new decimal(new[]
            {
                36000,
                0,
                0,
                -2147483648
            });
            pitch.Name          = "pitch";
            pitch.Size          = new Size(59, 19);
            pitch.TabIndex      = 8;
            pitch.TextAlign     = HorizontalAlignment.Right;
            pitch.ValueChanged += eyeX_ValueChanged;
            roll.Location       = new Point(617, 3);
            NumericUpDown arg_CED_0 = roll;
            var           array9    = new int[4];

            array9[0]         = 36000;
            arg_CED_0.Maximum = new decimal(array9);
            roll.Minimum      = new decimal(new[]
            {
                36000,
                0,
                0,
                -2147483648
            });
            roll.Name                             = "roll";
            roll.Size                             = new Size(59, 19);
            roll.TabIndex                         = 9;
            roll.TextAlign                        = HorizontalAlignment.Right;
            roll.ValueChanged                    += eyeX_ValueChanged;
            cbFog.AutoSize                        = true;
            cbFog.Checked                         = true;
            cbFog.CheckState                      = CheckState.Checked;
            cbFog.Location                        = new Point(682, 3);
            cbFog.Name                            = "cbFog";
            cbFog.Size                            = new Size(64, 16);
            cbFog.TabIndex                        = 10;
            cbFog.Text                            = "Use &fog";
            cbFog.UseVisualStyleBackColor         = true;
            cbFog.CheckedChanged                 += cbFog_CheckedChanged;
            cbVertexColor.AutoSize                = true;
            cbVertexColor.Checked                 = true;
            cbVertexColor.CheckState              = CheckState.Checked;
            cbVertexColor.Location                = new Point(752, 3);
            cbVertexColor.Name                    = "cbVertexColor";
            cbVertexColor.Size                    = new Size(97, 16);
            cbVertexColor.TabIndex                = 11;
            cbVertexColor.Text                    = "Use vertex &clr";
            cbVertexColor.UseVisualStyleBackColor = true;
            cbVertexColor.CheckedChanged         += cbFog_CheckedChanged;
            timerRun.Interval                     = 25;
            timerRun.Tick                        += timerRun_Tick;
            label5.Anchor                         = (AnchorStyles.Bottom | AnchorStyles.Left);
            label5.AutoSize                       = true;
            label5.Location                       = new Point(229, 675);
            label5.Name                           = "label5";
            label5.Size                           = new Size(99, 48);
            label5.TabIndex                       = 1;
            label5.Text                           = "* W: move forward\r\n* S: move back\r\n* A: move left\r\n* D: move right";
            label6.Anchor                         = (AnchorStyles.Bottom | AnchorStyles.Left);
            label6.AutoSize                       = true;
            label6.Location                       = new Point(353, 675);
            label6.Name                           = "label6";
            label6.Size                           = new Size(106, 36);
            label6.TabIndex                       = 1;
            label6.Text                           = "* Shift: Move fast\r\n* Up: move up\r\n* Down: move down";
            p1.Anchor                             = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
            p1.BackColor                          = SystemColors.ControlDarkDark;
            p1.BorderStyle                        = BorderStyle.FixedSingle;
            p1.Location                           = new Point(12, 28);
            p1.Name                  = "p1";
            p1.Size                  = new Size(861, 607);
            p1.TabIndex              = 0;
            p1.UseTransparent        = true;
            p1.Load                 += p1_Load;
            p1.Paint                += p1_Paint;
            p1.PreviewKeyDown       += p1_PreviewKeyDown;
            p1.MouseMove            += p1_MouseMove;
            p1.KeyUp                += p1_KeyUp;
            p1.MouseDown            += p1_MouseDown;
            p1.MouseUp              += p1_MouseUp;
            p1.SizeChanged          += p1_SizeChanged;
            p1.KeyDown              += p1_KeyDown;
            timerBall.Interval       = 50;
            timerBall.Tick          += timerBall_Tick;
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode       = AutoScaleMode.Font;
            base.ClientSize          = new Size(885, 732);
            base.Controls.Add(flppos);
            base.Controls.Add(toolStrip1);
            base.Controls.Add(label6);
            base.Controls.Add(label5);
            base.Controls.Add(label1);
            base.Controls.Add(p1);
            base.Name         = "Visf";
            Text              = "map viewer test";
            base.Load        += Visf_Load;
            base.FormClosing += Visf_FormClosing;
            toolStrip1.ResumeLayout(false);
            toolStrip1.PerformLayout();
            flppos.ResumeLayout(false);
            flppos.PerformLayout();
            ((ISupportInitialize)eyeX).EndInit();
            ((ISupportInitialize)eyeY).EndInit();
            ((ISupportInitialize)eyeZ).EndInit();
            ((ISupportInitialize)fov).EndInit();
            ((ISupportInitialize)yaw).EndInit();
            ((ISupportInitialize)pitch).EndInit();
            ((ISupportInitialize)roll).EndInit();
            base.ResumeLayout(false);
            base.PerformLayout();
        }
Example #25
0
 private void PerformLayoutHelper(FlowLayoutPanel flp)
 {
     flp.PerformLayout();
 }
Example #26
0
        /// <summary>
        /// Updates the options display.
        /// </summary>
        public void UpdateOptionsDisplay()
        {
            CheckDisposed();

            m_insertPanel.SuspendLayout();
            SuspendLayout();
            foreach (Control c in m_insertPanel.Controls.Cast <Control>().ToArray())
            {
                c.Dispose();
            }
            bool displayingOpts = false;

            foreach (Tuple <object, Func <object, bool>, Func <IEnumerable <object> > > opt in m_options)
            {
                if (opt.Item2 == null || opt.Item2(opt.Item1))
                {
                    var linkLabel = new LinkLabel {
                        AutoSize = true, Font = new Font(MiscUtils.StandardSansSerif, 10), TabStop = true, VisitedLinkColor = Color.Blue
                    };
                    linkLabel.LinkClicked += link_LinkClicked;
                    if (opt.Item3 != null)
                    {
                        object[] options = opt.Item3().ToArray();
                        var      sb      = new StringBuilder();
                        for (int i = 0; i < options.Length; i++)
                        {
                            sb.Append(options[i]);
                            if (i < options.Length - 1)
                            {
                                sb.Append(" ");
                            }
                        }
                        linkLabel.Text = sb.ToString();

                        linkLabel.Links.Clear();
                        int start = 0;
                        foreach (int option in options)
                        {
                            int            len  = Convert.ToString(option).Length;
                            LinkLabel.Link link = linkLabel.Links.Add(start, len, opt.Item1);
                            // use the tag property to store the index for this link
                            link.Tag = option;
                            start   += len + 1;
                        }
                    }
                    else
                    {
                        linkLabel.Text = opt.Item1.ToString();
                        linkLabel.Links[0].LinkData = opt.Item1;
                    }

                    m_insertPanel.Controls.Add(linkLabel);
                    displayingOpts = true;
                }
            }

            if (!displayingOpts && m_noOptsMsg != null)
            {
                string text = m_noOptsMsg();
                if (text != null)
                {
                    m_msgLabel = new GrowLabel {
                        Font = new Font(MiscUtils.StandardSansSerif, 10), Text = text, Width = m_insertPanel.ClientSize.Width
                    };
                    m_insertPanel.Controls.Add(m_msgLabel);
                }
            }
            else
            {
                m_msgLabel = null;
            }

            m_insertPanel.ResumeLayout(false);
            m_insertPanel.PerformLayout();
            ResumeLayout(false);

            Height = m_insertPanel.PreferredSize.Height;
        }
        /// <summary>
        /// Updates the options display.
        /// </summary>
        public void UpdateOptionsDisplay()
        {
            CheckDisposed();

            m_insertPanel.SuspendLayout();
            SuspendLayout();
            m_insertPanel.Controls.Clear();
            Font f = new Font("Arial", 10);
            bool displayingOpts = false;

            foreach (InsertOption opt in m_options)
            {
                if (opt.shouldDisplay == null || opt.shouldDisplay(opt.type))
                {
                    LinkLabel linkLabel = new LinkLabel();
                    linkLabel.AutoSize         = true;
                    linkLabel.Font             = f;
                    linkLabel.TabStop          = true;
                    linkLabel.VisitedLinkColor = Color.Blue;
                    linkLabel.LinkClicked     += new LinkLabelLinkClickedEventHandler(link_LinkClicked);
                    if (opt.type == RuleInsertType.INDEX)
                    {
                        int[]         indices = opt.displayIndices();
                        StringBuilder sb      = new StringBuilder();
                        for (int i = 0; i < indices.Length; i++)
                        {
                            sb.Append(indices[i]);
                            if (i < indices.Length - 1)
                            {
                                sb.Append(" ");
                            }
                        }
                        linkLabel.Text = sb.ToString();

                        linkLabel.Links.Clear();
                        int start = 0;
                        foreach (int index in indices)
                        {
                            int            len  = Convert.ToString(index).Length;
                            LinkLabel.Link link = linkLabel.Links.Add(start, len, RuleInsertType.INDEX);
                            // use the tag property to store the index for this link
                            link.Tag = index;
                            start   += len + 1;
                        }
                    }
                    else
                    {
                        linkLabel.Text = GetOptionString(opt.type);
                        linkLabel.Links[0].LinkData = opt.type;
                    }

                    m_insertPanel.Controls.Add(linkLabel);
                    displayingOpts = true;
                }
            }

            if (!displayingOpts && m_noOptsMsg != null)
            {
                string text = m_noOptsMsg();
                if (text != null)
                {
                    m_msgLabel       = new GrowLabel();
                    m_msgLabel.Font  = f;
                    m_msgLabel.Text  = text;
                    m_msgLabel.Width = m_insertPanel.ClientSize.Width;
                    m_insertPanel.Controls.Add(m_msgLabel);
                }
            }
            else if (m_msgLabel != null)
            {
                m_msgLabel = null;
            }

            m_insertPanel.ResumeLayout(false);
            m_insertPanel.PerformLayout();
            ResumeLayout(false);

            Height = m_insertPanel.PreferredSize.Height;
        }
Example #28
0
    public TextInput(string title, string message, string iconPath = null)
    {
        if (iconPath != null && !Path.IsPathRooted(iconPath))
        {
            iconPath = Application.streamingAssetsPath + Path.DirectorySeparatorChar + iconPath;
        }

        this.message = new GrowLabel();
        if (iconPath != null)
        {
            icon = new PictureBox();
            ((ISupportInitialize)icon).BeginInit();
        }

        layout    = new FlowLayoutPanel();
        okButton  = new Button();
        textInput = new TextBox();
        layout.SuspendLayout();
        SuspendLayout();
        //
        // icon
        //
        if (icon != null)
        {
            icon.Dock          = DockStyle.Left;
            icon.ErrorImage    = null;
            icon.InitialImage  = null;
            icon.ImageLocation = iconPath;
            icon.Name          = "icon";
            icon.Size          = new Size(96, 96);
            icon.SizeMode      = PictureBoxSizeMode.Zoom;
            icon.TabIndex      = 0;
            icon.TabStop       = false;
        }
        //
        // message
        //
        this.message.AutoSize = true;
        this.message.Dock     = DockStyle.Fill;
        this.message.Location = new Point(96, 0);
        this.message.Margin   = new Padding(20);
        this.message.Name     = "message";
        this.message.Padding  = new Padding(20);
        this.message.TabIndex = 1;
        this.message.Text     = message;
        //
        // layout
        //
        layout.AutoSize = true;
        layout.Controls.Add(okButton);
        layout.Controls.Add(textInput);
        layout.Dock          = DockStyle.Bottom;
        layout.FlowDirection = FlowDirection.RightToLeft;
        layout.Name          = "layout";
        layout.TabIndex      = 2;
        layout.Padding       = new Padding(0, 5, 15, 5);
        layout.MinimumSize   = new Size(0, 40);
        //
        // okButton
        //
        okButton.AutoSize                = true;
        okButton.Anchor                  = AnchorStyles.Bottom | AnchorStyles.Right;
        okButton.Padding                 = new Padding(15, 1, 15, 1);
        okButton.DialogResult            = DialogResult.OK;
        okButton.Name                    = "okButton";
        okButton.TabIndex                = 1;
        okButton.Text                    = "OK?";
        okButton.UseVisualStyleBackColor = true;
        //
        // textInput
        //
        textInput.AutoSize    = true;
        textInput.Anchor      = AnchorStyles.Bottom | AnchorStyles.Left;
        textInput.MinimumSize = new Size(250, 50);
        textInput.Multiline   = false;
        textInput.WordWrap    = false;
        textInput.Name        = "textInput";
        textInput.TabIndex    = 0;
        textInput.ReadOnly    = false;
        //
        // TextInput
        //
        AutoScaleDimensions = new SizeF(6F, 13F);
        AutoScaleMode       = AutoScaleMode.Font;
        AutoSize            = true;
        Controls.Add(layout);
        Controls.Add(this.message);
        Controls.Add(icon);
        FormBorderStyle = FormBorderStyle.FixedDialog;
        MaximizeBox     = false;
        MinimizeBox     = false;
        ControlBox      = false;
        Name            = "TextInput";
        Padding         = new Padding(15);
        StartPosition   = FormStartPosition.CenterScreen;
        Size            = new Size(550, 250);
        MinimumSize     = Size;
        MaximumSize     = Size;
        Text            = title;
        TopMost         = true;
        if (icon != null)
        {
            ((ISupportInitialize)icon).EndInit();
            icon.Load();
        }
        layout.ResumeLayout(false);
        layout.PerformLayout();
        ResumeLayout(false);
        PerformLayout();
    }
        //Создание табличных лэайутов для демонстрации массивов
        private void CreateFlowLayout(
            SplitContainer container,      //Куда добавить созданный лэайут
            out List <DataGridView> grids, //Выходной список созданных таблиц
            out List <Label> labels,       //Выходной список созданных названий альтернатив
            int gridCount,
            int gridRowCount,              //Число строк в таблицах
            int gridCollCount)             //Число столбцов в таблицах
        {
            var flowLayout = new FlowLayoutPanel();

            flowLayout.AutoScroll = true;

            flowLayout.SuspendLayout();
            container.SuspendLayout();
            SuspendLayout();

            flowLayout.Anchor = ((((AnchorStyles.Top | AnchorStyles.Bottom)
                                   | AnchorStyles.Left)
                                  | AnchorStyles.Right));
            flowLayout.BorderStyle = BorderStyle.FixedSingle;
            flowLayout.Dock        = DockStyle.Fill;
            flowLayout.AutoSize    = true;

            grids  = new List <DataGridView>();
            labels = new List <Label>();


            for (int i = 0; i < gridCount; i++)
            {
                var gridTable = CreateGridTable(gridCollCount, gridRowCount); //Создаём таблицу с матрицей

                grids.Add(gridTable);                                         //Сохраняем таблицу для дальнейшего изменения

                var label = new Label();
                label.Text      = "Матрица попарных сравнений\r\nдля " + $"Критерий {i + 1} = ";
                label.TextAlign = ContentAlignment.MiddleCenter;
                label.Dock      = DockStyle.Fill;
                labels.Add(label);//Сохраняем название для дальнейшего изменения

                var table = new TableLayoutPanel();
                table.RowCount    = 1;
                table.ColumnCount = 2;
                table.AutoSize    = true;
                table.Controls.Add(label, 0, 0);
                table.Controls.Add(gridTable, 1, 0);
                table.BackColor = Color.DarkGray;

                gridTable.Size = gridTable.Parent.Size;

                flowLayout.Controls.Add(table);//Добавляем в лэйаут
            }

            container.Panel2.Controls.Clear();
            container.Panel2.Controls.Add(flowLayout);

            buttonFillData.Visible  = true;
            buttonFillCrits.Visible = true;
            buttonFillVars.Visible  = true;

            flowLayout.ResumeLayout(false);
            flowLayout.PerformLayout();

            container.ResumeLayout(false);
            container.PerformLayout();

            ResumeLayout(false);
        }
Example #30
0
        private ModelessMessageBox(Form owner, string text, string caption, string okText, string cancelText)
        {
            var okButton = new Button();

            okButton.DialogResult            = DialogResult.OK;
            okButton.UseVisualStyleBackColor = true;
            okButton.AutoSize     = true;
            okButton.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            okButton.Text         = okText;
            okButton.Click       += ButtonClicked;

            var cancelButton = new Button();

            cancelButton.DialogResult            = DialogResult.Cancel;
            cancelButton.UseVisualStyleBackColor = true;
            cancelButton.AutoSize     = true;
            cancelButton.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            cancelButton.Text         = cancelText;
            cancelButton.Click       += ButtonClicked;

            var buttonPanel = new FlowLayoutPanel();

            buttonPanel.SuspendLayout();
            buttonPanel.FlowDirection = FlowDirection.RightToLeft;
            buttonPanel.AutoSize      = true;
            buttonPanel.AutoSizeMode  = AutoSizeMode.GrowAndShrink;
            buttonPanel.Dock          = DockStyle.Bottom;
            buttonPanel.Controls.Add(cancelButton);
            buttonPanel.Controls.Add(okButton);

            var bodyText = new Label();

            bodyText.SuspendLayout();
            bodyText.AutoSize    = true;
            bodyText.MaximumSize = new Size(400, 400);
            bodyText.Padding     = new Padding(10);
            bodyText.Dock        = DockStyle.Fill;
            bodyText.Text        = text;

            this.SuspendLayout();
            this.AutoScaleMode = AutoScaleMode.Font;
            this.AutoSize      = true;
            this.AutoSizeMode  = AutoSizeMode.GrowAndShrink;
            this.AcceptButton  = okButton;
            this.CancelButton  = cancelButton;
            this.ControlBox    = false;
            this.Controls.Add(bodyText);
            this.Controls.Add(buttonPanel);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox     = false;
            this.MinimizeBox     = false;
            this.ShowIcon        = false;
            this.ShowInTaskbar   = false;
            this.StartPosition   = FormStartPosition.CenterScreen;
            this.Text            = caption;

            buttonPanel.ResumeLayout(false);
            buttonPanel.PerformLayout();
            bodyText.ResumeLayout(false);
            bodyText.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

            owner.AddOwnedForm(this);
            this.Show(owner);
            this.Invalidate();
        }