OSDN Git Service

下三角形のボタンをDropDownButtonに分離する
authorKazuhiro Fujieda <fujieda@users.osdn.me>
Sun, 19 Apr 2020 09:31:31 +0000 (18:31 +0900)
committerKazuhiro Fujieda <fujieda@users.osdn.me>
Sun, 30 Aug 2020 05:58:21 +0000 (14:58 +0900)
KancolleSniffer/KancolleSniffer.csproj
KancolleSniffer/ListForm.Designer.cs
KancolleSniffer/ListForm.cs
KancolleSniffer/MainForm.Designer.cs
KancolleSniffer/MainForm.cs
KancolleSniffer/Properties/Resources.Designer.cs
KancolleSniffer/Properties/Resources.resx
KancolleSniffer/View/DropDownButton.cs [new file with mode: 0644]
KancolleSniffer/View/HqPanel.cs

index ff7532f..c4d067f 100644 (file)
@@ -86,6 +86,9 @@
     <Compile Include="View\ChargeStatus.cs">\r
       <SubType>Component</SubType>\r
     </Compile>\r
+    <Compile Include="View\DropDownButton.cs">\r
+      <SubType>Component</SubType>\r
+    </Compile>\r
     <Compile Include="View\IUpdateable.cs" />\r
     <Compile Include="View\MaterialHistoryPanel.cs">\r
       <SubType>Component</SubType>\r
index f9b4f65..fa4c0f3 100644 (file)
@@ -90,7 +90,7 @@ namespace KancolleSniffer
             this.checkBoxSTypeHeavyCruiser = new System.Windows.Forms.CheckBox();\r
             this.checkBoxSTypeAircraftCarrier = new System.Windows.Forms.CheckBox();\r
             this.checkBoxSTypeBattleShip = new System.Windows.Forms.CheckBox();\r
-            this.labelSTypeButton = new System.Windows.Forms.Label();\r
+            this.dropDownButtonSType = new KancolleSniffer.View.DropDownButton();\r
             this.labelSType = new System.Windows.Forms.Label();\r
             this.airBattleResultPanel = new KancolleSniffer.View.AirBattleResultPanel();\r
             this.battleResultPanel = new KancolleSniffer.View.BattleResultPanel();\r
@@ -535,15 +535,13 @@ namespace KancolleSniffer
             this.checkBoxSTypeBattleShip.UseVisualStyleBackColor = true;\r
             this.checkBoxSTypeBattleShip.Click += new System.EventHandler(this.checkBoxSType_Click);\r
             // \r
-            // labelSTypeButton\r
+            // dropDownButtonSType\r
             // \r
-            this.labelSTypeButton.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
-            this.labelSTypeButton.Image = global::KancolleSniffer.Properties.Resources.arrow_virtical;\r
-            this.labelSTypeButton.Location = new System.Drawing.Point(58, 7);\r
-            this.labelSTypeButton.Name = "labelSTypeButton";\r
-            this.labelSTypeButton.Size = new System.Drawing.Size(14, 14);\r
-            this.labelSTypeButton.TabIndex = 19;\r
-            this.labelSTypeButton.Click += new System.EventHandler(this.labelSTypeButton_Click);\r
+            this.dropDownButtonSType.Location = new System.Drawing.Point(58, 7);\r
+            this.dropDownButtonSType.Name = "dropDownButtonSType";\r
+            this.dropDownButtonSType.Size = new System.Drawing.Size(14, 14);\r
+            this.dropDownButtonSType.TabIndex = 19;\r
+            this.dropDownButtonSType.Click += new System.EventHandler(this.labelSTypeButton_Click);\r
             // \r
             // labelSType\r
             // \r
@@ -641,7 +639,7 @@ namespace KancolleSniffer
             this.Controls.Add(this.panelRepairHeader);\r
             this.Controls.Add(this.panelGroupHeader);\r
             this.Controls.Add(this.labelSType);\r
-            this.Controls.Add(this.labelSTypeButton);\r
+            this.Controls.Add(this.dropDownButtonSType);\r
             this.Controls.Add(this.labelHeaderExp);\r
             this.Controls.Add(this.labelHeaderCond);\r
             this.Controls.Add(this.label3);\r
