From: <nic...@us...> - 2014-02-24 19:38:44
|
Revision: 4765 http://sourceforge.net/p/mp-plugins/code/4765 Author: nicsergio Date: 2014-02-24 19:38:41 +0000 (Mon, 24 Feb 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.resx Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs 2014-02-24 17:36:22 UTC (rev 4764) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs 2014-02-24 19:38:41 UTC (rev 4765) @@ -32,11 +32,6 @@ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShortCuterConfig)); this.shortCutsDataGridView = new System.Windows.Forms.DataGridView(); - this.itemsTabControl = new System.Windows.Forms.TabControl(); - this.linksTabPage = new System.Windows.Forms.TabPage(); - this.skinLinksTreeView = new System.Windows.Forms.TreeView(); - this.skinTabPage = new System.Windows.Forms.TabPage(); - this.skinFilesListBox = new System.Windows.Forms.ListBox(); this.linkPropertiesGroupBox = new System.Windows.Forms.GroupBox(); this.loadParameterGroupBox = new System.Windows.Forms.GroupBox(); this.loadParameterTextBox = new System.Windows.Forms.TextBox(); @@ -60,11 +55,8 @@ this.capsLockGroupBox = new System.Windows.Forms.GroupBox(); this.capsLockComboBox = new System.Windows.Forms.ComboBox(); this.rowCopyButton = new System.Windows.Forms.Button(); - this.skinItems1 = new My.Common.SkinItems(); + this.skinItems = new My.Common.SkinItems(); ((System.ComponentModel.ISupportInitialize)(this.shortCutsDataGridView)).BeginInit(); - this.itemsTabControl.SuspendLayout(); - this.linksTabPage.SuspendLayout(); - this.skinTabPage.SuspendLayout(); this.linkPropertiesGroupBox.SuspendLayout(); this.loadParameterGroupBox.SuspendLayout(); this.windowIdGroupBox.SuspendLayout(); @@ -107,66 +99,6 @@ this.shortCutsDataGridView.EditingControlShowing += new System.Windows.Forms.DataGridViewEditingControlShowingEventHandler(this.shortCutsDataGridView_EditingControlShowing); this.shortCutsDataGridView.Enter += new System.EventHandler(this.shortCutsDataGridView_Enter); // - // itemsTabControl - // - this.itemsTabControl.Controls.Add(this.linksTabPage); - this.itemsTabControl.Controls.Add(this.skinTabPage); - this.itemsTabControl.ItemSize = new System.Drawing.Size(74, 18); - this.itemsTabControl.Location = new System.Drawing.Point(266, 8); - this.itemsTabControl.Name = "itemsTabControl"; - this.itemsTabControl.SelectedIndex = 0; - this.itemsTabControl.Size = new System.Drawing.Size(330, 260); - this.itemsTabControl.TabIndex = 1; - this.itemsTabControl.SelectedIndexChanged += new System.EventHandler(this.itemsTabControl_SelectedIndexChanged); - this.itemsTabControl.Click += new System.EventHandler(this.itemsTabControl_Click); - // - // linksTabPage - // - this.linksTabPage.Controls.Add(this.skinLinksTreeView); - this.linksTabPage.Location = new System.Drawing.Point(4, 22); - this.linksTabPage.Name = "linksTabPage"; - this.linksTabPage.Padding = new System.Windows.Forms.Padding(3); - this.linksTabPage.Size = new System.Drawing.Size(322, 234); - this.linksTabPage.TabIndex = 0; - this.linksTabPage.Text = "Default Links"; - this.linksTabPage.UseVisualStyleBackColor = true; - // - // skinLinksTreeView - // - this.skinLinksTreeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(220)))), ((int)(((byte)(227))))); - this.skinLinksTreeView.FullRowSelect = true; - this.skinLinksTreeView.HideSelection = false; - this.skinLinksTreeView.Location = new System.Drawing.Point(1, 5); - this.skinLinksTreeView.Name = "skinLinksTreeView"; - this.skinLinksTreeView.Size = new System.Drawing.Size(318, 225); - this.skinLinksTreeView.TabIndex = 2; - this.skinLinksTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.skinLinksTreeView_AfterSelect); - this.skinLinksTreeView.DoubleClick += new System.EventHandler(this.skinLinksTreeView_DoubleClick); - this.skinLinksTreeView.Enter += new System.EventHandler(this.skinLinksTreeView_Enter); - // - // skinTabPage - // - this.skinTabPage.Controls.Add(this.skinFilesListBox); - this.skinTabPage.Location = new System.Drawing.Point(4, 22); - this.skinTabPage.Name = "skinTabPage"; - this.skinTabPage.Padding = new System.Windows.Forms.Padding(3); - this.skinTabPage.Size = new System.Drawing.Size(322, 234); - this.skinTabPage.TabIndex = 1; - this.skinTabPage.Text = "Skin Files"; - this.skinTabPage.UseVisualStyleBackColor = true; - // - // skinFilesListBox - // - this.skinFilesListBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(220)))), ((int)(((byte)(227))))); - this.skinFilesListBox.FormattingEnabled = true; - this.skinFilesListBox.Location = new System.Drawing.Point(1, 5); - this.skinFilesListBox.Name = "skinFilesListBox"; - this.skinFilesListBox.Size = new System.Drawing.Size(318, 225); - this.skinFilesListBox.TabIndex = 0; - this.skinFilesListBox.SelectedIndexChanged += new System.EventHandler(this.skinFilesListBox_SelectedIndexChanged); - this.skinFilesListBox.DoubleClick += new System.EventHandler(this.skinFilesListBox_DoubleClick); - this.skinFilesListBox.Enter += new System.EventHandler(this.skinFilesListBox_Enter); - // // linkPropertiesGroupBox // this.linkPropertiesGroupBox.Controls.Add(this.loadParameterGroupBox); @@ -419,19 +351,22 @@ this.rowCopyButton.UseVisualStyleBackColor = true; this.rowCopyButton.Click += new System.EventHandler(this.rowCopyButton_Click); // - // skinItems1 + // skinItems // - this.skinItems1.Location = new System.Drawing.Point(466, 8); - this.skinItems1.Name = "skinItems1"; - this.skinItems1.Size = new System.Drawing.Size(330, 260); - this.skinItems1.TabIndex = 39; + this.skinItems.Location = new System.Drawing.Point(266, 8); + this.skinItems.Name = "skinItems"; + this.skinItems.Size = new System.Drawing.Size(330, 260); + this.skinItems.TabIndex = 39; + this.skinItems.Enter += new My.Common.SkinItems.ItemChanged(this.skinItems_Enter); + this.skinItems.Changed += new My.Common.SkinItems.ItemChanged(this.skinItems_Changed); + this.skinItems.DoubleClick += new My.Common.SkinItems.ItemChanged(this.skinItems_DoubleClick); // // ShortCuterConfig // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1018, 740); - this.Controls.Add(this.skinItems1); + this.Controls.Add(this.skinItems); this.Controls.Add(this.rowCopyButton); this.Controls.Add(this.overridesGroupBox); this.Controls.Add(this.saveButton); @@ -443,7 +378,6 @@ this.Controls.Add(this.infoPictureBox); this.Controls.Add(this.rowRemoveButton); this.Controls.Add(this.rowAddButton); - this.Controls.Add(this.itemsTabControl); this.Controls.Add(this.shortCutsDataGridView); this.Controls.Add(this.propLeftPictureBox); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; @@ -456,9 +390,6 @@ this.Load += new System.EventHandler(this.ShortCuterConfig_Load); this.Shown += new System.EventHandler(this.ShortCuterConfig_Shown); ((System.ComponentModel.ISupportInitialize)(this.shortCutsDataGridView)).EndInit(); - this.itemsTabControl.ResumeLayout(false); - this.linksTabPage.ResumeLayout(false); - this.skinTabPage.ResumeLayout(false); this.linkPropertiesGroupBox.ResumeLayout(false); this.loadParameterGroupBox.ResumeLayout(false); this.loadParameterGroupBox.PerformLayout(); @@ -477,10 +408,6 @@ #endregion private System.Windows.Forms.DataGridView shortCutsDataGridView; - private System.Windows.Forms.TabControl itemsTabControl; - private System.Windows.Forms.TabPage linksTabPage; - private System.Windows.Forms.TabPage skinTabPage; - private System.Windows.Forms.ListBox skinFilesListBox; private System.Windows.Forms.PictureBox propLeftPictureBox; private System.Windows.Forms.Button rowAddButton; private System.Windows.Forms.Button rowRemoveButton; @@ -496,7 +423,6 @@ private System.Windows.Forms.GroupBox skinFileGroupBox; private System.Windows.Forms.Label skinFileLabel; private System.Windows.Forms.GroupBox loadParameterGroupBox; - private System.Windows.Forms.TreeView skinLinksTreeView; private System.Windows.Forms.Button saveButton; private System.Windows.Forms.TextBox loadParameterTextBox; private System.Windows.Forms.GroupBox overridesGroupBox; @@ -505,7 +431,7 @@ private System.Windows.Forms.ComboBox capsLockComboBox; private System.Windows.Forms.ComboBox numLockComboBox; private System.Windows.Forms.Button rowCopyButton; - private My.Common.SkinItems skinItems1; + private My.Common.SkinItems skinItems; } } \ No newline at end of file Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-02-24 17:36:22 UTC (rev 4764) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-02-24 19:38:41 UTC (rev 4765) @@ -29,10 +29,7 @@ #region Metodi Privati private void InitializeGUI() //Inizializzazione interfaccia { - skinFilesListBox.DataSource = mySkin.SkinFiles; - skinFilesListBox.SelectedIndex = -1; - mySkin.FillTreeViewSkinLinks(skinLinksTreeView); - skinLinksTreeView.CollapseAll(); + skinItems.Populate(mySkin.SkinFiles, mySkin.SkinLinks, false, true); FormatShortCutsGrid(); capsLockComboBox.DataSource = Enum.GetNames(typeof(LockKeys.LockKeyActions)); @@ -40,8 +37,7 @@ numLockComboBox.DataSource = Enum.GetNames(typeof(LockKeys.LockKeyActions)); numLockComboBox.SelectedItem = Enum.GetName(typeof(LockKeys.LockKeyActions), myShortCuts.GeneralForcingNumLock); - toolTip.SetToolTip(skinFilesListBox, "Double click to set the link's parameter to shortcut"); - toolTip.SetToolTip(skinLinksTreeView, "Double click to set the link's parameter to shortcut"); + toolTip.SetToolTip(skinItems, "Double click to set the link's parameter to shortcut"); toolTip.SetToolTip(rowAddButton, "Add shortcut to list"); toolTip.SetToolTip(rowRemoveButton, "Remove selected shortcut from list"); toolTip.SetToolTip(rowCopyButton, "Copy selected shortcut to list"); @@ -148,42 +144,28 @@ shortCutsDataGridView.DataSource = myShortCuts.Items; } - private void ShowLinkProperties(object listControl) //Visualizzazione proprietà link + private void ShowLinkProperties(SkinItems.SkinItemsType itemType, int index) //Visualizzazione proprietà link { - Control itemsList = (Control)listControl; //Casting sender -> Control - int selectedIndex; //Indice eventuale elemento selezionato - - if (itemsList is ListBox) + if (index < 0) //Se indice invalido --> reset proprietà { - ListBox listBox = (ListBox)itemsList; //Casting Control -> ListBox - selectedIndex = listBox.SelectedIndex; //<-- indice lista selezionato - } - else - { - TreeView treeView = (TreeView)itemsList; //Casting Control -> TreeView - selectedIndex= mySkin.GetSkinLinkIndex(treeView); //<-- indice nodo selezionato - } - - if (selectedIndex < 0) //Se indice invalido --> reset proprietà - { skinFileLabel.Text = "-"; windowIdLabel.Text = "-"; loadParameterTextBox.Text = "-"; } else //Visualizzazione proprietà elemento selezionato - { - switch (itemsList.Name) + { + switch (itemType) { - case "skinFilesListBox": //Lista files della skin - skinFileLabel.Text = mySkin.SkinFiles[selectedIndex].Name; - windowIdLabel.Text = mySkin.SkinFiles[selectedIndex].Id.ToString(); + case SkinItems.SkinItemsType.Files: //Lista files della skin + skinFileLabel.Text = mySkin.SkinFiles[index].Name; + windowIdLabel.Text = mySkin.SkinFiles[index].Id.ToString(); loadParameterTextBox.Text = "-"; break; - case "skinLinksTreeView": //Lista links predefiniti della skin - skinFileLabel.Text = mySkin.SkinLinks[selectedIndex].XmlFile; - windowIdLabel.Text = mySkin.SkinLinks[selectedIndex].WindowID.ToString(); - loadParameterTextBox.Text = mySkin.SkinLinks[selectedIndex].LoadParameter; + case SkinItems.SkinItemsType.Links: //Lista links predefiniti della skin + skinFileLabel.Text = mySkin.SkinLinks[index].XmlFile; + windowIdLabel.Text = mySkin.SkinLinks[index].WindowID.ToString(); + loadParameterTextBox.Text = mySkin.SkinLinks[index].LoadParameter; break; } } @@ -194,6 +176,7 @@ { if (!forceCell) //Non nel caso di forzatura valore cella WindowID (doppio click da lista links) { + /* int showIndex; int windowID = Convert.ToInt32(shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[5].Value); if (itemsTabControl.SelectedIndex == 0) @@ -207,6 +190,7 @@ showIndex = mySkin.SkinFiles.FindLastIndex(x => x.Id == windowID); skinFilesListBox.SelectedIndex = showIndex; //--> selezione eventuale file corrispondente a WindowID } + */ } } } @@ -394,56 +378,29 @@ } #endregion #region Eventi Liste Files & Links Skin - private void itemsTabControl_SelectedIndexChanged(object sender, EventArgs e) + private void skinItems_Enter(SkinItems.SkinItemsType itemType, int index) { - if(itemsTabControl.SelectedIndex == 0) - skinLinksTreeView.Focus(); - else - skinFilesListBox.Focus(); - } - private void itemsTabControl_Click(object sender, EventArgs e) - { - if (itemsTabControl.SelectedIndex == 0) - skinLinksTreeView.Focus(); - else - skinFilesListBox.Focus(); - } - private void skinFilesListBox_SelectedIndexChanged(object sender, EventArgs e) - { - ShowLinkProperties(sender); - } - private void skinFilesListBox_Enter(object sender, EventArgs e) - { propLeftPictureBox.Visible = false; //--> il link non è collegato allo shortcut selezionato - ShowLinkProperties(sender); + ShowLinkProperties(itemType, index); } - private void skinFilesListBox_DoubleClick(object sender, EventArgs e) + private void skinItems_Changed(SkinItems.SkinItemsType itemType, int index) { - if (shortCutsDataGridView.CurrentRow != null && shortCutsDataGridView.RowCount > 0) - { - shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[5].Value = mySkin.SkinFiles[skinFilesListBox.SelectedIndex].Id.ToString(); - shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[6].Value = ""; - forceCell = true; - shortCutsDataGridView.CurrentCell = shortCutsDataGridView[5, shortCutsDataGridView.CurrentRow.Index]; - forceCell = false; - } + ShowLinkProperties(itemType, index); } - private void skinLinksTreeView_AfterSelect(object sender, TreeViewEventArgs e) + private void skinItems_DoubleClick(SkinItems.SkinItemsType itemType, int index) { - ShowLinkProperties(sender); - } - private void skinLinksTreeView_Enter(object sender, EventArgs e) - { - propLeftPictureBox.Visible = false; //--> il link non è collegato allo shortcut selezionato - ShowLinkProperties(sender); - } - private void skinLinksTreeView_DoubleClick(object sender, EventArgs e) - { - int skinLinkIndex = mySkin.GetSkinLinkIndex(skinLinksTreeView); - if (shortCutsDataGridView.CurrentRow != null && shortCutsDataGridView.RowCount > 0 && skinLinkIndex >= 0) + if (shortCutsDataGridView.CurrentRow != null && shortCutsDataGridView.RowCount > 0 && index >= 0) { - shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[5].Value = mySkin.SkinLinks[skinLinkIndex].WindowID.ToString(); - shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[6].Value = mySkin.SkinLinks[skinLinkIndex].LoadParameter; + if (itemType == SkinItems.SkinItemsType.Files) + { + shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[5].Value = mySkin.SkinFiles[index].Id.ToString(); + shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[6].Value = ""; + } + else + { + shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[5].Value = mySkin.SkinLinks[index].WindowID.ToString(); + shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[6].Value = mySkin.SkinLinks[index].LoadParameter; + } forceCell = true; shortCutsDataGridView.CurrentCell = shortCutsDataGridView[5, shortCutsDataGridView.CurrentRow.Index]; forceCell = false; @@ -521,5 +478,8 @@ return false; } #endregion + + + } } Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.resx =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.resx 2014-02-24 17:36:22 UTC (rev 4764) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.resx 2014-02-24 19:38:41 UTC (rev 4765) @@ -120,21 +120,6 @@ <metadata name="shortCutsDataGridView.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> - <metadata name="itemsTabControl.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="linksTabPage.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="skinLinksTreeView.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="skinTabPage.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="skinFilesListBox.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> <metadata name="linkPropertiesGroupBox.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |