public MainForm () { // // _tableLayoutPanel // _tableLayoutPanel = new TableLayoutPanel (); _tableLayoutPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; _tableLayoutPanel.ColumnCount = 3; _tableLayoutPanel.ColumnStyles.Add (new ColumnStyle ()); _tableLayoutPanel.ColumnStyles.Add (new ColumnStyle ()); _tableLayoutPanel.ColumnStyles.Add (new ColumnStyle ()); _tableLayoutPanel.Dock = DockStyle.Fill; _tableLayoutPanel.RowCount = 2; _tableLayoutPanel.RowStyles.Add (new RowStyle (SizeType.Percent, 50F)); _tableLayoutPanel.RowStyles.Add (new RowStyle (SizeType.Percent, 50F)); Controls.Add (_tableLayoutPanel); // // _buttonA // _buttonA = new Button (); _buttonA.TabIndex = 1; _buttonA.Text = "Button A"; _buttonA.UseVisualStyleBackColor = true; _tableLayoutPanel.Controls.Add (_buttonA, 0, 1); // // _buttonB // _buttonB = new Button (); _buttonB.TabIndex = 4; _buttonB.Text = "Button B"; _buttonB.UseVisualStyleBackColor = true; _tableLayoutPanel.Controls.Add (_buttonB, 2, 1); // // _label // _label = new Label (); _label.AutoSize = true; _label.Dock = DockStyle.Fill; _label.TabIndex = 6; _label.Text = "Label"; _tableLayoutPanel.Controls.Add (_label, 1, 1); // // _textBox // _textBox = new TextBox (); _textBox.Dock = DockStyle.Fill; _textBox.Multiline = true; _textBox.TabIndex = 7; _tableLayoutPanel.Controls.Add (_textBox, 1, 0); // // MainForm // AutoScaleDimensions = new SizeF (6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size (292, 300); Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #81843"; Load += new EventHandler (MainForm_Load); }
public static TableLayoutPanel GetStacked(Control[] controls, string[] widths) { TableLayoutPanel layout = new TableLayoutPanel(); layout.Dock = DockStyle.Fill; layout.ColumnCount = 1; layout.RowCount = controls.Length; foreach (string width in widths) { float val = 0F; SizeType tp = SizeType.Absolute; if (width.EndsWith("%")) { val = (float) Convert.ToDouble(width.Remove(width.Length - 1)); tp = SizeType.Percent; } else { val = (float) Convert.ToDouble(width); } layout.RowStyles.Add(new RowStyle(tp, val)); } foreach (Control c in controls) { c.Dock = DockStyle.Fill; layout.Controls.Add(c); } return layout; }
public MainForm () { // // _table // _table = new TableLayoutPanel (); _table.ColumnStyles.Add (new ColumnStyle (SizeType.Percent, 100F)); _table.Dock = DockStyle.Fill; _table.RowCount = 1; _table.RowStyles.Add (new RowStyle (SizeType.Absolute, 80F)); Controls.Add (_table); // // _label // _label = new Label (); _label.Anchor = ((AnchorStyles) ((AnchorStyles.Left | AnchorStyles.Right))); _label.AutoEllipsis = true; _label.AutoSize = true; _label.Text = "Centered Label"; _label.TextAlign = ContentAlignment.MiddleCenter; _table.Controls.Add (_label, 0, 1); // // MainForm // ClientSize = new Size (300, 100); Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #82605"; Load += new EventHandler (MainForm_Load); }
public MainForm () { // // _tableLayoutPanel // _tableLayoutPanel = new TableLayoutPanel (); _tableLayoutPanel.AutoScroll = true; _tableLayoutPanel.AutoSizeMode = AutoSizeMode.GrowAndShrink; _tableLayoutPanel.ColumnCount = 1; _tableLayoutPanel.ColumnStyles.Add (new ColumnStyle (SizeType.Percent, 100F)); _tableLayoutPanel.Dock = DockStyle.Fill; _tableLayoutPanel.RowCount = 5; _tableLayoutPanel.RowStyles.Add (new RowStyle ()); _tableLayoutPanel.RowStyles.Add (new RowStyle ()); _tableLayoutPanel.RowStyles.Add (new RowStyle ()); _tableLayoutPanel.RowStyles.Add (new RowStyle ()); _tableLayoutPanel.RowStyles.Add (new RowStyle ()); _tableLayoutPanel.TabIndex = 0; Controls.Add (_tableLayoutPanel); // // Form2 // AutoScaleDimensions = new SizeF (6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size (401, 368); Location = new Point (200, 100); StartPosition = FormStartPosition.Manual; Text = "bug #332892"; Load += new EventHandler (MainForm_Load); ResumeLayout (false); }
public PreferencesView() { this.SuspendLayout(); tlp0 = new TableLayoutPanel(); tlp0.Dock = DockStyle.Fill; Controls.Add(tlp0); tlp0.ColumnCount = 2; tlp0.RowCount++; tlp0.Controls.Add(lUsername = new Label()); tlp0.Controls.Add(tUsername = new TextBox()); tlp0.RowCount++; tlp0.Controls.Add(lPassword = new Label()); TextBox passwordTB = new TextBox(); passwordTB.UseSystemPasswordChar = true; tlp0.Controls.Add(tPassword = passwordTB); tlp0.RowCount++; tlp0.Controls.Add(lHostname = new Label()); tlp0.Controls.Add(tHostname = new TextBox()); tlp0.RowCount++; tlp0.Controls.Add(lDatabase = new Label()); tlp0.Controls.Add(tDatabase = new TextBox()); tlp0.RowCount++; tlp0.Controls.Add(lPooling = new Label()); tlp0.Controls.Add(cbPooling = new CheckBox()); tlp0.RowCount++; tlp0.Controls.Add(btnSave = new Button()); tlp0.RowCount++; tlp0.Controls.Add(lVersion = new Label(), 0, tlp0.RowCount - 1); tUsername.Dock = DockStyle.Fill; tPassword.Dock = DockStyle.Fill; tHostname.Dock = DockStyle.Fill; tDatabase.Dock = DockStyle.Fill; lUsername.Text = "Username"; lPassword.Text = "Password"; lHostname.Text = "Hostname"; lDatabase.Text = "Database"; lPooling.Text = "Connection Pooling"; btnSave.Text = "Save"; btnSave.Click += new EventHandler(btnSave_OnClick); lVersion.Text = "v" + Assembly.GetExecutingAssembly().GetName().Version; // Work around weird bug w/ last column's SizeType.AutoSize growing but not shrinking Util.FixTableLayoutStyles(tlp0); this.ResumeLayout(); }
public PartEditView() { this.SuspendLayout(); tlp0 = new TableLayoutPanel(); tlp0.Dock = DockStyle.Fill; this.Controls.Add(tlp0); txtPart = new TextBox(); txtPart.Text = ""; txtPart.Width *= 2; txtPart.ReadOnly = true; tlp0.Controls.Add(txtPart, 0, 0); btnSave = new Button(); btnSave.Text = "Save"; btnSave.Click += new EventHandler(delegate (object sender, EventArgs e) { if (OnSavePart != null && newPart != null) { foreach (DataRow row in newPart.Attributes.Rows) { row.EndEdit(); } OnSavePart(newPart); } }); tlp0.Controls.Add(btnSave, 1, 0); btnReset = new Button(); btnReset.Text = "Reset"; btnReset.Click += new EventHandler(delegate (object sender, EventArgs e) { this.Reset(); }); tlp0.Controls.Add(btnReset, 2, 0); dgvAttributes = new DataGridView(); dgvAttributes.Dock = DockStyle.Top; dgvAttributes.MultiSelect = false; dgvAttributes.RowHeadersVisible = false; dgvAttributes.AllowUserToAddRows = false; dgvAttributes.AllowUserToDeleteRows = false; dgvAttributes.DataBindingComplete += new DataGridViewBindingCompleteEventHandler(dgv_DataBindingComplete); dgvAttributes.CellParsing += new DataGridViewCellParsingEventHandler(dgv_CellParsing); tlp0.Controls.Add(dgvAttributes, 0, 1); tlp0.SetColumnSpan(dgvAttributes, 3); tlp0.RowCount = 2; tlp0.ColumnCount = 3; Util.FixTableLayoutStyles(tlp0); this.ResumeLayout(); }
public MainForm () { // // _table // _table = new TableLayoutPanel (); _table.ColumnCount = 1; _table.ColumnStyles.Add (new ColumnStyle (SizeType.Percent, 100F)); _table.Dock = DockStyle.Fill; _table.RowCount = 1; _table.RowStyles.Add (new RowStyle ()); Controls.Add (_table); // // _toolStrip // _toolStrip = new ToolStrip (); _toolStrip.AllowItemReorder = true; _toolStrip.Dock = DockStyle.Fill; _toolStrip.Margin = new Padding (5); _toolStrip.Stretch = true; _toolStrip.TabStop = false; _table.Controls.Add (_toolStrip, 0, 0); // // _textBox // _textBox = new ToolStripTextBox (); _textBox.AcceptsReturn = true; _textBox.AcceptsTab = true; _textBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend; _textBox.AutoCompleteSource = AutoCompleteSource.RecentlyUsedList; _textBox.AutoSize = false; _textBox.AutoToolTip = true; _textBox.Multiline = true; _textBox.Margin = new Padding (5); _textBox.Size = new Size(265, 60); _textBox.Text = "1"; _toolStrip.Items.Add (_textBox); // // MainForm // ClientSize = new Size (270, 165); Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #325969"; Load += new EventHandler (MainForm_Load); }
public static void FixTableLayoutStyles(TableLayoutPanel panel) { // Work around weird bug w/ last row/column's SizeType.AutoSize growing but not shrinking panel.ColumnStyles.Clear(); for (int i = 0; i < panel.ColumnCount; ++i) { if (i < panel.ColumnCount - 1) panel.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize)); else panel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 100.0f)); } panel.RowStyles.Clear(); for (int i = 0; i < panel.RowCount; ++i) { if (i < panel.RowCount - 1) panel.RowStyles.Add(new RowStyle(SizeType.AutoSize)); else panel.RowStyles.Add(new RowStyle(SizeType.Absolute, 100.0f)); } }
static void Main () { Form form = new Form (); form.ShowInTaskbar = false; TableLayoutPanel tableLayoutPanel = new TableLayoutPanel (); tableLayoutPanel.ColumnCount = 3; tableLayoutPanel.Dock = DockStyle.Fill; tableLayoutPanel.RowCount = 11; form.Controls.Add (tableLayoutPanel); Timer timer = new Timer (); timer.Interval = 100; timer.Tick += delegate (object sender, EventArgs e) { form.Close (); }; form.Load += delegate (object sender, EventArgs e) { timer.Enabled = true; }; form.ShowDialog (); }
private void LayoutControls (TableLayoutPanel panel) { TableLayoutSettings settings = panel.LayoutSettings; int border_width = TableLayoutPanel.GetCellBorderWidth (panel.CellBorderStyle); int columns = panel.actual_positions.GetLength(0); int rows = panel.actual_positions.GetLength(1); Point current_pos = new Point (panel.DisplayRectangle.Left + border_width, panel.DisplayRectangle.Top + border_width); for (int y = 0; y < rows; y++) { for (int x = 0; x < columns; x++) { Control c = panel.actual_positions[x,y]; if(c != null && c != dummy_control) { Size preferred; if (c.AutoSize) preferred = c.PreferredSize; else preferred = c.ExplicitBounds.Size; int new_x = 0; int new_y = 0; int new_width = 0; int new_height = 0; // Figure out the width of the control int column_width = panel.column_widths[x]; for (int i = 1; i < Math.Min (settings.GetColumnSpan(c), panel.column_widths.Length); i++) column_width += panel.column_widths[x + i]; if (c.Dock == DockStyle.Fill || c.Dock == DockStyle.Top || c.Dock == DockStyle.Bottom || ((c.Anchor & AnchorStyles.Left) == AnchorStyles.Left && (c.Anchor & AnchorStyles.Right) == AnchorStyles.Right)) new_width = column_width - c.Margin.Left - c.Margin.Right; else new_width = Math.Min (preferred.Width, column_width - c.Margin.Left - c.Margin.Right); // Figure out the height of the control int column_height = panel.row_heights[y]; for (int i = 1; i < Math.Min (settings.GetRowSpan (c), panel.row_heights.Length); i++) column_height += panel.row_heights[y + i]; if (c.Dock == DockStyle.Fill || c.Dock == DockStyle.Left || c.Dock == DockStyle.Right || ((c.Anchor & AnchorStyles.Top) == AnchorStyles.Top && (c.Anchor & AnchorStyles.Bottom) == AnchorStyles.Bottom)) new_height = column_height - c.Margin.Top - c.Margin.Bottom; else new_height = Math.Min (preferred.Height, column_height - c.Margin.Top - c.Margin.Bottom); // Figure out the left location of the control if (c.Dock == DockStyle.Left || c.Dock == DockStyle.Fill || (c.Anchor & AnchorStyles.Left) == AnchorStyles.Left) new_x = current_pos.X + c.Margin.Left; else if (c.Dock == DockStyle.Right || (c.Anchor & AnchorStyles.Right) == AnchorStyles.Right) new_x = (current_pos.X + column_width) - new_width - c.Margin.Right; else // (center control) new_x = (current_pos.X + (column_width - c.Margin.Left - c.Margin.Right) / 2) + c.Margin.Left - (new_width / 2); // Figure out the top location of the control if (c.Dock == DockStyle.Top || c.Dock == DockStyle.Fill || (c.Anchor & AnchorStyles.Top) == AnchorStyles.Top) new_y = current_pos.Y + c.Margin.Top; else if (c.Dock == DockStyle.Bottom || (c.Anchor & AnchorStyles.Bottom) == AnchorStyles.Bottom) new_y = (current_pos.Y + column_height) - new_height - c.Margin.Bottom; else // (center control) new_y = (current_pos.Y + (column_height - c.Margin.Top - c.Margin.Bottom) / 2) + c.Margin.Top - (new_height / 2); c.SetBoundsInternal (new_x, new_y, new_width, new_height, BoundsSpecified.None); } current_pos.Offset (panel.column_widths[x] + border_width, 0); } current_pos.Offset ((-1 * current_pos.X) + border_width + panel.DisplayRectangle.Left, panel.row_heights[y] + border_width); } }
private void InitializeComponent() { this.m_grid = new System.Windows.Forms.TableLayoutPanel(); this.m_btnPrev = new System.Windows.Forms.Button(); this.m_btnNext = new System.Windows.Forms.Button(); this.m_headerPanel = new System.Windows.Forms.Panel(); this.m_dataPanel = new System.Windows.Forms.Panel(); this.m_scrollPanel = new System.Windows.Forms.Panel(); this.m_Scrollbar = new System.Windows.Forms.VScrollBar(); this.m_grid.SuspendLayout(); this.m_dataPanel.SuspendLayout(); this.m_scrollPanel.SuspendLayout(); this.SuspendLayout(); // // m_grid // this.m_grid.ColumnCount = 1; this.m_grid.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.m_grid.Controls.Add(this.m_btnPrev, 0, 0); this.m_grid.Controls.Add(this.m_btnNext, 0, 3); this.m_grid.Controls.Add(this.m_headerPanel, 0, 1); this.m_grid.Controls.Add(this.m_dataPanel, 0, 2); this.m_grid.Dock = System.Windows.Forms.DockStyle.Fill; this.m_grid.Location = new System.Drawing.Point(0, 0); this.m_grid.Name = "m_grid"; this.m_grid.RowCount = 4; this.m_grid.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.m_grid.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F)); this.m_grid.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.m_grid.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.m_grid.Size = new System.Drawing.Size(530, 426); this.m_grid.TabIndex = 0; // // m_btnPrev // this.m_btnPrev.Dock = System.Windows.Forms.DockStyle.Top; this.m_btnPrev.Location = new System.Drawing.Point(0, 0); this.m_btnPrev.Margin = new System.Windows.Forms.Padding(0); this.m_btnPrev.Name = "m_btnPrev"; this.m_btnPrev.Size = new System.Drawing.Size(530, 23); this.m_btnPrev.TabIndex = 0; this.m_btnPrev.Text = "button1"; this.m_btnPrev.UseVisualStyleBackColor = true; // // m_btnNext // this.m_btnNext.Dock = System.Windows.Forms.DockStyle.Bottom; this.m_btnNext.Location = new System.Drawing.Point(0, 403); this.m_btnNext.Margin = new System.Windows.Forms.Padding(0); this.m_btnNext.Name = "m_btnNext"; this.m_btnNext.Size = new System.Drawing.Size(530, 23); this.m_btnNext.TabIndex = 1; this.m_btnNext.Text = "button2"; this.m_btnNext.UseVisualStyleBackColor = true; // // m_headerPanel // this.m_headerPanel.Dock = System.Windows.Forms.DockStyle.Fill; this.m_headerPanel.Location = new System.Drawing.Point(0, 23); this.m_headerPanel.Margin = new System.Windows.Forms.Padding(0); this.m_headerPanel.Name = "m_headerPanel"; this.m_headerPanel.Size = new System.Drawing.Size(530, 40); this.m_headerPanel.TabIndex = 2; // // m_dataPanel // this.m_dataPanel.Controls.Add(this.m_scrollPanel); this.m_dataPanel.Dock = System.Windows.Forms.DockStyle.Fill; this.m_dataPanel.Location = new System.Drawing.Point(0, 63); this.m_dataPanel.Margin = new System.Windows.Forms.Padding(0); this.m_dataPanel.Name = "m_dataPanel"; this.m_dataPanel.Size = new System.Drawing.Size(530, 340); this.m_dataPanel.TabIndex = 3; // // m_scrollPanel // this.m_scrollPanel.Controls.Add(this.m_Scrollbar); this.m_scrollPanel.Dock = System.Windows.Forms.DockStyle.Right; this.m_scrollPanel.Location = new System.Drawing.Point(511, 0); this.m_scrollPanel.Margin = new System.Windows.Forms.Padding(0); this.m_scrollPanel.Name = "m_scrollPanel"; this.m_scrollPanel.Size = new System.Drawing.Size(19, 340); this.m_scrollPanel.TabIndex = 5; // // m_Scrollbar // this.m_Scrollbar.Dock = System.Windows.Forms.DockStyle.Right; this.m_Scrollbar.Location = new System.Drawing.Point(0, 0); this.m_Scrollbar.Maximum = 1000; this.m_Scrollbar.Minimum = 1; this.m_Scrollbar.Name = "m_Scrollbar"; this.m_Scrollbar.Size = new System.Drawing.Size(19, 340); this.m_Scrollbar.TabIndex = 4; this.m_Scrollbar.Value = 1; // // Calendar // this.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.Controls.Add(this.m_grid); this.Name = "Calendar"; this.Size = new System.Drawing.Size(530, 426); this.m_grid.ResumeLayout(false); this.m_dataPanel.ResumeLayout(false); this.m_scrollPanel.ResumeLayout(false); this.ResumeLayout(false); }
void applyData(bool isAdd) { if (Controls.Find("seriesTable", true).Length != 0 && !isAdd) { TableLayoutPanel seriesTable = (TableLayoutPanel)Controls.Find("seriesTable", true)[0]; Controls.Remove(seriesTable); applyData(isAdd); return; } if (Internal.Variables.SeriesList.Count > 0) { Label deleteLabel = Context.Controls.CreateLabel("deleteLabel", "", true); Label nameHeaderLabel = Context.Controls.CreateLabel("nameHeaderLabel", "Name", true); Label lastViewedHeaderLabel = Context.Controls.CreateLabel("lastViewedHeaderLabel", "Last Viewed", true); Label lastEpisodeHeaderLabel = Context.Controls.CreateLabel("lastEpisodeHeaderLabel", "Newest", true); TableLayoutPanel seriesTable = Context.Controls.CreateTableLayoutPanel(deleteLabel, nameHeaderLabel, lastViewedHeaderLabel, lastEpisodeHeaderLabel); Application.OpenForms[0].Controls.Add(seriesTable); } int forStart = 0; if (isAdd) { forStart = Internal.Variables.SeriesList.Count - 1; } else { forStart = 0; } for (int i = forStart; i < Internal.Variables.SeriesList.Count; i++) { Label nameLabel = Context.Controls.CreateLabel("name_" + Internal.Variables.SeriesList[i].Id, Internal.Variables.SeriesList[i].Name, false); Label lastViewedLabel = Context.Controls.CreateLabel("lastViewed_" + Internal.Variables.SeriesList[i].Id, Internal.Variables.SeriesList[i].LastViewed.ToString(), false); lastViewedLabel.Cursor = Cursors.Hand; lastViewedLabel.Click += lastViewedLabel_Click; Label lastEpLabel = new Label(); if (Internal.Variables.SeriesList[i].LastEpisode != null) { lastEpLabel = Context.Controls.CreateLabel("lastEp_" + Internal.Variables.SeriesList[i].Id, Internal.Variables.SeriesList[i].LastEpisode.ToString(), false); } else { lastEpLabel = Context.Controls.CreateLabel("lastEp_" + Internal.Variables.SeriesList[i].Id, "", false); } PictureBox deleteImage = Context.Controls.CreatePictureBox("delete_" + Internal.Variables.SeriesList[i].Id, Properties.Resources.delete1, 0, 0, 10, true); deleteImage.Click += deleteImage_Click; TableLayoutPanel seriesTable = (TableLayoutPanel)Controls.Find("seriesTable", true)[0]; seriesTable.Controls.Add(deleteImage, 0, i + 1); seriesTable.Controls.Add(nameLabel, 1, i + 1); seriesTable.Controls.Add(lastViewedLabel, 2, i + 1); seriesTable.Controls.Add(lastEpLabel, 3, i + 1); if (Internal.Variables.SeriesList[i].LastEpisode.SeasonNumber > Internal.Variables.SeriesList[i].LastViewed.SeasonNumber || (Internal.Variables.SeriesList[i].LastEpisode.SeasonNumber == Internal.Variables.SeriesList[i].LastViewed.SeasonNumber && Internal.Variables.SeriesList[i].LastEpisode.EpisodeNumber > Internal.Variables.SeriesList[i].LastViewed.EpisodeNumber)) { lastEpLabel.Font = new Font(lastEpLabel.Font, FontStyle.Bold); lastEpLabel.Width = lastEpLabel.PreferredWidth; /* * PictureBox newPicture = ControlManagement.NewControls.createPictureBox("new_" + MainProgram.Variables.seriesList[i].id, * SeriesUpdater.Properties.Resources.uj_másolat, createSeriesTable.Left + lastEpLabel.Left + lastEpLabel.Width + 2, * createSeriesTable.Top + lastEpLabel.Top + 1, 10); * newPicture.BringToFront(); */ } } placeForm(false, false); }
public TableFleetControl(FormFleet parent, TableLayoutPanel table) : this( parent ) { AddToTable(table); }
/// <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(ColorPicker)); this.grpPreview = new System.Windows.Forms.GroupBox(); this.lblPreview = new System.Windows.Forms.Label(); this.dialogButtons1 = new GIS.Common.Dialogs.DialogButtons(); this.grdSlider = new GIS.Common.Dialogs.GradientControl(); this._spatialStatusStrip1 = new GIS.Common.Dialogs.SymbologyStatusStrip(); this.statusText = new System.Windows.Forms.ToolStripStatusLabel(); this.statusProgress = new System.Windows.Forms.ToolStripProgressBar(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.helpProvider1 = new System.Windows.Forms.HelpProvider(); this.grpPreview.SuspendLayout(); this._spatialStatusStrip1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); this.SuspendLayout(); // // grpPreview // resources.ApplyResources(this.grpPreview, "grpPreview"); this.grpPreview.Controls.Add(this.lblPreview); this.helpProvider1.SetHelpString(this.grpPreview, resources.GetString("grpPreview.HelpString")); this.grpPreview.Name = "grpPreview"; this.helpProvider1.SetShowHelp(this.grpPreview, ((bool)(resources.GetObject("grpPreview.ShowHelp")))); this.grpPreview.TabStop = false; // // lblPreview // this.lblPreview.BackColor = System.Drawing.Color.White; this.lblPreview.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; resources.ApplyResources(this.lblPreview, "lblPreview"); this.lblPreview.Name = "lblPreview"; this.helpProvider1.SetShowHelp(this.lblPreview, ((bool)(resources.GetObject("lblPreview.ShowHelp")))); // // dialogButtons1 // resources.ApplyResources(this.dialogButtons1, "dialogButtons1"); this.dialogButtons1.Name = "dialogButtons1"; this.helpProvider1.SetShowHelp(this.dialogButtons1, ((bool)(resources.GetObject("dialogButtons1.ShowHelp")))); // // grdSlider // resources.ApplyResources(this.grdSlider, "grdSlider"); this.grdSlider.EndValue = 0.8F; this.helpProvider1.SetHelpString(this.grdSlider, resources.GetString("grdSlider.HelpString")); this.grdSlider.MaximumColor = System.Drawing.Color.Blue; this.grdSlider.MinimumColor = System.Drawing.Color.Lime; this.grdSlider.Name = "grdSlider"; this.helpProvider1.SetShowHelp(this.grdSlider, ((bool)(resources.GetObject("grdSlider.ShowHelp")))); this.grdSlider.SlidersEnabled = true; this.grdSlider.StartValue = 0.2F; // // _spatialStatusStrip1 // this._spatialStatusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.statusText, this.statusProgress }); resources.ApplyResources(this._spatialStatusStrip1, "_spatialStatusStrip1"); this._spatialStatusStrip1.Name = "_spatialStatusStrip1"; this._spatialStatusStrip1.ProgressBar = null; this._spatialStatusStrip1.ProgressLabel = this.statusText; this.helpProvider1.SetShowHelp(this._spatialStatusStrip1, ((bool)(resources.GetObject("_spatialStatusStrip1.ShowHelp")))); // // statusText // this.statusText.IsLink = true; this.statusText.Name = "statusText"; resources.ApplyResources(this.statusText, "statusText"); this.statusText.Text = ICSharpCode.Core.StringParser.Parse("${res:UI.Ready}"); this.statusText.Spring = true; // // statusProgress // this.statusProgress.Name = "statusProgress"; resources.ApplyResources(this.statusProgress, "statusProgress"); // // tableLayoutPanel1 // resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); this.tableLayoutPanel1.Controls.Add(this.dialogButtons1, 0, 2); this.tableLayoutPanel1.Controls.Add(this.grdSlider, 0, 1); this.tableLayoutPanel1.Controls.Add(this.grpPreview, 0, 0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.helpProvider1.SetShowHelp(this.tableLayoutPanel1, ((bool)(resources.GetObject("tableLayoutPanel1.ShowHelp")))); // // ColorPicker // resources.ApplyResources(this, "$this"); this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this._spatialStatusStrip1); this.HelpButton = true; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "ColorPicker"; this.helpProvider1.SetShowHelp(this, ((bool)(resources.GetObject("$this.ShowHelp")))); this.ShowInTaskbar = false; this.grpPreview.ResumeLayout(false); this._spatialStatusStrip1.ResumeLayout(false); this._spatialStatusStrip1.PerformLayout(); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); }
public Layout_TCWizardDomain() { InitializeComponent(); this.Dock = DockStyle.Fill; folderBrowserDialog.Description = "Select root TWizard folder"; folderBrowserDialog.ShowNewFolderButton = false; tblPanel = new TableLayoutPanel(); tblPanel.Dock = DockStyle.Fill; if (Client.Properties.Settings.DEBUGENABLED) { tblPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Inset; } this.Controls.Add(tblPanel); // add row tblPanel.RowCount = 2; tblPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 40)); tblPanel.RowStyles.Add(new RowStyle(SizeType.AutoSize)); lblFolder = new Label(); lblFolder.Anchor = AnchorStyles.Left; lblFolder.AutoSize = true; lblFolder.Text = "No folder selcted"; btnSelectFolder = new Button(); btnSelectFolder.Text = "Open"; btnSelectFolder.Click += BtnSelectFolder_Click; btnSaveSetting = new Button(); btnSaveSetting.Text = "Save Setup"; btnSaveSetting.Enabled = false; btnSaveSetting.Click += BtnSaveSetting_Click; //Add items to first Row flowpnl_firstRow = new FlowLayoutPanel(); tblPanel.Controls.Add(flowpnl_firstRow, 0, 0); tblPanel.Controls[0].Dock = DockStyle.Fill; flowpnl_firstRow.Controls.Add(btnSaveSetting); flowpnl_firstRow.Controls.Add(btnSelectFolder); flowpnl_firstRow.Controls.Add(lblFolder); //Add items to second Row (table) dataGridView = new DataGridView(); dataGridView.Dock = DockStyle.Fill; tblPanel.Controls.Add(dataGridView, 0, 1); // Setup datagrid dataGridView.ColumnCount = 11; dataGridView.ColumnHeadersVisible = true; //dataGridView.EditMode = DataGridViewEditMode.EditProgrammatically; //TODO Falls über eingabefeld geändert wird. // Set the column header names. dataGridView.Columns[0].Name = "Module ID"; dataGridView.Columns[0].Width = 35; dataGridView.Columns[0].ReadOnly = true; dataGridView.Columns[1].Name = "Full directory"; dataGridView.Columns[1].ReadOnly = true; dataGridView.Columns[2].Name = "Modulename"; dataGridView.Columns[2].Width = 140; dataGridView.Columns[2].ReadOnly = true; dataGridView.Columns[3].Name = "Equipment file"; dataGridView.Columns[3].ReadOnly = true; dataGridView.Columns[4].Name = "List equipment id"; dataGridView.Columns[4].Width = 35; dataGridView.Columns[4].ReadOnly = true; dataGridView.Columns[5].Name = "Group prefix"; dataGridView.Columns[5].Width = 160; dataGridView.Columns[5].ReadOnly = false; dataGridView.Columns[6].Name = "Level2"; dataGridView.Columns[6].ReadOnly = true; dataGridView.Columns[7].Name = "Level3"; dataGridView.Columns[7].ReadOnly = true; dataGridView.Columns[8].Name = "Level4"; dataGridView.Columns[8].ReadOnly = true; dataGridView.Columns[9].Name = "Level11"; dataGridView.Columns[9].ReadOnly = true; dataGridView.Columns[10].Name = "Level15"; dataGridView.Columns[10].ReadOnly = true; //Setup objects listXmlEquipment = new List <XmlDocument>(); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.m_lbl_red = new System.Windows.Forms.Label(); this.m_lbl_hex = new System.Windows.Forms.Label(); this.m_lbl_blue = new System.Windows.Forms.Label(); this.m_lbl_green = new System.Windows.Forms.Label(); this.m_edit_red = new System.Windows.Forms.TextBox(); this.m_edit_green = new System.Windows.Forms.TextBox(); this.m_edit_blue = new System.Windows.Forms.TextBox(); this.m_edit_hex = new System.Windows.Forms.TextBox(); this.m_btn_ok = new System.Windows.Forms.Button(); this.m_btn_cancel = new System.Windows.Forms.Button(); this.m_edit_hue = new System.Windows.Forms.TextBox(); this.m_edit_sat = new System.Windows.Forms.TextBox(); this.m_edit_lum = new System.Windows.Forms.TextBox(); this.m_lbl_hue = new System.Windows.Forms.Label(); this.m_lbl_sat = new System.Windows.Forms.Label(); this.m_lbl_lum = new System.Windows.Forms.Label(); this.m_edit_alpha = new System.Windows.Forms.TextBox(); this.m_lbl_alpha = new System.Windows.Forms.Label(); this.m_lbl_basic = new System.Windows.Forms.Label(); this.m_table_basic = new System.Windows.Forms.TableLayoutPanel(); this.m_lbl_recent = new System.Windows.Forms.Label(); this.m_table_recent = new System.Windows.Forms.TableLayoutPanel(); this.m_lbl_initial = new System.Windows.Forms.Label(); this.m_panel_initial = new System.Windows.Forms.Panel(); this.m_panel_selected = new System.Windows.Forms.Panel(); this.m_lbl_selected = new System.Windows.Forms.Label(); this.m_wheel = new Rylogic.Gui.WinForms.ColourWheel(); this.SuspendLayout(); // // m_lbl_red // this.m_lbl_red.AutoSize = true; this.m_lbl_red.Location = new System.Drawing.Point(315, 159); this.m_lbl_red.Name = "m_lbl_red"; this.m_lbl_red.Size = new System.Drawing.Size(30, 13); this.m_lbl_red.TabIndex = 1; this.m_lbl_red.Text = "&Red:"; // // m_lbl_hex // this.m_lbl_hex.AutoSize = true; this.m_lbl_hex.Location = new System.Drawing.Point(265, 251); this.m_lbl_hex.Name = "m_lbl_hex"; this.m_lbl_hex.Size = new System.Drawing.Size(29, 13); this.m_lbl_hex.TabIndex = 2; this.m_lbl_hex.Text = "&Hex:"; // // m_lbl_blue // this.m_lbl_blue.AutoSize = true; this.m_lbl_blue.Location = new System.Drawing.Point(314, 203); this.m_lbl_blue.Name = "m_lbl_blue"; this.m_lbl_blue.Size = new System.Drawing.Size(31, 13); this.m_lbl_blue.TabIndex = 3; this.m_lbl_blue.Text = "&Blue:"; // // m_lbl_green // this.m_lbl_green.AutoSize = true; this.m_lbl_green.Location = new System.Drawing.Point(306, 181); this.m_lbl_green.Name = "m_lbl_green"; this.m_lbl_green.Size = new System.Drawing.Size(39, 13); this.m_lbl_green.TabIndex = 4; this.m_lbl_green.Text = "&Green:"; // // m_edit_red // this.m_edit_red.Location = new System.Drawing.Point(351, 156); this.m_edit_red.Name = "m_edit_red"; this.m_edit_red.Size = new System.Drawing.Size(45, 20); this.m_edit_red.TabIndex = 3; // // m_edit_green // this.m_edit_green.Location = new System.Drawing.Point(351, 178); this.m_edit_green.Name = "m_edit_green"; this.m_edit_green.Size = new System.Drawing.Size(45, 20); this.m_edit_green.TabIndex = 4; // // m_edit_blue // this.m_edit_blue.Location = new System.Drawing.Point(351, 200); this.m_edit_blue.Name = "m_edit_blue"; this.m_edit_blue.Size = new System.Drawing.Size(45, 20); this.m_edit_blue.TabIndex = 5; // // m_edit_hex // this.m_edit_hex.Location = new System.Drawing.Point(300, 248); this.m_edit_hex.Name = "m_edit_hex"; this.m_edit_hex.Size = new System.Drawing.Size(87, 20); this.m_edit_hex.TabIndex = 7; // // m_btn_ok // this.m_btn_ok.DialogResult = System.Windows.Forms.DialogResult.OK; this.m_btn_ok.Location = new System.Drawing.Point(239, 285); this.m_btn_ok.Name = "m_btn_ok"; this.m_btn_ok.Size = new System.Drawing.Size(75, 23); this.m_btn_ok.TabIndex = 8; this.m_btn_ok.Text = "&OK"; this.m_btn_ok.UseVisualStyleBackColor = true; // // m_btn_cancel // this.m_btn_cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.m_btn_cancel.Location = new System.Drawing.Point(321, 285); this.m_btn_cancel.Name = "m_btn_cancel"; this.m_btn_cancel.Size = new System.Drawing.Size(75, 23); this.m_btn_cancel.TabIndex = 9; this.m_btn_cancel.Text = "&Cancel"; this.m_btn_cancel.UseVisualStyleBackColor = true; // // m_edit_hue // this.m_edit_hue.Location = new System.Drawing.Point(249, 156); this.m_edit_hue.Name = "m_edit_hue"; this.m_edit_hue.Size = new System.Drawing.Size(45, 20); this.m_edit_hue.TabIndex = 0; // // m_edit_sat // this.m_edit_sat.Location = new System.Drawing.Point(249, 178); this.m_edit_sat.Name = "m_edit_sat"; this.m_edit_sat.Size = new System.Drawing.Size(45, 20); this.m_edit_sat.TabIndex = 1; // // m_edit_lum // this.m_edit_lum.Location = new System.Drawing.Point(249, 200); this.m_edit_lum.Name = "m_edit_lum"; this.m_edit_lum.Size = new System.Drawing.Size(45, 20); this.m_edit_lum.TabIndex = 2; // // m_lbl_hue // this.m_lbl_hue.AutoSize = true; this.m_lbl_hue.Location = new System.Drawing.Point(213, 159); this.m_lbl_hue.Name = "m_lbl_hue"; this.m_lbl_hue.Size = new System.Drawing.Size(30, 13); this.m_lbl_hue.TabIndex = 14; this.m_lbl_hue.Text = "&Hue:"; // // m_lbl_sat // this.m_lbl_sat.AutoSize = true; this.m_lbl_sat.Location = new System.Drawing.Point(217, 181); this.m_lbl_sat.Name = "m_lbl_sat"; this.m_lbl_sat.Size = new System.Drawing.Size(26, 13); this.m_lbl_sat.TabIndex = 15; this.m_lbl_sat.Text = "&Sat:"; // // m_lbl_lum // this.m_lbl_lum.AutoSize = true; this.m_lbl_lum.Location = new System.Drawing.Point(213, 203); this.m_lbl_lum.Name = "m_lbl_lum"; this.m_lbl_lum.Size = new System.Drawing.Size(30, 13); this.m_lbl_lum.TabIndex = 16; this.m_lbl_lum.Text = "&Lum:"; // // m_edit_alpha // this.m_edit_alpha.Location = new System.Drawing.Point(300, 225); this.m_edit_alpha.Name = "m_edit_alpha"; this.m_edit_alpha.Size = new System.Drawing.Size(45, 20); this.m_edit_alpha.TabIndex = 6; // // m_lbl_alpha // this.m_lbl_alpha.AutoSize = true; this.m_lbl_alpha.Location = new System.Drawing.Point(257, 228); this.m_lbl_alpha.Name = "m_lbl_alpha"; this.m_lbl_alpha.Size = new System.Drawing.Size(37, 13); this.m_lbl_alpha.TabIndex = 18; this.m_lbl_alpha.Text = "&Alpha:"; // // m_lbl_basic // this.m_lbl_basic.AutoSize = true; this.m_lbl_basic.Location = new System.Drawing.Point(12, 10); this.m_lbl_basic.Name = "m_lbl_basic"; this.m_lbl_basic.Size = new System.Drawing.Size(74, 13); this.m_lbl_basic.TabIndex = 19; this.m_lbl_basic.Text = "Basic Colours:"; // // m_table_basic // this.m_table_basic.ColumnCount = 7; this.m_table_basic.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_basic.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_basic.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_basic.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_basic.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_basic.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_basic.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_basic.Location = new System.Drawing.Point(12, 25); this.m_table_basic.Name = "m_table_basic"; this.m_table_basic.RowCount = 7; this.m_table_basic.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_basic.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_basic.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_basic.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_basic.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_basic.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_basic.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_basic.Size = new System.Drawing.Size(175, 175); this.m_table_basic.TabIndex = 20; // // m_lbl_recent // this.m_lbl_recent.AutoSize = true; this.m_lbl_recent.Location = new System.Drawing.Point(9, 205); this.m_lbl_recent.Name = "m_lbl_recent"; this.m_lbl_recent.Size = new System.Drawing.Size(83, 13); this.m_lbl_recent.TabIndex = 21; this.m_lbl_recent.Text = "Recent Colours:"; // // m_table_recent // this.m_table_recent.ColumnCount = 7; this.m_table_recent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_recent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_recent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_recent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_recent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_recent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_recent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_recent.Location = new System.Drawing.Point(12, 220); this.m_table_recent.Name = "m_table_recent"; this.m_table_recent.RowCount = 2; this.m_table_recent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_recent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.m_table_recent.Size = new System.Drawing.Size(175, 50); this.m_table_recent.TabIndex = 21; // // m_lbl_initial // this.m_lbl_initial.AutoSize = true; this.m_lbl_initial.Location = new System.Drawing.Point(27, 280); this.m_lbl_initial.Name = "m_lbl_initial"; this.m_lbl_initial.Size = new System.Drawing.Size(67, 13); this.m_lbl_initial.TabIndex = 22; this.m_lbl_initial.Text = "Initial Colour:\r\n"; // // m_panel_initial // this.m_panel_initial.Location = new System.Drawing.Point(100, 277); this.m_panel_initial.Name = "m_panel_initial"; this.m_panel_initial.Size = new System.Drawing.Size(88, 19); this.m_panel_initial.TabIndex = 23; // // m_panel_selected // this.m_panel_selected.Location = new System.Drawing.Point(100, 295); this.m_panel_selected.Name = "m_panel_selected"; this.m_panel_selected.Size = new System.Drawing.Size(88, 19); this.m_panel_selected.TabIndex = 24; // // m_lbl_selected // this.m_lbl_selected.AutoSize = true; this.m_lbl_selected.Location = new System.Drawing.Point(9, 298); this.m_lbl_selected.Name = "m_lbl_selected"; this.m_lbl_selected.Size = new System.Drawing.Size(85, 13); this.m_lbl_selected.TabIndex = 25; this.m_lbl_selected.Text = "Selected Colour:"; // // m_wheel // this.m_wheel.Colour = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); this.m_wheel.Location = new System.Drawing.Point(194, 12); this.m_wheel.Name = "m_wheel"; this.m_wheel.Parts = ((Rylogic.Gui.WinForms.ColourWheel.EParts)((((((Rylogic.Gui.WinForms.ColourWheel.EParts.Wheel | Rylogic.Gui.WinForms.ColourWheel.EParts.VSlider) | Rylogic.Gui.WinForms.ColourWheel.EParts.ASlider) | Rylogic.Gui.WinForms.ColourWheel.EParts.ColourSelection) | Rylogic.Gui.WinForms.ColourWheel.EParts.VSelection) | Rylogic.Gui.WinForms.ColourWheel.EParts.ASelection))); this.m_wheel.Size = new System.Drawing.Size(203, 138); this.m_wheel.SliderWidth = 20; this.m_wheel.TabIndex = 0; this.m_wheel.VerticalLayout = false; // // ColourUI // this.AcceptButton = this.m_btn_ok; this.CancelButton = this.m_btn_cancel; this.ClientSize = new System.Drawing.Size(409, 321); this.Controls.Add(this.m_lbl_selected); this.Controls.Add(this.m_panel_selected); this.Controls.Add(this.m_panel_initial); this.Controls.Add(this.m_lbl_initial); this.Controls.Add(this.m_table_recent); this.Controls.Add(this.m_lbl_recent); this.Controls.Add(this.m_table_basic); this.Controls.Add(this.m_lbl_basic); this.Controls.Add(this.m_lbl_alpha); this.Controls.Add(this.m_edit_alpha); this.Controls.Add(this.m_lbl_lum); this.Controls.Add(this.m_lbl_sat); this.Controls.Add(this.m_lbl_hue); this.Controls.Add(this.m_edit_lum); this.Controls.Add(this.m_edit_sat); this.Controls.Add(this.m_edit_hue); this.Controls.Add(this.m_btn_cancel); this.Controls.Add(this.m_btn_ok); this.Controls.Add(this.m_edit_hex); this.Controls.Add(this.m_edit_blue); this.Controls.Add(this.m_edit_green); this.Controls.Add(this.m_edit_red); this.Controls.Add(this.m_lbl_green); this.Controls.Add(this.m_lbl_blue); this.Controls.Add(this.m_lbl_hex); this.Controls.Add(this.m_lbl_red); this.Controls.Add(this.m_wheel); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "ColourUI"; this.ShowIcon = false; this.ShowInTaskbar = false; this.Text = "Choose a Colour:"; this.ResumeLayout(false); this.PerformLayout(); }
private void InitializeComponent() { this.tableLayoutPanel1 = new TableLayoutPanel(); this.gameFileEdit1 = new DoomLauncher.GameFileEdit(); this.flowLayoutPanel1 = new FlowLayoutPanel(); this.btnCancel = new Button(); this.btnAccept = new Button(); this.label1 = new Label(); this.button1 = new Button(); this.tableLayoutPanel1.SuspendLayout(); this.flowLayoutPanel1.SuspendLayout(); base.SuspendLayout(); this.tableLayoutPanel1.ColumnCount = 1; this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f)); this.tableLayoutPanel1.Controls.Add(this.gameFileEdit1, 0, 0); this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 2); this.tableLayoutPanel1.Controls.Add(this.label1, 0, 1); this.tableLayoutPanel1.Dock = DockStyle.Fill; this.tableLayoutPanel1.Location = new Point(0, 0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 3; this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 40f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 32f)); this.tableLayoutPanel1.Size = new Size(430, 490); this.tableLayoutPanel1.TabIndex = 2; this.gameFileEdit1.AuthorChecked = false; this.gameFileEdit1.CommentsChecked = true; this.gameFileEdit1.DescriptionChecked = false; this.gameFileEdit1.Dock = DockStyle.Fill; this.gameFileEdit1.Location = new Point(3, 3); this.gameFileEdit1.Name = "gameFileEdit1"; this.gameFileEdit1.RatingChecked = false; this.gameFileEdit1.ReleaseDateChecked = false; this.gameFileEdit1.Size = new Size(0x1a8, 0x19c); this.gameFileEdit1.TabIndex = 0; this.gameFileEdit1.TitleChecked = false; this.flowLayoutPanel1.Controls.Add(this.btnCancel); this.flowLayoutPanel1.Controls.Add(this.button1); this.flowLayoutPanel1.Controls.Add(this.btnAccept); this.flowLayoutPanel1.Dock = DockStyle.Fill; this.flowLayoutPanel1.FlowDirection = FlowDirection.RightToLeft; this.flowLayoutPanel1.Location = new Point(0, 0x1ca); this.flowLayoutPanel1.Margin = new Padding(0); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Size = new Size(430, 0x20); this.flowLayoutPanel1.TabIndex = 1; this.btnCancel.DialogResult = DialogResult.Cancel; this.btnCancel.Location = new Point(0x160, 3); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new Size(0x4b, 0x17); this.btnCancel.TabIndex = 0; this.btnCancel.Text = "Cancel"; this.btnCancel.UseVisualStyleBackColor = true; this.btnAccept.DialogResult = DialogResult.OK; this.btnAccept.Location = new Point(190, 3); this.btnAccept.Name = "btnAccept"; this.btnAccept.Size = new Size(0x4b, 0x17); this.btnAccept.TabIndex = 1; this.btnAccept.Text = "Accept"; this.btnAccept.UseVisualStyleBackColor = true; this.label1.Anchor = AnchorStyles.Left; this.label1.AutoSize = true; this.label1.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0); this.label1.Location = new Point(3, 0x1a9); this.label1.Name = "label1"; this.label1.Size = new Size(0x1a5, 0x1a); this.label1.TabIndex = 2; this.label1.Text = "The fields from id games are displayed above. To accept meta changes, check the box next to the items you wish to update and click accept."; this.button1.DialogResult = DialogResult.Yes; this.button1.Location = new Point(0x10f, 3); this.button1.Name = "button1"; this.button1.Size = new Size(0x4b, 0x17); this.button1.TabIndex = 2; this.button1.Text = "Accept All"; this.button1.UseVisualStyleBackColor = true; base.AcceptButton = this.btnAccept; base.AutoScaleDimensions = new SizeF(6f, 13f); base.AutoScaleMode = AutoScaleMode.Font; base.CancelButton = this.btnCancel; base.ClientSize = new Size(430, 490); base.Controls.Add(this.tableLayoutPanel1); base.Name = "MetaDataForm"; this.Text = "Metadata"; this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); this.flowLayoutPanel1.ResumeLayout(false); base.ResumeLayout(false); }
private void InitializeComponent() { this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.flowLayoutPanel4 = new System.Windows.Forms.FlowLayoutPanel(); this.label4 = new System.Windows.Forms.Label(); this.checkBox2 = new System.Windows.Forms.CheckBox(); this.webBrowser2 = new System.Windows.Forms.WebBrowser(); this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); this.label2 = new System.Windows.Forms.Label(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel(); this.label1 = new System.Windows.Forms.Label(); this.webBrowser1 = new System.Windows.Forms.WebBrowser(); this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel(); this.label3 = new System.Windows.Forms.Label(); this.checkBox1 = new System.Windows.Forms.CheckBox(); this.flowLayoutPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.tableLayoutPanel1.SuspendLayout(); this.flowLayoutPanel4.SuspendLayout(); this.tableLayoutPanel3.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); this.flowLayoutPanel2.SuspendLayout(); this.flowLayoutPanel3.SuspendLayout(); this.SuspendLayout(); // // flowLayoutPanel1 // this.flowLayoutPanel1.AutoSize = true; this.flowLayoutPanel1.Controls.Add(this.pictureBox1); this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 277); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Size = new System.Drawing.Size(848, 321); this.flowLayoutPanel1.TabIndex = 0; // // pictureBox1 // this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Top; this.pictureBox1.Image = global::WF_Practice.Properties.Resources.batVSsup; this.pictureBox1.Location = new System.Drawing.Point(3, 3); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(851, 315); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.pictureBox1.TabIndex = 0; this.pictureBox1.TabStop = false; // // tableLayoutPanel1 // this.tableLayoutPanel1.ColumnCount = 2; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel4, 1, 2); this.tableLayoutPanel1.Controls.Add(this.webBrowser2, 1, 1); this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel3, 1, 0); this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 0); this.tableLayoutPanel1.Controls.Add(this.webBrowser1, 0, 1); this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel3, 0, 2); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 3; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); this.tableLayoutPanel1.Size = new System.Drawing.Size(848, 277); this.tableLayoutPanel1.TabIndex = 1; // // flowLayoutPanel4 // this.flowLayoutPanel4.Controls.Add(this.label4); this.flowLayoutPanel4.Controls.Add(this.checkBox2); this.flowLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutPanel4.Location = new System.Drawing.Point(424, 247); this.flowLayoutPanel4.Margin = new System.Windows.Forms.Padding(0); this.flowLayoutPanel4.Name = "flowLayoutPanel4"; this.flowLayoutPanel4.Size = new System.Drawing.Size(424, 30); this.flowLayoutPanel4.TabIndex = 5; // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(50, 6); this.label4.Margin = new System.Windows.Forms.Padding(50, 6, 3, 0); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(79, 13); this.label4.TabIndex = 2; this.label4.Text = "Superman wins"; // // checkBox2 // this.checkBox2.AutoSize = true; this.checkBox2.Location = new System.Drawing.Point(135, 6); this.checkBox2.Margin = new System.Windows.Forms.Padding(3, 6, 3, 3); this.checkBox2.Name = "checkBox2"; this.checkBox2.Size = new System.Drawing.Size(44, 17); this.checkBox2.TabIndex = 1; this.checkBox2.Text = "(-_-)"; this.checkBox2.UseVisualStyleBackColor = true; // // webBrowser2 // this.webBrowser2.Dock = System.Windows.Forms.DockStyle.Fill; this.webBrowser2.Location = new System.Drawing.Point(427, 33); this.webBrowser2.MinimumSize = new System.Drawing.Size(20, 20); this.webBrowser2.Name = "webBrowser2"; this.webBrowser2.ScriptErrorsSuppressed = true; this.webBrowser2.Size = new System.Drawing.Size(418, 211); this.webBrowser2.TabIndex = 3; this.webBrowser2.Url = new System.Uri("https://media.giphy.com/media/3osxYfP8SJVa9XpVyo/giphy.gif", System.UriKind.Absolute); // // tableLayoutPanel3 // this.tableLayoutPanel3.ColumnCount = 1; this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel3.Controls.Add(this.label2, 0, 0); this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel3.Location = new System.Drawing.Point(424, 0); this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(0); this.tableLayoutPanel3.Name = "tableLayoutPanel3"; this.tableLayoutPanel3.RowCount = 1; this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); this.tableLayoutPanel3.Size = new System.Drawing.Size(424, 30); this.tableLayoutPanel3.TabIndex = 1; // // label2 // this.label2.AutoSize = true; this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 16F); this.label2.Location = new System.Drawing.Point(150, 0); this.label2.Margin = new System.Windows.Forms.Padding(150, 0, 3, 0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(113, 26); this.label2.TabIndex = 1; this.label2.Text = "Superman"; // // tableLayoutPanel2 // this.tableLayoutPanel2.ColumnCount = 1; this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel2.Controls.Add(this.flowLayoutPanel2, 0, 0); this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0); this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0); this.tableLayoutPanel2.Name = "tableLayoutPanel2"; this.tableLayoutPanel2.RowCount = 1; this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel2.Size = new System.Drawing.Size(424, 30); this.tableLayoutPanel2.TabIndex = 0; // // flowLayoutPanel2 // this.flowLayoutPanel2.Controls.Add(this.label1); this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutPanel2.Location = new System.Drawing.Point(0, 0); this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(0); this.flowLayoutPanel2.Name = "flowLayoutPanel2"; this.flowLayoutPanel2.Size = new System.Drawing.Size(424, 30); this.flowLayoutPanel2.TabIndex = 0; // // label1 // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 16F); this.label1.Location = new System.Drawing.Point(150, 0); this.label1.Margin = new System.Windows.Forms.Padding(150, 0, 3, 0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(88, 26); this.label1.TabIndex = 0; this.label1.Text = "Batman"; // // webBrowser1 // this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill; this.webBrowser1.Location = new System.Drawing.Point(3, 33); this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); this.webBrowser1.Name = "webBrowser1"; this.webBrowser1.ScriptErrorsSuppressed = true; this.webBrowser1.Size = new System.Drawing.Size(418, 211); this.webBrowser1.TabIndex = 2; this.webBrowser1.Url = new System.Uri("http://45.media.tumblr.com/c09abeaae50b2b922e18a3ee47ba427c/tumblr_mwahfnhpEg1r3m" + "aj7o1_500.gif", System.UriKind.Absolute); // // flowLayoutPanel3 // this.flowLayoutPanel3.Controls.Add(this.label3); this.flowLayoutPanel3.Controls.Add(this.checkBox1); this.flowLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutPanel3.Location = new System.Drawing.Point(0, 247); this.flowLayoutPanel3.Margin = new System.Windows.Forms.Padding(0); this.flowLayoutPanel3.Name = "flowLayoutPanel3"; this.flowLayoutPanel3.Size = new System.Drawing.Size(424, 30); this.flowLayoutPanel3.TabIndex = 4; // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(50, 6); this.label3.Margin = new System.Windows.Forms.Padding(50, 6, 3, 0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(67, 13); this.label3.TabIndex = 1; this.label3.Text = "Batman wins"; // // checkBox1 // this.checkBox1.AutoSize = true; this.checkBox1.Location = new System.Drawing.Point(123, 6); this.checkBox1.Margin = new System.Windows.Forms.Padding(3, 6, 3, 3); this.checkBox1.Name = "checkBox1"; this.checkBox1.Size = new System.Drawing.Size(50, 17); this.checkBox1.TabIndex = 0; this.checkBox1.Text = "(^_^)"; this.checkBox1.UseVisualStyleBackColor = true; // // Form1 // this.ClientSize = new System.Drawing.Size(848, 598); this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.flowLayoutPanel1); this.Name = "Form1"; this.flowLayoutPanel1.ResumeLayout(false); this.flowLayoutPanel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.tableLayoutPanel1.ResumeLayout(false); this.flowLayoutPanel4.ResumeLayout(false); this.flowLayoutPanel4.PerformLayout(); this.tableLayoutPanel3.ResumeLayout(false); this.tableLayoutPanel3.PerformLayout(); this.tableLayoutPanel2.ResumeLayout(false); this.flowLayoutPanel2.ResumeLayout(false); this.flowLayoutPanel2.PerformLayout(); this.flowLayoutPanel3.ResumeLayout(false); this.flowLayoutPanel3.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); }
private void InitializeComponent() { this.tableLayoutPanel = new TableLayoutPanel(); this.valueTextBox = new TextBox(); this.label18 = new Label(); this.label1 = new Label(); this.addressTextBox = new TextBox(); this.readButton = new Button(); this.writeButton = new Button(); this.label2 = new Label(); this.spanComboBox = new ComboBox(); this.tableLayoutPanel1 = new TableLayoutPanel(); this.label3 = new Label(); this.calibrationNumericUpDown = new NumericUpDown(); this.flashButton = new Button(); this.tableLayoutPanel.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); ((ISupportInitialize)this.calibrationNumericUpDown).BeginInit(); base.SuspendLayout(); this.tableLayoutPanel.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right); this.tableLayoutPanel.ColumnCount = 4; this.tableLayoutPanel1.SetColumnSpan(this.tableLayoutPanel, 2); this.tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50f)); this.tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50f)); this.tableLayoutPanel.ColumnStyles.Add(new ColumnStyle()); this.tableLayoutPanel.ColumnStyles.Add(new ColumnStyle()); this.tableLayoutPanel.Controls.Add(this.valueTextBox, 1, 2); this.tableLayoutPanel.Controls.Add(this.label18, 0, 1); this.tableLayoutPanel.Controls.Add(this.label1, 1, 1); this.tableLayoutPanel.Controls.Add(this.addressTextBox, 0, 2); this.tableLayoutPanel.Controls.Add(this.readButton, 2, 2); this.tableLayoutPanel.Controls.Add(this.writeButton, 3, 2); this.tableLayoutPanel.Controls.Add(this.label3, 0, 0); this.tableLayoutPanel.Controls.Add(this.calibrationNumericUpDown, 1, 0); this.tableLayoutPanel.Controls.Add(this.flashButton, 2, 0); this.tableLayoutPanel.Location = new Point(0, 27); this.tableLayoutPanel.Margin = new Padding(0); this.tableLayoutPanel.Name = "tableLayoutPanel"; this.tableLayoutPanel.RowCount = 3; this.tableLayoutPanel.RowStyles.Add(new RowStyle()); this.tableLayoutPanel.RowStyles.Add(new RowStyle()); this.tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100f)); this.tableLayoutPanel.Size = new Size(202, 73); this.tableLayoutPanel.TabIndex = 63; this.valueTextBox.Anchor = (AnchorStyles.Left | AnchorStyles.Right); this.valueTextBox.Location = new Point(78, 47); this.valueTextBox.Name = "valueTextBox"; this.valueTextBox.Size = new Size(69, 20); this.valueTextBox.TabIndex = 37; this.label18.Anchor = AnchorStyles.Left; this.label18.AutoSize = true; this.label18.Location = new Point(0, 29); this.label18.Margin = new Padding(0); this.label18.Name = "label18"; this.label18.Size = new Size(45, 13); this.label18.TabIndex = 34; this.label18.Text = "Address"; this.label1.Anchor = AnchorStyles.Left; this.label1.AutoSize = true; this.label1.Location = new Point(75, 29); this.label1.Margin = new Padding(0); this.label1.Name = "label1"; this.label1.Size = new Size(34, 13); this.label1.TabIndex = 35; this.label1.Text = "Value"; this.addressTextBox.Anchor = (AnchorStyles.Left | AnchorStyles.Right); this.addressTextBox.Location = new Point(3, 47); this.addressTextBox.Name = "addressTextBox"; this.addressTextBox.Size = new Size(69, 20); this.addressTextBox.TabIndex = 36; this.readButton.Anchor = AnchorStyles.None; this.readButton.Location = new Point(153, 47); this.readButton.Name = "readButton"; this.readButton.Size = new Size(20, 20); this.readButton.TabIndex = 38; this.readButton.Text = "R"; this.readButton.UseVisualStyleBackColor = true; this.readButton.Click += this.readButton_Click; this.writeButton.Anchor = AnchorStyles.None; this.writeButton.Location = new Point(179, 47); this.writeButton.Name = "writeButton"; this.writeButton.Size = new Size(20, 20); this.writeButton.TabIndex = 39; this.writeButton.Text = "W"; this.writeButton.UseVisualStyleBackColor = true; this.writeButton.Click += this.writeButton_Click; this.label2.Anchor = AnchorStyles.Left; this.label2.AutoSize = true; this.label2.Location = new Point(3, 7); this.label2.Name = "label2"; this.label2.Size = new Size(57, 13); this.label2.TabIndex = 40; this.label2.Text = "Bandwidth"; this.spanComboBox.Anchor = (AnchorStyles.Left | AnchorStyles.Right); this.spanComboBox.DropDownStyle = ComboBoxStyle.DropDownList; this.spanComboBox.FormattingEnabled = true; this.spanComboBox.Location = new Point(79, 3); this.spanComboBox.Name = "spanComboBox"; this.spanComboBox.Size = new Size(120, 21); this.spanComboBox.TabIndex = 41; this.spanComboBox.SelectedIndexChanged += this.spanComboBox_SelectedIndexChanged; this.tableLayoutPanel1.ColumnCount = 2; this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 37.62376f)); this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 62.37624f)); this.tableLayoutPanel1.Controls.Add(this.label2, 0, 0); this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel, 0, 1); this.tableLayoutPanel1.Controls.Add(this.spanComboBox, 1, 0); this.tableLayoutPanel1.Dock = DockStyle.Fill; this.tableLayoutPanel1.Location = new Point(0, 0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 2; this.tableLayoutPanel1.RowStyles.Add(new RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100f)); this.tableLayoutPanel1.Size = new Size(202, 100); this.tableLayoutPanel1.TabIndex = 64; this.label3.Anchor = AnchorStyles.Left; this.label3.AutoSize = true; this.label3.Location = new Point(3, 8); this.label3.Name = "label3"; this.label3.Size = new Size(57, 13); this.label3.TabIndex = 40; this.label3.Text = "CLK (PPB)"; this.calibrationNumericUpDown.Anchor = (AnchorStyles.Left | AnchorStyles.Right); this.calibrationNumericUpDown.Location = new Point(78, 4); this.calibrationNumericUpDown.Maximum = new decimal(new int[4] { 10000, 0, 0, 0 }); this.calibrationNumericUpDown.Minimum = new decimal(new int[4] { 10000, 0, 0, -2147483648 }); this.calibrationNumericUpDown.Name = "calibrationNumericUpDown"; this.calibrationNumericUpDown.Size = new Size(69, 20); this.calibrationNumericUpDown.TabIndex = 41; this.calibrationNumericUpDown.TextAlign = HorizontalAlignment.Right; this.calibrationNumericUpDown.ValueChanged += this.calibrationNumericUpDown_ValueChanged; this.flashButton.Anchor = (AnchorStyles.Left | AnchorStyles.Right); this.tableLayoutPanel.SetColumnSpan(this.flashButton, 2); this.flashButton.Location = new Point(153, 3); this.flashButton.Name = "flashButton"; this.flashButton.Size = new Size(46, 23); this.flashButton.TabIndex = 42; this.flashButton.Text = "Flash"; this.flashButton.UseVisualStyleBackColor = true; this.flashButton.Click += this.flashButton_Click; base.AutoScaleDimensions = new SizeF(6f, 13f); base.AutoScaleMode = AutoScaleMode.Font; base.Controls.Add(this.tableLayoutPanel1); base.Name = "ControllerPanel"; base.Size = new Size(202, 100); this.tableLayoutPanel.ResumeLayout(false); this.tableLayoutPanel.PerformLayout(); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); ((ISupportInitialize)this.calibrationNumericUpDown).EndInit(); base.ResumeLayout(false); }
public static void Execute(LabirintGraph graph, TableLayoutPanel panel = null, LabelControl first = null, LabelControl best = null) { var iterations = 0; var queue = new Queue <LabirintVertex>(); queue.Enqueue(graph.Start); while (queue.Count > 0 && !found) { var curr = queue.Dequeue(); curr.Visited = true; var elems = curr.Neighbours.FindAll(v => !v.Visited); foreach (var elem in elems) { if (!queue.Contains(elem)) { queue.Enqueue(elem); if (graph.Size < maxSize) { index = graph.Vertices.IndexOf(elem); if (elem != graph.Finish && panel != null) { panel.Controls[index].BackColor = GraphParser.Colors[5]; } } elem.Parent = curr; } } if (queue.Contains(graph.Finish)) { found = true; } if (panel == null || curr.NodeType != CellTypes.Empty) { continue; } iterations++; if (first != null) //&& !found) { dataFirst.Data = iterations; first.Invoke((MethodInvoker) delegate { first.Text = iterations.ToString(); }); } best?.Invoke((MethodInvoker) delegate { best.Text = iterations.ToString(); }); if (graph.Size < maxSize) { panel.Controls[graph.Vertices.IndexOf(curr)].BackColor = GraphParser.Colors[4]; } if (graph.Size < maxSize) { Thread.Sleep(speed); } while (wait) { ; } } dataBest.Data = iterations; dataBest.Algo = "BreadthFirst"; dataFirst.Algo = "BreadthFirst"; dataBest.Type = "Best"; dataFirst.Type = "First"; if (graph.Size > maxSize) { return; } var built = false; var steps = 1; var current = graph.Finish; while (!built) { if (panel == null) { continue; } if (current.Parent == graph.Start) { built = true; continue; } panel.Controls[graph.Vertices.IndexOf(current.Parent)].BackColor = Color.RoyalBlue; current = current.Parent; steps++; } if (graph.Size < 25) { built = false; current = graph.Finish; while (!built) { if (current == graph.Start) { built = true; continue; } panel.Controls[graph.Vertices.IndexOf(current)].Controls[0].Invoke((MethodInvoker) delegate { panel.Controls[graph.Vertices.IndexOf(current)].Controls[0].Text = steps.ToString(); }); steps--; if (current == graph.Start) { built = true; continue; } current = current.Parent; } } }
private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TrustManagerPromptUI)); this.tableLayoutPanelOuter = new System.Windows.Forms.TableLayoutPanel(); this.warningTextTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); this.pictureBoxWarning = new System.Windows.Forms.PictureBox(); this.linkLblMoreInformation = new System.Windows.Forms.LinkLabel(); this.tableLayoutPanelQuestion = new System.Windows.Forms.TableLayoutPanel(); this.lblQuestion = new System.Windows.Forms.Label(); this.pictureBoxQuestion = new System.Windows.Forms.PictureBox(); this.tableLayoutPanelButtons = new System.Windows.Forms.TableLayoutPanel(); this.btnInstall = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button(); this.tableLayoutPanelInfo = new System.Windows.Forms.TableLayoutPanel(); this.lblName = new System.Windows.Forms.Label(); this.lblFrom = new System.Windows.Forms.Label(); this.lblPublisher = new System.Windows.Forms.Label(); this.linkLblName = new System.Windows.Forms.LinkLabel(); this.linkLblFromUrl = new System.Windows.Forms.LinkLabel(); this.linkLblPublisher = new System.Windows.Forms.LinkLabel(); this.lineLabel = new System.Windows.Forms.Label(); this.toolTipFromUrl = new System.Windows.Forms.ToolTip(this.components); this.tableLayoutPanelOuter.SuspendLayout(); this.warningTextTableLayoutPanel.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxWarning)).BeginInit(); this.tableLayoutPanelQuestion.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxQuestion)).BeginInit(); this.tableLayoutPanelButtons.SuspendLayout(); this.tableLayoutPanelInfo.SuspendLayout(); this.SuspendLayout(); // // tableLayoutPanelOuter // resources.ApplyResources(this.tableLayoutPanelOuter, "tableLayoutPanelOuter"); this.tableLayoutPanelOuter.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.tableLayoutPanelOuter.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 510F)); this.tableLayoutPanelOuter.Controls.Add(this.warningTextTableLayoutPanel, 0, 4); this.tableLayoutPanelOuter.Controls.Add(this.tableLayoutPanelQuestion, 0, 0); this.tableLayoutPanelOuter.Controls.Add(this.tableLayoutPanelButtons, 0, 2); this.tableLayoutPanelOuter.Controls.Add(this.tableLayoutPanelInfo, 0, 1); this.tableLayoutPanelOuter.Controls.Add(this.lineLabel, 0, 3); this.tableLayoutPanelOuter.Margin = new System.Windows.Forms.Padding(0, 0, 0, 12); this.tableLayoutPanelOuter.Name = "tableLayoutPanelOuter"; this.tableLayoutPanelOuter.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanelOuter.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanelOuter.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanelOuter.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanelOuter.RowStyles.Add(new System.Windows.Forms.RowStyle()); // // warningTextTableLayoutPanel // resources.ApplyResources(this.warningTextTableLayoutPanel, "warningTextTableLayoutPanel"); this.warningTextTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.warningTextTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.warningTextTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.warningTextTableLayoutPanel.Controls.Add(this.pictureBoxWarning, 0, 0); this.warningTextTableLayoutPanel.Controls.Add(this.linkLblMoreInformation, 1, 0); this.warningTextTableLayoutPanel.Margin = new System.Windows.Forms.Padding(12, 6, 0, 0); this.warningTextTableLayoutPanel.Name = "warningTextTableLayoutPanel"; this.warningTextTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle()); // // pictureBoxWarning // resources.ApplyResources(this.pictureBoxWarning, "pictureBoxWarning"); this.pictureBoxWarning.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0); this.pictureBoxWarning.Name = "pictureBoxWarning"; this.pictureBoxWarning.TabStop = false; // // linkLblMoreInformation // resources.ApplyResources(this.linkLblMoreInformation, "linkLblMoreInformation"); this.linkLblMoreInformation.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0); this.linkLblMoreInformation.Name = "linkLblMoreInformation"; this.linkLblMoreInformation.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.TrustManagerPromptUI_ShowMoreInformation); // // tableLayoutPanelQuestion // resources.ApplyResources(this.tableLayoutPanelQuestion, "tableLayoutPanelQuestion"); this.tableLayoutPanelQuestion.BackColor = System.Drawing.SystemColors.Window; this.tableLayoutPanelQuestion.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanelQuestion.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 58F)); this.tableLayoutPanelQuestion.Controls.Add(this.lblQuestion, 0, 0); this.tableLayoutPanelQuestion.Controls.Add(this.pictureBoxQuestion, 1, 0); this.tableLayoutPanelQuestion.Margin = new System.Windows.Forms.Padding(0); this.tableLayoutPanelQuestion.Name = "tableLayoutPanelQuestion"; this.tableLayoutPanelQuestion.RowStyles.Add(new System.Windows.Forms.RowStyle()); // // lblQuestion // resources.ApplyResources(this.lblQuestion, "lblQuestion"); this.lblQuestion.Margin = new System.Windows.Forms.Padding(12, 12, 12, 0); this.lblQuestion.Name = "lblQuestion"; // // pictureBoxQuestion // resources.ApplyResources(this.pictureBoxQuestion, "pictureBoxQuestion"); this.pictureBoxQuestion.Margin = new System.Windows.Forms.Padding(0); this.pictureBoxQuestion.Name = "pictureBoxQuestion"; this.pictureBoxQuestion.TabStop = false; // // tableLayoutPanelButtons // resources.ApplyResources(this.tableLayoutPanelButtons, "tableLayoutPanelButtons"); this.tableLayoutPanelButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanelButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanelButtons.Controls.Add(this.btnInstall, 0, 0); this.tableLayoutPanelButtons.Controls.Add(this.btnCancel, 1, 0); this.tableLayoutPanelButtons.Margin = new System.Windows.Forms.Padding(0, 6, 12, 12); this.tableLayoutPanelButtons.Name = "tableLayoutPanelButtons"; this.tableLayoutPanelButtons.RowStyles.Add(new System.Windows.Forms.RowStyle()); // // btnInstall // resources.ApplyResources(this.btnInstall, "btnInstall"); this.btnInstall.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.btnInstall.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0); this.btnInstall.MinimumSize = new System.Drawing.Size(75, 23); this.btnInstall.Name = "btnInstall"; this.btnInstall.Padding = new System.Windows.Forms.Padding(10, 0, 10, 0); // // btnCancel // resources.ApplyResources(this.btnCancel, "btnCancel"); this.btnCancel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnCancel.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0); this.btnCancel.MinimumSize = new System.Drawing.Size(75, 23); this.btnCancel.Name = "btnCancel"; this.btnCancel.Padding = new System.Windows.Forms.Padding(10, 0, 10, 0); // // tableLayoutPanelInfo // resources.ApplyResources(this.tableLayoutPanelInfo, "tableLayoutPanelInfo"); this.tableLayoutPanelInfo.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.tableLayoutPanelInfo.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanelInfo.Controls.Add(this.lblName, 0, 0); this.tableLayoutPanelInfo.Controls.Add(this.linkLblName, 0, 1); this.tableLayoutPanelInfo.Controls.Add(this.lblFrom, 0, 2); this.tableLayoutPanelInfo.Controls.Add(this.linkLblFromUrl, 0, 3); this.tableLayoutPanelInfo.Controls.Add(this.lblPublisher, 0, 4); this.tableLayoutPanelInfo.Controls.Add(this.linkLblPublisher, 0, 5); this.tableLayoutPanelInfo.Margin = new System.Windows.Forms.Padding(30, 22, 12, 3); this.tableLayoutPanelInfo.Name = "tableLayoutPanelInfo"; this.tableLayoutPanelInfo.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanelInfo.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanelInfo.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanelInfo.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanelInfo.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanelInfo.RowStyles.Add(new System.Windows.Forms.RowStyle()); // // lblName // resources.ApplyResources(this.lblName, "lblName"); this.lblName.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0); this.lblName.Name = "lblName"; // // lblFrom // resources.ApplyResources(this.lblFrom, "lblFrom"); this.lblFrom.Margin = new System.Windows.Forms.Padding(0, 8, 3, 0); this.lblFrom.Name = "lblFrom"; // // lblPublisher // resources.ApplyResources(this.lblPublisher, "lblPublisher"); this.lblPublisher.Margin = new System.Windows.Forms.Padding(0, 8, 3, 0); this.lblPublisher.Name = "lblPublisher"; // // linkLblName // resources.ApplyResources(this.linkLblName, "linkLblName"); this.linkLblName.AutoEllipsis = true; this.linkLblName.Margin = new System.Windows.Forms.Padding(3, 0, 3, 8); this.linkLblName.Name = "linkLblName"; this.linkLblName.TabStop = true; this.linkLblName.UseMnemonic = false; this.linkLblName.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.TrustManagerPromptUI_ShowSupportPage); // // linkLblFromUrl // resources.ApplyResources(this.linkLblFromUrl, "linkLblFromUrl"); this.linkLblFromUrl.AutoEllipsis = true; this.linkLblFromUrl.Margin = new System.Windows.Forms.Padding(3, 0, 3, 8); this.linkLblFromUrl.Name = "linkLblFromUrl"; this.linkLblFromUrl.TabStop = true; this.linkLblFromUrl.UseMnemonic = false; this.linkLblFromUrl.MouseEnter += new System.EventHandler(this.linkLblFromUrl_MouseEnter); this.linkLblFromUrl.MouseLeave += new System.EventHandler(this.linkLblFromUrl_MouseLeave); // // linkLblPublisher // resources.ApplyResources(this.linkLblPublisher, "linkLblPublisher"); this.linkLblPublisher.AutoEllipsis = true; this.linkLblPublisher.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0); this.linkLblPublisher.Name = "linkLblPublisher"; this.linkLblPublisher.TabStop = true; this.linkLblPublisher.UseMnemonic = false; this.linkLblPublisher.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.TrustManagerPromptUI_ShowPublisherCertificate); // // lineLabel // resources.ApplyResources(this.lineLabel, "lineLabel"); this.lineLabel.BackColor = System.Drawing.SystemColors.ControlDark; this.lineLabel.Margin = new System.Windows.Forms.Padding(0); this.lineLabel.Name = "lineLabel"; // // TrustManagerPromptUI // this.AcceptButton = this.btnCancel; resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.CancelButton = this.btnCancel; this.Controls.Add(this.tableLayoutPanelOuter); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "TrustManagerPromptUI"; // Bug# 398538 - Explicitly setting RighToLeft property for RightToLeft cultures at runtime for TrustManager dialog. if (SR.GetString(SR.RTL) != "RTL_False") { this.RightToLeft = RightToLeft.Yes; this.RightToLeftLayout = true; } this.VisibleChanged += new System.EventHandler(this.TrustManagerPromptUI_VisibleChanged); this.Load += new System.EventHandler(this.TrustManagerPromptUI_Load); this.tableLayoutPanelOuter.ResumeLayout(false); this.tableLayoutPanelOuter.PerformLayout(); this.warningTextTableLayoutPanel.ResumeLayout(false); this.warningTextTableLayoutPanel.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxWarning)).EndInit(); this.tableLayoutPanelQuestion.ResumeLayout(false); this.tableLayoutPanelQuestion.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxQuestion)).EndInit(); this.tableLayoutPanelButtons.ResumeLayout(false); this.tableLayoutPanelButtons.PerformLayout(); this.tableLayoutPanelInfo.ResumeLayout(false); this.tableLayoutPanelInfo.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); }
private void InitializeComponent() { components = new System.ComponentModel.Container(); var resources = new System.ComponentModel.ComponentResourceManager(typeof(MessageBoxCeresOK)); var BorderEdges3 = new Bunifu.UI.WinForms.BunifuButton.BunifuButton.BorderEdges(); var StateProperties5 = new Bunifu.UI.WinForms.BunifuButton.BunifuButton.StateProperties(); var StateProperties6 = new Bunifu.UI.WinForms.BunifuButton.BunifuButton.StateProperties(); buttonsPanel = new TableLayoutPanel(); _okButton = new Bunifu.UI.WinForms.BunifuButton.BunifuButton(); _okButton.Click += new EventHandler(okButton_Click); messageLabel = new Label(); titleLabel = new Label(); BunifuElipse1 = new Bunifu.Framework.UI.BunifuElipse(components); PictureBox1 = new PictureBox(); buttonsPanel.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)PictureBox1).BeginInit(); SuspendLayout(); // // buttonsPanel // buttonsPanel.Anchor = AnchorStyles.None; buttonsPanel.ColumnCount = 1; buttonsPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50.0f)); buttonsPanel.Controls.Add(_okButton, 0, 0); buttonsPanel.Location = new Point(121, 302); buttonsPanel.Name = "buttonsPanel"; buttonsPanel.RowCount = 1; buttonsPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 50.0f)); buttonsPanel.Size = new Size(210, 39); buttonsPanel.TabIndex = 174; // // okButton // _okButton.AllowToggling = false; _okButton.Anchor = AnchorStyles.None; _okButton.AnimationSpeed = 200; _okButton.AutoGenerateColors = false; _okButton.BackColor = Color.Transparent; _okButton.BackColor1 = Color.White; _okButton.BackgroundImage = (Image)resources.GetObject("okButton.BackgroundImage"); _okButton.BorderStyle = Bunifu.UI.WinForms.BunifuButton.BunifuButton.BorderStyles.Solid; _okButton.ButtonText = "OK"; _okButton.ButtonTextMarginLeft = 0; _okButton.ColorContrastOnClick = 45; _okButton.ColorContrastOnHover = 45; _okButton.Cursor = Cursors.Hand; BorderEdges3.BottomLeft = true; BorderEdges3.BottomRight = true; BorderEdges3.TopLeft = true; BorderEdges3.TopRight = true; _okButton.CustomizableEdges = BorderEdges3; _okButton.DialogResult = DialogResult.None; _okButton.DisabledBorderColor = Color.Empty; _okButton.DisabledFillColor = Color.FromArgb(Conversions.ToInteger(Conversions.ToByte(204)), Conversions.ToInteger(Conversions.ToByte(204)), Conversions.ToInteger(Conversions.ToByte(204))); _okButton.DisabledForecolor = Color.FromArgb(Conversions.ToInteger(Conversions.ToByte(168)), Conversions.ToInteger(Conversions.ToByte(160)), Conversions.ToInteger(Conversions.ToByte(168))); _okButton.FocusState = Bunifu.UI.WinForms.BunifuButton.BunifuButton.ButtonStates.Pressed; _okButton.Font = new Font("Segoe UI Semibold", 11.12727f, FontStyle.Bold, GraphicsUnit.Point, Conversions.ToByte(0)); _okButton.ForeColor = Color.FromArgb(Conversions.ToInteger(Conversions.ToByte(64)), Conversions.ToInteger(Conversions.ToByte(64)), Conversions.ToInteger(Conversions.ToByte(64))); _okButton.IconLeftCursor = Cursors.Hand; _okButton.IconMarginLeft = 11; _okButton.IconPadding = 10; _okButton.IconRightCursor = Cursors.Hand; _okButton.IdleBorderColor = Color.Gray; _okButton.IdleBorderRadius = 3; _okButton.IdleBorderThickness = 1; _okButton.IdleFillColor = Color.White; _okButton.IdleIconLeftImage = null; _okButton.IdleIconRightImage = null; _okButton.IndicateFocus = true; _okButton.Location = new Point(57, 3); _okButton.Name = "_okButton"; StateProperties5.BorderColor = Color.DarkGray; StateProperties5.BorderRadius = 3; StateProperties5.BorderStyle = Bunifu.UI.WinForms.BunifuButton.BunifuButton.BorderStyles.Solid; StateProperties5.BorderThickness = 1; StateProperties5.FillColor = Color.DarkGray; StateProperties5.ForeColor = Color.FromArgb(Conversions.ToInteger(Conversions.ToByte(64)), Conversions.ToInteger(Conversions.ToByte(64)), Conversions.ToInteger(Conversions.ToByte(64))); StateProperties5.IconLeftImage = null; StateProperties5.IconRightImage = null; _okButton.onHoverState = StateProperties5; StateProperties6.BorderColor = Color.FromArgb(Conversions.ToInteger(Conversions.ToByte(64)), Conversions.ToInteger(Conversions.ToByte(64)), Conversions.ToInteger(Conversions.ToByte(64))); StateProperties6.BorderRadius = 3; StateProperties6.BorderStyle = Bunifu.UI.WinForms.BunifuButton.BunifuButton.BorderStyles.Solid; StateProperties6.BorderThickness = 1; StateProperties6.FillColor = Color.White; StateProperties6.ForeColor = Color.FromArgb(Conversions.ToInteger(Conversions.ToByte(64)), Conversions.ToInteger(Conversions.ToByte(64)), Conversions.ToInteger(Conversions.ToByte(64))); StateProperties6.IconLeftImage = null; StateProperties6.IconRightImage = null; _okButton.OnPressedState = StateProperties6; _okButton.Size = new Size(95, 33); _okButton.TabIndex = 137; _okButton.TextAlign = ContentAlignment.MiddleCenter; _okButton.TextMarginLeft = 0; _okButton.UseDefaultRadiusAndThickness = true; // // messageLabel // messageLabel.Font = new Font("Segoe UI", 11.12727f, FontStyle.Regular, GraphicsUnit.Point, Conversions.ToByte(0)); messageLabel.Location = new Point(21, 122); messageLabel.Name = "messageLabel"; messageLabel.Size = new Size(428, 177); messageLabel.TabIndex = 171; messageLabel.Text = "Label1"; // // titleLabel // titleLabel.Font = new Font("Segoe UI Semibold", 11.12727f, FontStyle.Bold, GraphicsUnit.Point, Conversions.ToByte(0)); titleLabel.Location = new Point(12, 81); titleLabel.Name = "titleLabel"; titleLabel.Size = new Size(414, 41); titleLabel.TabIndex = 175; titleLabel.Text = "Label2"; titleLabel.TextAlign = ContentAlignment.MiddleLeft; // // BunifuElipse1 // BunifuElipse1.ElipseRadius = 30; BunifuElipse1.TargetControl = this; // // PictureBox1 // PictureBox1.Image = My.Resources.Resources.warning; PictureBox1.Location = new Point(208, 0); PictureBox1.Name = "PictureBox1"; PictureBox1.Size = new Size(87, 78); PictureBox1.SizeMode = PictureBoxSizeMode.Zoom; PictureBox1.TabIndex = 176; PictureBox1.TabStop = false; // // MessageBoxCeresOK // AutoScaleDimensions = new SizeF(6.0f, 13.0f); AutoScaleMode = AutoScaleMode.Font; BackColor = Color.White; ClientSize = new Size(478, 360); Controls.Add(PictureBox1); Controls.Add(buttonsPanel); Controls.Add(messageLabel); Controls.Add(titleLabel); FormBorderStyle = FormBorderStyle.None; Name = "MessageBoxCeresOK"; StartPosition = FormStartPosition.CenterScreen; Text = "MessageBoxCeresOK"; buttonsPanel.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)PictureBox1).EndInit(); ResumeLayout(false); }
void editLastViewedLabel(object sender) { TableLayoutPanel seriesTable = (TableLayoutPanel)Controls.Find("seriesTable", true)[0]; try { Label currLastViewedLabel = (Label)sender; int id = Convert.ToInt32(currLastViewedLabel.Name.Split('_')[1]); string text = currLastViewedLabel.Text; seriesTable.Controls.Remove(currLastViewedLabel); TextBox newTextBox = Context.Controls.CreateTextBox("lastViewedBox_" + id, text); newTextBox.KeyDown += newTextBox_KeyDown; newTextBox.LostFocus += newTextBox_LostFocus; seriesTable.Controls.Add(newTextBox, 2, id + 1); newTextBox.Focus(); } catch { TextBox currLastViewedTextBox = new TextBox(); foreach (Control currControl in seriesTable.Controls) { if (currControl.GetType() == typeof(TextBox)) { currLastViewedTextBox = (TextBox)currControl; } } int id = Convert.ToInt32(currLastViewedTextBox.Name.Split('_')[1]); string text = currLastViewedTextBox.Text; if (!Episode.IsValidEpisodeString(text)) { Variables.IsAddFormOpened = true; Notifications.ShowError("The format of the given episode number is incorrect. Please give a correct one.", "Invalid episode number"); return; } seriesTable.Controls.Remove(currLastViewedTextBox); Label newLabel = Context.Controls.CreateLabel("lastViewed_" + id, text, false); newLabel.Cursor = Cursors.Hand; newLabel.Click += lastViewedLabel_Click; seriesTable.Controls.Add(newLabel, 2, id + 1); Internal.Variables.SeriesList[id].LastViewed = new Episode(text); Context.IO.WriteSeries(); Control currLastEpLabel = Controls.Find("lastEp_" + id, true)[0]; if (Internal.Variables.SeriesList[id].LastEpisode.SeasonNumber > Internal.Variables.SeriesList[id].LastViewed.SeasonNumber || (Internal.Variables.SeriesList[id].LastEpisode.SeasonNumber == Internal.Variables.SeriesList[id].LastViewed.SeasonNumber && Internal.Variables.SeriesList[id].LastEpisode.EpisodeNumber > Internal.Variables.SeriesList[id].LastViewed.EpisodeNumber)) { currLastEpLabel.Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Bold, GraphicsUnit.Point, 238); } else if (Internal.Variables.SeriesList[id].LastEpisode.SeasonNumber < Internal.Variables.SeriesList[id].LastViewed.SeasonNumber || (Internal.Variables.SeriesList[id].LastEpisode.SeasonNumber == Internal.Variables.SeriesList[id].LastViewed.SeasonNumber && Internal.Variables.SeriesList[id].LastEpisode.EpisodeNumber < Internal.Variables.SeriesList[id].LastViewed.EpisodeNumber)) { Deactivate -= Form1_Deactivate; MessageBox.Show(this, "The number of the last viewed episode has to be smaller than the one of the newest episode.", "Invalid episode number", MessageBoxButtons.OK, MessageBoxIcon.Error); Show(); Deactivate += Form1_Deactivate; editLastViewedLabel(newLabel); } else { currLastEpLabel.Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular, GraphicsUnit.Point, 238); } } }
internal Control[,] CalculateControlPositions (TableLayoutPanel panel, int columns, int rows) { Control[,] grid = new Control[columns, rows]; TableLayoutSettings settings = panel.LayoutSettings; // First place all controls that have an explicit col/row foreach (Control c in panel.Controls) { int col = settings.GetColumn (c); int row = settings.GetRow (c); if (col >= 0 && row >= 0) { if (col >= columns) return CalculateControlPositions (panel, col + 1, rows); if (row >= rows) return CalculateControlPositions (panel, columns, row + 1); if (grid[col, row] == null) { int col_span = Math.Min (settings.GetColumnSpan (c), columns); int row_span = Math.Min (settings.GetRowSpan (c), rows); if (col + col_span > columns) { if (row + 1 < rows) { grid[col, row] = dummy_control; row++; col = 0; } else if (settings.GrowStyle == TableLayoutPanelGrowStyle.AddColumns) return CalculateControlPositions (panel, columns + 1, rows); else throw new ArgumentException (); } if (row + row_span > rows) { if (settings.GrowStyle == TableLayoutPanelGrowStyle.AddRows) return CalculateControlPositions (panel, columns, rows + 1); else throw new ArgumentException (); } grid[col, row] = c; for (int i = 1; i < col_span; i++) grid[col + i, row] = dummy_control; for (int i = 1; i < row_span; i++) grid[col, row + i] = dummy_control; } } } int x_pointer = 0; int y_pointer = 0; // Fill in gaps with controls that do not have an explicit col/row foreach (Control c in panel.Controls) { int col = settings.GetColumn (c); int row = settings.GetRow (c); if ((col >= 0 && col < columns) && (row >= 0 && row < rows) && (grid[col, row] == c || grid[col, row] == dummy_control)) continue; for (int y = y_pointer; y < rows; y++) { y_pointer = y; x_pointer = 0; for (int x = x_pointer; x < columns; x++) { x_pointer = x; if (grid[x, y] == null) { int col_span = Math.Min (settings.GetColumnSpan (c), columns); int row_span = Math.Min (settings.GetRowSpan (c), rows); if (x + col_span > columns) { if (y + 1 < rows) break; else if (settings.GrowStyle == TableLayoutPanelGrowStyle.AddColumns) return CalculateControlPositions (panel, columns + 1, rows); else throw new ArgumentException (); } if (y + row_span > rows) { if (x + 1 < columns) break; else if (settings.GrowStyle == TableLayoutPanelGrowStyle.AddRows) return CalculateControlPositions (panel, columns, rows + 1); else throw new ArgumentException (); } grid[x, y] = c; for (int i = 1; i < col_span; i++) grid[x + i, y] = dummy_control; for (int i = 1; i < row_span; i++) grid[x, y + i] = dummy_control; // I know someone will kill me for using a goto, but // sometimes they really are the easiest way... goto Found; } else { // MS adds the controls only to the first row if // GrowStyle is AddColumns and RowCount is 0, // so interrupt the search for a free horizontal cell // beyond the first one in the given vertical if (settings.GrowStyle == TableLayoutPanelGrowStyle.AddColumns && settings.RowCount == 0) break; } } } // MS adds rows instead of columns even when GrowStyle is AddColumns, // but RowCount is 0. TableLayoutPanelGrowStyle adjustedGrowStyle = settings.GrowStyle; if (settings.GrowStyle == TableLayoutPanelGrowStyle.AddColumns) { if (settings.RowCount == 0) adjustedGrowStyle = TableLayoutPanelGrowStyle.AddRows; } switch (adjustedGrowStyle) { case TableLayoutPanelGrowStyle.AddColumns: return CalculateControlPositions (panel, columns + 1, rows); case TableLayoutPanelGrowStyle.AddRows: default: return CalculateControlPositions (panel, columns, rows + 1); case TableLayoutPanelGrowStyle.FixedSize: throw new ArgumentException (); } Found: ; } return grid; }
private void InitializeComponent() { DataGridViewCellStyle dataGridViewCellStyle1 = new DataGridViewCellStyle(); dtgrdAttributes = new DataGridView(); description = new RichTextBox(); splitter1 = new Splitter(); panel1 = new Panel(); btnInf = new Button(); btnMinusInf = new Button(); lblColor = new Label(); lblCNoA = new Label(); tableLayoutPanel1 = new TableLayoutPanel(); rdoFloat = new RadioButton(); rdoInt = new RadioButton(); rdoColor = new RadioButton(); rdoFlags = new RadioButton(); rdoDegrees = new RadioButton(); rdoUnknown = new RadioButton(); rdoBytes = new RadioButton(); rdoShorts = new RadioButton(); ((ISupportInitialize)dtgrdAttributes).BeginInit(); panel1.SuspendLayout(); tableLayoutPanel1.SuspendLayout(); SuspendLayout(); // // dtgrdAttributes // dtgrdAttributes.AllowUserToAddRows = false; dtgrdAttributes.AllowUserToDeleteRows = false; dtgrdAttributes.AllowUserToResizeRows = false; dtgrdAttributes.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dtgrdAttributes.BackgroundColor = SystemColors.ControlLightLight; dtgrdAttributes.BorderStyle = BorderStyle.Fixed3D; dtgrdAttributes.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dtgrdAttributes.ColumnHeadersVisible = false; dataGridViewCellStyle1.Alignment = DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle1.BackColor = SystemColors.Window; dataGridViewCellStyle1.Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular, GraphicsUnit.Point, 0); dataGridViewCellStyle1.ForeColor = SystemColors.ControlText; dataGridViewCellStyle1.Format = "N4"; dataGridViewCellStyle1.NullValue = null; dataGridViewCellStyle1.SelectionBackColor = SystemColors.Highlight; dataGridViewCellStyle1.SelectionForeColor = SystemColors.HighlightText; dataGridViewCellStyle1.WrapMode = DataGridViewTriState.False; dtgrdAttributes.DefaultCellStyle = dataGridViewCellStyle1; dtgrdAttributes.Dock = DockStyle.Fill; dtgrdAttributes.EditMode = DataGridViewEditMode.EditOnKeystroke; dtgrdAttributes.EnableHeadersVisualStyles = false; dtgrdAttributes.GridColor = SystemColors.ControlLight; dtgrdAttributes.Location = new Point(0, 0); dtgrdAttributes.MultiSelect = false; dtgrdAttributes.Name = "dtgrdAttributes"; dtgrdAttributes.RowHeadersBorderStyle = DataGridViewHeaderBorderStyle.None; dtgrdAttributes.RowHeadersWidth = 8; dtgrdAttributes.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing; dtgrdAttributes.RowTemplate.Height = 16; dtgrdAttributes.ScrollBars = ScrollBars.Vertical; dtgrdAttributes.SelectionMode = DataGridViewSelectionMode.FullRowSelect; dtgrdAttributes.Size = new Size(479, 200); dtgrdAttributes.TabIndex = 5; dtgrdAttributes.CellEndEdit += new DataGridViewCellEventHandler(dtgrdAttributes_CellEndEdit); dtgrdAttributes.CurrentCellChanged += new EventHandler(dtgrdAttributes_CurrentCellChanged); // // description // description.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; description.BackColor = SystemColors.Control; description.BorderStyle = BorderStyle.None; description.Cursor = Cursors.Default; description.Font = new Font("Microsoft Sans Serif", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 0); description.ForeColor = Color.Black; description.Location = new Point(0, 0); description.Name = "description"; description.ScrollBars = RichTextBoxScrollBars.Vertical; description.Size = new Size(479, 74); description.TabIndex = 6; description.Text = "No Description Available."; description.LinkClicked += new LinkClickedEventHandler(description_LinkClicked); description.TextChanged += new EventHandler(description_TextChanged); // // splitter1 // splitter1.Dock = DockStyle.Bottom; splitter1.Location = new Point(0, 200); splitter1.Name = "splitter1"; splitter1.Size = new Size(479, 3); splitter1.TabIndex = 7; splitter1.TabStop = false; // // panel1 // panel1.Controls.Add(btnInf); panel1.Controls.Add(btnMinusInf); panel1.Controls.Add(lblColor); panel1.Controls.Add(lblCNoA); panel1.Controls.Add(tableLayoutPanel1); panel1.Controls.Add(description); panel1.Dock = DockStyle.Bottom; panel1.Location = new Point(0, 203); panel1.Name = "panel1"; panel1.Size = new Size(479, 102); panel1.TabIndex = 8; // // btnInf // btnInf.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; btnInf.Font = new Font("Microsoft Sans Serif", 11F, FontStyle.Regular, GraphicsUnit.Point, 0); btnInf.Location = new Point(446, 44); btnInf.Name = "btnInf"; btnInf.Size = new Size(30, 30); btnInf.TabIndex = 13; btnInf.Text = "∞"; btnInf.UseVisualStyleBackColor = true; btnInf.Visible = false; btnInf.Click += new EventHandler(btnInf_Click); // // btnMinusInf // btnMinusInf.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; btnMinusInf.Font = new Font("Microsoft Sans Serif", 11F, FontStyle.Regular, GraphicsUnit.Point, 0); btnMinusInf.Location = new Point(412, 44); btnMinusInf.Name = "btnMinusInf"; btnMinusInf.Size = new Size(30, 30); btnMinusInf.TabIndex = 12; btnMinusInf.Text = "-∞"; btnMinusInf.UseVisualStyleBackColor = true; btnMinusInf.Visible = false; btnMinusInf.Click += new EventHandler(btnMinusInf_Click); // // lblColor // lblColor.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; lblColor.BorderStyle = BorderStyle.FixedSingle; lblColor.Location = new Point(394, 60); lblColor.Name = "lblColor"; lblColor.Size = new Size(41, 14); lblColor.TabIndex = 10; lblColor.Visible = false; lblColor.Click += new EventHandler(lblColor_Click); // // lblCNoA // lblCNoA.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; lblCNoA.BorderStyle = BorderStyle.FixedSingle; lblCNoA.Location = new Point(434, 60); lblCNoA.Name = "lblCNoA"; lblCNoA.Size = new Size(41, 14); lblCNoA.TabIndex = 11; lblCNoA.Visible = false; lblCNoA.Click += new EventHandler(lblColor_Click); // // tableLayoutPanel1 // tableLayoutPanel1.ColumnCount = 8; tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); tableLayoutPanel1.Controls.Add(rdoFloat, 0, 0); tableLayoutPanel1.Controls.Add(rdoInt, 1, 0); tableLayoutPanel1.Controls.Add(rdoColor, 2, 0); tableLayoutPanel1.Controls.Add(rdoBytes, 3, 0); tableLayoutPanel1.Controls.Add(rdoShorts, 4, 0); tableLayoutPanel1.Controls.Add(rdoFlags, 5, 0); tableLayoutPanel1.Controls.Add(rdoDegrees, 6, 0); tableLayoutPanel1.Controls.Add(rdoUnknown, 7, 0); tableLayoutPanel1.Dock = DockStyle.Bottom; tableLayoutPanel1.Location = new Point(0, 77); tableLayoutPanel1.Name = "tableLayoutPanel1"; tableLayoutPanel1.RowCount = 1; tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 50F)); tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20F)); tableLayoutPanel1.Size = new Size(479, 25); tableLayoutPanel1.TabIndex = 9; // // rdoFloat // rdoFloat.Appearance = Appearance.Button; rdoFloat.AutoSize = true; rdoFloat.Dock = DockStyle.Fill; rdoFloat.Font = new Font("Microsoft Sans Serif", 8F, FontStyle.Regular, GraphicsUnit.Point, 0); rdoFloat.Location = new Point(0, 0); rdoFloat.Margin = new Padding(0); rdoFloat.Name = "rdoFloat"; rdoFloat.Size = new Size(79, 25); rdoFloat.TabIndex = 0; rdoFloat.TabStop = true; rdoFloat.Text = "Float"; rdoFloat.UseVisualStyleBackColor = true; rdoFloat.CheckedChanged += new EventHandler(radioButtonsChanged); // // rdoInt // rdoInt.Appearance = Appearance.Button; rdoInt.AutoSize = true; rdoInt.Dock = DockStyle.Fill; rdoInt.Font = new Font("Microsoft Sans Serif", 8F, FontStyle.Regular, GraphicsUnit.Point, 0); rdoInt.Location = new Point(79, 0); rdoInt.Margin = new Padding(0); rdoInt.Name = "rdoInt"; rdoInt.Size = new Size(79, 25); rdoInt.TabIndex = 1; rdoInt.TabStop = true; rdoInt.Text = "Integer"; rdoInt.UseVisualStyleBackColor = true; rdoInt.CheckedChanged += new EventHandler(radioButtonsChanged); // // rdoColor // rdoColor.Appearance = Appearance.Button; rdoColor.AutoSize = true; rdoColor.Dock = DockStyle.Fill; rdoColor.Font = new Font("Microsoft Sans Serif", 8F, FontStyle.Regular, GraphicsUnit.Point, 0); rdoColor.Location = new Point(158, 0); rdoColor.Margin = new Padding(0); rdoColor.Name = "rdoColor"; rdoColor.Size = new Size(79, 25); rdoColor.TabIndex = 2; rdoColor.TabStop = true; rdoColor.Text = "Color"; rdoColor.UseVisualStyleBackColor = true; rdoColor.CheckedChanged += new EventHandler(radioButtonsChanged); // // rdoBytes // rdoBytes.Appearance = Appearance.Button; rdoBytes.AutoSize = true; rdoBytes.Dock = DockStyle.Fill; rdoBytes.Font = new Font("Microsoft Sans Serif", 8F, FontStyle.Regular, GraphicsUnit.Point, 0); rdoBytes.Location = new Point(395, 0); rdoBytes.Margin = new Padding(0); rdoBytes.Name = "rdoBytes"; rdoBytes.Size = new Size(84, 25); rdoBytes.TabIndex = 3; rdoBytes.TabStop = true; rdoBytes.Text = "Bytes"; rdoBytes.UseVisualStyleBackColor = true; rdoBytes.CheckedChanged += new EventHandler(radioButtonsChanged); // // rdoShorts // rdoShorts.Appearance = Appearance.Button; rdoShorts.AutoSize = true; rdoShorts.Dock = DockStyle.Fill; rdoShorts.Font = new Font("Microsoft Sans Serif", 8F, FontStyle.Regular, GraphicsUnit.Point, 0); rdoShorts.Location = new Point(395, 0); rdoShorts.Margin = new Padding(0); rdoShorts.Name = "rdoShorts"; rdoShorts.Size = new Size(84, 25); rdoShorts.TabIndex = 4; rdoShorts.TabStop = true; rdoShorts.Text = "Shorts"; rdoShorts.UseVisualStyleBackColor = true; rdoShorts.CheckedChanged += new EventHandler(radioButtonsChanged); // // rdoFlags // rdoFlags.Appearance = Appearance.Button; rdoFlags.AutoSize = true; rdoFlags.Dock = DockStyle.Fill; rdoFlags.Font = new Font("Microsoft Sans Serif", 8F, FontStyle.Regular, GraphicsUnit.Point, 0); rdoFlags.Location = new Point(237, 0); rdoFlags.Margin = new Padding(0); rdoFlags.Name = "rdoFlags"; rdoFlags.Size = new Size(79, 25); rdoFlags.TabIndex = 5; rdoFlags.TabStop = true; rdoFlags.Text = "Flags"; rdoFlags.UseVisualStyleBackColor = true; rdoFlags.CheckedChanged += new EventHandler(radioButtonsChanged); // // rdoDegrees // rdoDegrees.Appearance = Appearance.Button; rdoDegrees.AutoSize = true; rdoDegrees.Dock = DockStyle.Fill; rdoDegrees.Font = new Font("Microsoft Sans Serif", 8F, FontStyle.Regular, GraphicsUnit.Point, 0); rdoDegrees.Location = new Point(316, 0); rdoDegrees.Margin = new Padding(0); rdoDegrees.Name = "rdoDegrees"; rdoDegrees.Size = new Size(79, 25); rdoDegrees.TabIndex = 6; rdoDegrees.TabStop = true; rdoDegrees.Text = "Degrees"; rdoDegrees.UseVisualStyleBackColor = true; rdoDegrees.CheckedChanged += new EventHandler(radioButtonsChanged); // // rdoUnknown // rdoUnknown.Appearance = Appearance.Button; rdoUnknown.AutoSize = true; rdoUnknown.Dock = DockStyle.Fill; rdoUnknown.Font = new Font("Microsoft Sans Serif", 8F, FontStyle.Regular, GraphicsUnit.Point, 0); rdoUnknown.Location = new Point(395, 0); rdoUnknown.Margin = new Padding(0); rdoUnknown.Name = "rdoUnknown"; rdoUnknown.Size = new Size(84, 25); rdoUnknown.TabIndex = 7; rdoUnknown.TabStop = true; rdoUnknown.Text = "Hex"; rdoUnknown.UseVisualStyleBackColor = true; rdoUnknown.CheckedChanged += new EventHandler(radioButtonsChanged); // // AttributeGrid // Controls.Add(dtgrdAttributes); Controls.Add(splitter1); Controls.Add(panel1); Name = "AttributeGrid"; Size = new Size(479, 305); ((ISupportInitialize)dtgrdAttributes).EndInit(); panel1.ResumeLayout(false); tableLayoutPanel1.ResumeLayout(false); tableLayoutPanel1.PerformLayout(); ResumeLayout(false); }
private void CalculateColumnRowSizes (TableLayoutPanel panel, int columns, int rows) { TableLayoutSettings settings = panel.LayoutSettings; panel.column_widths = new int[panel.actual_positions.GetLength (0)]; panel.row_heights = new int[panel.actual_positions.GetLength (1)]; int border_width = TableLayoutPanel.GetCellBorderWidth (panel.CellBorderStyle); Rectangle parentDisplayRectangle = panel.DisplayRectangle; TableLayoutColumnStyleCollection col_styles = new TableLayoutColumnStyleCollection (panel); foreach (ColumnStyle cs in settings.ColumnStyles) col_styles.Add( new ColumnStyle(cs.SizeType, cs.Width)); TableLayoutRowStyleCollection row_styles = new TableLayoutRowStyleCollection (panel); foreach (RowStyle rs in settings.RowStyles) row_styles.Add (new RowStyle (rs.SizeType, rs.Height)); // If we have more columns than columnstyles, temporarily add enough columnstyles if (columns > col_styles.Count) { for (int i = col_styles.Count; i < columns; i++) col_styles.Add(new ColumnStyle()); } // Same for rows.. if (rows > row_styles.Count) { for (int i = row_styles.Count; i < rows; i++) row_styles.Add (new RowStyle ()); } while (row_styles.Count > rows) row_styles.RemoveAt (row_styles.Count - 1); while (col_styles.Count > columns) col_styles.RemoveAt (col_styles.Count - 1); // Find the largest column-span/row-span values. int max_colspan = 0, max_rowspan = 0; foreach (Control c in panel.Controls) { max_colspan = Math.Max (max_colspan, settings.GetColumnSpan (c)); max_rowspan = Math.Max (max_rowspan, settings.GetRowSpan (c)); } // Figure up all the column widths int total_width = parentDisplayRectangle.Width - (border_width * (columns + 1)); int index = 0; // First assign all the Absolute sized columns.. foreach (ColumnStyle cs in col_styles) { if (cs.SizeType == SizeType.Absolute) { panel.column_widths[index] = (int)cs.Width; total_width -= (int)cs.Width; } index++; } // Next, assign all the AutoSize columns to the width of their widest // control. If the table-layout is auto-sized, then make sure that // no column with Percent styling clips its contents. // (per http://msdn.microsoft.com/en-us/library/ms171690.aspx) for (int colspan = 0; colspan < max_colspan; ++colspan) { for (index = colspan; index < col_styles.Count - colspan; ++index) { ColumnStyle cs = col_styles[index]; if (cs.SizeType == SizeType.AutoSize || (panel.AutoSize && cs.SizeType == SizeType.Percent)) { int max_width = panel.column_widths[index]; // Find the widest control in the column for (int i = 0; i < rows; i ++) { Control c = panel.actual_positions[index - colspan, i]; if (c != null && c != dummy_control && c.VisibleInternal) { // Skip any controls not being sized in this pass. if (settings.GetColumnSpan (c) != colspan + 1) continue; // Calculate the maximum control width. if (c.AutoSize) max_width = Math.Max (max_width, c.PreferredSize.Width + c.Margin.Horizontal); else max_width = Math.Max (max_width, c.ExplicitBounds.Width + c.Margin.Horizontal); max_width = Math.Max (max_width, c.Width + c.Margin.Left + c.Margin.Right); } } // Subtract the width of prior columns, if any. for (int i = Math.Max (index - colspan, 0); i < index; ++i) max_width -= panel.column_widths[i]; // If necessary, increase this column's width. if (max_width > panel.column_widths[index]) { max_width -= panel.column_widths[index]; panel.column_widths[index] += max_width; total_width -= max_width; } } } } index = 0; float total_percent = 0; // Finally, assign the remaining space to Percent columns, if any. if (total_width > 0) { int percent_width = total_width; // Find the total percent (not always 100%) foreach (ColumnStyle cs in col_styles) { if (cs.SizeType == SizeType.Percent) total_percent += cs.Width; } // Divvy up the space.. foreach (ColumnStyle cs in col_styles) { if (cs.SizeType == SizeType.Percent) { int width_change = (int)(((cs.Width / total_percent) * percent_width) - panel.column_widths[index]); if (width_change > 0) { panel.column_widths[index] += width_change; total_width -= width_change; } } index++; } } if (total_width > 0) { // Find the last column that isn't an Absolute SizeType, and give it // all this free space. (Absolute sized columns need to retain their // absolute width if at all possible!) int col = col_styles.Count - 1; for (; col >= 0; --col) { if (col_styles[col].SizeType != SizeType.Absolute) break; } if (col < 0) col = col_styles.Count - 1; panel.column_widths[col] += total_width; } // Figure up all the row heights int total_height = parentDisplayRectangle.Height - (border_width * (rows + 1)); index = 0; // First assign all the Absolute sized rows.. foreach (RowStyle rs in row_styles) { if (rs.SizeType == SizeType.Absolute) { panel.row_heights[index] = (int)rs.Height; total_height -= (int)rs.Height; } index++; } index = 0; // Next, assign all the AutoSize rows to the height of their tallest // control. If the table-layout is auto-sized, then make sure that // no row with Percent styling clips its contents. // (per http://msdn.microsoft.com/en-us/library/ms171690.aspx) for (int rowspan = 0; rowspan < max_rowspan; ++rowspan) { for (index = rowspan; index < row_styles.Count - rowspan; ++index) { RowStyle rs = row_styles[index]; if (rs.SizeType == SizeType.AutoSize || (panel.AutoSize && rs.SizeType == SizeType.Percent)) { int max_height = panel.row_heights[index]; // Find the tallest control in the row for (int i = 0; i < columns; i++) { Control c = panel.actual_positions[i, index - rowspan]; if (c != null && c != dummy_control && c.VisibleInternal) { // Skip any controls not being sized in this pass. if (settings.GetRowSpan (c) != rowspan + 1) continue; // Calculate the maximum control height. if (c.AutoSize) max_height = Math.Max (max_height, c.PreferredSize.Height + c.Margin.Vertical); else max_height = Math.Max (max_height, c.ExplicitBounds.Height + c.Margin.Vertical); max_height = Math.Max (max_height, c.Height + c.Margin.Top + c.Margin.Bottom); } } // Subtract the height of prior rows, if any. for (int i = Math.Max (index - rowspan, 0); i < index; ++i) max_height -= panel.row_heights[i]; // If necessary, increase this row's height. if (max_height > panel.row_heights[index]) { max_height -= panel.row_heights[index]; panel.row_heights[index] += max_height; total_height -= max_height; } } } } index = 0; total_percent = 0; // Finally, assign the remaining space to Percent rows, if any. if (total_height > 0) { int percent_height = total_height; // Find the total percent (not always 100%) foreach (RowStyle rs in row_styles) { if (rs.SizeType == SizeType.Percent) total_percent += rs.Height; } // Divvy up the space.. foreach (RowStyle rs in row_styles) { if (rs.SizeType == SizeType.Percent) { int height_change = (int)(((rs.Height / total_percent) * percent_height) - panel.row_heights[index]); if (height_change > 0) { panel.row_heights[index] += height_change; total_height -= height_change; } } index++; } } if (total_height > 0) { // Find the last row that isn't an Absolute SizeType, and give it // all this free space. (Absolute sized rows need to retain their // absolute height if at all possible!) int row = row_styles.Count - 1; for (; row >= 0; --row) { if (row_styles[row].SizeType != SizeType.Absolute) break; } if (row < 0) row = row_styles.Count - 1; panel.row_heights[row] += total_height; } }
/// <summary> /// Fields generator that works on field data descriptions (FieldDataDescriptor) /// </summary> /// <param name="dataPanel">TableLayoutPanel</param> /// <param name="DataSource">Data Source to support data-binding</param> /// <param name="Fields">Field data descriptors</param> public static void GenerateFields(this TableLayoutPanel dataPanel, object DataSource, params FieldDataDescriptor[] Fields) { TableLayoutPanelExtenders.GenerateFields(dataPanel, null, DataSource, Fields); }
private void StworzWidokProduktu(string zdjecie, string nazwa, string cena, string kategoria, int id, int kolumna, int wiersz) { TableLayoutPanel panel = new TableLayoutPanel(); panel.ColumnCount = 2; panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50)); panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50)); panel.RowCount = 4; panel.Size = new Size(tableLayoutShopPanel.Width / 3, (int)(tableLayoutShopPanel.Height * 0.33)); panel.RowStyles.Add(new RowStyle(SizeType.Percent, 40)); panel.RowStyles.Add(new RowStyle(SizeType.Percent, 20)); panel.RowStyles.Add(new RowStyle(SizeType.Percent, 20)); panel.RowStyles.Add(new RowStyle(SizeType.Percent, 20)); panel.CellBorderStyle = TableLayoutPanelCellBorderStyle.None; panel.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Left); Image image = (Image)Properties.Resources.ResourceManager.GetObject($"{zdjecie}"); //Zdjecie button Button btn = new Button(); btn.Name = $"btn{id}"; btn.Click += PokazProdukt; btn.BackgroundImage = image; btn.BackgroundImageLayout = ImageLayout.Stretch; btn.Dock = DockStyle.Fill; btn.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Left); panel.Controls.Add(btn, 0, 0); panel.SetRowSpan(btn, 4); //Nazwa label Label lblNazwa = new Label(); lblNazwa.Text = nazwa; lblNazwa.Font = new Font("Bahnschrift", 12); lblNazwa.Size = new Size(panel.Width - 85, 50); lblNazwa.Anchor = AnchorStyles.None; panel.Controls.Add(lblNazwa, 1, 0); //Cena label Label lblCena = new Label(); lblCena.Text = cena + " zł"; lblCena.Font = new Font("Bahnschrift", 12); lblCena.Size = new Size(panel.Width - 85, 30); lblCena.Anchor = AnchorStyles.None; panel.Controls.Add(lblCena, 1, 1); //Kategoria label Label lblKategoria = new Label(); lblKategoria.Text = kategoria; lblKategoria.Font = new Font("Bahnschrift", 12); lblKategoria.Size = new Size(panel.Width - 85, 30); lblKategoria.Anchor = AnchorStyles.None; panel.Controls.Add(lblKategoria, 1, 2); //Koszyk przycisk IconButton iconButton = new IconButton(); iconButton.Name = $"iconButton{id}"; iconButton.IconChar = IconChar.ShoppingCart; iconButton.ImageAlign = ContentAlignment.MiddleLeft; iconButton.IconSize = (int)(iconButton.Height * 1.25); iconButton.Font = new Font("Bahnschrift", iconButton.Height / 2, FontStyle.Bold); iconButton.ForeColor = Color.White; iconButton.TextAlign = ContentAlignment.MiddleRight; iconButton.Text = "DO KOSZYKA"; iconButton.Dock = DockStyle.Fill; iconButton.Click += DodajDoKoszyka_Click; iconButton.IconColor = Color.White; iconButton.BackColor = Color.FromArgb(255, 0, 150, 136); iconButton.FlatStyle = FlatStyle.Flat; panel.Controls.Add(iconButton, 1, 3); if (_form.isLoggedIn == false) { iconButton.Visible = false; } tableLayoutShopPanel.Controls.Add(panel, kolumna, wiersz); //tableLayoutShopPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; }
/// <summary> /// Fields generator that works on field data descriptions (FieldDataDescriptor) /// </summary> /// <param name="dataPanel">TableLayoutPanel</param> /// <param name="toolTip">ToolTip</param> /// <param name="DataSource">Data Source to support data-binding</param> /// <param name="Fields">Field data descriptors</param> public static void GenerateFields(this TableLayoutPanel dataPanel, ToolTip toolTip, object DataSource, params FieldDataDescriptor[] Fields) { dataPanel.SuspendLayout(); dataPanel.Controls.Clear(); if (DataSource == null || Fields == null || Fields.Length == 0) { return; } dataPanel.ColumnStyles.Clear(); dataPanel.ColumnCount = 2; dataPanel.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize)); dataPanel.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize)); dataPanel.RowStyles.Clear(); dataPanel.RowCount = 0; dataPanel.AutoSize = true; dataPanel.AutoSizeMode = AutoSizeMode.GrowAndShrink; dataPanel.Margin = new Padding(3, 3, 9, 3); int tabIndex = 0; foreach (var field in Fields) { dataPanel.RowCount += 1; dataPanel.RowStyles.Add(new RowStyle(SizeType.AutoSize)); #region creating the label var leadLabel = new Label(); leadLabel.Text = field.CaptionText; // TODO: add option for generating label in format: column.CaptionText + ":" leadLabel.TextAlign = ContentAlignment.MiddleRight; leadLabel.Padding = new Padding(0, 0, 0, 0); if (field.Mode == FieldEditorMode.MultilineTextBox || field.Mode == FieldEditorMode.BitMask || field.Mode == FieldEditorMode.BitMask64) { leadLabel.Anchor = AnchorStyles.Right | AnchorStyles.Top; leadLabel.Margin = new Padding(12, 6, 0, 6); } else { leadLabel.Anchor = AnchorStyles.Right; leadLabel.Margin = new Padding(12, 1, 0, 1); } leadLabel.TabIndex = tabIndex++; leadLabel.AutoSize = true; dataPanel.Controls.Add(leadLabel, 0, dataPanel.RowCount - 1); #endregion Binding binding = null; if (field.Mode == FieldEditorMode.TextBox || field.Mode == FieldEditorMode.MultilineTextBox || field.Mode == FieldEditorMode.DateTimeTextBox) { #region creating editor control for text var _textBox = new TextBox(); field.GeneratedControl = _textBox; _textBox.Multiline = field.Mode == FieldEditorMode.MultilineTextBox; _textBox.Size = new Size(field.SizeWidth.HasValue ? field.SizeWidth.Value : (int)DataDescriptorSizeWidth.Normal, _textBox.Multiline ? 125 : 20); _textBox.Anchor = AnchorStyles.Left; if (field.MaxLength.HasValue) { _textBox.MaxLength = field.MaxLength.Value; } _textBox.TabIndex = tabIndex++; if (toolTip != null) { toolTip.SetToolTip(_textBox, field.ColumnName); } leadLabel.Click += delegate { _textBox.Focus(); }; binding = new Binding("Text", DataSource, field.ColumnName, true, field.IsReadOnly ? DataSourceUpdateMode.Never : DataSourceUpdateMode.OnPropertyChanged); if (field.FormatValueMethod != null) { _textBox.Tag = field.FormatValueMethod; binding.FormattingEnabled = true; binding.Format += TableLayoutPanelExtenders.BindingFormat; } if (field.IsNull) { binding.DataSourceNullValue = DBNull.Value; } if (field.NullValue != null) { binding.NullValue = field.NullValue; } if (field.Style.HasValue) { TableLayoutPanelExtenders.SetBindingStyle(binding, field.Style.Value); _textBox.TextAlign = field.Style == EditorDataStyle.DateTime || field.Style == EditorDataStyle.Date ? HorizontalAlignment.Center : HorizontalAlignment.Right; } _textBox.DataBindings.Add(binding); _textBox.ReadOnly = field.IsReadOnly; if (field.DataSource != null && field.DataSource is string[]) { _textBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend; _textBox.AutoCompleteSource = AutoCompleteSource.CustomSource; _textBox.AutoCompleteCustomSource = new AutoCompleteStringCollection(); _textBox.AutoCompleteCustomSource.AddRange((string[])field.DataSource); } dataPanel.Controls.Add(_textBox, 1, dataPanel.RowCount - 1); #endregion } else if (field.Mode == FieldEditorMode.NumberTextBox) { #region creating editor control for numbers var _textBox = new NumericUpDown(); field.GeneratedControl = _textBox; _textBox.Minimum = field.Minimum.HasValue ? field.Minimum.Value : decimal.MinValue; _textBox.Maximum = field.Maximum.HasValue ? field.Maximum.Value : decimal.MaxValue; _textBox.DecimalPlaces = 0; _textBox.ThousandsSeparator = true; _textBox.Size = new Size(field.SizeWidth.HasValue ? field.SizeWidth.Value : (int)DataDescriptorSizeWidth.Normal, 20); _textBox.Anchor = AnchorStyles.Left; _textBox.TabIndex = tabIndex++; if (toolTip != null) { toolTip.SetToolTip(_textBox, field.ColumnName); } leadLabel.Click += delegate { _textBox.Focus(); }; binding = new Binding("Text", DataSource, field.ColumnName, true, field.IsReadOnly ? DataSourceUpdateMode.Never : DataSourceUpdateMode.OnPropertyChanged); if (field.FormatValueMethod != null) { _textBox.Tag = field.FormatValueMethod; binding.FormattingEnabled = true; binding.Format += TableLayoutPanelExtenders.BindingFormat; } if (field.IsNull) { binding.DataSourceNullValue = DBNull.Value; } if (field.NullValue != null) { binding.NullValue = field.NullValue; } if (field.Style.HasValue) { TableLayoutPanelExtenders.SetBindingStyle(binding, field.Style.Value); _textBox.TextAlign = HorizontalAlignment.Right; } _textBox.DataBindings.Add(binding); _textBox.ReadOnly = field.IsReadOnly; dataPanel.Controls.Add(_textBox, 1, dataPanel.RowCount - 1); #endregion } else if (field.Mode == FieldEditorMode.CheckBox) { #region creating editor control for booleans var _checkBox = new CheckBox(); field.GeneratedControl = _checkBox; _checkBox.Anchor = AnchorStyles.Left; _checkBox.AutoSize = false; _checkBox.Size = new Size(20, 20); _checkBox.TabIndex = tabIndex++; if (toolTip != null) { toolTip.SetToolTip(_checkBox, field.ColumnName); } leadLabel.Click += delegate { _checkBox.Checked = !_checkBox.Checked; }; if (field.IsNull) { _checkBox.DataBindings.Add(new Binding("CheckState", DataSource, field.ColumnName, true, field.IsReadOnly ? DataSourceUpdateMode.Never : DataSourceUpdateMode.OnPropertyChanged, CheckState.Indeterminate)); _checkBox.ThreeState = true; } else { _checkBox.DataBindings.Add(new Binding("Checked", DataSource, field.ColumnName, false, field.IsReadOnly ? DataSourceUpdateMode.Never : DataSourceUpdateMode.OnPropertyChanged, false)); } _checkBox.Enabled = !field.IsReadOnly; dataPanel.Controls.Add(_checkBox, 1, dataPanel.RowCount - 1); #endregion } else if (field.Mode == FieldEditorMode.ListBox) { #region creating editor control for lists with dialog var _comboBox = new ComboBox(); field.GeneratedControl = _comboBox; _comboBox.Size = new Size(field.SizeWidth.HasValue ? field.SizeWidth.Value : (int)DataDescriptorSizeWidth.Normal, 21); _comboBox.Anchor = AnchorStyles.Left; if (field.MaxLength.HasValue) { _comboBox.MaxLength = field.MaxLength.Value; } _comboBox.TabIndex = tabIndex++; _comboBox.DropDownStyle = ComboBoxStyle.Simple; if (toolTip != null) { toolTip.SetToolTip(_comboBox, field.ColumnName); } leadLabel.Click += delegate { _comboBox.Focus(); }; if (field.FormatValueMethod != null) { binding = new Binding("Text", DataSource, field.ColumnName, true, DataSourceUpdateMode.Never); _comboBox.Tag = field.FormatValueMethod; binding.FormattingEnabled = true; binding.Format += TableLayoutPanelExtenders.BindingFormat; if (field.IsNull) { binding.DataSourceNullValue = DBNull.Value; } _comboBox.DataBindings.Add(binding); } else { binding = new Binding("SelectedValue", DataSource, field.ColumnName, true, DataSourceUpdateMode.Never); if (field.IsNull) { binding.DataSourceNullValue = DBNull.Value; } _comboBox.DataBindings.Add(binding); } _comboBox.DataSource = field.DataSource; if (!string.IsNullOrWhiteSpace(field.ValueMember)) { _comboBox.ValueMember = field.ValueMember; } if (!string.IsNullOrWhiteSpace(field.DisplayMember)) { _comboBox.DisplayMember = field.DisplayMember; } _comboBox.Enabled = false; if (field.IsReadOnly) { dataPanel.Controls.Add(_comboBox, 1, dataPanel.RowCount - 1); } else { var _pnl = new TableLayoutPanel(); _pnl.AutoSize = true; _pnl.AutoSizeMode = AutoSizeMode.GrowAndShrink; _pnl.Margin = new Padding(0); _pnl.Padding = new Padding(0); _pnl.RowCount = 1; _pnl.ColumnCount = 2; _pnl.RowStyles.Add(new RowStyle(SizeType.AutoSize)); _pnl.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize)); _pnl.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize)); _pnl.Controls.Add(_comboBox, 0, 0); var _btnSelect = new Button(); _btnSelect.Anchor = AnchorStyles.Left; _btnSelect.MaximumSize = new Size(128, 128); _btnSelect.Margin = new Padding(1, 0, 1, 0); _btnSelect.Padding = new Padding(0); _btnSelect.AutoSize = true; _btnSelect.AutoSizeMode = AutoSizeMode.GrowAndShrink; _btnSelect.FlatStyle = FlatStyle.Flat; _btnSelect.FlatAppearance.BorderSize = 0; _btnSelect.FlatAppearance.MouseOverBackColor = SystemColors.GradientActiveCaption; _btnSelect.FlatAppearance.MouseDownBackColor = SystemColors.ControlLight; _btnSelect.Image = Settings.Images.SelectRowImage; _btnSelect.ImageAlign = ContentAlignment.MiddleCenter; _btnSelect.TextAlign = ContentAlignment.MiddleCenter; _btnSelect.TabIndex = tabIndex++; _btnSelect.TabStop = false; if (toolTip != null) { toolTip.SetToolTip(_btnSelect, string.Format("Select a value for {0}", field.ColumnName)); } _pnl.Controls.Add(_btnSelect, 1, 0); _comboBox.Size = new Size((field.SizeWidth.HasValue ? field.SizeWidth.Value : (int)DataDescriptorSizeWidth.Normal) - _btnSelect.Width - _btnSelect.Margin.Left - _btnSelect.Margin.Right - _comboBox.Margin.Right, _comboBox.Height); _btnSelect.Click += delegate(object sender, EventArgs e) { var cm = binding.BindingManagerBase; if (cm != null) { try { var col = cm.GetItemProperties().Find(field.ColumnName, false); if (col != null) { object items = field.DataSource; bool agc = false; if (field.GetListBoxItemsMethod != null) { items = field.GetListBoxItemsMethod.Invoke(); if (items == null) { FormServices.ShowError("No data exists", true); return; } agc = true; } var row = SelectItemForm.GetSelectedRow(items, field.ValueMember, field.DisplayMember, col.GetValue(cm.Current), agc); if (row != null) { col.SetValue(cm.Current, row[field.ValueMember]); cm.EndCurrentEdit(); } } } catch (Exception ex) { FormServices.ShowError(ex); cm.CancelCurrentEdit(); } } }; dataPanel.Controls.Add(_pnl, 1, dataPanel.RowCount - 1); } #endregion } else if (field.Mode == FieldEditorMode.ComboBox || field.Mode == FieldEditorMode.ComboTextBox) { #region creating editor control for drop down lists var _comboBox = new ComboBox(); field.GeneratedControl = _comboBox; _comboBox.Size = new Size(field.SizeWidth.HasValue ? field.SizeWidth.Value : (int)DataDescriptorSizeWidth.Normal, 20); _comboBox.Anchor = AnchorStyles.Left; if (field.MaxLength.HasValue) { _comboBox.MaxLength = field.MaxLength.Value; } _comboBox.TabIndex = tabIndex++; _comboBox.DropDownStyle = field.Mode == FieldEditorMode.ComboBox ? ComboBoxStyle.DropDownList : ComboBoxStyle.DropDown; if (toolTip != null) { toolTip.SetToolTip(_comboBox, field.ColumnName); } leadLabel.Click += delegate { _comboBox.Focus(); if (_comboBox.Enabled) { _comboBox.DroppedDown = true; } }; binding = new Binding(field.Mode == FieldEditorMode.ComboBox ? "SelectedValue" : "Text", DataSource, field.ColumnName, true, field.IsReadOnly ? DataSourceUpdateMode.Never : DataSourceUpdateMode.OnPropertyChanged); if (field.IsNull) { binding.DataSourceNullValue = DBNull.Value; } _comboBox.DataBindings.Add(binding); _comboBox.DataSource = field.DataSource; if (!string.IsNullOrWhiteSpace(field.ValueMember)) { _comboBox.ValueMember = field.ValueMember; } if (!string.IsNullOrWhiteSpace(field.DisplayMember)) { _comboBox.DisplayMember = field.DisplayMember; } _comboBox.Enabled = !field.IsReadOnly; if (field.Mode == FieldEditorMode.ComboTextBox) { _comboBox.AutoCompleteMode = AutoCompleteMode.Append; _comboBox.AutoCompleteSource = AutoCompleteSource.ListItems; } dataPanel.Controls.Add(_comboBox, 1, dataPanel.RowCount - 1); #endregion } else if (field.Mode == FieldEditorMode.GuidEditor) { #region creating editor control for Guid var _textBox = new TextBox(); field.GeneratedControl = _textBox; _textBox.Size = new Size((int)DataDescriptorSizeWidth.Normal, 20); _textBox.Anchor = AnchorStyles.Left; _textBox.TabIndex = tabIndex++; if (toolTip != null) { toolTip.SetToolTip(_textBox, field.ColumnName); } leadLabel.Click += delegate { _textBox.Focus(); }; if (DataSource != null) { _textBox.DataBindings.Add(new Binding("Text", DataSource, field.ColumnName, true, DataSourceUpdateMode.Never, "(null)")); } _textBox.ReadOnly = true; dataPanel.Controls.Add(_textBox, 1, dataPanel.RowCount - 1); #endregion } else if (field.Mode == FieldEditorMode.BitMask || field.Mode == FieldEditorMode.BitMask64) { #region creating editor control for mask (bits) var _listBox = new BitMaskCheckedListBox(); field.GeneratedControl = _listBox; _listBox.Size = new Size(field.SizeWidth.HasValue ? field.SizeWidth.Value : (int)DataDescriptorSizeWidth.Normal, 150); _listBox.Anchor = AnchorStyles.Left; _listBox.TabIndex = tabIndex++; if (toolTip != null) { toolTip.SetToolTip(_listBox, field.ColumnName); } leadLabel.Click += delegate { _listBox.Focus(); }; binding = new Binding(field.Mode == FieldEditorMode.BitMask ? "Value" : "LongValue", DataSource, field.ColumnName, true, field.IsReadOnly ? DataSourceUpdateMode.Never : DataSourceUpdateMode.OnPropertyChanged); if (field.IsNull) { binding.DataSourceNullValue = DBNull.Value; } if (field.NullValue != null) { binding.NullValue = field.NullValue; } if (field.Style.HasValue) { TableLayoutPanelExtenders.SetBindingStyle(binding, field.Style.Value); } _listBox.DataBindings.Add(binding); _listBox.Enabled = !field.IsReadOnly; if (field.DataSource != null) { if (field.DataSource is string[]) { _listBox.Items.AddRange((string[])field.DataSource); if (_listBox.Items.Count > 0) { var _nHeight = _listBox.Items.Count * (_listBox.GetItemHeight(0) + 4) + 1; if (_nHeight < _listBox.Size.Height) { _listBox.Size = new Size(_listBox.Size.Width, _nHeight); } } } else { _listBox.DataSource = field.DataSource; _listBox.DisplayMember = field.DisplayMember; } } dataPanel.Controls.Add(_listBox, 1, dataPanel.RowCount - 1); #endregion } if (field.IsNull && !field.IsReadOnly && field.Mode != FieldEditorMode.CheckBox || field.Mode == FieldEditorMode.GuidEditor) { #region button for clear value if (dataPanel.ColumnCount == 2) { dataPanel.ColumnCount = 3; dataPanel.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize)); } var _btnClear = new Button(); _btnClear.Anchor = AnchorStyles.Left; if (field.Mode == FieldEditorMode.MultilineTextBox) { _btnClear.Anchor |= AnchorStyles.Top; } _btnClear.MaximumSize = new Size(128, 128); _btnClear.Margin = new Padding(1, 0, 1, 0); _btnClear.Padding = new Padding(0); _btnClear.AutoSize = true; _btnClear.AutoSizeMode = AutoSizeMode.GrowAndShrink; _btnClear.FlatStyle = FlatStyle.Flat; _btnClear.FlatAppearance.BorderSize = 0; _btnClear.FlatAppearance.MouseOverBackColor = SystemColors.GradientActiveCaption; _btnClear.FlatAppearance.MouseDownBackColor = SystemColors.ControlLight; _btnClear.Image = Settings.Images.ClearFieldImage; _btnClear.ImageAlign = ContentAlignment.MiddleCenter; _btnClear.TextAlign = ContentAlignment.MiddleCenter; _btnClear.TabIndex = tabIndex++; _btnClear.TabStop = false; if (toolTip != null) { toolTip.SetToolTip(_btnClear, string.Format("Clear value from {0}", field.ColumnName)); } _btnClear.Click += delegate { var cm = binding.BindingManagerBase; if (cm != null) { try { var col = cm.GetItemProperties().Find(binding.BindingMemberInfo.BindingMember, false); if (col != null && cm.Count > 0) { col.SetValue(cm.Current, DBNull.Value); } cm.EndCurrentEdit(); binding.Control.Focus(); } catch (Exception ex) { FormServices.ShowError(ex); cm.CancelCurrentEdit(); } } }; dataPanel.Controls.Add(_btnClear, 2, dataPanel.RowCount - 1); #endregion } } dataPanel.ResumeLayout(false); }
public TableMemberControl(FormFleet parent, TableLayoutPanel table, int row) : this( parent ) { AddToTable(table, row); }
private void CreateFormerOptions(IWorldFormer former) { var table = new TableLayoutPanel(); table.Dock = DockStyle.Fill; table.Location = new Point(0, 0); Label lbl_Summary = new Label(); lbl_Summary.Text = former.Summary; lbl_Summary.Dock = DockStyle.Fill; table.Controls.Add(lbl_Summary, 0, 0); table.SetColumnSpan(lbl_Summary, 2); int rowCount = 1; foreach (var prop in former.GetType().GetProperties().Where(p => p.Name != "Summary")) { Control valueCtrl = null; if (prop.PropertyType == typeof(int) || prop.PropertyType == typeof(short)) { NumericUpDown num = new NumericUpDown(); num.DecimalPlaces = 0; num.DataBindings.Add("Value", former, prop.Name); valueCtrl = num; } else if (prop.PropertyType == typeof(double)) { NumericUpDown num = new NumericUpDown(); num.DecimalPlaces = 2; num.DataBindings.Add("Value", former, prop.Name); valueCtrl = num; } else if (prop.PropertyType == typeof(string)) { TextBox tb = new TextBox(); tb.DataBindings.Add("Text", former, prop.Name); valueCtrl = tb; } if (valueCtrl != null) { valueCtrl.Enabled = prop.CanWrite; table.RowStyles.Add(new RowStyle());//(SizeType.Absolute, 30F)); var lbl = new Label(); lbl.AutoSize = false; lbl.Location = new Point(0, 5); lbl.Text = prop.Name; table.Controls.Add(lbl, 0, rowCount); lbl.Location = new Point(0, 5); table.Controls.Add(valueCtrl, 1, rowCount); valueCtrl.Location = new Point(0, 0); rowCount++; } } formerOptions.Controls.Clear(); formerOptions.Controls.Add(table); table.Dock = DockStyle.Fill; table.Location = new Point(0, 0); }
private void InitializeComponent() { playerListMapSplitContainer = new SplitContainer(); playerBoxSearchBarContainer = new Panel(); playerBox = new PlayerListControl(); searchBarContainer = new TableLayoutPanel(); playerSearchBox = new ZklTextBox(); sendBox = new SendBox(); topicPanel = new Panel(); hideButton = new BitmapButton(); topicBox = new ChatBox(); ChatBox = new ChatBox(); splitContainer1 = new ZkSplitContainer(); ((ISupportInitialize)playerListMapSplitContainer).BeginInit(); playerListMapSplitContainer.Panel1.SuspendLayout(); playerListMapSplitContainer.SuspendLayout(); playerBoxSearchBarContainer.SuspendLayout(); searchBarContainer.SuspendLayout(); topicPanel.SuspendLayout(); ((ISupportInitialize)splitContainer1).BeginInit(); splitContainer1.Panel1.SuspendLayout(); splitContainer1.Panel2.SuspendLayout(); splitContainer1.SuspendLayout(); SuspendLayout(); // // playerListMapSplitContainer // playerListMapSplitContainer.BackColor = Color.DimGray; playerListMapSplitContainer.Dock = DockStyle.Fill; playerListMapSplitContainer.Location = new Point(0, 0); playerListMapSplitContainer.Margin = new Padding(2); playerListMapSplitContainer.Name = "playerListMapSplitContainer"; playerListMapSplitContainer.Orientation = Orientation.Horizontal; // // playerListMapSplitContainer.Panel1 // playerListMapSplitContainer.Panel1.Controls.Add(playerBoxSearchBarContainer); // // playerListMapSplitContainer.Panel2 // playerListMapSplitContainer.Panel2.AutoScroll = true; playerListMapSplitContainer.Size = new Size(326, 793); playerListMapSplitContainer.SplitterDistance = 565; playerListMapSplitContainer.SplitterWidth = 3; playerListMapSplitContainer.TabIndex = 0; playerListMapSplitContainer.SplitterMoved += new SplitterEventHandler(playerListMapSplitContainer_SplitterMoved); // // playerBoxSearchBarContainer // playerBoxSearchBarContainer.AutoSizeMode = AutoSizeMode.GrowAndShrink; playerBoxSearchBarContainer.Controls.Add(playerBox); playerBoxSearchBarContainer.Controls.Add(searchBarContainer); playerBoxSearchBarContainer.Dock = DockStyle.Fill; playerBoxSearchBarContainer.Location = new Point(0, 0); playerBoxSearchBarContainer.Name = "playerBoxSearchBarContainer"; playerBoxSearchBarContainer.Size = new Size(326, 565); playerBoxSearchBarContainer.TabIndex = 2; // // playerBox // playerBox.BackColor = Color.DimGray; playerBox.Dock = DockStyle.Fill; playerBox.ForeColor = Color.White; playerBox.HoverItem = null; playerBox.IsBattle = false; playerBox.IsSorted = false; playerBox.Location = new Point(0, 24); playerBox.Name = "playerBox"; playerBox.SelectedItem = null; playerBox.Size = new Size(326, 541); playerBox.TabIndex = 1; // // searchBarContainer // searchBarContainer.ColumnCount = 2; searchBarContainer.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize, 20F)); searchBarContainer.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 20F)); searchBarContainer.Controls.Add(playerSearchBox, 1, 0); searchBarContainer.Dock = DockStyle.Top; searchBarContainer.Location = new Point(0, 0); searchBarContainer.Name = "searchBarContainer"; searchBarContainer.RowCount = 1; searchBarContainer.RowStyles.Add(new RowStyle(SizeType.Absolute, 25F)); searchBarContainer.Size = new Size(326, 30); searchBarContainer.AutoSize = false; searchBarContainer.TabIndex = 0; // // playerSearchBox // playerSearchBox.Anchor = AnchorStyles.Left | AnchorStyles.Top; playerSearchBox.Location = new Point(23, 22); playerSearchBox.Name = "playerSearchBox"; playerSearchBox.Size = new Size(300, 20); playerSearchBox.Margin = new Padding(0); playerSearchBox.TabIndex = 0; playerSearchBox.Font = Config.GeneralFontSmall; playerSearchBox.TextChanged += new EventHandler(playerSearchBox_TextChanged); // // sendBox // sendBox.Dock = DockStyle.Bottom; sendBox.Font = Config.GeneralFont; sendBox.ForeColor = Color.White; sendBox.Location = new Point(0, 765); sendBox.Multiline = true; sendBox.Name = "sendBox"; sendBox.Size = new Size(800, 28); sendBox.TabIndex = 0; sendBox.WordWrap = false; // // topicPanel // topicPanel.AutoSizeMode = AutoSizeMode.GrowAndShrink; topicPanel.Controls.Add(hideButton); topicPanel.Controls.Add(topicBox); topicPanel.Dock = DockStyle.Top; topicPanel.Location = new Point(0, 0); topicPanel.Margin = new Padding(0); topicPanel.Name = "topicPanel"; topicPanel.Size = new Size(800, 0); topicPanel.TabIndex = 3; // // hideButton // hideButton.Anchor = (AnchorStyles)(AnchorStyles.Bottom | AnchorStyles.Right); hideButton.BackColor = Color.Transparent; hideButton.ButtonStyle = FrameBorderRenderer.StyleType.DarkHive; hideButton.Cursor = Cursors.Hand; hideButton.FlatStyle = FlatStyle.Flat; hideButton.ForeColor = Color.White; hideButton.Location = new Point(711, -29); hideButton.Name = "hideButton"; hideButton.Size = new Size(75, 23); hideButton.SoundType = SoundPalette.SoundType.Click; hideButton.TabIndex = 3; hideButton.Text = "Hide"; hideButton.UseVisualStyleBackColor = true; hideButton.Click += new EventHandler(hideButton_Click); // // topicBox // topicBox.BackColor = Color.FromArgb((int)(byte)0, (int)(byte)30, (int)(byte)40); topicBox.ChatBackgroundColor = 0; topicBox.DefaultTooltip = null; topicBox.Dock = DockStyle.Fill; topicBox.Font = Config.GeneralFontBig; topicBox.HideScroll = false; topicBox.IRCForeColor = 0; topicBox.LineHighlight = null; topicBox.Location = new Point(0, 0); topicBox.Name = "topicBox"; topicBox.NoColorMode = false; topicBox.ShowHistory = true; topicBox.ShowJoinLeave = false; topicBox.ShowUnreadLine = true; topicBox.SingleLine = false; topicBox.Size = new Size(800, 0); topicBox.TabIndex = 2; topicBox.TextFilter = null; // // ChatBox // ChatBox.BackColor = Color.DimGray; ChatBox.ChatBackgroundColor = 0; ChatBox.DefaultTooltip = null; ChatBox.Dock = DockStyle.Fill; ChatBox.Font = Config.GeneralFont; ChatBox.ForeColor = Color.White; ChatBox.HideScroll = false; ChatBox.IRCForeColor = 0; ChatBox.LineHighlight = null; ChatBox.Location = new Point(0, 0); ChatBox.Name = "ChatBox"; ChatBox.NoColorMode = false; ChatBox.ShowHistory = true; ChatBox.ShowJoinLeave = false; ChatBox.ShowUnreadLine = true; ChatBox.SingleLine = false; ChatBox.Size = new Size(800, 765); ChatBox.TabIndex = 1; ChatBox.TextFilter = null; // // splitContainer1 // splitContainer1.BackColor = Color.Transparent; splitContainer1.Dock = DockStyle.Fill; splitContainer1.Location = new Point(0, 0); splitContainer1.Margin = new Padding(0); splitContainer1.Name = "splitContainer1"; // // splitContainer1.Panel1 // splitContainer1.Panel1.Controls.Add(ChatBox); splitContainer1.Panel1.Controls.Add(topicPanel); splitContainer1.Panel1.Controls.Add(sendBox); // // splitContainer1.Panel2 // splitContainer1.Panel2.Controls.Add(playerListMapSplitContainer); splitContainer1.Size = new Size(1130, 793); splitContainer1.SplitterDistance = 800; splitContainer1.TabIndex = 0; splitContainer1.SplitterMoved += splitContainer1_SplitterMoved; playerBox.BackColor = Config.BgColor; playerBox.ForeColor = Config.TextColor; playerBox_zklclick.AttachTo(playerBox); playerBox_zklclick.MouseClick += PlayerBox_MouseClick; playerSearchBox.BackColor = Config.BgColor; playerSearchBox.ForeColor = Config.TextColor; var searchLabel = new Label() { Text = "Search: ", AutoSize = true, Font = Config.GeneralFontSmall, Margin = new Padding(3) }; searchBarContainer.Controls.Add(searchLabel, 0, 0); // // ChatControl // Controls.Add(splitContainer1); Margin = new Padding(0); Name = "ChatControl"; Size = new Size(1130, 793); playerListMapSplitContainer.Panel1.ResumeLayout(false); ((ISupportInitialize)playerListMapSplitContainer).EndInit(); playerListMapSplitContainer.ResumeLayout(false); playerBoxSearchBarContainer.ResumeLayout(false); searchBarContainer.ResumeLayout(false); topicPanel.ResumeLayout(false); splitContainer1.Panel1.ResumeLayout(false); splitContainer1.Panel1.PerformLayout(); splitContainer1.Panel2.ResumeLayout(false); ((ISupportInitialize)splitContainer1).EndInit(); splitContainer1.ResumeLayout(false); ResumeLayout(false); }
// Constructors public TableLayoutControlCollection(TableLayoutPanel container) { }
private void InitializeComponent() { ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(BillingSettings)); this.tb1rate = new TextBox(); this.lbCurrency1 = new Label(); this.rbBilling1rate = new RadioButton(); this.rbBilling2rate = new RadioButton(); this.tblPanel2rate = new TableLayoutPanel(); this.tb2Rate2 = new TextBox(); this.dtPicker2from1 = new DateTimePicker(); this.lbFrom = new Label(); this.lbnonPeak = new Label(); this.lbPeak = new Label(); this.lbDuration = new Label(); this.lbRCurrency2 = new Label(); this.tb2Rate1 = new TextBox(); this.tbduration = new TextBox(); this.butSysparaSave = new Button(); this.groupBox1 = new GroupBox(); this.tblPanel2rate.SuspendLayout(); this.groupBox1.SuspendLayout(); base.SuspendLayout(); componentResourceManager.ApplyResources(this.tb1rate, "tb1rate"); this.tb1rate.ForeColor = Color.Black; this.tb1rate.Name = "tb1rate"; this.tb1rate.KeyPress += new KeyPressEventHandler(this.double_KeyPress); componentResourceManager.ApplyResources(this.lbCurrency1, "lbCurrency1"); this.lbCurrency1.ForeColor = Color.Black; this.lbCurrency1.Name = "lbCurrency1"; componentResourceManager.ApplyResources(this.rbBilling1rate, "rbBilling1rate"); this.rbBilling1rate.ForeColor = Color.Black; this.rbBilling1rate.Name = "rbBilling1rate"; this.rbBilling1rate.TabStop = true; this.rbBilling1rate.UseVisualStyleBackColor = true; this.rbBilling1rate.CheckedChanged += new System.EventHandler(this.rbBillingrateType_CheckedChanged); componentResourceManager.ApplyResources(this.rbBilling2rate, "rbBilling2rate"); this.rbBilling2rate.ForeColor = Color.Black; this.rbBilling2rate.Name = "rbBilling2rate"; this.rbBilling2rate.TabStop = true; this.rbBilling2rate.UseVisualStyleBackColor = true; this.rbBilling2rate.CheckedChanged += new System.EventHandler(this.rbBillingrateType_CheckedChanged); componentResourceManager.ApplyResources(this.tblPanel2rate, "tblPanel2rate"); this.tblPanel2rate.Controls.Add(this.tb2Rate2, 3, 2); this.tblPanel2rate.Controls.Add(this.dtPicker2from1, 1, 1); this.tblPanel2rate.Controls.Add(this.lbFrom, 1, 0); this.tblPanel2rate.Controls.Add(this.lbnonPeak, 0, 2); this.tblPanel2rate.Controls.Add(this.lbPeak, 0, 1); this.tblPanel2rate.Controls.Add(this.lbDuration, 2, 0); this.tblPanel2rate.Controls.Add(this.lbRCurrency2, 3, 0); this.tblPanel2rate.Controls.Add(this.tb2Rate1, 3, 1); this.tblPanel2rate.Controls.Add(this.tbduration, 2, 1); this.tblPanel2rate.Name = "tblPanel2rate"; componentResourceManager.ApplyResources(this.tb2Rate2, "tb2Rate2"); this.tb2Rate2.ForeColor = Color.Black; this.tb2Rate2.Name = "tb2Rate2"; this.tb2Rate2.KeyPress += new KeyPressEventHandler(this.double_KeyPress); componentResourceManager.ApplyResources(this.dtPicker2from1, "dtPicker2from1"); this.dtPicker2from1.Format = DateTimePickerFormat.Custom; this.dtPicker2from1.Name = "dtPicker2from1"; this.dtPicker2from1.ShowUpDown = true; componentResourceManager.ApplyResources(this.lbFrom, "lbFrom"); this.lbFrom.ForeColor = SystemColors.ControlText; this.lbFrom.Name = "lbFrom"; componentResourceManager.ApplyResources(this.lbnonPeak, "lbnonPeak"); this.lbnonPeak.ForeColor = SystemColors.ControlText; this.lbnonPeak.Name = "lbnonPeak"; componentResourceManager.ApplyResources(this.lbPeak, "lbPeak"); this.lbPeak.ForeColor = SystemColors.ControlText; this.lbPeak.Name = "lbPeak"; componentResourceManager.ApplyResources(this.lbDuration, "lbDuration"); this.lbDuration.ForeColor = SystemColors.ControlText; this.lbDuration.Name = "lbDuration"; componentResourceManager.ApplyResources(this.lbRCurrency2, "lbRCurrency2"); this.lbRCurrency2.ForeColor = SystemColors.ControlText; this.lbRCurrency2.Name = "lbRCurrency2"; componentResourceManager.ApplyResources(this.tb2Rate1, "tb2Rate1"); this.tb2Rate1.ForeColor = Color.Black; this.tb2Rate1.Name = "tb2Rate1"; this.tb2Rate1.KeyPress += new KeyPressEventHandler(this.double_KeyPress); componentResourceManager.ApplyResources(this.tbduration, "tbduration"); this.tbduration.ForeColor = Color.Black; this.tbduration.Name = "tbduration"; this.tbduration.KeyPress += new KeyPressEventHandler(this.int_KeyPress); this.butSysparaSave.BackColor = Color.Gainsboro; componentResourceManager.ApplyResources(this.butSysparaSave, "butSysparaSave"); this.butSysparaSave.ForeColor = SystemColors.ControlText; this.butSysparaSave.Name = "butSysparaSave"; this.butSysparaSave.UseVisualStyleBackColor = false; this.butSysparaSave.Click += new System.EventHandler(this.butSysparaSave_Click); this.groupBox1.Controls.Add(this.rbBilling2rate); this.groupBox1.Controls.Add(this.rbBilling1rate); this.groupBox1.Controls.Add(this.tblPanel2rate); this.groupBox1.Controls.Add(this.lbCurrency1); this.groupBox1.Controls.Add(this.tb1rate); componentResourceManager.ApplyResources(this.groupBox1, "groupBox1"); this.groupBox1.ForeColor = Color.FromArgb(20, 73, 160); this.groupBox1.Name = "groupBox1"; this.groupBox1.TabStop = false; base.AutoScaleMode = AutoScaleMode.None; this.BackColor = Color.WhiteSmoke; base.Controls.Add(this.groupBox1); base.Controls.Add(this.butSysparaSave); componentResourceManager.ApplyResources(this, "$this"); base.Name = "BillingSettings"; this.tblPanel2rate.ResumeLayout(false); this.tblPanel2rate.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); base.ResumeLayout(false); }
private void InitializeComponents(int width, int height) { MenuStrip menu = new MenuStrip(); ToolStripMenuItem fileMenuItem = new ToolStripMenuItem(); ToolStripMenuItem openFileMenuItem = new ToolStripMenuItem(); ToolStripMenuItem saveFileMenuItem = new ToolStripMenuItem(); TableLayoutPanel mainTable = new TableLayoutPanel(); ToolsPanel toolsPanel = new ToolsPanel(); PropertiesPanel propertiesPanel = new PropertiesPanel(); Panel picturePanel = new Panel(); pictureBox = new PictureBox(); menu.Items.Add(fileMenuItem); fileMenuItem.Text = "File"; fileMenuItem.DropDownItems.Add(openFileMenuItem); fileMenuItem.DropDownItems.Add(saveFileMenuItem); openFileMenuItem.Text = "Open"; openFileMenuItem.Click += OpenFileMenuItem_Click; saveFileMenuItem.Text = "Save"; saveFileMenuItem.Click += SaveFileMenuItem_Click; mainTable.RowCount = 3; mainTable.ColumnCount = 2; mainTable.Dock = DockStyle.Fill; mainTable.RowStyles.Add(new RowStyle(SizeType.Absolute, 25)); mainTable.RowStyles.Add(new RowStyle(SizeType.Absolute, 32)); mainTable.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); mainTable.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 52)); mainTable.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); mainTable.Controls.Add(toolsPanel, 0, 2); mainTable.Controls.Add(propertiesPanel, 1, 1); mainTable.Controls.Add(picturePanel, 1, 2); toolsPanel.PensilClick += ToolsPanel_PensilClick; toolsPanel.RectangleClick += ToolsPanel_RectangleClick; toolsPanel.EllipseClick += ToolsPanel_EllipseClick; toolsPanel.TriangleClick += ToolsPanel_TriangleClick; toolsPanel.StarClick += ToolsPanel_StarClick; toolsPanel.BucketClick += ToolsPanel_BucketClick; propertiesPanel.ColorChanged += PropertiesPanel_ColorChanged; propertiesPanel.ToolSizeChanged += PropertiesPanel_ToolSizeChanged; propertiesPanel.ZoomChanged += PropertiesPanel_ZoomChanged; picturePanel.Dock = DockStyle.Fill; picturePanel.AutoScroll = true; picturePanel.Controls.Add(pictureBox); pictureBox.Image = new Bitmap(width, height); pictureBox.BorderStyle = BorderStyle.Fixed3D; pictureBox.SizeMode = PictureBoxSizeMode.AutoSize; pictureBox.MouseDown += PictureBox_MouseDown; pictureBox.MouseUp += PictureBox_MouseUp; pictureBox.MouseMove += PictureBox_MouseMove; pictureBox.MouseWheel += PictureBox_MouseWheel; ClientSize = new Size(width + 65, height + 70); MinimumSize = Size; Controls.Add(menu); Controls.Add(mainTable); }
public RawSqlView() { this.SuspendLayout(); tlp0 = new TableLayoutPanel(); tlp0.Dock = DockStyle.Fill; Controls.Add(tlp0); tlp0.ColumnCount = 1; tCmd = new TextBox(); tCmd.Text = "SHOW DATABASES;"; tCmd.Anchor = AnchorStyles.Left | AnchorStyles.Right; tCmd.Multiline = true; tCmd.Height *= 4; KeyEventHandler keh = new KeyEventHandler(delegate(object sender, KeyEventArgs e) { if (e.KeyData == (Keys.Control | Keys.Return) || e.KeyData == (Keys.Alt | Keys.Return)) { btnExecute_OnClick(sender, new EventArgs()); e.Handled = true; e.SuppressKeyPress = true; } }); tCmd.KeyDown += keh; tlp0.RowCount++; tlp0.Controls.Add(tCmd); btnExecute = new Button(); btnExecute.Text = "Execute"; btnExecute.Click += new EventHandler(btnExecute_OnClick); btnExecute.Anchor = AnchorStyles.Left; tlp0.RowCount++; tlp0.Controls.Add(btnExecute); dropDown = new ComboBox(); dropDown.Width *= 3; dropDownList = Query.CreateQueries(); dropDown.DataSource = dropDownList; dropDown.SelectedValueChanged += new EventHandler(dropDown_SelectedValueChanged); dropDown.DropDownStyle = ComboBoxStyle.DropDownList; tlp0.RowCount++; tlp0.Controls.Add(dropDown); tMessage = new TextBox(); tMessage.Anchor = AnchorStyles.Left | AnchorStyles.Right; tMessage.Text = ""; tMessage.Multiline = true; tMessage.Height *= 4; tMessage.ReadOnly = true; tlp0.RowCount++; tlp0.Controls.Add(tMessage); g = new DataGridView(); g.BorderStyle = BorderStyle.None; g.Dock = DockStyle.Fill; g.AutoGenerateColumns = true; tlp0.RowCount++; tlp0.Controls.Add(g); Util.FixTableLayoutStyles(tlp0); this.ResumeLayout(); }
private void MakeIOSignalsGraphics(List <List <string> > ioSignals, List <DateTime> dateTimes) { this.Invoke((MethodInvoker) delegate { int rowCount = _checkedIOIndexes.Count; if (rowCount == 0) { rowCount = 1; } //plots var tlpIOplots = new TableLayoutPanel(); tlpIOplots.Dock = DockStyle.Fill; tlpIOplots.CellBorderStyle = TableLayoutPanelCellBorderStyle.Outset; tlpIOplots.ColumnCount = 1; tlpIOplots.RowCount = rowCount; for (int i = 0; i < rowCount; i++) { tlpIOplots.RowStyles.Add(new RowStyle()); } float rowHight = 100 / rowCount; TableLayoutRowStyleCollection styles = tlpIOplots.RowStyles; foreach (RowStyle style in styles) { style.SizeType = SizeType.Percent; style.Height = rowHight; } panelIOplots.Controls.Clear(); panelIOplots.Controls.Add(tlpIOplots); _ioSeries[0] = new LineSeries { StrokeThickness = 1, Color = OxyColors.Blue, MarkerType = MarkerType.Circle, MarkerStroke = OxyColors.Blue, MarkerFill = OxyColors.Blue, MarkerSize = 2 }; _ioSeries[1] = new LineSeries { StrokeThickness = 1, Color = OxyColors.Magenta, MarkerType = MarkerType.Circle, MarkerStroke = OxyColors.Magenta, MarkerFill = OxyColors.Magenta, MarkerSize = 2 }; _ioSeries[2] = new LineSeries { StrokeThickness = 1, Color = OxyColors.Green, MarkerType = MarkerType.Circle, MarkerStroke = OxyColors.Green, MarkerFill = OxyColors.Green, MarkerSize = 2 }; _ioSeries[3] = new LineSeries { StrokeThickness = 1, Color = OxyColors.IndianRed, MarkerType = MarkerType.Circle, MarkerStroke = OxyColors.IndianRed, MarkerFill = OxyColors.IndianRed, MarkerSize = 2 }; _ioSeries[4] = new LineSeries { StrokeThickness = 1, Color = OxyColors.DarkOrange, MarkerType = MarkerType.Circle, MarkerStroke = OxyColors.DarkOrange, MarkerFill = OxyColors.DarkOrange, MarkerSize = 2 }; _ioSeries[5] = new LineSeries { StrokeThickness = 1, Color = OxyColors.Yellow, MarkerType = MarkerType.Circle, MarkerStroke = OxyColors.Yellow, MarkerFill = OxyColors.Yellow, MarkerSize = 2 }; _ioSeries[6] = new LineSeries { StrokeThickness = 1, Color = OxyColors.Red, MarkerType = MarkerType.Circle, MarkerStroke = OxyColors.Red, MarkerFill = OxyColors.Red, MarkerSize = 2 }; _ioSeries[7] = new LineSeries { StrokeThickness = 1, Color = OxyColors.LimeGreen, MarkerType = MarkerType.Circle, MarkerStroke = OxyColors.LimeGreen, MarkerFill = OxyColors.LimeGreen, MarkerSize = 2 }; _ioSeries[8] = new LineSeries { StrokeThickness = 1, Color = OxyColors.DeepSkyBlue, MarkerType = MarkerType.Circle, MarkerStroke = OxyColors.DeepSkyBlue, MarkerFill = OxyColors.DeepSkyBlue, MarkerSize = 2 }; _ioSeries[9] = new LineSeries { StrokeThickness = 1, Color = OxyColors.BlueViolet, MarkerType = MarkerType.Circle, MarkerStroke = OxyColors.BlueViolet, MarkerFill = OxyColors.BlueViolet, MarkerSize = 2 }; for (int i = 0; i < _checkedIOIndexes.Count; i++) { xAxis[i] = new DateTimeAxis(AxisPosition.Bottom, dateTimes[0], dateTimes[dateTimes.Count - 1], null, null, DateTimeIntervalType.Auto) { MajorGridlineStyle = LineStyle.Solid, MinorGridlineStyle = LineStyle.Dot, //Title = "Дата", StringFormat = "dd-MM-yyyy HH:mm:ss", FontSize = 10, IsZoomEnabled = true, MajorStep = 1.0 / 24 / 60 / 2, MinorStep = 1.0 / 24 / 60 / 12, Minimum = DateTimeAxis.ToDouble(dateTimes[0]), Maximum = DateTimeAxis.ToDouble(dateTimes[dateTimes.Count - 1]) }; yAxis[i] = new LinearAxis(AxisPosition.Left, 0) { MajorGridlineStyle = LineStyle.Solid, MinorGridlineStyle = LineStyle.Dot, Title = "value", StringFormat = "00#", Minimum = -0.2, Maximum = 1.2 }; plotIOSignals[i] = new OxyPlot.WindowsForms.Plot { Model = new PlotModel(), Dock = DockStyle.Fill }; plotIOSignals[i].Model.PlotType = PlotType.XY; plotIOSignals[i].Model.Axes.Clear(); plotIOSignals[i].Model.Axes.Add(xAxis[i]); plotIOSignals[i].Model.Axes.Add(yAxis[i]); //annotations lineAnnotationsIO[i] = new LineAnnotation { Type = LineAnnotationType.Vertical, Color = OxyColors.Brown, Layer = AnnotationLayer.BelowSeries }; lineAnnotationsIO[i].X = lineAnnotationVertical.X; /* lineAnnotationsIO[i].MouseDown += (s, e) => * { * if (e.ChangedButton != OxyMouseButton.Left) * { * return; * } * if (_isMarkersActive == 1) * { * lineAnnotationsIO[i].StrokeThickness *= 3; * plotIOSignals[i].Model.InvalidatePlot(false); * e.Handled = true; * } * }; * lineAnnotationsIO[i].MouseMove += (s, e) => * { * if (_isMarkersActive == 1) * { * lineAnnotationsIO[i].X = lineAnnotationsIO[i].InverseTransform(e.Position).X; * plotIOSignals[i].Model.InvalidatePlot(false); * e.Handled = true; * } * }; * lineAnnotationsIO[i].MouseUp += (s, e) => * { * if (_isMarkersActive == 1) * { * lineAnnotationsIO[i].StrokeThickness /= 3; * plotIOSignals[i].Model.InvalidatePlot(false); * e.Handled = true; * } * }; */ plotIOSignals[i].Model.Annotations.Add(lineAnnotationsIO[i]); } for (int i = 0; i < _ioSeries.Count(); i++) { _ioSeries[i].Points.Clear(); } for (int i = 0; i < _checkedIOIndexes.Count; i++) { plotIOSignals[i].Model.Series.Clear(); } for (int i = 0; i < _checkedIOIndexes.Count; i++) { for (int j = 0; j < dateTimes.Count; j++) { if (ioSignals[_checkedIOIndexes[i]][j] != "нет данных") { _ioSeries[i].Points.Add(new DataPoint(DateTimeAxis.ToDouble(dateTimes[j]), Convert.ToDouble(ioSignals[_checkedIOIndexes[i]][j]))); } } } for (int i = 0; i < _checkedIOIndexes.Count; i++) { plotIOSignals[i].Model.Series.Add(_ioSeries[i]); plotIOSignals[i].InvalidatePlot(true); tlpIOplots.Controls.Add(plotIOSignals[i], 0, i); } }); }
public PartsView() { this.SuspendLayout(); tlp0 = new TableLayoutPanel(); tlp0.Dock = DockStyle.Fill; this.Controls.Add(tlp0); cbPartType = new ComboBox(); cbPartType.DropDownStyle = ComboBoxStyle.DropDownList; cbPartType.SelectedIndexChanged += new EventHandler(delegate (object sender, EventArgs e) { this.RefreshParts(); }); tlp0.Controls.Add(cbPartType, 0, 0); btnRefresh = new Button(); btnRefresh.Text = "Refresh"; btnRefresh.Click += new EventHandler(btnRefresh_OnClick); tlp0.Controls.Add(btnRefresh, 1, 0); btnNewPart = new Button(); btnNewPart.Text = "New Part"; btnNewPart.Click += new EventHandler(btnNewPart_OnClick); tlp0.Controls.Add(btnNewPart, 2, 0); btnEditPart = new Button(); btnEditPart.Text = "Edit Part"; btnEditPart.Click += new EventHandler(btnEditPart_OnClick); tlp0.Controls.Add(btnEditPart, 3, 0); btnDeletePart = new Button(); btnDeletePart.Text = "Delete Part"; btnDeletePart.Click += new EventHandler(btnDeletePart_OnClick); btnDeletePart.Enabled = false; tlp0.Controls.Add(btnDeletePart, 4, 0); btnRepairMissingAttributes = new Button(); btnRepairMissingAttributes.Text = "Repair Attributes"; btnRepairMissingAttributes.Width *= 2; btnRepairMissingAttributes.Click += new EventHandler(btnRepairMissingAttributes_OnClick); btnRepairMissingAttributes.Enabled = false; tlp0.Controls.Add(btnRepairMissingAttributes, 5, 0); dgv = new DataGridView(); dgv.Dock = DockStyle.Fill; dgv.MultiSelect = false; dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect; dgv.RowHeadersVisible = false; dgv.AllowUserToAddRows = false; dgv.AllowUserToDeleteRows = false; dgv.ReadOnly = true; dgv.DataBindingComplete += new DataGridViewBindingCompleteEventHandler(dgv_DataBindingComplete); dgv.CellDoubleClick += new DataGridViewCellEventHandler(delegate (object sender, DataGridViewCellEventArgs e) { if (OnEditPart != null) { DataRowView view = (DataRowView)dgv.Rows[e.RowIndex].DataBoundItem; DataRow row = view.Row; OnEditPart(row, this.SelectedPartType); } }); tlp0.Controls.Add(dgv, 0, 1); tlp0.SetColumnSpan(dgv, 6); tlp0.RowCount = 2; tlp0.ColumnCount = 6; Util.FixTableLayoutStyles(tlp0); this.ResumeLayout(); }
public GameRouter(TableLayoutPanel field, int sizeOfField, int countOfCharacters) { gameActivities = new GameActivities(); gameActivities.InitializeSession(sizeOfField, countOfCharacters); }
private void InitializeComponent() { this.components = new Container(); ResourceManager manager = new ResourceManager(typeof(RACUNFormRACUNRacunStavkeUserControl)); this.contextMenu1 = new ContextMenu(); this.SetNullItem = new MenuItem(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.errorProvider1 = new ErrorProvider(); this.errorProviderValidator1 = new ErrorProviderValidator(this.components); this.bindingSourceRACUNRacunStavke = new BindingSource(this.components); ((ISupportInitialize)this.bindingSourceRACUNRacunStavke).BeginInit(); this.layoutManagerformRACUNRacunStavke = new TableLayoutPanel(); this.layoutManagerformRACUNRacunStavke.SuspendLayout(); this.layoutManagerformRACUNRacunStavke.AutoSize = true; this.layoutManagerformRACUNRacunStavke.Dock = DockStyle.Fill; this.layoutManagerformRACUNRacunStavke.AutoSizeMode = AutoSizeMode.GrowAndShrink; this.layoutManagerformRACUNRacunStavke.AutoScroll = false; System.Drawing.Point point = new System.Drawing.Point(0, 0); this.layoutManagerformRACUNRacunStavke.Location = point; Size size = new System.Drawing.Size(0, 0); this.layoutManagerformRACUNRacunStavke.Size = size; this.layoutManagerformRACUNRacunStavke.ColumnCount = 2; this.layoutManagerformRACUNRacunStavke.RowCount = 7; this.layoutManagerformRACUNRacunStavke.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.layoutManagerformRACUNRacunStavke.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.layoutManagerformRACUNRacunStavke.RowStyles.Add(new RowStyle()); this.layoutManagerformRACUNRacunStavke.RowStyles.Add(new RowStyle()); this.layoutManagerformRACUNRacunStavke.RowStyles.Add(new RowStyle()); this.layoutManagerformRACUNRacunStavke.RowStyles.Add(new RowStyle()); this.layoutManagerformRACUNRacunStavke.RowStyles.Add(new RowStyle()); this.layoutManagerformRACUNRacunStavke.RowStyles.Add(new RowStyle()); this.layoutManagerformRACUNRacunStavke.RowStyles.Add(new RowStyle()); this.label1BROJSTAVKE = new UltraLabel(); this.textBROJSTAVKE = new UltraNumericEditor(); this.label1IDPROIZVOD = new UltraLabel(); this.comboIDPROIZVOD = new PROIZVODComboBox(); this.label1NAZIVPROIZVODRACUN = new UltraLabel(); this.textNAZIVPROIZVODRACUN = new UltraTextEditor(); this.label1CIJENARACUN = new UltraLabel(); this.textCIJENARACUN = new UltraNumericEditor(); this.label1KOLICINA = new UltraLabel(); this.textKOLICINA = new UltraNumericEditor(); this.label1RABAT = new UltraLabel(); this.textRABAT = new UltraNumericEditor(); ((ISupportInitialize)this.textBROJSTAVKE).BeginInit(); ((ISupportInitialize)this.textNAZIVPROIZVODRACUN).BeginInit(); ((ISupportInitialize)this.textCIJENARACUN).BeginInit(); ((ISupportInitialize)this.textKOLICINA).BeginInit(); ((ISupportInitialize)this.textRABAT).BeginInit(); this.dsRACUNDataSet1 = new RACUNDataSet(); this.dsRACUNDataSet1.BeginInit(); this.SuspendLayout(); this.dsRACUNDataSet1.DataSetName = "dsRACUN"; this.dsRACUNDataSet1.Locale = new CultureInfo("hr-HR"); this.bindingSourceRACUNRacunStavke.DataSource = this.dsRACUNDataSet1; this.bindingSourceRACUNRacunStavke.DataMember = "RACUNRacunStavke"; ((ISupportInitialize)this.bindingSourceRACUNRacunStavke).BeginInit(); point = new System.Drawing.Point(0, 0); this.label1BROJSTAVKE.Location = point; this.label1BROJSTAVKE.Name = "label1BROJSTAVKE"; this.label1BROJSTAVKE.TabIndex = 1; this.label1BROJSTAVKE.Tag = "labelBROJSTAVKE"; this.label1BROJSTAVKE.Text = "Stavka:"; this.label1BROJSTAVKE.StyleSetName = "FieldUltraLabel"; this.label1BROJSTAVKE.AutoSize = true; this.label1BROJSTAVKE.Anchor = AnchorStyles.Left; this.label1BROJSTAVKE.Appearance.TextVAlign = VAlign.Middle; this.label1BROJSTAVKE.Appearance.Image = RuntimeHelpers.GetObjectValue(manager.GetObject("pictureBoxKey.Image")); this.label1BROJSTAVKE.Appearance.ImageHAlign = HAlign.Right; size = new System.Drawing.Size(7, 10); this.label1BROJSTAVKE.ImageSize = size; this.label1BROJSTAVKE.Appearance.ForeColor = Color.Black; this.label1BROJSTAVKE.BackColor = Color.Transparent; this.layoutManagerformRACUNRacunStavke.Controls.Add(this.label1BROJSTAVKE, 0, 0); this.layoutManagerformRACUNRacunStavke.SetColumnSpan(this.label1BROJSTAVKE, 1); this.layoutManagerformRACUNRacunStavke.SetRowSpan(this.label1BROJSTAVKE, 1); Padding padding = new Padding(3, 1, 5, 2); this.label1BROJSTAVKE.Margin = padding; size = new System.Drawing.Size(0, 0); this.label1BROJSTAVKE.MinimumSize = size; size = new System.Drawing.Size(0x3a, 0x17); this.label1BROJSTAVKE.Size = size; point = new System.Drawing.Point(0, 0); this.textBROJSTAVKE.Location = point; this.textBROJSTAVKE.Name = "textBROJSTAVKE"; this.textBROJSTAVKE.Tag = "BROJSTAVKE"; this.textBROJSTAVKE.TabIndex = 0; this.textBROJSTAVKE.Anchor = AnchorStyles.Left; this.textBROJSTAVKE.MouseEnter += new EventHandler(this.mouseEnter_Text); this.textBROJSTAVKE.ReadOnly = true; this.textBROJSTAVKE.TabStop = false; this.textBROJSTAVKE.PromptChar = ' '; this.textBROJSTAVKE.Enter += new EventHandler(this.numericEditor_Enter); this.textBROJSTAVKE.DataBindings.Add(new Binding("Value", this.bindingSourceRACUNRacunStavke, "BROJSTAVKE")); this.textBROJSTAVKE.NumericType = NumericType.Integer; this.textBROJSTAVKE.MaskInput = "{LOC}-nnnnnn"; this.layoutManagerformRACUNRacunStavke.Controls.Add(this.textBROJSTAVKE, 1, 0); this.layoutManagerformRACUNRacunStavke.SetColumnSpan(this.textBROJSTAVKE, 1); this.layoutManagerformRACUNRacunStavke.SetRowSpan(this.textBROJSTAVKE, 1); padding = new Padding(0, 1, 3, 2); this.textBROJSTAVKE.Margin = padding; size = new System.Drawing.Size(0x3a, 0x16); this.textBROJSTAVKE.MinimumSize = size; size = new System.Drawing.Size(0x3a, 0x16); this.textBROJSTAVKE.Size = size; point = new System.Drawing.Point(0, 0); this.label1IDPROIZVOD.Location = point; this.label1IDPROIZVOD.Name = "label1IDPROIZVOD"; this.label1IDPROIZVOD.TabIndex = 1; this.label1IDPROIZVOD.Tag = "labelIDPROIZVOD"; this.label1IDPROIZVOD.Text = "Šif. pro:"; this.label1IDPROIZVOD.StyleSetName = "FieldUltraLabel"; this.label1IDPROIZVOD.AutoSize = true; this.label1IDPROIZVOD.Anchor = AnchorStyles.Left; this.label1IDPROIZVOD.Appearance.TextVAlign = VAlign.Middle; this.label1IDPROIZVOD.Appearance.ForeColor = Color.Black; this.label1IDPROIZVOD.BackColor = Color.Transparent; this.layoutManagerformRACUNRacunStavke.Controls.Add(this.label1IDPROIZVOD, 0, 1); this.layoutManagerformRACUNRacunStavke.SetColumnSpan(this.label1IDPROIZVOD, 1); this.layoutManagerformRACUNRacunStavke.SetRowSpan(this.label1IDPROIZVOD, 1); padding = new Padding(3, 1, 5, 2); this.label1IDPROIZVOD.Margin = padding; size = new System.Drawing.Size(0, 0); this.label1IDPROIZVOD.MinimumSize = size; size = new System.Drawing.Size(0x40, 0x17); this.label1IDPROIZVOD.Size = size; point = new System.Drawing.Point(0, 0); this.comboIDPROIZVOD.Location = point; this.comboIDPROIZVOD.Name = "comboIDPROIZVOD"; this.comboIDPROIZVOD.Tag = "IDPROIZVOD"; this.comboIDPROIZVOD.TabIndex = 0; this.comboIDPROIZVOD.Anchor = AnchorStyles.Left; this.comboIDPROIZVOD.MouseEnter += new EventHandler(this.mouseEnter_Text); this.comboIDPROIZVOD.DropDownStyle = DropDownStyle.DropDown; this.comboIDPROIZVOD.ComboBox.DropDownStyle = DropDownStyle.DropDown; this.comboIDPROIZVOD.ComboBox.AutoCompleteMode = Infragistics.Win.AutoCompleteMode.Suggest; this.comboIDPROIZVOD.Enabled = true; this.comboIDPROIZVOD.DataBindings.Add(new Binding("Value", this.bindingSourceRACUNRacunStavke, "IDPROIZVOD")); this.comboIDPROIZVOD.ShowPictureBox = true; this.comboIDPROIZVOD.PictureBoxClicked += new EventHandler(this.PictureBoxClickedIDPROIZVOD); this.comboIDPROIZVOD.ValueMember = "IDPROIZVOD"; this.comboIDPROIZVOD.SelectionChanged += new EventHandler(this.SelectedIndexChangedIDPROIZVOD); this.layoutManagerformRACUNRacunStavke.Controls.Add(this.comboIDPROIZVOD, 1, 1); this.layoutManagerformRACUNRacunStavke.SetColumnSpan(this.comboIDPROIZVOD, 1); this.layoutManagerformRACUNRacunStavke.SetRowSpan(this.comboIDPROIZVOD, 1); padding = new Padding(0, 1, 3, 2); this.comboIDPROIZVOD.Margin = padding; size = new System.Drawing.Size(0x268, 0x17); this.comboIDPROIZVOD.MinimumSize = size; size = new System.Drawing.Size(0x268, 0x17); this.comboIDPROIZVOD.Size = size; point = new System.Drawing.Point(0, 0); this.label1NAZIVPROIZVODRACUN.Location = point; this.label1NAZIVPROIZVODRACUN.Name = "label1NAZIVPROIZVODRACUN"; this.label1NAZIVPROIZVODRACUN.TabIndex = 1; this.label1NAZIVPROIZVODRACUN.Tag = "labelNAZIVPROIZVODRACUN"; this.label1NAZIVPROIZVODRACUN.Text = "Proizvod:"; this.label1NAZIVPROIZVODRACUN.StyleSetName = "FieldUltraLabel"; this.label1NAZIVPROIZVODRACUN.AutoSize = true; this.label1NAZIVPROIZVODRACUN.Anchor = AnchorStyles.Left | AnchorStyles.Top; this.label1NAZIVPROIZVODRACUN.Appearance.TextVAlign = VAlign.Middle; this.label1NAZIVPROIZVODRACUN.Appearance.ForeColor = Color.Black; this.label1NAZIVPROIZVODRACUN.BackColor = Color.Transparent; this.layoutManagerformRACUNRacunStavke.Controls.Add(this.label1NAZIVPROIZVODRACUN, 0, 2); this.layoutManagerformRACUNRacunStavke.SetColumnSpan(this.label1NAZIVPROIZVODRACUN, 1); this.layoutManagerformRACUNRacunStavke.SetRowSpan(this.label1NAZIVPROIZVODRACUN, 1); padding = new Padding(3, 1, 5, 2); this.label1NAZIVPROIZVODRACUN.Margin = padding; size = new System.Drawing.Size(0, 0); this.label1NAZIVPROIZVODRACUN.MinimumSize = size; size = new System.Drawing.Size(0x49, 0x17); this.label1NAZIVPROIZVODRACUN.Size = size; point = new System.Drawing.Point(0, 0); this.textNAZIVPROIZVODRACUN.Location = point; this.textNAZIVPROIZVODRACUN.Name = "textNAZIVPROIZVODRACUN"; this.textNAZIVPROIZVODRACUN.Tag = "NAZIVPROIZVODRACUN"; this.textNAZIVPROIZVODRACUN.TabIndex = 0; this.textNAZIVPROIZVODRACUN.Anchor = AnchorStyles.Left; this.textNAZIVPROIZVODRACUN.MouseEnter += new EventHandler(this.mouseEnter_Text); this.textNAZIVPROIZVODRACUN.ReadOnly = false; this.textNAZIVPROIZVODRACUN.DataBindings.Add(new Binding("Text", this.bindingSourceRACUNRacunStavke, "NAZIVPROIZVODRACUN")); this.textNAZIVPROIZVODRACUN.Multiline = true; this.textNAZIVPROIZVODRACUN.MaxLength = 500; this.layoutManagerformRACUNRacunStavke.Controls.Add(this.textNAZIVPROIZVODRACUN, 1, 2); this.layoutManagerformRACUNRacunStavke.SetColumnSpan(this.textNAZIVPROIZVODRACUN, 1); this.layoutManagerformRACUNRacunStavke.SetRowSpan(this.textNAZIVPROIZVODRACUN, 1); padding = new Padding(0, 1, 3, 2); this.textNAZIVPROIZVODRACUN.Margin = padding; size = new System.Drawing.Size(0x240, 110); this.textNAZIVPROIZVODRACUN.MinimumSize = size; size = new System.Drawing.Size(0x240, 110); this.textNAZIVPROIZVODRACUN.Size = size; this.textNAZIVPROIZVODRACUN.Dock = DockStyle.Fill; point = new System.Drawing.Point(0, 0); this.label1CIJENARACUN.Location = point; this.label1CIJENARACUN.Name = "label1CIJENARACUN"; this.label1CIJENARACUN.TabIndex = 1; this.label1CIJENARACUN.Tag = "labelCIJENARACUN"; this.label1CIJENARACUN.Text = "Cijena:"; this.label1CIJENARACUN.StyleSetName = "FieldUltraLabel"; this.label1CIJENARACUN.AutoSize = true; this.label1CIJENARACUN.Anchor = AnchorStyles.Left; this.label1CIJENARACUN.Appearance.TextVAlign = VAlign.Middle; this.label1CIJENARACUN.Appearance.ForeColor = Color.Black; this.label1CIJENARACUN.BackColor = Color.Transparent; this.layoutManagerformRACUNRacunStavke.Controls.Add(this.label1CIJENARACUN, 0, 3); this.layoutManagerformRACUNRacunStavke.SetColumnSpan(this.label1CIJENARACUN, 1); this.layoutManagerformRACUNRacunStavke.SetRowSpan(this.label1CIJENARACUN, 1); padding = new Padding(3, 1, 5, 2); this.label1CIJENARACUN.Margin = padding; size = new System.Drawing.Size(0, 0); this.label1CIJENARACUN.MinimumSize = size; size = new System.Drawing.Size(0x3a, 0x17); this.label1CIJENARACUN.Size = size; point = new System.Drawing.Point(0, 0); this.textCIJENARACUN.Location = point; this.textCIJENARACUN.Name = "textCIJENARACUN"; this.textCIJENARACUN.Tag = "CIJENARACUN"; this.textCIJENARACUN.TabIndex = 0; this.textCIJENARACUN.Anchor = AnchorStyles.Left; this.textCIJENARACUN.MouseEnter += new EventHandler(this.mouseEnter_Text); this.textCIJENARACUN.ReadOnly = false; this.textCIJENARACUN.PromptChar = ' '; this.textCIJENARACUN.Enter += new EventHandler(this.numericEditor_Enter); this.textCIJENARACUN.DataBindings.Add(new Binding("Value", this.bindingSourceRACUNRacunStavke, "CIJENARACUN")); this.textCIJENARACUN.NumericType = NumericType.Double; this.textCIJENARACUN.MaxValue = 79228162514264337593543950335M; this.textCIJENARACUN.MinValue = -79228162514264337593543950335M; this.textCIJENARACUN.MaskInput = "{LOC}-nnnnn.nnnn"; this.layoutManagerformRACUNRacunStavke.Controls.Add(this.textCIJENARACUN, 1, 3); this.layoutManagerformRACUNRacunStavke.SetColumnSpan(this.textCIJENARACUN, 1); this.layoutManagerformRACUNRacunStavke.SetRowSpan(this.textCIJENARACUN, 1); padding = new Padding(0, 1, 3, 2); this.textCIJENARACUN.Margin = padding; size = new System.Drawing.Size(0x52, 0x16); this.textCIJENARACUN.MinimumSize = size; size = new System.Drawing.Size(0x52, 0x16); this.textCIJENARACUN.Size = size; point = new System.Drawing.Point(0, 0); this.label1KOLICINA.Location = point; this.label1KOLICINA.Name = "label1KOLICINA"; this.label1KOLICINA.TabIndex = 1; this.label1KOLICINA.Tag = "labelKOLICINA"; this.label1KOLICINA.Text = "Količina:"; this.label1KOLICINA.StyleSetName = "FieldUltraLabel"; this.label1KOLICINA.AutoSize = true; this.label1KOLICINA.Anchor = AnchorStyles.Left; this.label1KOLICINA.Appearance.TextVAlign = VAlign.Middle; this.label1KOLICINA.Appearance.ForeColor = Color.Black; this.label1KOLICINA.BackColor = Color.Transparent; this.layoutManagerformRACUNRacunStavke.Controls.Add(this.label1KOLICINA, 0, 4); this.layoutManagerformRACUNRacunStavke.SetColumnSpan(this.label1KOLICINA, 1); this.layoutManagerformRACUNRacunStavke.SetRowSpan(this.label1KOLICINA, 1); padding = new Padding(3, 1, 5, 2); this.label1KOLICINA.Margin = padding; size = new System.Drawing.Size(0, 0); this.label1KOLICINA.MinimumSize = size; size = new System.Drawing.Size(0x44, 0x17); this.label1KOLICINA.Size = size; point = new System.Drawing.Point(0, 0); this.textKOLICINA.Location = point; this.textKOLICINA.Name = "textKOLICINA"; this.textKOLICINA.Tag = "KOLICINA"; this.textKOLICINA.TabIndex = 0; this.textKOLICINA.Anchor = AnchorStyles.Left; this.textKOLICINA.MouseEnter += new EventHandler(this.mouseEnter_Text); this.textKOLICINA.ReadOnly = false; this.textKOLICINA.PromptChar = ' '; this.textKOLICINA.Enter += new EventHandler(this.numericEditor_Enter); this.textKOLICINA.DataBindings.Add(new Binding("Value", this.bindingSourceRACUNRacunStavke, "KOLICINA")); this.textKOLICINA.NumericType = NumericType.Double; this.textKOLICINA.MaxValue = 79228162514264337593543950335M; this.textKOLICINA.MinValue = -79228162514264337593543950335M; this.textKOLICINA.MaskInput = "{LOC}-nnnnnnnnnn.nn"; this.layoutManagerformRACUNRacunStavke.Controls.Add(this.textKOLICINA, 1, 4); this.layoutManagerformRACUNRacunStavke.SetColumnSpan(this.textKOLICINA, 1); this.layoutManagerformRACUNRacunStavke.SetRowSpan(this.textKOLICINA, 1); padding = new Padding(0, 1, 3, 2); this.textKOLICINA.Margin = padding; size = new System.Drawing.Size(0x66, 0x16); this.textKOLICINA.MinimumSize = size; size = new System.Drawing.Size(0x66, 0x16); this.textKOLICINA.Size = size; point = new System.Drawing.Point(0, 0); this.label1RABAT.Location = point; this.label1RABAT.Name = "label1RABAT"; this.label1RABAT.TabIndex = 1; this.label1RABAT.Tag = "labelRABAT"; this.label1RABAT.Text = "% Rabat:"; this.label1RABAT.StyleSetName = "FieldUltraLabel"; this.label1RABAT.AutoSize = true; this.label1RABAT.Anchor = AnchorStyles.Left; this.label1RABAT.Appearance.TextVAlign = VAlign.Middle; this.label1RABAT.Appearance.ForeColor = Color.Black; this.label1RABAT.BackColor = Color.Transparent; this.layoutManagerformRACUNRacunStavke.Controls.Add(this.label1RABAT, 0, 5); this.layoutManagerformRACUNRacunStavke.SetColumnSpan(this.label1RABAT, 1); this.layoutManagerformRACUNRacunStavke.SetRowSpan(this.label1RABAT, 1); padding = new Padding(3, 1, 5, 2); this.label1RABAT.Margin = padding; size = new System.Drawing.Size(0, 0); this.label1RABAT.MinimumSize = size; size = new System.Drawing.Size(0x4a, 0x17); this.label1RABAT.Size = size; point = new System.Drawing.Point(0, 0); this.textRABAT.Location = point; this.textRABAT.Name = "textRABAT"; this.textRABAT.Tag = "RABAT"; this.textRABAT.TabIndex = 0; this.textRABAT.Anchor = AnchorStyles.Left; this.textRABAT.MouseEnter += new EventHandler(this.mouseEnter_Text); this.textRABAT.ReadOnly = false; this.textRABAT.PromptChar = ' '; this.textRABAT.Enter += new EventHandler(this.numericEditor_Enter); this.textRABAT.DataBindings.Add(new Binding("Value", this.bindingSourceRACUNRacunStavke, "RABAT")); this.textRABAT.NumericType = NumericType.Double; this.textRABAT.MaxValue = 79228162514264337593543950335M; this.textRABAT.MinValue = -79228162514264337593543950335M; this.textRABAT.MaskInput = "{LOC}-nnn.nn"; this.layoutManagerformRACUNRacunStavke.Controls.Add(this.textRABAT, 1, 5); this.layoutManagerformRACUNRacunStavke.SetColumnSpan(this.textRABAT, 1); this.layoutManagerformRACUNRacunStavke.SetRowSpan(this.textRABAT, 1); padding = new Padding(0, 1, 3, 2); this.textRABAT.Margin = padding; size = new System.Drawing.Size(0x37, 0x16); this.textRABAT.MinimumSize = size; size = new System.Drawing.Size(0x37, 0x16); this.textRABAT.Size = size; this.Controls.Add(this.layoutManagerformRACUNRacunStavke); this.SetNullItem.Index = 0; this.SetNullItem.Text = "Set Null"; this.SetNullItem.Click += new EventHandler(this.SetNullItem_Click); this.contextMenu1.Popup += new EventHandler(this.contextMenu1_Popup); this.contextMenu1.MenuItems.AddRange(new MenuItem[] { this.SetNullItem }); this.errorProvider1.DataSource = this.bindingSourceRACUNRacunStavke; this.errorProviderValidator1.ErrorProvider = this.errorProvider1; this.Name = "RACUNFormRACUNRacunStavkeUserControl"; this.Text = " Stavke racuna"; this.AutoSize = true; this.AutoScroll = true; this.Load += new EventHandler(this.RACUNFormUserControl_Load); this.layoutManagerformRACUNRacunStavke.ResumeLayout(false); this.layoutManagerformRACUNRacunStavke.PerformLayout(); ((ISupportInitialize)this.bindingSourceRACUNRacunStavke).EndInit(); ((ISupportInitialize)this.textBROJSTAVKE).EndInit(); ((ISupportInitialize)this.textNAZIVPROIZVODRACUN).EndInit(); ((ISupportInitialize)this.textCIJENARACUN).EndInit(); ((ISupportInitialize)this.textKOLICINA).EndInit(); ((ISupportInitialize)this.textRABAT).EndInit(); this.dsRACUNDataSet1.EndInit(); this.ResumeLayout(false); this.PerformLayout(); }
private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InputBox)); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.Txt_Value = new System.Windows.Forms.TextBox(); this.Lab_Text = new System.Windows.Forms.Label(); this.Btn_Ok = new System.Windows.Forms.Button(); this.Btn_Cancel = new System.Windows.Forms.Button(); this.tableLayoutPanel1.SuspendLayout(); this.SuspendLayout(); // // tableLayoutPanel1 // this.tableLayoutPanel1.ColumnCount = 2; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel1.Controls.Add(this.Txt_Value, 0, 1); this.tableLayoutPanel1.Controls.Add(this.Lab_Text, 0, 0); this.tableLayoutPanel1.Controls.Add(this.Btn_Ok, 0, 2); this.tableLayoutPanel1.Controls.Add(this.Btn_Cancel, 1, 2); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 3; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.Size = new System.Drawing.Size(258, 97); this.tableLayoutPanel1.TabIndex = 1; // // Txt_Value // this.tableLayoutPanel1.SetColumnSpan(this.Txt_Value, 2); this.Txt_Value.Dock = System.Windows.Forms.DockStyle.Fill; this.Txt_Value.Font = new System.Drawing.Font("宋体", 12F); this.Txt_Value.Location = new System.Drawing.Point(3, 28); this.Txt_Value.MaxLength = 50; this.Txt_Value.Name = "Txt_Value"; this.Txt_Value.Size = new System.Drawing.Size(252, 30); this.Txt_Value.TabIndex = 1; this.Txt_Value.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Txt_Value_KeyDown); // // Lab_Text // this.tableLayoutPanel1.SetColumnSpan(this.Lab_Text, 2); this.Lab_Text.Dock = System.Windows.Forms.DockStyle.Fill; this.Lab_Text.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Lab_Text.ForeColor = System.Drawing.Color.Maroon; this.Lab_Text.Location = new System.Drawing.Point(3, 3); this.Lab_Text.Margin = new System.Windows.Forms.Padding(3, 3, 3, 0); this.Lab_Text.Name = "Lab_Text"; this.Lab_Text.Size = new System.Drawing.Size(252, 22); this.Lab_Text.TabIndex = 0; this.Lab_Text.Text = "提示语"; this.Lab_Text.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // Btn_Ok // this.Btn_Ok.Cursor = System.Windows.Forms.Cursors.Hand; this.Btn_Ok.Dock = System.Windows.Forms.DockStyle.Right; this.Btn_Ok.Image = ((System.Drawing.Image)(resources.GetObject("Btn_Ok.Image"))); this.Btn_Ok.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.Btn_Ok.Location = new System.Drawing.Point(28, 58); this.Btn_Ok.Margin = new System.Windows.Forms.Padding(0, 3, 10, 3); this.Btn_Ok.Name = "Btn_Ok"; this.Btn_Ok.Size = new System.Drawing.Size(91, 36); this.Btn_Ok.TabIndex = 2; this.Btn_Ok.Text = "确定"; this.Btn_Ok.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage; this.Btn_Ok.UseVisualStyleBackColor = true; this.Btn_Ok.Click += new System.EventHandler(this.Btn_Ok_Click); // // Btn_Cancel // this.Btn_Cancel.Cursor = System.Windows.Forms.Cursors.Hand; this.Btn_Cancel.Dock = System.Windows.Forms.DockStyle.Left; this.Btn_Cancel.Image = ((System.Drawing.Image)(resources.GetObject("Btn_Cancel.Image"))); this.Btn_Cancel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.Btn_Cancel.Location = new System.Drawing.Point(129, 58); this.Btn_Cancel.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3); this.Btn_Cancel.Name = "Btn_Cancel"; this.Btn_Cancel.Size = new System.Drawing.Size(95, 36); this.Btn_Cancel.TabIndex = 3; this.Btn_Cancel.Text = "取消"; this.Btn_Cancel.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage; this.Btn_Cancel.UseVisualStyleBackColor = true; this.Btn_Cancel.Click += new System.EventHandler(this.Btn_Cancel_Click); // // InputBox // this.ClientSize = new System.Drawing.Size(258, 97); this.Controls.Add(this.tableLayoutPanel1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "InputBox"; this.ShowIcon = false; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "标题"; this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); this.ResumeLayout(false); }
private void CreateOutputPage() { m_OutputPage = new Page("Output"); m_OutputPage.SuspendLayout(); m_OutputControl = new OutputControl() { Id = "Output" }; m_OutputPage.AddControl( m_OutputControl, true ); m_PictureBox = new PictureBox(); ((System.ComponentModel.ISupportInitialize)(m_PictureBox)).BeginInit(); m_PictureBox.Location = new System.Drawing.Point(0, 0); m_PictureBox.Margin = new System.Windows.Forms.Padding(0, 6, 0, 0); m_PictureBox.Size = new System.Drawing.Size(32, 32); m_PictureBox.TabStop = false; //m_PictureBox.Image = NoConsoleLib.Properties.Resources.circle_green; ((System.ComponentModel.ISupportInitialize)(m_PictureBox)).EndInit(); m_InfoTextBox = new InfoTextbox(); m_InfoTextBox.SetHeightRows( 2 ); m_KillButton = new Button(); m_KillButton.Image = NoConsoleLib.Properties.Resources.Skull; m_KillButton.Location = new System.Drawing.Point(0, 0); m_KillButton.Size = new System.Drawing.Size(26, 26); Lib.ToolTip.SetToolTip(m_KillButton, "Kill"); m_KillButton.UseVisualStyleBackColor = true; m_KillButton.Click += new System.EventHandler(this.OnKillClick); TableLayoutPanel tableLayoutPanel1 = new TableLayoutPanel(); tableLayoutPanel1.SuspendLayout(); tableLayoutPanel1.ColumnCount = 3; tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 32F + 12f)); tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 32F)); tableLayoutPanel1.RowCount = 1; tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); tableLayoutPanel1.Controls.Add(m_PictureBox, 0, 0); tableLayoutPanel1.Controls.Add(m_InfoTextBox, 1, 0); tableLayoutPanel1.Controls.Add(m_KillButton, 2, 0); tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0); tableLayoutPanel1.Size = new System.Drawing.Size(300, 32 + 6); m_OutputPage.AddControl(tableLayoutPanel1); tableLayoutPanel1.ResumeLayout(false); m_OutputPage.ResumeLayout(); }
public void InitializeComponent() { table = new TableLayoutPanel(); view = new ViewportPanel(); scroll = new VScrollBar(); scroll.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom; view.Dock = DockStyle.Fill; table.Dock = DockStyle.Fill; table.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); table.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); table.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize, 0)); table.RowCount = 1; table.ColumnCount = 2; table.Controls.Add(view); table.Controls.Add(scroll); table.SetColumn(view, 0); table.SetColumn(scroll, 1); scroll.Scroll += (sender, e) => OnScroll(e); view.Paint += (sender, e) => OnPaint(e); Controls.Add(table); }
private void InitializeComponent() { this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.label1 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.myLabel1 = new MissionPlanner.Controls.MyLabel(); this.tableLayoutPanel1.SuspendLayout(); this.SuspendLayout(); // // tableLayoutPanel1 // this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tableLayoutPanel1.AutoSize = true; this.tableLayoutPanel1.ColumnCount = 1; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 1); this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 28); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(0, 5, 0, 10); this.tableLayoutPanel1.RowCount = 2; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.Size = new System.Drawing.Size(337, 84); this.tableLayoutPanel1.TabIndex = 4; // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(3, 5); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(35, 13); this.label1.TabIndex = 0; this.label1.Text = "label1"; // // panel1 // this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Location = new System.Drawing.Point(3, 21); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(331, 50); this.panel1.TabIndex = 1; // // myLabel1 // this.myLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.myLabel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold); this.myLabel1.Location = new System.Drawing.Point(3, 3); this.myLabel1.Name = "myLabel1"; this.myLabel1.resize = false; this.myLabel1.Size = new System.Drawing.Size(337, 23); this.myLabel1.TabIndex = 3; this.myLabel1.Text = "myLabel1"; // // MavlinkCheckBoxBitMask // this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.myLabel1); this.Name = "MavlinkCheckBoxBitMask"; this.Size = new System.Drawing.Size(343, 115); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); }
public MainForm () { tableLayoutPanel1 = new TableLayoutPanel (); tableLayoutPanel2 = new TableLayoutPanel (); label1 = new Label (); label2 = new Label (); textBox1 = new TextBox (); textBox2 = new TextBox (); label3 = new Label (); tableLayoutPanel1.SuspendLayout (); tableLayoutPanel2.SuspendLayout (); SuspendLayout (); // // tableLayoutPanel1 // tableLayoutPanel1.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; tableLayoutPanel1.ColumnCount = 2; tableLayoutPanel1.ColumnStyles.Add (new ColumnStyle ()); tableLayoutPanel1.ColumnStyles.Add (new ColumnStyle ()); tableLayoutPanel1.Controls.Add (tableLayoutPanel2, 1, 0); tableLayoutPanel1.Controls.Add (label3, 0, 0); tableLayoutPanel1.Location = new Point (20, 30); tableLayoutPanel1.RowCount = 2; tableLayoutPanel1.RowStyles.Add (new RowStyle (SizeType.Percent, 50F)); tableLayoutPanel1.RowStyles.Add (new RowStyle (SizeType.Percent, 50F)); tableLayoutPanel1.Size = new Size (250, 145); tableLayoutPanel1.TabIndex = 0; // // tableLayoutPanel2 // tableLayoutPanel2.AutoSize = true; tableLayoutPanel2.ColumnCount = 2; tableLayoutPanel2.ColumnStyles.Add (new ColumnStyle ()); tableLayoutPanel2.ColumnStyles.Add (new ColumnStyle (SizeType.Percent, 50F)); tableLayoutPanel2.Controls.Add (label1, 0, 0); tableLayoutPanel2.Controls.Add (label2, 0, 1); tableLayoutPanel2.Controls.Add (textBox1, 1, 0); tableLayoutPanel2.Controls.Add (textBox2, 1, 1); tableLayoutPanel2.Location = new Point (68, 3); tableLayoutPanel2.RowCount = 2; tableLayoutPanel2.RowStyles.Add (new RowStyle (SizeType.Percent, 50F)); tableLayoutPanel2.RowStyles.Add (new RowStyle (SizeType.Percent, 50F)); tableLayoutPanel2.Size = new Size (131, 39); tableLayoutPanel2.TabIndex = 0; // // label1 // label1.AutoSize = true; label1.Location = new Point (3, 0); label1.Size = new Size (19, 13); label1.TabIndex = 0; label1.Text = "en"; // // label2 // label2.AutoSize = true; label2.Location = new Point (3, 19); label2.Size = new Size (18, 13); label2.TabIndex = 1; label2.Text = "es"; // // textBox1 // textBox1.Dock = DockStyle.Fill; textBox1.Location = new Point (28, 3); textBox1.Size = new Size (100, 20); textBox1.TabIndex = 2; // // textBox2 // textBox2.Dock = DockStyle.Fill; textBox2.Location = new Point (28, 22); textBox2.Size = new Size (100, 20); textBox2.TabIndex = 3; // // label3 // label3.AutoSize = true; label3.Location = new Point (3, 0); label3.Size = new Size (59, 13); label3.TabIndex = 1; label3.Text = "Head word"; // // MainForm // AutoScaleDimensions = new SizeF (6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size (292, 200); Controls.Add (tableLayoutPanel1); tableLayoutPanel1.ResumeLayout (false); tableLayoutPanel1.PerformLayout (); tableLayoutPanel2.ResumeLayout (false); tableLayoutPanel2.PerformLayout (); Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #354672"; ResumeLayout (false); Load += new EventHandler (MainForm_Load); }
private void InitializeComponent() { this.components = new Container(); ResourceManager manager = new ResourceManager(typeof(s_od_rekap_brutoUserControl)); this.layoutManagerforms_od_rekap_bruto = new TableLayoutPanel(); this.layoutManagerforms_od_rekap_bruto.SuspendLayout(); this.layoutManagerforms_od_rekap_bruto.AutoSize = true; this.layoutManagerforms_od_rekap_bruto.Dock = DockStyle.Fill; this.layoutManagerforms_od_rekap_bruto.AutoSizeMode = AutoSizeMode.GrowAndShrink; this.layoutManagerforms_od_rekap_bruto.AutoScroll = false; System.Drawing.Point point = new System.Drawing.Point(0, 0); this.layoutManagerforms_od_rekap_bruto.Location = point; Size size = new System.Drawing.Size(0, 0); this.layoutManagerforms_od_rekap_bruto.Size = size; this.layoutManagerforms_od_rekap_bruto.ColumnCount = 2; this.layoutManagerforms_od_rekap_bruto.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.layoutManagerforms_od_rekap_bruto.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.layoutManagerforms_od_rekap_bruto.RowCount = 2; this.layoutManagerforms_od_rekap_bruto.RowStyles.Add(new RowStyle()); this.layoutManagerforms_od_rekap_bruto.RowStyles.Add(new RowStyle()); this.label1idobracun = new UltraLabel(); this.textidobracun = new UltraTextEditor(); this.userControlDataGrids_od_rekap_bruto = new s_od_rekap_brutoUserDataGrid(); this.ultraGridPrintDocument1 = new UltraGridPrintDocument(this.components); this.ultraPrintPreviewDialog1 = new UltraPrintPreviewDialog(this.components); ((ISupportInitialize)this.textidobracun).BeginInit(); this.SuspendLayout(); this.label1idobracun.Name = "label1idobracun"; this.label1idobracun.TabIndex = 1; this.label1idobracun.Tag = "labelidobracun"; this.label1idobracun.AutoSize = true; this.label1idobracun.StyleSetName = "FieldUltraLabel"; this.label1idobracun.Text = "idobracun :"; this.label1idobracun.Appearance.TextVAlign = VAlign.Middle; this.label1idobracun.Anchor = AnchorStyles.Left | AnchorStyles.Top; this.label1idobracun.Appearance.ForeColor = Color.Black; this.layoutManagerforms_od_rekap_bruto.Controls.Add(this.label1idobracun, 0, 0); this.layoutManagerforms_od_rekap_bruto.SetColumnSpan(this.label1idobracun, 1); this.layoutManagerforms_od_rekap_bruto.SetRowSpan(this.label1idobracun, 1); Padding padding = new Padding(3, 1, 5, 2); this.label1idobracun.Margin = padding; size = new System.Drawing.Size(0, 0); this.label1idobracun.MinimumSize = size; point = new System.Drawing.Point(0, 0); this.textidobracun.Location = point; this.textidobracun.Name = "textidobracun"; this.textidobracun.Tag = "idobracun"; this.textidobracun.TabIndex = 0; size = new System.Drawing.Size(0x71, 0x16); this.textidobracun.Size = size; this.textidobracun.MaxLength = 11; EditorButton button = new EditorButton { Key = "editorButtonOBRACUNidobracun", Tag = "editorButtonOBRACUNidobracun", Text = "..." }; this.textidobracun.ButtonsRight.Add(button); this.textidobracun.EditorButtonClick += new EditorButtonEventHandler(this.CallPromptOBRACUNidobracun); this.layoutManagerforms_od_rekap_bruto.Controls.Add(this.textidobracun, 1, 0); this.layoutManagerforms_od_rekap_bruto.SetColumnSpan(this.textidobracun, 1); this.layoutManagerforms_od_rekap_bruto.SetRowSpan(this.textidobracun, 1); padding = new Padding(0, 1, 3, 2); this.textidobracun.Margin = padding; size = new System.Drawing.Size(0x71, 0x16); this.textidobracun.MinimumSize = size; this.layoutManagerforms_od_rekap_bruto.Controls.Add(this.userControlDataGrids_od_rekap_bruto, 0, 1); this.layoutManagerforms_od_rekap_bruto.SetColumnSpan(this.userControlDataGrids_od_rekap_bruto, 2); this.layoutManagerforms_od_rekap_bruto.SetRowSpan(this.userControlDataGrids_od_rekap_bruto, 1); padding = new Padding(5, 10, 5, 10); this.userControlDataGrids_od_rekap_bruto.Margin = padding; size = new System.Drawing.Size(100, 100); this.userControlDataGrids_od_rekap_bruto.MinimumSize = size; this.userControlDataGrids_od_rekap_bruto.Dock = DockStyle.Fill; this.Controls.Add(this.layoutManagerforms_od_rekap_bruto); this.userControlDataGrids_od_rekap_bruto.Name = "userControlDataGrids_od_rekap_bruto"; this.userControlDataGrids_od_rekap_bruto.Dock = DockStyle.Fill; this.userControlDataGrids_od_rekap_bruto.DockPadding.All = 5; this.userControlDataGrids_od_rekap_bruto.FillAtStartup = false; this.userControlDataGrids_od_rekap_bruto.TabIndex = 6; point = new System.Drawing.Point(0, 0); this.userControlDataGrids_od_rekap_bruto.Location = point; size = new System.Drawing.Size(0x285, 350); this.userControlDataGrids_od_rekap_bruto.Size = size; this.ultraGridPrintDocument1.Grid = this.userControlDataGrids_od_rekap_bruto.DataGrid; SizeF ef = new System.Drawing.SizeF(6f, 13f); this.AutoScaleDimensions = ef; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.DockPadding.All = 5; this.Name = "s_od_rekap_brutoWorkWith"; this.Text = "Work With s_od_rekap_bruto"; this.Load += new EventHandler(this.s_od_rekap_brutoUserControl_Load); this.layoutManagerforms_od_rekap_bruto.ResumeLayout(false); this.layoutManagerforms_od_rekap_bruto.PerformLayout(); ((ISupportInitialize)this.textidobracun).EndInit(); this.ResumeLayout(false); }
private void FocusEntryPanel(object sender, MouseEventArgs e) { TableLayoutPanel.Focus(); }
private void CalculateColumnRowSizes (TableLayoutPanel panel, int columns, int rows) { TableLayoutSettings settings = panel.LayoutSettings; panel.column_widths = new int[panel.actual_positions.GetLength (0)]; panel.row_heights = new int[panel.actual_positions.GetLength (1)]; int border_width = TableLayoutPanel.GetCellBorderWidth (panel.CellBorderStyle); Rectangle parentDisplayRectangle = panel.DisplayRectangle; TableLayoutColumnStyleCollection col_styles = new TableLayoutColumnStyleCollection (panel); foreach (ColumnStyle cs in settings.ColumnStyles) col_styles.Add( new ColumnStyle(cs.SizeType, cs.Width)); TableLayoutRowStyleCollection row_styles = new TableLayoutRowStyleCollection (panel); foreach (RowStyle rs in settings.RowStyles) row_styles.Add (new RowStyle (rs.SizeType, rs.Height)); // If we have more columns than columnstyles, temporarily add enough columnstyles if (columns > col_styles.Count) { for (int i = col_styles.Count; i < columns; i++) col_styles.Add(new ColumnStyle()); } // Same for rows.. if (rows > row_styles.Count) { for (int i = row_styles.Count; i < rows; i++) row_styles.Add (new RowStyle ()); } while (row_styles.Count > rows) row_styles.RemoveAt (row_styles.Count - 1); while (col_styles.Count > columns) col_styles.RemoveAt (col_styles.Count - 1); // Figure up all the column widths int total_width = parentDisplayRectangle.Width - (border_width * (columns + 1)); int index = 0; // First assign all the Absolute sized columns.. foreach (ColumnStyle cs in col_styles) { if (cs.SizeType == SizeType.Absolute) { panel.column_widths[index] = (int)cs.Width; total_width -= (int)cs.Width; } index++; } index = 0; // Next, assign all the AutoSize columns.. foreach (ColumnStyle cs in col_styles) { if (cs.SizeType == SizeType.AutoSize) { int max_width = 0; // Find the widest control in the column for (int i = 0; i < rows; i ++) { Control c = panel.actual_positions[index, i]; if (c != null && c != dummy_control && c.VisibleInternal) { if (settings.GetColumnSpan (c) > 1) continue; if (c.AutoSize) max_width = Math.Max (max_width, c.PreferredSize.Width + c.Margin.Horizontal); else max_width = Math.Max (max_width, c.ExplicitBounds.Width + c.Margin.Horizontal); if (c.Width + c.Margin.Left + c.Margin.Right > max_width) max_width = c.Width + c.Margin.Left + c.Margin.Right; } } panel.column_widths[index] = max_width; total_width -= max_width; } index++; } index = 0; float total_percent = 0; // Finally, assign the remaining space to Percent columns.. if (total_width > 0) { int percent_width = total_width; // Find the total percent (not always 100%) foreach (ColumnStyle cs in col_styles) { if (cs.SizeType == SizeType.Percent) total_percent += cs.Width; } // Divy up the space.. foreach (ColumnStyle cs in col_styles) { if (cs.SizeType == SizeType.Percent) { panel.column_widths[index] = (int)((cs.Width / total_percent) * percent_width); total_width -= panel.column_widths[index]; } index++; } } if (total_width > 0) panel.column_widths[col_styles.Count - 1] += total_width; // Figure up all the row heights int total_height = parentDisplayRectangle.Height - (border_width * (rows + 1)); index = 0; // First assign all the Absolute sized rows.. foreach (RowStyle rs in row_styles) { if (rs.SizeType == SizeType.Absolute) { panel.row_heights[index] = (int)rs.Height; total_height -= (int)rs.Height; } index++; } index = 0; // Next, assign all the AutoSize rows.. foreach (RowStyle rs in row_styles) { if (rs.SizeType == SizeType.AutoSize) { int max_height = 0; // Find the tallest control in the row for (int i = 0; i < columns; i++) { Control c = panel.actual_positions[i, index]; if (c != null && c != dummy_control && c.VisibleInternal) { if (settings.GetRowSpan (c) > 1) continue; if (c.AutoSize) max_height = Math.Max (max_height, c.PreferredSize.Height + c.Margin.Vertical); else max_height = Math.Max (max_height, c.ExplicitBounds.Height + c.Margin.Vertical); if (c.Height + c.Margin.Top + c.Margin.Bottom > max_height) max_height = c.Height + c.Margin.Top + c.Margin.Bottom; } } panel.row_heights[index] = max_height; total_height -= max_height; } index++; } index = 0; total_percent = 0; // Finally, assign the remaining space to Percent columns.. if (total_height > 0) { int percent_height = total_height; // Find the total percent (not always 100%) foreach (RowStyle rs in row_styles) { if (rs.SizeType == SizeType.Percent) total_percent += rs.Height; } // Divy up the space.. foreach (RowStyle rs in row_styles) { if (rs.SizeType == SizeType.Percent) { panel.row_heights[index] = (int)((rs.Height / total_percent) * percent_height); total_height -= panel.row_heights[index]; } index++; } } if (total_height > 0) panel.row_heights[row_styles.Count - 1] += total_height; }
private void refreshTimeTable(TableLayoutPanel tableLayoutPanel3) { clearTimeTable(tableLayoutPanel3); List <string> name = new List <string>(); List <string> type = new List <string>(); List <string> day = new List <string>(); List <int> startTime = new List <int>(); List <int> endTime = new List <int>(); List <string> classroom = new List <string>(); label_weeklyHoursShow.Text = userStudnet.getWeaklyHours().ToString(); labelSemesterPoints.Text = userStudnet.getSemeterPoints().ToString(); if (userStudnet.getSemeterPoints() < 10 || userStudnet.getSemeterPoints() > 30) { labelSemesterPoints.ForeColor = Color.Red; } else { labelSemesterPoints.ForeColor = Color.Green; } if (userStudnet.getRegisteredLessonsIDs() != null) { for (int k = 0; k < userStudnet.getRegisteredLessonsIDs().Count; k++) { for (int i = 0; i < allowedCoursesProperties.Count; i++) { for (int j = 0; j < allowedCoursesProperties[i].getLessons().Count; j++) { if (allowedCoursesProperties[i].getLessons()[j].getLessonID() == userStudnet.getRegisteredLessonsIDs()[k]) { name.Add(allowedCoursesProperties[i].getCourseName()); type.Add(allowedCoursesProperties[i].getLessons()[j].getType()); day.Add(allowedCoursesProperties[i].getLessons()[j].getDay()); startTime.Add(allowedCoursesProperties[i].getLessons()[j].getStartTime()); endTime.Add(allowedCoursesProperties[i].getLessons()[j].getEndTime()); classroom.Add(allowedCoursesProperties[i].getLessons()[j].getClassroom().getName()); } } } } } for (int j = 0; j < name.Count; j++) { for (int i = startTime[j]; i < endTime[j]; i++) { string labelName = day[j] + Convert.ToString(i); foreach (var c in tableLayoutPanel3.Controls) { if (c is Label) { var x = (Label)c; if (x.Name == labelName) { if (x.Text == "") { x.Text = name[j] + "\n" + type[j] + "\n" + classroom[j]; x.BackColor = Color.White; break; } } } } } } }
private void OutputControlGrid (Control[,] grid, TableLayoutPanel panel) { Console.WriteLine (" Size: {0}x{1}", grid.GetLength (0), grid.GetLength (1)); Console.Write (" "); foreach (int i in panel.column_widths) Console.Write (" {0}px ", i.ToString ().PadLeft (3)); Console.WriteLine (); for (int y = 0; y < grid.GetLength (1); y++) { Console.Write (" {0}px |", panel.row_heights[y].ToString ().PadLeft (3)); for (int x = 0; x < grid.GetLength (0); x++) { if (grid[x, y] == null) Console.Write (" --- |"); else if (string.IsNullOrEmpty (grid[x, y].Name)) Console.Write (" ??? |"); else Console.Write (" {0} |", grid[x, y].Name.PadRight (5).Substring (0, 5)); } Console.WriteLine (); } }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { var editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (editorService != null) { var subscription = default(IDisposable); var propertyDescriptor = context.PropertyDescriptor; var source = GetDataSource(context, provider); var chart = new ChartPanel(source, provider); chart.Dock = DockStyle.Fill; var autoSetButton = new Button { Text = AutoStart }; autoSetButton.Dock = DockStyle.Fill; var autoSetButtonClicked = Observable.FromEventPattern <EventHandler, EventArgs>( handler => autoSetButton.Click += handler, handler => autoSetButton.Click -= handler); var autoSetDeviationLabel = new Label(); autoSetDeviationLabel.Dock = DockStyle.Fill; autoSetDeviationLabel.Text = DeviationLabel; autoSetDeviationLabel.TextAlign = ContentAlignment.MiddleCenter; var autoSetDeviationUpDown = new NumericUpDown(); var upDownMargin = autoSetDeviationUpDown.Margin; autoSetDeviationUpDown.Margin = new Padding(upDownMargin.Left, upDownMargin.Top + 1, upDownMargin.Right, upDownMargin.Bottom); autoSetDeviationUpDown.Anchor = AnchorStyles.None; var autoSetPanel = new TableLayoutPanel(); autoSetPanel.Dock = DockStyle.Top; autoSetPanel.Height = autoSetButton.Height + autoSetPanel.Margin.Top; autoSetPanel.GrowStyle = TableLayoutPanelGrowStyle.AddColumns; autoSetPanel.Controls.Add(autoSetDeviationLabel, 0, 0); autoSetPanel.Controls.Add(autoSetDeviationUpDown, 1, 0); autoSetPanel.Controls.Add(autoSetButton, 2, 0); autoSetPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, autoSetDeviationLabel.PreferredWidth + autoSetPanel.Margin.Left + autoSetPanel.Margin.Right)); autoSetPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, autoSetDeviationUpDown.PreferredSize.Width)); autoSetPanel.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize)); autoSetDeviationUpDown.Maximum = 99; autoSetDeviationUpDown.Minimum = -99; var editorPanel = new TableLayoutPanel(); editorPanel.ClientSize = new System.Drawing.Size(320, 320); editorPanel.RowCount = 2; editorPanel.ColumnCount = 1; editorPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 99)); editorPanel.RowStyles.Add(new RowStyle(SizeType.AutoSize)); editorPanel.Controls.Add(chart); editorPanel.Controls.Add(autoSetPanel); var activeVisualizer = provider.GetService(typeof(DialogTypeVisualizer)) as SpikeWaveformCollectionVisualizer; var spikeVisualizer = new MatVisualizer <WaveformThresholdPicker>(); if (activeVisualizer != null) { spikeVisualizer.AutoScaleX = activeVisualizer.AutoScaleX; spikeVisualizer.AutoScaleY = activeVisualizer.AutoScaleY; spikeVisualizer.ChannelOffset = activeVisualizer.ChannelOffset; spikeVisualizer.ChannelsPerPage = activeVisualizer.ChannelsPerPage; spikeVisualizer.HistoryLength = activeVisualizer.HistoryLength; spikeVisualizer.OverlayChannels = activeVisualizer.OverlayChannels; spikeVisualizer.SelectedChannels = activeVisualizer.SelectedChannels; spikeVisualizer.SelectedPage = activeVisualizer.SelectedPage; spikeVisualizer.WaveformBufferLength = activeVisualizer.WaveformBufferLength; spikeVisualizer.XMax = activeVisualizer.XMax; spikeVisualizer.XMin = activeVisualizer.XMin; spikeVisualizer.YMax = activeVisualizer.YMax; spikeVisualizer.YMin = activeVisualizer.YMin; } else { spikeVisualizer.OverlayChannels = false; spikeVisualizer.WaveformBufferLength = 10; } spikeVisualizer.Load(chart); var thresholdPicker = spikeVisualizer.Graph; thresholdPicker.Threshold = (double[])value; thresholdPicker.ThresholdChanged += (sender, e) => propertyDescriptor.SetValue(context.Instance, value = thresholdPicker.Threshold); var visualizerObservable = spikeVisualizer.Visualize(source.Output, chart); var autoSetObservable = AutoThreshold(source.Output, autoSetButtonClicked, () => (double)autoSetDeviationUpDown.Value) .Do(ts => propertyDescriptor.SetValue(context.Instance, value = thresholdPicker.Threshold = ts)); chart.HandleCreated += delegate { subscription = new CompositeDisposable(visualizerObservable.Subscribe(), autoSetObservable.Subscribe()); }; editorPanel.Leave += delegate { editorService.CloseDropDown(); subscription.Dispose(); }; autoSetButton.Click += delegate { autoSetButton.Text = autoSetButton.Text == AutoStart ? AutoStop : AutoStart; }; try { editorService.DropDownControl(editorPanel); } finally { chart.Dispose(); autoSetButton.Dispose(); editorPanel.Dispose(); spikeVisualizer.Unload(); } return(value); } return(base.EditValue(context, provider, value)); }
public MainForm () { // // _tableLayoutPanel // _tableLayoutPanel = new TableLayoutPanel (); _tableLayoutPanel.ColumnCount = 3; _tableLayoutPanel.ColumnStyles.Add (new ColumnStyle ()); _tableLayoutPanel.ColumnStyles.Add (new ColumnStyle ()); _tableLayoutPanel.ColumnStyles.Add (new ColumnStyle ()); _tableLayoutPanel.Dock = DockStyle.Top; _tableLayoutPanel.Height = 200; _tableLayoutPanel.RowCount = 2; _tableLayoutPanel.RowStyles.Add (new RowStyle (SizeType.Percent, 50F)); _tableLayoutPanel.RowStyles.Add (new RowStyle (SizeType.Percent, 50F)); Controls.Add (_tableLayoutPanel); // // _labelA // _labelA = new Label (); _labelA.Dock = DockStyle.Fill; _labelA.Size = new Size (95, 20); _labelA.Text = "A"; _tableLayoutPanel.Controls.Add (_labelA, 0, 0); // // _labelB // _labelB = new Label (); _labelB.Dock = DockStyle.Fill; _labelB.Size = new Size (95, 20); _labelB.Text = "B"; _tableLayoutPanel.Controls.Add (_labelB, 1, 0); // // _labelC // _labelC = new Label (); _labelC.Dock = DockStyle.Fill; _labelC.Size = new Size (95, 20); _labelC.Text = "C"; _tableLayoutPanel.Controls.Add (_labelC, 2, 0); // // _labelD // _labelD = new Label (); _labelD.Dock = DockStyle.Fill; _labelD.Size = new Size (95, 20); _labelD.Text = "D"; _tableLayoutPanel.Controls.Add (_labelD, 0, 1); // // _labelE // _labelE = new Label (); _labelE.Dock = DockStyle.Fill; _labelE.Size = new Size (95, 20); _labelE.Text = "E"; _tableLayoutPanel.Controls.Add (_labelE, 1, 1); // // _labelF // _labelF = new Label (); _labelF.Dock = DockStyle.Fill; _labelF.Size = new Size (95, 20); _labelF.Text = "F"; _tableLayoutPanel.Controls.Add (_labelF, 2, 1); // // _borderStyleGroupBox // _borderStyleGroupBox = new GroupBox (); _borderStyleGroupBox.Dock = DockStyle.Bottom; _borderStyleGroupBox.Height = 100; _borderStyleGroupBox.Text = "CellBorderStyle"; Controls.Add (_borderStyleGroupBox); // // _insetBorderStyleRadioButton // _insetBorderStyleRadioButton = new RadioButton (); _insetBorderStyleRadioButton.Location = new Point (8, 16); _insetBorderStyleRadioButton.Text = "Inset"; _insetBorderStyleRadioButton.Size = new Size (95, 20); _insetBorderStyleRadioButton.CheckedChanged += new EventHandler (InsetBorderStyleRadioButton_CheckedChanged); _borderStyleGroupBox.Controls.Add (_insetBorderStyleRadioButton); // // _insetDoubleBorderStyleRadioButton // _insetDoubleBorderStyleRadioButton = new RadioButton (); _insetDoubleBorderStyleRadioButton.Location = new Point (8, 36); _insetDoubleBorderStyleRadioButton.Text = "InsetDouble"; _insetDoubleBorderStyleRadioButton.Size = new Size (95, 20); _insetDoubleBorderStyleRadioButton.CheckedChanged += new EventHandler (InsetDoubleBorderStyleRadioButton_CheckedChanged); _borderStyleGroupBox.Controls.Add (_insetDoubleBorderStyleRadioButton); // // _noneBorderStyleRadioButton // _noneBorderStyleRadioButton = new RadioButton (); _noneBorderStyleRadioButton.Checked = true; _noneBorderStyleRadioButton.Location = new Point (8, 56); _noneBorderStyleRadioButton.Text = "None"; _noneBorderStyleRadioButton.Size = new Size (95, 20); _noneBorderStyleRadioButton.CheckedChanged += new EventHandler (NoneBorderStyleRadioButton_CheckedChanged); _borderStyleGroupBox.Controls.Add (_noneBorderStyleRadioButton); // // _outsetBorderStyleRadioButton // _outsetBorderStyleRadioButton = new RadioButton (); _outsetBorderStyleRadioButton.Location = new Point (8, 76); _outsetBorderStyleRadioButton.Text = "Outset"; _outsetBorderStyleRadioButton.Size = new Size (95, 20); _outsetBorderStyleRadioButton.CheckedChanged += new EventHandler (OutsetBorderStyleRadioButton_CheckedChanged); _borderStyleGroupBox.Controls.Add (_outsetBorderStyleRadioButton); // // _outsetDoubleBorderStyleRadioButton // _outsetDoubleBorderStyleRadioButton = new RadioButton (); _outsetDoubleBorderStyleRadioButton.Location = new Point (160, 16); _outsetDoubleBorderStyleRadioButton.Text = "OutsetDouble"; _outsetDoubleBorderStyleRadioButton.Size = new Size (95, 20); _outsetDoubleBorderStyleRadioButton.CheckedChanged += new EventHandler (OutsetDoubleBorderStyleRadioButton_CheckedChanged); _borderStyleGroupBox.Controls.Add (_outsetDoubleBorderStyleRadioButton); // // _outsetPartialBorderStyleRadioButton // _outsetPartialBorderStyleRadioButton = new RadioButton (); _outsetPartialBorderStyleRadioButton.Location = new Point (160, 36); _outsetPartialBorderStyleRadioButton.Text = "OutsetPartial"; _outsetPartialBorderStyleRadioButton.Size = new Size (95, 20); _outsetPartialBorderStyleRadioButton.CheckedChanged += new EventHandler (OutsetPartialBorderStyleRadioButton_CheckedChanged); _borderStyleGroupBox.Controls.Add (_outsetPartialBorderStyleRadioButton); // // _singleBorderStyleRadioButton // _singleBorderStyleRadioButton = new RadioButton (); _singleBorderStyleRadioButton.Location = new Point (160, 56); _singleBorderStyleRadioButton.Text = "Single"; _singleBorderStyleRadioButton.Size = new Size (95, 20); _singleBorderStyleRadioButton.CheckedChanged += new EventHandler (SingleBorderStyleRadioButton_CheckedChanged); _borderStyleGroupBox.Controls.Add (_singleBorderStyleRadioButton); // // MainForm // AutoScaleDimensions = new SizeF (6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size (315, 310); Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #81884"; Load += new EventHandler (MainForm_Load); }
public MainForm () { label3 = new Label (); label4 = new Label (); label5 = new Label (); label6 = new Label (); label7 = new Label (); label8 = new Label (); label9 = new Label (); label10 = new Label (); CbbCOMPorts = new ComboBox (); Label2 = new Label (); CmbSpeed = new ComboBox (); CmbEncod = new ComboBox (); CmbData = new ComboBox (); CmbParity = new ComboBox (); TxtWriteTimOut = new TextBox (); CmbBitStop = new ComboBox (); TxtWriteBuff = new TextBox (); TxtReadBuff = new TextBox (); TxtReadTimout = new TextBox (); Label1 = new Label (); label11 = new Label (); CmbTypeCom = new ComboBox (); // // _tableLayoutPanel // _tableLayoutPanel = new TableLayoutPanel (); _tableLayoutPanel.SuspendLayout (); _tableLayoutPanel.ColumnCount = 3; _tableLayoutPanel.ColumnStyles.Add (new ColumnStyle (SizeType.Absolute, 89F)); _tableLayoutPanel.ColumnStyles.Add (new ColumnStyle (SizeType.Absolute, 92F)); _tableLayoutPanel.ColumnStyles.Add (new ColumnStyle (SizeType.Absolute, 196F)); _tableLayoutPanel.Controls.Add (label3, 0, 9); _tableLayoutPanel.Controls.Add (label4, 0, 8); _tableLayoutPanel.Controls.Add (label5, 0, 7); _tableLayoutPanel.Controls.Add (label6, 0, 6); _tableLayoutPanel.Controls.Add (label7, 0, 5); _tableLayoutPanel.Controls.Add (label8, 0, 4); _tableLayoutPanel.Controls.Add (label9, 0, 3); _tableLayoutPanel.Controls.Add (label10, 0, 2); _tableLayoutPanel.Controls.Add (CbbCOMPorts, 1, 0); _tableLayoutPanel.Controls.Add (Label2, 2, 2); _tableLayoutPanel.Controls.Add (CmbSpeed, 1, 1); _tableLayoutPanel.Controls.Add (CmbEncod, 1, 9); _tableLayoutPanel.Controls.Add (CmbData, 1, 3); _tableLayoutPanel.Controls.Add (CmbParity, 1, 2); _tableLayoutPanel.Controls.Add (TxtWriteTimOut, 1, 8); _tableLayoutPanel.Controls.Add (CmbBitStop, 1, 4); _tableLayoutPanel.Controls.Add (TxtWriteBuff, 1, 7); _tableLayoutPanel.Controls.Add (TxtReadBuff, 1, 5); _tableLayoutPanel.Controls.Add (TxtReadTimout, 1, 6); _tableLayoutPanel.Controls.Add (Label1, 0, 0); _tableLayoutPanel.Controls.Add (label11, 0, 1); _tableLayoutPanel.Dock = DockStyle.Fill; _tableLayoutPanel.Location = new Point (3, 31); _tableLayoutPanel.RowCount = 11; _tableLayoutPanel.RowStyles.Add (new RowStyle (SizeType.Absolute, 28F)); _tableLayoutPanel.RowStyles.Add (new RowStyle (SizeType.Absolute, 28F)); _tableLayoutPanel.RowStyles.Add (new RowStyle (SizeType.Absolute, 28F)); _tableLayoutPanel.RowStyles.Add (new RowStyle (SizeType.Absolute, 28F)); _tableLayoutPanel.RowStyles.Add (new RowStyle (SizeType.Absolute, 28F)); _tableLayoutPanel.RowStyles.Add (new RowStyle (SizeType.Absolute, 28F)); _tableLayoutPanel.RowStyles.Add (new RowStyle (SizeType.Absolute, 28F)); _tableLayoutPanel.RowStyles.Add (new RowStyle (SizeType.Absolute, 28F)); _tableLayoutPanel.RowStyles.Add (new RowStyle (SizeType.Absolute, 28F)); _tableLayoutPanel.RowStyles.Add (new RowStyle (SizeType.Absolute, 28F)); _tableLayoutPanel.RowStyles.Add (new RowStyle (SizeType.Absolute, 28F)); _tableLayoutPanel.Size = new Size (377, 312); Controls.Add (_tableLayoutPanel); // // label3 // label3.Anchor = AnchorStyles.Left | AnchorStyles.Right; label3.AutoSize = true; label3.Location = new Point (3, 259); label3.Size = new Size (83, 13); label3.TabIndex = 32; label3.Text = "Encodage"; // // label4 // label4.Anchor = AnchorStyles.Left | AnchorStyles.Right; label4.AutoSize = true; label4.Location = new Point (3, 231); label4.Size = new Size (83, 13); label4.TabIndex = 33; label4.Text = "Writetimeout"; // // label5 // label5.Anchor = AnchorStyles.Left | AnchorStyles.Right; label5.AutoSize = true; label5.Location = new Point (3, 203); label5.Size = new Size (83, 13); label5.TabIndex = 34; label5.Text = "Writebuffersize" + Environment.NewLine; // // label6 // label6.Anchor = AnchorStyles.Left | AnchorStyles.Right; label6.AutoSize = true; label6.Location = new Point (3, 175); label6.Size = new Size (83, 13); label6.TabIndex = 35; label6.Text = "Readtimeout" + Environment.NewLine; // // label7 // label7.Anchor = AnchorStyles.Left | AnchorStyles.Right; label7.AutoSize = true; label7.Location = new Point (3, 147); label7.Size = new Size (83, 13); label7.TabIndex = 36; label7.Text = "Readbuffersize" + Environment.NewLine; // // label8 // label8.Anchor = AnchorStyles.Left | AnchorStyles.Right; label8.AutoSize = true; label8.Location = new Point (3, 119); label8.Size = new Size (83, 13); label8.TabIndex = 37; label8.Text = "Bit de stop"; // // label9 // label9.Anchor = AnchorStyles.Left | AnchorStyles.Right; label9.AutoSize = true; label9.Location = new Point (3, 91); label9.Size = new Size (83, 13); label9.TabIndex = 38; label9.Text = "Donnée"; // // label10 // label10.Anchor = AnchorStyles.Left | AnchorStyles.Right; label10.AutoSize = true; label10.Location = new Point (3, 63); label10.Size = new Size (83, 13); label10.TabIndex = 39; label10.Text = "Parité"; // // CbbCOMPorts // CbbCOMPorts.Anchor = AnchorStyles.Left | AnchorStyles.Right; CbbCOMPorts.FormattingEnabled = true; CbbCOMPorts.Location = new Point (92, 3); CbbCOMPorts.Size = new Size (86, 21); CbbCOMPorts.TabIndex = 1; CbbCOMPorts.Text = "/dev/ttyS70"; // // Label2 // Label2.Anchor = AnchorStyles.Left | AnchorStyles.Right; Label2.AutoSize = true; Label2.Location = new Point (184, 63); Label2.Size = new Size (190, 13); Label2.TabIndex = 26; Label2.Text = "(Pair)"; // // CmbSpeed // CmbSpeed.Anchor = AnchorStyles.Left | AnchorStyles.Right; CmbSpeed.FormattingEnabled = true; CmbSpeed.Items.AddRange (new object [] { "75", "110", "134", "150", "300", "600", "1200", "1800", "2400", "4800", "7200", "9600", "14400", "19200", "38400", "57600", "115200", "128000"}); CmbSpeed.Location = new Point (92, 31); CmbSpeed.Size = new Size (86, 21); CmbSpeed.TabIndex = 21; CmbSpeed.Tag = ""; CmbSpeed.Text = "115200"; // // CmbEncod // CmbEncod.Anchor = AnchorStyles.Left | AnchorStyles.Right; CmbEncod.FormattingEnabled = true; CmbEncod.Items.AddRange (new object [] { "Default", "ASCII", "UTF8", "UTF32", "Unicode", "BigEndianUnicode"}); CmbEncod.Location = new Point (92, 255); CmbEncod.Size = new Size (86, 21); CmbEncod.TabIndex = 28; CmbEncod.Text = "UTF8"; // // CmbData // CmbData.Anchor = AnchorStyles.Left | AnchorStyles.Right; CmbData.FormattingEnabled = true; CmbData.Items.AddRange (new object [] { "8", "7", "6", "5", "11"}); CmbData.Location = new Point (92, 87); CmbData.Size = new Size (86, 21); CmbData.TabIndex = 29; CmbData.Text = "8"; // // CmbParity // CmbParity.Anchor = AnchorStyles.Left | AnchorStyles.Right; CmbParity.FormattingEnabled = true; CmbParity.Items.AddRange (new object [] { "None", "Odd", "Even", "Mark", "Space"}); CmbParity.Location = new Point (92, 59); CmbParity.Size = new Size (86, 21); CmbParity.TabIndex = 20; CmbParity.Text = "None"; // // TxtWriteTimOut // TxtWriteTimOut.Anchor = AnchorStyles.Left | AnchorStyles.Right; TxtWriteTimOut.Location = new Point (92, 228); TxtWriteTimOut.Size = new Size (86, 20); TxtWriteTimOut.TabIndex = 25; TxtWriteTimOut.Text = "500"; TxtWriteTimOut.TextAlign = HorizontalAlignment.Right; // // CmbBitStop // CmbBitStop.Anchor = AnchorStyles.Left | AnchorStyles.Right; CmbBitStop.FormattingEnabled = true; CmbBitStop.Items.AddRange (new object [] { "None", "One", "Two", "OnePointFive"}); CmbBitStop.Location = new Point (92, 115); CmbBitStop.Size = new Size (86, 21); CmbBitStop.TabIndex = 19; CmbBitStop.Text = "1"; // // TxtWriteBuff // TxtWriteBuff.Anchor = AnchorStyles.Left | AnchorStyles.Right; TxtWriteBuff.Location = new Point (92, 200); TxtWriteBuff.Size = new Size (86, 20); TxtWriteBuff.TabIndex = 24; TxtWriteBuff.Text = "512"; TxtWriteBuff.TextAlign = HorizontalAlignment.Right; // // TxtReadBuff // TxtReadBuff.Anchor = AnchorStyles.Left | AnchorStyles.Right; TxtReadBuff.Location = new Point (92, 144); TxtReadBuff.Size = new Size (86, 20); TxtReadBuff.TabIndex = 22; TxtReadBuff.Text = "1024"; TxtReadBuff.TextAlign = HorizontalAlignment.Right; // // TxtReadTimout // TxtReadTimout.Anchor = AnchorStyles.Left | AnchorStyles.Right; TxtReadTimout.Location = new Point (92, 172); TxtReadTimout.Size = new Size (86, 20); TxtReadTimout.TabIndex = 23; TxtReadTimout.Text = "500"; TxtReadTimout.TextAlign = HorizontalAlignment.Right; // // Label1 // Label1.Anchor = AnchorStyles.Left | AnchorStyles.Right; Label1.AutoSize = true; Label1.Location = new Point (3, 7); Label1.Size = new Size (83, 13); Label1.TabIndex = 18; Label1.Text = "Port\r\n"; // // label11 // label11.Anchor = AnchorStyles.Left | AnchorStyles.Right; label11.AutoSize = true; label11.Location = new Point (3, 35); label11.Size = new Size (83, 13); label11.TabIndex = 40; label11.Text = "Vitesse"; // // CmbTypeCom // CmbTypeCom.Anchor = AnchorStyles.Top | AnchorStyles.Bottom; CmbTypeCom.FormattingEnabled = true; CmbTypeCom.Items.AddRange (new object [] { "Bluetooth", "Serial"}); CmbTypeCom.Location = new Point (154, 3); CmbTypeCom.Size = new Size (75, 21); CmbTypeCom.TabIndex = 3; CmbTypeCom.Text = "Bluetooth"; // // MainForm // AutoScaleDimensions = new SizeF (6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size (300, 290); Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #81936"; Load += new EventHandler (MainForm_Load); }