@@ -724,7 +722,7 @@ namespace KancolleSniffer
         private System.Windows.Forms.CheckBox checkBoxSTypeHeavyCruiser;\r
         private System.Windows.Forms.CheckBox checkBoxSTypeAircraftCarrier;\r
         private System.Windows.Forms.CheckBox checkBoxSTypeBattleShip;\r
-        private System.Windows.Forms.Label labelSTypeButton;\r
+        private DropDownButton dropDownButtonSType;\r
         private System.Windows.Forms.Label labelSType;\r
         private System.Windows.Forms.CheckBox checkBoxSTypeDetails;\r
         private System.Windows.Forms.ToolStripMenuItem kantaiBunsekiToolStripMenuItem;\r
index 6c92a86..75d5969 100644 (file)
@@ -597,7 +597,7 @@ namespace KancolleSniffer
             panelSType.Visible = visible;\r
             if (visible)\r
                 panelSType.BringToFront();\r
-            labelSTypeButton.BackColor = visible ? CustomColors.ActiveButtonColor : DefaultBackColor;\r
+            dropDownButtonSType.BackColor = visible ? CustomColors.ActiveButtonColor : DefaultBackColor;\r
         }\r
 \r
         private void checkBoxSTypeDetails_Click(object sender, EventArgs e)\r
index 4037f25..f43c2ca 100644 (file)
@@ -70,8 +70,7 @@ namespace KancolleSniffer
             this.label31 = new System.Windows.Forms.Label();\r
             this.labelAkashiRepair = new System.Windows.Forms.Label();\r
             this.labelClearQuest = new System.Windows.Forms.Label();\r
-            this.labelRepairListButton = new System.Windows.Forms.Label();\r
-            this.labelMaterialHistoryButton = new System.Windows.Forms.Label();\r
+            this.dropDownButtonRepairList = new KancolleSniffer.View.DropDownButton();\r
             this.labelQuestCount = new System.Windows.Forms.Label();\r
             this.kdockPanel = new KancolleSniffer.View.KDockPanel();\r
             this.panelRepairList = new KancolleSniffer.View.RepairListForMain();\r
@@ -89,6 +88,7 @@ namespace KancolleSniffer
             this.triangleMark2 = new KancolleSniffer.View.TriangleMark();\r
             this.triangleMark3 = new KancolleSniffer.View.TriangleMark();\r
             this.triangleMark4 = new KancolleSniffer.View.TriangleMark();\r
+            this.dropDownButtonMaterialHistory = new KancolleSniffer.View.DropDownButton();\r
             this.contextMenuStripNotifyIcon.SuspendLayout();\r
             this.contextMenuStripMain.SuspendLayout();\r
             this.SuspendLayout();\r
@@ -296,24 +296,13 @@ namespace KancolleSniffer
             this.labelClearQuest.MouseDown += new System.Windows.Forms.MouseEventHandler(this.labelClearQuest_MouseDown);\r
             this.labelClearQuest.MouseUp += new System.Windows.Forms.MouseEventHandler(this.labelClearQuest_MouseUp);\r
             // \r
-            // labelRepairListButton\r
+            // dropDownButtonRepairList\r
             // \r
-            this.labelRepairListButton.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
-            this.labelRepairListButton.Image = global::KancolleSniffer.Properties.Resources.arrow_virtical;\r
-            this.labelRepairListButton.Location = new System.Drawing.Point(121, 193);\r
-            this.labelRepairListButton.Name = "labelRepairListButton";\r
-            this.labelRepairListButton.Size = new System.Drawing.Size(14, 14);\r
-            this.labelRepairListButton.TabIndex = 45;\r
-            this.labelRepairListButton.Click += new System.EventHandler(this.labelRepairListButton_Click);\r
-            // \r
-            // labelMaterialHistoryButton\r
-            // \r
-            this.labelMaterialHistoryButton.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
-            this.labelMaterialHistoryButton.Image = global::KancolleSniffer.Properties.Resources.arrow_virtical;\r
-            this.labelMaterialHistoryButton.Location = new System.Drawing.Point(211, 340);\r
-            this.labelMaterialHistoryButton.Name = "labelMaterialHistoryButton";\r
-            this.labelMaterialHistoryButton.Size = new System.Drawing.Size(14, 14);\r
-            this.labelMaterialHistoryButton.TabIndex = 10;\r
+            this.dropDownButtonRepairList.Location = new System.Drawing.Point(121, 193);\r
+            this.dropDownButtonRepairList.Name = "dropDownButtonRepairList";\r
+            this.dropDownButtonRepairList.Size = new System.Drawing.Size(14, 14);\r
+            this.dropDownButtonRepairList.TabIndex = 45;\r
+            this.dropDownButtonRepairList.Click += new System.EventHandler(this.labelRepairListButton_Click);\r
             // \r
             // labelQuestCount\r
             // \r
