OSDN Git Service

AppliStation-GUI,表示スタイルを無駄に選べるようにした。
authorttp <ttp@users.sourceforge.jp>
Sun, 15 Nov 2009 10:48:57 +0000 (19:48 +0900)
committerttp <ttp@users.sourceforge.jp>
Sun, 15 Nov 2009 10:48:57 +0000 (19:48 +0900)
AppliStation/PackageListViewForm.Designer.cs
AppliStation/PackageListViewForm.cs

index 942d368..96eb5b5 100644 (file)
                        this.propertiesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
                        this.packageListViewImageList = new System.Windows.Forms.ImageList(this.components);\r
                        this.detailBox = new System.Windows.Forms.RichTextBox();\r
+                       this.viewStyleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
+                       this.viewStyleListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
+                       this.viewStyleTileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
+                       this.viewStyleDetailToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
                        this.tableLayoutPanel1.SuspendLayout();\r
                        this.toolStripContainer.SuspendLayout();\r
                        this.packageListFilterToolStrip.SuspendLayout();\r
                                                                        this.webOfficialMenuItem,\r
                                                                        this.webGoogleSearchMenuItem});\r
                        this.webResourceCommonContextMenuStrip.Name = "packageListContextMenuStrip";\r
+                       this.webResourceCommonContextMenuStrip.OwnerItem = this.webResourceToolStripMenuItem;\r
                        this.webResourceCommonContextMenuStrip.Size = new System.Drawing.Size(152, 48);\r
                        this.webResourceCommonContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.WebResourceCommonContextMenuStripOpening);\r
                        // \r
                                                                        this.packageListContextMenuStripSeparator,\r
                                                                        this.webResourceToolStripMenuItem,\r
                                                                        this.installedDirectoryToolStripMenuItem,\r
-                                                                       this.propertiesToolStripMenuItem});\r
+                                                                       this.propertiesToolStripMenuItem,\r
+                                                                       this.viewStyleToolStripMenuItem});\r
                        this.packageListContextMenuStrip.Name = "packageListContextMenuStrip";\r
-                       this.packageListContextMenuStrip.Size = new System.Drawing.Size(215, 120);\r
+                       this.packageListContextMenuStrip.Size = new System.Drawing.Size(215, 164);\r
                        this.packageListContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.PackageListContextMenuStripOpening);\r
                        // \r
                        // installToolStripMenuItem\r
                        this.detailBox.Text = "";\r
                        this.detailBox.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.DetailBoxLinkClicked);\r
                        // \r
+                       // viewStyleToolStripMenuItem\r
+                       // \r
+                       this.viewStyleToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
+                                                                       this.viewStyleListToolStripMenuItem,\r
+                                                                       this.viewStyleTileToolStripMenuItem,\r
+                                                                       this.viewStyleDetailToolStripMenuItem});\r
+                       this.viewStyleToolStripMenuItem.Name = "viewStyleToolStripMenuItem";\r
+                       this.viewStyleToolStripMenuItem.Size = new System.Drawing.Size(214, 22);\r
+                       this.viewStyleToolStripMenuItem.Text = "表示(&V)";\r
+                       // \r
+                       // viewStyleListToolStripMenuItem\r
+                       // \r
+                       this.viewStyleListToolStripMenuItem.Name = "viewStyleListToolStripMenuItem";\r
+                       this.viewStyleListToolStripMenuItem.Size = new System.Drawing.Size(152, 22);\r
+                       this.viewStyleListToolStripMenuItem.Text = "一覧(&L)";\r
+                       this.viewStyleListToolStripMenuItem.Click += new System.EventHandler(this.ViewStyleCommonToolStripMenuItemClick);\r
+                       // \r
+                       // viewStyleTileToolStripMenuItem\r
+                       // \r
+                       this.viewStyleTileToolStripMenuItem.Name = "viewStyleTileToolStripMenuItem";\r
+                       this.viewStyleTileToolStripMenuItem.Size = new System.Drawing.Size(152, 22);\r
+                       this.viewStyleTileToolStripMenuItem.Text = "並べて表示(&S)";\r
+                       this.viewStyleTileToolStripMenuItem.Click += new System.EventHandler(this.ViewStyleCommonToolStripMenuItemClick);\r
+                       // \r
+                       // viewStyleDetailToolStripMenuItem\r
+                       // \r
+                       this.viewStyleDetailToolStripMenuItem.Checked = true;\r
+                       this.viewStyleDetailToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;\r
+                       this.viewStyleDetailToolStripMenuItem.Name = "viewStyleDetailToolStripMenuItem";\r
+                       this.viewStyleDetailToolStripMenuItem.Size = new System.Drawing.Size(152, 22);\r
+                       this.viewStyleDetailToolStripMenuItem.Text = "詳細(&D)";\r
+                       this.viewStyleDetailToolStripMenuItem.Click += new System.EventHandler(this.ViewStyleCommonToolStripMenuItemClick);\r
+                       // \r
                        // PackageListViewForm\r
                        // \r
                        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);\r
                        this.packageListContextMenuStrip.ResumeLayout(false);\r
                        this.ResumeLayout(false);\r
                }\r
+               private System.Windows.Forms.ToolStripMenuItem viewStyleDetailToolStripMenuItem;\r
+               private System.Windows.Forms.ToolStripMenuItem viewStyleTileToolStripMenuItem;\r
+               private System.Windows.Forms.ToolStripMenuItem viewStyleListToolStripMenuItem;\r
+               private System.Windows.Forms.ToolStripMenuItem viewStyleToolStripMenuItem;\r
                private System.Windows.Forms.ToolStripMenuItem webResourceToolStripMenuItem;\r
                private System.Windows.Forms.ToolStripMenuItem propertiesMenuItem;\r
                private AppliStation.Util.ToolStripPetitLauncherMenuItem installedDirectoryMenuItem;\r
index bbf4974..03ae3f3 100644 (file)
@@ -525,6 +525,7 @@ namespace AppliStation
                        packageListContextMenuStripSeparator.Visible = selectionIsOnlyOne;\r
                        webResourceToolStripMenuItem.Visible = selectionIsOnlyOne;\r
                        propertiesToolStripMenuItem.Visible = hasSelection;\r
+                       viewStyleToolStripMenuItem.Visible = ! hasSelection;\r
                }\r
                \r
                void InformationToolStripDropDownButtonDropDownOpening(object sender, EventArgs e)\r
@@ -629,6 +630,22 @@ namespace AppliStation
                                process.Invoke();\r
                        }\r
                }\r
+               \r
+               void ViewStyleCommonToolStripMenuItemClick(object sender, EventArgs e)\r
+               {\r
+                       viewStyleDetailToolStripMenuItem.Checked = (sender == viewStyleDetailToolStripMenuItem);\r
+                       viewStyleListToolStripMenuItem.Checked = (sender == viewStyleListToolStripMenuItem);\r
+                       viewStyleTileToolStripMenuItem.Checked = (sender == viewStyleTileToolStripMenuItem);\r
+                       \r
+                       if (sender == viewStyleDetailToolStripMenuItem) {\r
+                               packageListView.View = View.Details;\r
+                       } else if (sender == viewStyleListToolStripMenuItem) {\r
+                               packageListView.View = View.List;\r
+                       } else if (sender == viewStyleTileToolStripMenuItem) {\r
+                               packageListView.View = View.Tile;\r
+                       }\r
+                       \r
+               }\r
        }\r
 \r
 }\r