OSDN Git Service

デザインの変更,自動サイズ調整への対応
[fugashi/fugashi.git] / Fugashi / BitSwitches4.cs
index 8e55d56..f93fa8c 100755 (executable)
@@ -17,7 +17,7 @@ namespace Fugashi
         }\r
 \r
         [Category("データ")]\r
-        [DefaultValue(typeof(int), "0")]\r
+        [DefaultValue(typeof(int), "-1")]\r
         public int StartBit\r
         {\r
             get\r
@@ -62,18 +62,25 @@ namespace Fugashi
                 return b3;\r
             }\r
         }\r
+\r
         private void Coordinate()\r
         {\r
-            int y = startBit < 32 ? 16 : 0;\r
-            b0.Location = new Point(b0.Location.X, y);\r
-            b1.Location = new Point(b1.Location.X, y);\r
-            b2.Location = new Point(b2.Location.X, y);\r
-            b3.Location = new Point(b3.Location.X, y);\r
-            int labelY = startBit < 32 ? 0 : 24;\r
+            int y = startBit < 32 ? label.Size.Height : 0;\r
+            table.Location = new Point(table.Location.X, y);\r
+            int labelY = startBit < 32 ? 0 : b0.Size.Height;\r
             label.Location = new Point(label.Location.X, labelY);\r
             label.Text = startBit.ToString();\r
+            PerformAutoScale();\r
             PerformLayout();\r
         }\r
 \r
+        private void BitSwitches4_SizeChanged(object sender, EventArgs e)\r
+        {\r
+            table.Width = Width - Margin.Left - Margin.Right;\r
+            table.Height = Height - label.Height - Margin.Bottom - Margin.Top;\r
+            int y = startBit < 32 ? label.Size.Height : 0;\r
+            table.Location = new Point(table.Location.X, y);\r
+        }\r
+\r
     }\r
 }\r