@@ -469,12 +458,22 @@ namespace KancolleSniffer
             this.triangleMark4.Text = "triangleMark4";\r
             this.triangleMark4.Visible = false;\r
             // \r
+            // dropDownButtonMaterialHistory\r
+            // \r
+            this.dropDownButtonMaterialHistory.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
+            this.dropDownButtonMaterialHistory.Location = new System.Drawing.Point(211, 340);\r
+            this.dropDownButtonMaterialHistory.Name = "dropDownButtonMaterialHistory";\r
+            this.dropDownButtonMaterialHistory.Size = new System.Drawing.Size(14, 14);\r
+            this.dropDownButtonMaterialHistory.TabIndex = 80;\r
+            this.dropDownButtonMaterialHistory.Text = "dropDownButton1";\r
+            // \r
             // MainForm\r
             // \r
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);\r
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
             this.ClientSize = new System.Drawing.Size(232, 456);\r
             this.ContextMenuStrip = this.contextMenuStripMain;\r
+            this.Controls.Add(this.dropDownButtonMaterialHistory);\r
             this.Controls.Add(this.triangleMark4);\r
             this.Controls.Add(this.triangleMark3);\r
             this.Controls.Add(this.triangleMark2);\r
@@ -495,9 +494,8 @@ namespace KancolleSniffer
             this.Controls.Add(this.labelClearQuest);\r
             this.Controls.Add(this.labelAkashiRepair);\r
             this.Controls.Add(this.labelAkashiRepairTimer);\r
-            this.Controls.Add(this.labelRepairListButton);\r
+            this.Controls.Add(this.dropDownButtonRepairList);\r
             this.Controls.Add(this.label31);\r
-            this.Controls.Add(this.labelMaterialHistoryButton);\r
             this.Controls.Add(this.labelMaterialCaption);\r
             this.Controls.Add(this.labelFleet2);\r
             this.Controls.Add(this.labelFleet3);\r
@@ -538,8 +536,7 @@ namespace KancolleSniffer
         private System.Windows.Forms.Label labelFleet3;\r
         private System.Windows.Forms.Label labelFleet2;\r
         private System.Windows.Forms.Label labelMaterialCaption;\r
-        private System.Windows.Forms.Label labelMaterialHistoryButton;\r
-        private System.Windows.Forms.Label labelRepairListButton;\r
+        private DropDownButton dropDownButtonRepairList;\r
         private System.Windows.Forms.Label label31;\r
         private System.Windows.Forms.ContextMenuStrip contextMenuStripNotifyIcon;\r
         private System.Windows.Forms.ToolStripMenuItem NotifyIconOpenToolStripMenuItem;\r
@@ -567,6 +564,7 @@ namespace KancolleSniffer
         private TriangleMark triangleMark2;\r
         private TriangleMark triangleMark3;\r
         private TriangleMark triangleMark4;\r
+        private DropDownButton dropDownButtonMaterialHistory;\r
     }\r
 }\r
 \r
index 8b78a1c..1574f25 100644 (file)
@@ -94,7 +94,7 @@ namespace KancolleSniffer
             panelRepairList.CreateLabels(panelRepairList_Click);\r
             ndockPanel.SetClickHandler(labelNDockCaption);\r
             missionPanel.SetClickHandler(labelMissionCaption);\r
-            materialHistoryPanel.SetClickHandler(labelMaterialCaption, labelMaterialHistoryButton);\r
+            materialHistoryPanel.SetClickHandler(labelMaterialCaption, dropDownButtonMaterialHistory);\r
             SetupUpdateable();\r
             PerformZoom();\r
         }\r
