From 6cf04359d20b94003d7c942c82677f64277e5077 Mon Sep 17 00:00:00 2001 From: Lorenz Cuno Klopfenstein Date: Wed, 23 Mar 2011 19:36:56 +0100 Subject: [PATCH] Fixed sidepanels in design mode. --- OnTopReplica/MainForm_ChildForms.cs | 5 +- OnTopReplica/OnTopReplica.csproj | 49 ++++++++++--------- OnTopReplica/SidePanel.cs | 8 ++- .../SidePanels/GroupSwitchPanel.Designer.cs | 22 +++++---- .../SidePanels/RegionPanel.Designer.cs | 8 +-- 5 files changed, 50 insertions(+), 42 deletions(-) diff --git a/OnTopReplica/MainForm_ChildForms.cs b/OnTopReplica/MainForm_ChildForms.cs index 92da5fe..fb35b8b 100644 --- a/OnTopReplica/MainForm_ChildForms.cs +++ b/OnTopReplica/MainForm_ChildForms.cs @@ -26,7 +26,8 @@ namespace OnTopReplica { //Add and show _sidePanelContainer.Controls.Add(panel); - _sidePanelContainer.Visible = _sidePanelContainer.Enabled = true; + _sidePanelContainer.Enabled = true; + _sidePanelContainer.Show(); panel.Show(); int intHorzMargin = panel.Margin.Horizontal + _sidePanelContainer.Padding.Horizontal; //internal margins for sidepanel @@ -85,8 +86,8 @@ namespace OnTopReplica { _sidePanelContainer.Visible = _sidePanelContainer.Enabled = false; //Free panel - _currentSidePanel = null; _currentSidePanel.Dispose(); + _currentSidePanel = null; //Resize MinimumSize = new Size(20, 20); diff --git a/OnTopReplica/OnTopReplica.csproj b/OnTopReplica/OnTopReplica.csproj index d4e0a5a..99f1cad 100644 --- a/OnTopReplica/OnTopReplica.csproj +++ b/OnTopReplica/OnTopReplica.csproj @@ -151,11 +151,17 @@ GroupSwitchPanel.cs + + True + True + Strings.resx + + @@ -195,11 +201,6 @@ - - True - True - Strings.resx - Component @@ -233,7 +234,9 @@ ResXFileCodeGenerator Strings.da.Designer.cs + + ResXFileCodeGenerator Strings.it.Designer.cs @@ -252,6 +255,9 @@ RegionPanel.cs Designer + + + Strings.Designer.cs Designer @@ -280,11 +286,6 @@ - - True - True - Strings.it.resx - Component @@ -388,72 +389,72 @@ False - Exclude - True + Exclude + True File False - Exclude - True + Exclude + True File False - Exclude - True + Exclude + True File False - Exclude - True + Exclude + True File False - Include - True + Include + True Satellite False - Include - True + Include + True Satellite False - Include - True + Include + True Satellite diff --git a/OnTopReplica/SidePanel.cs b/OnTopReplica/SidePanel.cs index d3928cb..bb965ad 100644 --- a/OnTopReplica/SidePanel.cs +++ b/OnTopReplica/SidePanel.cs @@ -10,8 +10,12 @@ namespace OnTopReplica { /// class SidePanel : UserControl { - public SidePanel() { - Dock = DockStyle.Fill; + protected override void OnCreateControl() { + if (!DesignMode) { + Dock = DockStyle.Fill; + } + + base.OnCreateControl(); } /// diff --git a/OnTopReplica/SidePanels/GroupSwitchPanel.Designer.cs b/OnTopReplica/SidePanels/GroupSwitchPanel.Designer.cs index 542ba27..2a77d97 100644 --- a/OnTopReplica/SidePanels/GroupSwitchPanel.Designer.cs +++ b/OnTopReplica/SidePanels/GroupSwitchPanel.Designer.cs @@ -41,7 +41,7 @@ this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; this.groupBox1.Location = new System.Drawing.Point(0, 0); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(961, 592); + this.groupBox1.Size = new System.Drawing.Size(283, 337); this.groupBox1.TabIndex = 1; this.groupBox1.TabStop = false; this.groupBox1.Text = "Group switch mode:"; @@ -50,16 +50,17 @@ // this.labelStatus.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.labelStatus.Location = new System.Drawing.Point(3, 543); + this.labelStatus.Location = new System.Drawing.Point(3, 288); this.labelStatus.Name = "labelStatus"; - this.labelStatus.Size = new System.Drawing.Size(952, 17); + this.labelStatus.Size = new System.Drawing.Size(274, 17); this.labelStatus.TabIndex = 3; + this.labelStatus.Text = "-"; this.labelStatus.TextAlign = System.Drawing.ContentAlignment.BottomRight; // // buttonCancel // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonCancel.Location = new System.Drawing.Point(885, 563); + this.buttonCancel.Location = new System.Drawing.Point(207, 308); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(70, 23); this.buttonCancel.TabIndex = 2; @@ -71,7 +72,7 @@ // this.buttonEnable.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonEnable.Image = global::OnTopReplica.Properties.Resources.xiao_ok; - this.buttonEnable.Location = new System.Drawing.Point(745, 563); + this.buttonEnable.Location = new System.Drawing.Point(67, 308); this.buttonEnable.Name = "buttonEnable"; this.buttonEnable.Size = new System.Drawing.Size(134, 23); this.buttonEnable.TabIndex = 1; @@ -89,28 +90,29 @@ this.colName}); this.listWindows.FullRowSelect = true; this.listWindows.GridLines = true; + this.listWindows.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; this.listWindows.HideSelection = false; this.listWindows.LabelWrap = false; this.listWindows.Location = new System.Drawing.Point(6, 19); this.listWindows.Name = "listWindows"; - this.listWindows.Size = new System.Drawing.Size(949, 521); + this.listWindows.Size = new System.Drawing.Size(271, 266); this.listWindows.TabIndex = 0; this.listWindows.UseCompatibleStateImageBehavior = false; - this.listWindows.View = System.Windows.Forms.View.Details; + this.listWindows.View = System.Windows.Forms.View.List; // // colName // this.colName.Text = global::OnTopReplica.Strings.GroupSwitchModeWindows; - this.colName.Width = 220; + this.colName.Width = 187; // // GroupSwitchPanel // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.groupBox1); - this.MinimumSize = new System.Drawing.Size(220, 220); + this.MinimumSize = new System.Drawing.Size(240, 240); this.Name = "GroupSwitchPanel"; - this.Size = new System.Drawing.Size(961, 592); + this.Size = new System.Drawing.Size(283, 337); this.groupBox1.ResumeLayout(false); this.ResumeLayout(false); diff --git a/OnTopReplica/SidePanels/RegionPanel.Designer.cs b/OnTopReplica/SidePanels/RegionPanel.Designer.cs index 1399de1..a237f87 100644 --- a/OnTopReplica/SidePanels/RegionPanel.Designer.cs +++ b/OnTopReplica/SidePanels/RegionPanel.Designer.cs @@ -69,7 +69,7 @@ this.groupBox1.Size = new System.Drawing.Size(184, 170); this.groupBox1.TabIndex = 0; this.groupBox1.TabStop = false; - this.groupBox1.Text = Strings.RegionsTitle; + this.groupBox1.Text = "Regions:"; // // textRegionName // @@ -194,7 +194,7 @@ this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(38, 13); this.label6.TabIndex = 9; - this.label6.Text = Strings.RegionsHeight; + this.label6.Text = "Height"; // // label7 // @@ -204,7 +204,7 @@ this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(35, 13); this.label7.TabIndex = 8; - this.label7.Text = Strings.RegionsWidth; + this.label7.Text = "Width"; // // label3 // @@ -234,7 +234,7 @@ this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(76, 13); this.label1.TabIndex = 3; - this.label1.Text = Strings.RegionsCurrentRegion; + this.label1.Text = "Current region:"; // // buttonDelete //