@@ -1026,20 +1026,20 @@ namespace KancolleSniffer
             if (panelRepairList.Visible)\r
             {\r
                 panelRepairList.Visible = false;\r
-                labelRepairListButton.BackColor = DefaultBackColor;\r
+                dropDownButtonRepairList.BackColor = DefaultBackColor;\r
             }\r
             else\r
             {\r
                 panelRepairList.Visible = true;\r
                 panelRepairList.BringToFront();\r
-                labelRepairListButton.BackColor = CustomColors.ActiveButtonColor;\r
+                dropDownButtonRepairList.BackColor = CustomColors.ActiveButtonColor;\r
             }\r
         }\r
 \r
         private void panelRepairList_Click(object sender, EventArgs e)\r
         {\r
             panelRepairList.Visible = false;\r
-            labelRepairListButton.BackColor = DefaultBackColor;\r
+            dropDownButtonRepairList.BackColor = DefaultBackColor;\r
         }\r
 \r
         private void ShipListToolStripMenuItem_Click(object sender, EventArgs e)\r
index cbdc9f0..665d894 100644 (file)
@@ -59,15 +59,5 @@ namespace KancolleSniffer.Properties {
                 resourceCulture = value;\r
             }\r
         }\r
-        \r
-        /// <summary>\r
-        ///   型 System.Drawing.Bitmap のローカライズされたリソースを検索します。\r
-        /// </summary>\r
-        internal static System.Drawing.Bitmap arrow_virtical {\r
-            get {\r
-                object obj = ResourceManager.GetObject("arrow virtical", resourceCulture);\r
-                return ((System.Drawing.Bitmap)(obj));\r
-            }\r
-        }\r
     }\r
 }\r
index b97004e..29dcb1b 100644 (file)
   <resheader name="writer">\r
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
   </resheader>\r
-  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />\r
-  <data name="arrow virtical" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
-    <value>..\Resources\arrow virtical.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
-  </data>\r
 </root>
\ No newline at end of file
diff --git a/KancolleSniffer/View/DropDownButton.cs b/KancolleSniffer/View/DropDownButton.cs
new file mode 100644 (file)
index 0000000..fdae8d0
--- /dev/null
@@ -0,0 +1,35 @@
+// Copyright (C) 2020 Kazuhiro Fujieda <fujieda@users.osdn.me>\r
+//\r
+// Licensed under the Apache License, Version 2.0 (the "License");\r
+// you may not use this file except in compliance with the License.\r
+// You may obtain a copy of the License at\r
+//\r
+//    http://www.apache.org/licenses/LICENSE-2.0\r
+//\r
+// Unless required by applicable law or agreed to in writing, software\r
+// distributed under the License is distributed on an "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+// See the License for the specific language governing permissions and\r
+// limitations under the License.\r
+\r
+using System.Drawing;\r
+using System.Windows.Forms;\r
+\r
+namespace KancolleSniffer.View\r
+{\r
+    public class DropDownButton : Label\r
+    {\r
+        public override BorderStyle BorderStyle { get; set; }= BorderStyle.FixedSingle;\r
+\r
+        protected override void OnPaint(PaintEventArgs e)\r
+        {\r
+            var g = e.Graphics;\r
+            g.FillPolygon(Brushes.Black,\r
+                new[]\r
+                {\r
+                    new PointF(2, 2), new PointF(Width - 2 * 2, 2),\r
+                    new PointF(2 + (Width - 2 * 3) / 2.0f, Height - 2 * 2)\r
+                });\r
+        }\r
+    }\r
+}
\ No newline at end of file
index 1cb9448..bba0957 100644 (file)
@@ -2,7 +2,6 @@
 using System.Drawing;\r
 using System.Windows.Forms;\r
 using KancolleSniffer.Model;\r
-using KancolleSniffer.Properties;\r
 \r
 namespace KancolleSniffer.View\r
 {\r
@@ -25,12 +24,10 @@ namespace KancolleSniffer.View
             Visible = false\r
         };\r
 \r
-        private readonly Label _bucketHistoryButton = new Label\r
+        private readonly DropDownButton _bucketHistoryButton = new DropDownButton\r
         {\r
             Location = new Point(146, 15),\r
-            Size = new Size(14, 14),\r
-            BorderStyle = BorderStyle.FixedSingle,\r
-            Image = Resources.arrow_virtical\r
+            Size = new Size(14, 14)\r
         };\r
 \r
         private readonly Label _achievement = new Label\r