From: <nic...@us...> - 2013-12-06 15:03:49
|
Revision: 4700 http://sourceforge.net/p/mp-plugins/code/4700 Author: nicsergio Date: 2013-12-06 15:03:45 +0000 (Fri, 06 Dec 2013) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj Added Paths: ----------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/UnlockKeys.cs Removed Paths: ------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LockKeys.cs Deleted: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LockKeys.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LockKeys.cs 2013-12-06 14:08:13 UTC (rev 4699) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LockKeys.cs 2013-12-06 15:03:45 UTC (rev 4700) @@ -1,77 +0,0 @@ -using System; -using System.ComponentModel; -using System.Runtime.InteropServices; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Reflection; -using System.Windows.Forms; -using System.Collections.Generic; - - -namespace ProcessPlugins.ShortCuter -{ - internal static class LockKeys //Classe per gestione attivazione/disattivazione blocco maiuscole/numeri - { - #region Dati - //bool numLockReq = false, capsLockReq = false; //--> inizializzazione parametri (richiesta di impostazione OFF) - - - - - #region Costanti - const int KEYEVENTF_EXTENDEDKEY = 0x1; //Da impostare come flag per far precedere il codice per la scansione HW dal byte 0xE0 (tasti estesi) - const int KEYEVENTF_KEYUP = 0x2; //Da impostare come flag per ottenere l'azione di rilascio del tasto - const int VK_NUMLOCK = 0x90; //Codice VirtualKey di NumLock - const int HK_NUMLOCK = 0x45; //Codice HardwareKey di NumLock (per scansione HW -> bScan) - const int VK_CAPITAL = 0x14; //Codice VirtualKey di CapsLock - const int SC_CAPITAL = 0x3A; //Codice HardwareKey di CapsLock (per scansione HW -> bScan) - #endregion - #endregion - - /*static void Main(string[] args) //Chiamata applicazione con parametri: LockKeys X Y (X->NumLock Y->Capslock) - { - #region Verifica parametri - if (args.Count() > 0) //Verifica se parametro passato da riga di comando - if (args[0] == "1") - numLockReq = true; //--> richiesta di attivare NumLock - else if (args[0] == "0") - numLockReq = false; //--> richiesta di disattivare NumLock - else - numLockReq = Console.NumberLock; //--> altrimenti lo stato rimane invariato - - if (args.Count() > 1) //Verifica se parametro passato da riga di comando - if (args[1] == "1") - capsLockReq = true; //--> richiesta di attivare CapsLock - else if (args[1] == "0") - capsLockReq = false; //--> richiesta di disattivare CapsLock - else - capsLockReq = Console.CapsLock; //--> altrimenti lo stato rimane invariato - #endregion - - #region Azioni - if (numLockReq != Console.NumberLock) //Se richiesta diversa da stato attuale - { - //Simulazione pressione del tasto NumLock - keybd_event(VK_NUMLOCK, HK_NUMLOCK, KEYEVENTF_EXTENDEDKEY, (UIntPtr)0); - //Simulazione rilascio del tasto NumLock - keybd_event(VK_NUMLOCK, HK_NUMLOCK, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, (UIntPtr)0); - } - if (capsLockReq != Console.CapsLock) //Se richiesta diversa da stato attuale - { - //Simulazione pressione del tasto CapsLock - keybd_event(VK_CAPITAL, SC_CAPITAL, 0, (UIntPtr)0); - //Simulazione rilascio del tasto CapsLock - keybd_event(VK_CAPITAL, SC_CAPITAL, KEYEVENTF_KEYUP, (UIntPtr)0); - } - #endregion - } - */ - - - #region Importazione DLL - //Simulazione eventi di tastiera - [DllImport("user32.dll")] - static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, UIntPtr dwExtraInfo); - #endregion - } -} Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2013-12-06 14:08:13 UTC (rev 4699) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2013-12-06 15:03:45 UTC (rev 4700) @@ -93,7 +93,7 @@ </Compile> <Compile Include="KeyboardHookWorker.cs" /> <Compile Include="KeyboardHook.cs" /> - <Compile Include="LockKeys.cs" /> + <Compile Include="UnlockKeys.cs" /> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\Resources.Designer.cs"> Added: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/UnlockKeys.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/UnlockKeys.cs (rev 0) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/UnlockKeys.cs 2013-12-06 15:03:45 UTC (rev 4700) @@ -0,0 +1,53 @@ +using System; +using System.Runtime.InteropServices; +using System.Windows.Forms; + +namespace ProcessPlugins.ShortCuter +{ + internal static class UnlockKeys //Classe per disattivazione blocco maiuscole/numeri + { + #region Costanti + const int KEYEVENTF_EXTENDEDKEY = 0x1; //Da impostare come flag per far precedere il codice per la scansione HW dal byte 0xE0 (tasti estesi) + const int KEYEVENTF_KEYUP = 0x2; //Da impostare come flag per ottenere l'azione di rilascio del tasto + const int VK_NUMLOCK = 0x90; //Codice VirtualKey di NumLock + const int HK_NUMLOCK = 0x45; //Codice HardwareKey di NumLock (per scansione HW -> bScan) + const int VK_CAPITAL = 0x14; //Codice VirtualKey di CapsLock + const int SC_CAPITAL = 0x3A; //Codice HardwareKey di CapsLock (per scansione HW -> bScan) + #endregion + + #region Metodi Pubblici + public static bool ResetCapsLock() + { + if (Control.IsKeyLocked(Keys.CapsLock)) //Se richiesta diversa da stato attuale + { + //Simulazione pressione del tasto CapsLock + keybd_event(VK_CAPITAL, SC_CAPITAL, 0, (UIntPtr)0); + //Simulazione rilascio del tasto CapsLock + keybd_event(VK_CAPITAL, SC_CAPITAL, KEYEVENTF_KEYUP, (UIntPtr)0); + return true; + } + else + return false; + } + public static bool ResetNumLock() + { + if (Control.IsKeyLocked(Keys.NumLock)) //Se richiesta diversa da stato attuale + { + //Simulazione pressione del tasto NumLock + keybd_event(VK_NUMLOCK, HK_NUMLOCK, KEYEVENTF_EXTENDEDKEY, (UIntPtr)0); + //Simulazione rilascio del tasto NumLock + keybd_event(VK_NUMLOCK, HK_NUMLOCK, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, (UIntPtr)0); + return true; + } + else + return false; + } + #endregion + + #region Importazione DLL + //Simulazione eventi di tastiera + [DllImport("user32.dll")] + static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, UIntPtr dwExtraInfo); + #endregion + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-01-09 15:50:17
|
Revision: 4718 http://sourceforge.net/p/mp-plugins/code/4718 Author: nicsergio Date: 2014-01-09 15:50:13 +0000 (Thu, 09 Jan 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LockKeys.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LockKeys.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LockKeys.cs 2014-01-08 18:11:03 UTC (rev 4717) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LockKeys.cs 2014-01-09 15:50:13 UTC (rev 4718) @@ -1,11 +1,10 @@ using System; using System.Runtime.InteropServices; using System.Windows.Forms; -using System.ComponentModel; namespace ProcessPlugins.ShortCuter { - internal static class LockKeys //Classe per disattivazione blocco maiuscole/numeri + internal static class LockKeys //Classe per modifica stato blocco maiuscole/numeri { #region Costanti const int KEYEVENTF_EXTENDEDKEY = 0x1; //Da impostare come flag per far precedere il codice per la scansione HW dal byte 0xE0 (tasti estesi) @@ -15,38 +14,36 @@ const int VK_CAPITAL = 0x14; //Codice VirtualKey di CapsLock const int SC_CAPITAL = 0x3A; //Codice HardwareKey di CapsLock (per scansione HW -> bScan) - public enum LockKeyTypes + public enum LockKeyActions //Tipologie di azioni di modica stato { - ForceOff = 0, - [Description("Force OFF (reccomended)")] - HereIsAnother = 2, - [Description("Last one")] - LastOne = 3 + Off = 0, //--> reset blocco + On = 1, //--> forzatura blocco + None = 2 //--> nessuna modifica (stato invariato) } - - #endregion #region Metodi Pubblici - public static bool ResetCapsLock() //Richesta di disattivazione CapsLock + public static bool ChangeCapsLock(LockKeyActions forcing) //Richiesta di modifica stato CapsLock { - if (Control.IsKeyLocked(Keys.CapsLock)) //Se CapsLock attivo + if ((Control.IsKeyLocked(Keys.CapsLock) & forcing == LockKeyActions.On) || + (!Control.IsKeyLocked(Keys.CapsLock) & forcing == LockKeyActions.Off)) //Se richiesta una variazione di stato { keybd_event(VK_CAPITAL, SC_CAPITAL, 0, (UIntPtr)0); //--> simulazione pressione del tasto CapsLock keybd_event(VK_CAPITAL, SC_CAPITAL, KEYEVENTF_KEYUP, (UIntPtr)0); //--> simulazione rilascio del tasto CapsLock - return true; //--> CapsLock disattivato + return true; //--> stato CapsLock modificato } else return false; //--> stato CapsLock non modificato } - public static bool ResetNumLock() //Richesta di disattivazione NumLock + public static bool ChangeNumLock(LockKeyActions forcing) //Richesta di modifica stato NumLock { - if (Control.IsKeyLocked(Keys.NumLock)) //Se NumLock attivo + if ((Control.IsKeyLocked(Keys.NumLock) & forcing == LockKeyActions.On) || + (!Control.IsKeyLocked(Keys.NumLock) & forcing == LockKeyActions.Off)) //Se richiesta una variazione di stato { keybd_event(VK_NUMLOCK, HK_NUMLOCK, KEYEVENTF_EXTENDEDKEY, (UIntPtr)0); //--> simulazione pressione del tasto NumLock keybd_event(VK_NUMLOCK, HK_NUMLOCK, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, (UIntPtr)0); //--> simulazione rilascio del tasto NumLock - return true; //--> NumLock disattivato + return true; //--> stato NumLock modificato } else return false; //--> stato NumLock non modificato Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml 2014-01-08 18:11:03 UTC (rev 4717) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml 2014-01-09 15:50:13 UTC (rev 4718) @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <ShortCuter> <General> - <ResetCapsLock>1</ResetCapsLock> - <ResetNumLock>0</ResetNumLock> + <ForcingCapsLock>Off</ForcingCapsLock> + <ForcingNumLock>None</ForcingNumLock> </General> <Items> <Item> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-01-08 18:11:03 UTC (rev 4717) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-01-09 15:50:13 UTC (rev 4718) @@ -30,12 +30,12 @@ string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml"); myShortCuts = new ShortCuts(settingsFile, false); //--> lettura configurazione relativa agli shortcuts - if (myShortCuts.GeneralResetCapsLock) - if (LockKeys.ResetCapsLock()) - MpLog(false, "CapsLock deactivated"); //--> disattivazione CapsLock - if (myShortCuts.GeneralResetNumLock) - if (LockKeys.ResetNumLock()) - MpLog(false, "NumLock deactivated"); //--> disattivazione NumLock + + if (LockKeys.ChangeCapsLock(myShortCuts.GeneralForcingCapsLock)) + MpLog(false, "CapsLock deactivated"); //--> disattivazione CapsLock + if (LockKeys.ChangeNumLock(myShortCuts.GeneralForcingNumLock)) + MpLog(false, "NumLock deactivated"); //--> disattivazione NumLock + if (myShortCuts.Initialized) //Se classe di gestione shortcut inizializzata { try Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.Designer.cs 2014-01-08 18:11:03 UTC (rev 4717) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.Designer.cs 2014-01-09 15:50:13 UTC (rev 4718) @@ -55,7 +55,10 @@ this.propLeftPictureBox = new System.Windows.Forms.PictureBox(); this.saveButton = new System.Windows.Forms.Button(); this.overridesGroupBox = new System.Windows.Forms.GroupBox(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.capsLockGroupBox = new System.Windows.Forms.GroupBox(); + this.numLockGroupBox = new System.Windows.Forms.GroupBox(); + this.capsLockComboBox = new System.Windows.Forms.ComboBox(); + this.numLockComboBox = new System.Windows.Forms.ComboBox(); ((System.ComponentModel.ISupportInitialize)(this.shortCutsDataGridView)).BeginInit(); this.itemsTabControl.SuspendLayout(); this.linksTabPage.SuspendLayout(); @@ -67,6 +70,8 @@ ((System.ComponentModel.ISupportInitialize)(this.infoPictureBox)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.propLeftPictureBox)).BeginInit(); this.overridesGroupBox.SuspendLayout(); + this.capsLockGroupBox.SuspendLayout(); + this.numLockGroupBox.SuspendLayout(); this.SuspendLayout(); // // shortCutsDataGridView @@ -347,7 +352,8 @@ // // overridesGroupBox // - this.overridesGroupBox.Controls.Add(this.groupBox1); + this.overridesGroupBox.Controls.Add(this.numLockGroupBox); + this.overridesGroupBox.Controls.Add(this.capsLockGroupBox); this.overridesGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.overridesGroupBox.Location = new System.Drawing.Point(6, 200); this.overridesGroupBox.Name = "overridesGroupBox"; @@ -356,16 +362,46 @@ this.overridesGroupBox.TabStop = false; this.overridesGroupBox.Text = "Overrides at Start-Up"; // - // groupBox1 + // capsLockGroupBox // - this.groupBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.groupBox1.Location = new System.Drawing.Point(4, 13); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(152, 42); - this.groupBox1.TabIndex = 37; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Window ID:"; + this.capsLockGroupBox.Controls.Add(this.capsLockComboBox); + this.capsLockGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.capsLockGroupBox.Location = new System.Drawing.Point(6, 15); + this.capsLockGroupBox.Name = "capsLockGroupBox"; + this.capsLockGroupBox.Size = new System.Drawing.Size(152, 42); + this.capsLockGroupBox.TabIndex = 37; + this.capsLockGroupBox.TabStop = false; + this.capsLockGroupBox.Text = "Caps-Lock Forcing:"; // + // numLockGroupBox + // + this.numLockGroupBox.Controls.Add(this.numLockComboBox); + this.numLockGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.numLockGroupBox.Location = new System.Drawing.Point(164, 15); + this.numLockGroupBox.Name = "numLockGroupBox"; + this.numLockGroupBox.Size = new System.Drawing.Size(152, 42); + this.numLockGroupBox.TabIndex = 38; + this.numLockGroupBox.TabStop = false; + this.numLockGroupBox.Text = "Num-Lock Forcing:"; + // + // capsLockComboBox + // + this.capsLockComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.capsLockComboBox.FormattingEnabled = true; + this.capsLockComboBox.Location = new System.Drawing.Point(9, 15); + this.capsLockComboBox.Name = "capsLockComboBox"; + this.capsLockComboBox.Size = new System.Drawing.Size(133, 21); + this.capsLockComboBox.TabIndex = 0; + // + // numLockComboBox + // + this.numLockComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.numLockComboBox.FormattingEnabled = true; + this.numLockComboBox.Location = new System.Drawing.Point(9, 15); + this.numLockComboBox.Name = "numLockComboBox"; + this.numLockComboBox.Size = new System.Drawing.Size(133, 21); + this.numLockComboBox.TabIndex = 1; + // // ShortCuterForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -405,6 +441,8 @@ ((System.ComponentModel.ISupportInitialize)(this.infoPictureBox)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.propLeftPictureBox)).EndInit(); this.overridesGroupBox.ResumeLayout(false); + this.capsLockGroupBox.ResumeLayout(false); + this.numLockGroupBox.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -436,7 +474,10 @@ private System.Windows.Forms.Button saveButton; private System.Windows.Forms.TextBox loadParameterTextBox; private System.Windows.Forms.GroupBox overridesGroupBox; - private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.GroupBox capsLockGroupBox; + private System.Windows.Forms.GroupBox numLockGroupBox; + private System.Windows.Forms.ComboBox capsLockComboBox; + private System.Windows.Forms.ComboBox numLockComboBox; } } \ No newline at end of file Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.cs 2014-01-08 18:11:03 UTC (rev 4717) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.cs 2014-01-09 15:50:13 UTC (rev 4718) @@ -36,9 +36,11 @@ skinLinksTreeView.CollapseAll(); FormatShortCutsGrid(); - resetCapsLockCheckBox.Checked = myShortCuts.GeneralResetCapsLock; - resetNumLockCheckBox.Checked = myShortCuts.GeneralResetNumLock; - + capsLockComboBox.DataSource = Enum.GetNames(typeof(LockKeys.LockKeyActions)); + capsLockComboBox.SelectedItem = Enum.GetName(typeof(LockKeys.LockKeyActions), myShortCuts.GeneralForcingCapsLock); + 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(rowAddButton, "Add shortcut to list"); @@ -222,8 +224,8 @@ } private bool Save() //Salvataggio configurazione plugin { - myShortCuts.GeneralResetCapsLock = resetCapsLockCheckBox.Checked; - myShortCuts.GeneralResetNumLock = resetNumLockCheckBox.Checked; + myShortCuts.GeneralForcingCapsLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), capsLockComboBox.SelectedItem.ToString()); + myShortCuts.GeneralForcingNumLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), numLockComboBox.SelectedItem.ToString()); return myShortCuts.SaveConfig(); } #endregion Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-01-08 18:11:03 UTC (rev 4717) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-01-09 15:50:13 UTC (rev 4718) @@ -113,8 +113,8 @@ private readonly bool ConfigContext; //Utilizzo nella fase di configurazione (altrimenti plugin in esecuzione) private struct GeneralSettings //Struttura impostazioni generali { - public bool ResetCapsLock; //Reset attivazione Caps-Lock all'avvio - public bool ResetNumLock; //Reset attivazione Num-Lock all'avvio + public LockKeys.LockKeyActions ForcingCapsLock; //Tipologia di forzatura Caps-Lock all'avvio + public LockKeys.LockKeyActions ForcingNumLock; //Tipologia di forzatura Num-Lock all'avvio } private GeneralSettings _general = new GeneralSettings(); //Impostazioni generali plugin private BindingList<ShortCut> _items = new BindingList<ShortCut>(); //Lista (con associazione dati) degli shortcuts configurati @@ -126,6 +126,8 @@ { SettingsFile = settingsFile; //--> percorso & nome file delle impostazioni ConfigContext = configContext; //--> utilizzo nella fase di configurazione (altrimenti plugin in esecuzione) + _general.ForcingCapsLock = LockKeys.LockKeyActions.None; //--> default: nessuna modifica stato Caps-Lock + _general.ForcingNumLock = LockKeys.LockKeyActions.None; //--> default: nessuna modifica stato Num-Lock _initialized = LoadConfig(false); //--> caricamento configurazione (standard) shortcuts if (!_initialized) { @@ -214,13 +216,25 @@ XmlNode innerNode; XmlNode generalNode = xmlFile.DocumentElement.SelectSingleNode("/ShortCuter/General"); if (generalNode != null) //Se presente sezione "General" (implementata da V2.0.5) - { - innerNode = generalNode.SelectSingleNode("ResetCapsLock"); + { + innerNode = generalNode.SelectSingleNode("ForcingCapsLock"); if (innerNode != null) - _general.ResetCapsLock = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); - innerNode = generalNode.SelectSingleNode("ResetNumLock"); + _general.ForcingCapsLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), innerNode.InnerText); + else + { + innerNode = generalNode.SelectSingleNode("ResetCapsLock"); //Necessario per compatibilità con file di configurazione V2.0.5.0 + if (innerNode != null && Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText))) + _general.ForcingCapsLock = LockKeys.LockKeyActions.Off; + } + innerNode = generalNode.SelectSingleNode("ForcingNumLock"); if (innerNode != null) - _general.ResetNumLock = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); + _general.ForcingNumLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), innerNode.InnerText); + else + { + innerNode = generalNode.SelectSingleNode("ResetNumLock"); //Necessario per compatibilità con file di configurazione V2.0.5.0 + if (innerNode != null && Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText))) + _general.ForcingNumLock = LockKeys.LockKeyActions.Off; + } } XmlNodeList nodeList = xmlFile.DocumentElement.SelectNodes("/ShortCuter/Items/Item"); foreach (XmlNode node in nodeList) //Iterazione per memorizzazione impostazioni shortcuts @@ -303,8 +317,8 @@ xmlSettings.WriteStartElement("ShortCuter"); xmlSettings.WriteStartElement("General"); - xmlSettings.WriteElementString("ResetCapsLock", Convert.ToInt16(_general.ResetCapsLock).ToString()); - xmlSettings.WriteElementString("ResetNumLock", Convert.ToInt16(_general.ResetNumLock).ToString()); + xmlSettings.WriteElementString("ForcingCapsLock", _general.ForcingCapsLock.ToString()); + xmlSettings.WriteElementString("ForcingNumLock", _general.ForcingNumLock.ToString()); xmlSettings.WriteEndElement(); xmlSettings.WriteStartElement("Items"); foreach (ShortCut sc in _items) //Iterazione per salvataggio sortcuts @@ -342,10 +356,10 @@ #endregion #region Proprietà - public bool Initialized { get { return this._initialized; } } - public bool GeneralResetCapsLock { get { return this._general.ResetCapsLock; } set { this._general.ResetCapsLock = value; } } - public bool GeneralResetNumLock { get { return this._general.ResetNumLock; } set { this._general.ResetNumLock = value; } } - public BindingList<ShortCut> Items { get { return this._items; } } + public bool Initialized { get { return this._initialized; } } + public LockKeys.LockKeyActions GeneralForcingCapsLock { get { return this._general.ForcingCapsLock; } set { this._general.ForcingCapsLock = value; } } + public LockKeys.LockKeyActions GeneralForcingNumLock { get { return this._general.ForcingNumLock; } set { this._general.ForcingNumLock = value; } } + public BindingList<ShortCut> Items { get { return this._items; } } #endregion } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-01-10 16:19:50
|
Revision: 4720 http://sourceforge.net/p/mp-plugins/code/4720 Author: nicsergio Date: 2014-01-10 16:19:47 +0000 (Fri, 10 Jan 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml 2014-01-09 22:31:12 UTC (rev 4719) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml 2014-01-10 16:19:47 UTC (rev 4720) @@ -13,6 +13,7 @@ <Shift>1</Shift> <Hyperlink>35</Hyperlink> <HyperlinkParameter /> + <Return>0</Return> <SoundEffect>back.wav</SoundEffect> </Item> <Item> @@ -23,6 +24,7 @@ <Shift>1</Shift> <Hyperlink>0</Hyperlink> <HyperlinkParameter /> + <Return>0</Return> <SoundEffect>back.wav</SoundEffect> </Item> <Item> @@ -33,6 +35,7 @@ <Shift>1</Shift> <Hyperlink>1</Hyperlink> <HyperlinkParameter /> + <Return>0</Return> <SoundEffect>click.wav</SoundEffect> </Item> <Item> @@ -43,6 +46,7 @@ <Shift>1</Shift> <Hyperlink>602</Hyperlink> <HyperlinkParameter /> + <Return>0</Return> <SoundEffect>click.wav</SoundEffect> </Item> <Item> @@ -53,6 +57,7 @@ <Shift>1</Shift> <Hyperlink>600</Hyperlink> <HyperlinkParameter /> + <Return>0</Return> <SoundEffect>click.wav</SoundEffect> </Item> <Item> @@ -63,6 +68,7 @@ <Shift>1</Shift> <Hyperlink>7700</Hyperlink> <HyperlinkParameter /> + <Return>0</Return> <SoundEffect>click.wav</SoundEffect> </Item> <Item> @@ -73,6 +79,7 @@ <Shift>1</Shift> <Hyperlink>7701</Hyperlink> <HyperlinkParameter /> + <Return>0</Return> <SoundEffect>click.wav</SoundEffect> </Item> <Item> @@ -83,6 +90,7 @@ <Shift>1</Shift> <Hyperlink>6</Hyperlink> <HyperlinkParameter /> + <Return>0</Return> <SoundEffect>click.wav</SoundEffect> </Item> <Item> @@ -93,6 +101,7 @@ <Shift>1</Shift> <Hyperlink>2005</Hyperlink> <HyperlinkParameter /> + <Return>0</Return> <SoundEffect>click.wav</SoundEffect> </Item> <Item> @@ -103,6 +112,7 @@ <Shift>1</Shift> <Hyperlink>30</Hyperlink> <HyperlinkParameter /> + <Return>0</Return> <SoundEffect>click.wav</SoundEffect> </Item> <Item> @@ -113,6 +123,7 @@ <Shift>1</Shift> <Hyperlink>501</Hyperlink> <HyperlinkParameter /> + <Return>0</Return> <SoundEffect>click.wav</SoundEffect> </Item> <Item> @@ -123,6 +134,7 @@ <Shift>1</Shift> <Hyperlink>2</Hyperlink> <HyperlinkParameter /> + <Return>0</Return> <SoundEffect>click.wav</SoundEffect> </Item> <Item> @@ -133,6 +145,7 @@ <Shift>1</Shift> <Hyperlink>7977</Hyperlink> <HyperlinkParameter /> + <Return>0</Return> <SoundEffect>click.wav</SoundEffect> </Item> <Item> @@ -143,6 +156,7 @@ <Shift>1</Shift> <Hyperlink>9811</Hyperlink> <HyperlinkParameter /> + <Return>0</Return> <SoundEffect>click.wav</SoundEffect> </Item> <Item> @@ -153,6 +167,7 @@ <Shift>1</Shift> <Hyperlink>96742</Hyperlink> <HyperlinkParameter /> + <Return>0</Return> <SoundEffect>click.wav</SoundEffect> </Item> <Item> @@ -163,6 +178,7 @@ <Shift>1</Shift> <Hyperlink>3001</Hyperlink> <HyperlinkParameter /> + <Return>0</Return> <SoundEffect>click.wav</SoundEffect> </Item> </Items> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-01-09 22:31:12 UTC (rev 4719) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-01-10 16:19:47 UTC (rev 4720) @@ -1,4 +1,6 @@ using System; +using System.Collections.Generic; +using System.Linq; using System.Windows.Forms; using MediaPortal.Configuration; using MediaPortal.GUI.Library; @@ -14,6 +16,8 @@ private ShortCuts myShortCuts; //Istanza classe ShortCuts (dati relativi ai shortcuts configurati) private static readonly string LogPrefix; //Prefisso per log eventi private const int TrailersPluginControlID = 11899; //ID controllo per attivazione plugin Trailers + private int lastWindowID; //Id finestra per visualizzazione in MediaPortal + private string lastLoadParameter; //Eventuali parametri di caricamento per visualizzazione (sotto-categorie, ecc.) #endregion #region Costruttore @@ -113,6 +117,13 @@ MpLog(true, "Error going to screen", e); } } + private void GoToPrevious() //Esecuzione azione relativa allo shortcut + { + } + private bool AlreadyAtDestination(ShortCut sc) + { + return false; + } #endregion #region Metodi Pubblici @@ -139,15 +150,38 @@ { if (!ShortCut.ModifierKeys.Contains(e.KeyCode)) //Verifica se il tasto premuto non corrisponde ad un modificatore { - foreach (ShortCut sc in myShortCuts.Items) //Ricerca se la combinazione di tasti corrisponde ad uno shortcut + + /* + -ricerca sc, se nessuno: log + -se almeno 1, verifica ID finestra + - se <> da dest: gotoscreen + - se = a destinazione, verifica se ci sono altri sc + - se nessun sc, se return = false->gotoscreen altrimenti gotoback + - se altri sc --> gotoscreen(next) + */ + List<ShortCut> scList = myShortCuts.Items.ToList().FindAll(x => x.Key == e.KeyCode.ToString() + && x.Ctrl == e.Control + && x.Alt == e.Alt + && x.Shift == e.Shift); + if (scList != null && scList.Count > 0) //Se la combinazione di tasti corrisponde ad almeno uno shortcut { - if (sc.Key == e.KeyCode.ToString() && sc.Ctrl == e.Control && sc.Alt == e.Alt && sc.Shift == e.Shift) + if (scList.Count == 1) { - GoToScreen(sc); //--> esecuzione dell'azione relativa allo shortcut - return; + if (scList[0].Return && AlreadyAtDestination(scList[0])) + GoToPrevious(); + else + GoToScreen(scList[0]); } + else + { + foreach (ShortCut sc in scList) + { + + } + } } - MpLog(false, "Key not mapped: Key=" + (e.Control ? "<CTRL>" : "") + (e.Alt ? "<ALT>" : "") + (e.Shift ? "<SHIFT>" : "") + "<" + e.KeyCode.ToString() + ">"); + else + MpLog(false, "Key not mapped: Key=" + (e.Control ? "<CTRL>" : "") + (e.Alt ? "<ALT>" : "") + (e.Shift ? "<SHIFT>" : "") + "<" + e.KeyCode.ToString() + ">"); } } #endregion Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-01-09 22:31:12 UTC (rev 4719) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-01-10 16:19:47 UTC (rev 4720) @@ -16,11 +16,12 @@ #region Dati private string _caption; //Titolo private string _key; //Tasto (stringa corrispondente a KeyCode) - private bool _ctrl; //Utilizzo del modificatore "Ctrl" - combinazione di tasti - private bool _alt; //Utilizzo del modificatore "Alt" - combinazione di tasti + private bool _ctrl; //Utilizzo del modificatore "Ctrl" - combinazione di tasti + private bool _alt; //Utilizzo del modificatore "Alt" - combinazione di tasti private bool _shift; //Utilizzo del modificatore "Shift" - combinazione di tasti private int _windowID; //Id finestra per visualizzazione in MediaPortal private string _loadParameter; //Eventuali parametri di caricamento per visualizzazione (sotto-categorie, ecc.) + private bool _return; //Ritorno a finestra precedente se si è già a destinazione private string _soundEffect; //File relativo all'eventuale effetto sonoro public static readonly List<Keys> ModifierKeys = new List<Keys>(); //Lista dei tasti modificatori @@ -48,6 +49,7 @@ _shift = true; //--> inizializzazione utilizzo del modificatore "Shift" _windowID = 0; //--> inizializzazione window ID _loadParameter = ""; //--> inizializzazione parametri di caricamento per visualizzazione + _return = false; //--> inizializzazione ritorno a finestra precedente se si è già a destinazione _soundEffect = "click.wav"; //--> inizializzazione effetto sonoro } #endregion @@ -103,6 +105,7 @@ public bool Shift { get { return this._shift; } set { this._shift = value; this.NotifyPropertyChanged("Shift"); } } public int WindowID { get { return this._windowID; } set { this._windowID = value; this.NotifyPropertyChanged("WindowID"); } } public string LoadParameter { get { return this._loadParameter; } set { this._loadParameter = value; this.NotifyPropertyChanged("LoadParameter"); } } + public bool Return { get { return this._return; } set { this._return = value; this.NotifyPropertyChanged("Return"); } } public string SoundEffect { get { return this._soundEffect; } set { this._soundEffect = value; this.NotifyPropertyChanged("SoundEffect"); } } #endregion } @@ -273,6 +276,9 @@ if (innerNode != null) sc.LoadParameter = innerNode.InnerText; } + innerNode = node.SelectSingleNode("Return"); + if (innerNode != null) + sc.Return = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); innerNode = node.SelectSingleNode("SoundEffect"); if (innerNode != null) sc.SoundEffect = innerNode.InnerText; @@ -331,6 +337,7 @@ xmlSettings.WriteElementString("Shift", Convert.ToInt16(sc.Shift).ToString()); xmlSettings.WriteElementString("WindowID", sc.WindowID.ToString()); xmlSettings.WriteElementString("LoadParameter", sc.LoadParameter); + xmlSettings.WriteElementString("Return", Convert.ToInt16(sc.Return).ToString()); xmlSettings.WriteElementString("SoundEffect", sc.SoundEffect); xmlSettings.WriteEndElement(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-01-12 19:08:08
|
Revision: 4722 http://sourceforge.net/p/mp-plugins/code/4722 Author: nicsergio Date: 2014-01-12 19:08:05 +0000 (Sun, 12 Jan 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-01-12 18:53:13 UTC (rev 4721) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-01-12 19:08:05 UTC (rev 4722) @@ -5,7 +5,7 @@ using MediaPortal.Configuration; using MediaPortal.GUI.Library; using MediaPortal.Util; -//using Action = MediaPortal.GUI.Library.Action; +using Action = MediaPortal.GUI.Library.Action; using My.Common; namespace ProcessPlugins.ShortCuter @@ -54,6 +54,9 @@ } else MpLog(true, "Error loading configuration"); + + //GUIWindowManager.OnNewAction += new OnActionHandler(this.OnKeyPress); + //GUIWindowManager.OnActivateWindow += new GUIWindowManager.WindowActivationHandler(GUIWindowManager_OnActivateWindow); } public void Stop() //Terminazione del plugin { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-01-12 18:53:13 UTC (rev 4721) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-01-12 19:08:05 UTC (rev 4722) @@ -6,7 +6,7 @@ <ProductVersion>8.0.30703</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}</ProjectGuid> - <OutputType>Library</OutputType> + <OutputType>WinExe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>ProcessPlugins.ShortCuter</RootNamespace> <AssemblyName>ShortCuter</AssemblyName> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.cs 2014-01-12 18:53:13 UTC (rev 4721) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.cs 2014-01-12 19:08:05 UTC (rev 4722) @@ -119,7 +119,7 @@ returnColumn.HeaderText = "Return"; returnColumn.Width = 50; returnColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - returnColumn.ToolTipText = "If you're already on the window ID, another reminder of the shortcut will display the previous window (load parameter will not be verified)"; + returnColumn.ToolTipText = "If you're already on the window ID, another activation of the shortcut will display the previous window"; DataGridViewComboBoxColumn soundEffectColumn = new DataGridViewComboBoxColumn(); soundEffectColumn.DataPropertyName = "SoundEffect"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-01-13 16:51:05
|
Revision: 4724 http://sourceforge.net/p/mp-plugins/code/4724 Author: nicsergio Date: 2014-01-13 16:51:01 +0000 (Mon, 13 Jan 2014) Log Message: ----------- Added 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 trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.resx Added: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs (rev 0) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs 2014-01-13 16:51:01 UTC (rev 4724) @@ -0,0 +1,485 @@ +namespace ProcessPlugins.ShortCuter +{ + partial class ShortCuterConfig + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + 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(); + this.windowIdGroupBox = new System.Windows.Forms.GroupBox(); + this.windowIdLabel = new System.Windows.Forms.Label(); + this.skinFileGroupBox = new System.Windows.Forms.GroupBox(); + this.skinFileLabel = new System.Windows.Forms.Label(); + this.toolTip = new System.Windows.Forms.ToolTip(this.components); + this.updateButton = new System.Windows.Forms.Button(); + this.resetButton = new System.Windows.Forms.Button(); + this.rowDownButton = new System.Windows.Forms.Button(); + this.rowUpButton = new System.Windows.Forms.Button(); + this.infoPictureBox = new System.Windows.Forms.PictureBox(); + this.rowRemoveButton = new System.Windows.Forms.Button(); + this.rowAddButton = new System.Windows.Forms.Button(); + this.propLeftPictureBox = new System.Windows.Forms.PictureBox(); + this.saveButton = new System.Windows.Forms.Button(); + this.overridesGroupBox = new System.Windows.Forms.GroupBox(); + this.numLockGroupBox = new System.Windows.Forms.GroupBox(); + this.numLockComboBox = new System.Windows.Forms.ComboBox(); + this.capsLockGroupBox = new System.Windows.Forms.GroupBox(); + this.capsLockComboBox = new System.Windows.Forms.ComboBox(); + ((System.ComponentModel.ISupportInitialize)(this.shortCutsDataGridView)).BeginInit(); + this.itemsTabControl.SuspendLayout(); + this.linksTabPage.SuspendLayout(); + this.skinTabPage.SuspendLayout(); + this.linkPropertiesGroupBox.SuspendLayout(); + this.loadParameterGroupBox.SuspendLayout(); + this.windowIdGroupBox.SuspendLayout(); + this.skinFileGroupBox.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.infoPictureBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.propLeftPictureBox)).BeginInit(); + this.overridesGroupBox.SuspendLayout(); + this.numLockGroupBox.SuspendLayout(); + this.capsLockGroupBox.SuspendLayout(); + this.SuspendLayout(); + // + // shortCutsDataGridView + // + this.shortCutsDataGridView.AllowUserToAddRows = false; + this.shortCutsDataGridView.AllowUserToDeleteRows = false; + this.shortCutsDataGridView.AllowUserToResizeRows = false; + this.shortCutsDataGridView.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(220)))), ((int)(((byte)(227))))); + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.shortCutsDataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + this.shortCutsDataGridView.ColumnHeadersHeight = 30; + this.shortCutsDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; + this.shortCutsDataGridView.Location = new System.Drawing.Point(6, 304); + this.shortCutsDataGridView.MultiSelect = false; + this.shortCutsDataGridView.Name = "shortCutsDataGridView"; + this.shortCutsDataGridView.RowHeadersWidth = 20; + this.shortCutsDataGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; + this.shortCutsDataGridView.Size = new System.Drawing.Size(1006, 429); + this.shortCutsDataGridView.TabIndex = 0; + this.shortCutsDataGridView.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.shortCutsDataGridView_CellDoubleClick); + this.shortCutsDataGridView.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.shortCutsDataGridView_CellEndEdit); + this.shortCutsDataGridView.CurrentCellChanged += new System.EventHandler(this.shortCutsDataGridView_CurrentCellChanged); + this.shortCutsDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.shortCutsDataGridView_DataError); + 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); + this.linkPropertiesGroupBox.Controls.Add(this.windowIdGroupBox); + this.linkPropertiesGroupBox.Controls.Add(this.skinFileGroupBox); + this.linkPropertiesGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.linkPropertiesGroupBox.Location = new System.Drawing.Point(602, 30); + this.linkPropertiesGroupBox.Name = "linkPropertiesGroupBox"; + this.linkPropertiesGroupBox.Size = new System.Drawing.Size(320, 175); + this.linkPropertiesGroupBox.TabIndex = 31; + this.linkPropertiesGroupBox.TabStop = false; + this.linkPropertiesGroupBox.Text = "Link Properties"; + // + // loadParameterGroupBox + // + this.loadParameterGroupBox.Controls.Add(this.loadParameterTextBox); + this.loadParameterGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.loadParameterGroupBox.Location = new System.Drawing.Point(4, 103); + this.loadParameterGroupBox.Name = "loadParameterGroupBox"; + this.loadParameterGroupBox.Size = new System.Drawing.Size(312, 68); + this.loadParameterGroupBox.TabIndex = 37; + this.loadParameterGroupBox.TabStop = false; + this.loadParameterGroupBox.Text = "Load Parameter:"; + // + // loadParameterTextBox + // + this.loadParameterTextBox.BackColor = System.Drawing.SystemColors.Control; + this.loadParameterTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.loadParameterTextBox.ForeColor = System.Drawing.Color.Blue; + this.loadParameterTextBox.Location = new System.Drawing.Point(6, 19); + this.loadParameterTextBox.Multiline = true; + this.loadParameterTextBox.Name = "loadParameterTextBox"; + this.loadParameterTextBox.ReadOnly = true; + this.loadParameterTextBox.Size = new System.Drawing.Size(300, 43); + this.loadParameterTextBox.TabIndex = 39; + this.loadParameterTextBox.Text = "-"; + this.loadParameterTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // windowIdGroupBox + // + this.windowIdGroupBox.Controls.Add(this.windowIdLabel); + this.windowIdGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.windowIdGroupBox.Location = new System.Drawing.Point(4, 63); + this.windowIdGroupBox.Name = "windowIdGroupBox"; + this.windowIdGroupBox.Size = new System.Drawing.Size(312, 34); + this.windowIdGroupBox.TabIndex = 36; + this.windowIdGroupBox.TabStop = false; + this.windowIdGroupBox.Text = "Window ID:"; + // + // windowIdLabel + // + this.windowIdLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.windowIdLabel.ForeColor = System.Drawing.Color.Blue; + this.windowIdLabel.Location = new System.Drawing.Point(6, 16); + this.windowIdLabel.Name = "windowIdLabel"; + this.windowIdLabel.Size = new System.Drawing.Size(300, 13); + this.windowIdLabel.TabIndex = 6; + this.windowIdLabel.Text = "-"; + this.windowIdLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // skinFileGroupBox + // + this.skinFileGroupBox.Controls.Add(this.skinFileLabel); + this.skinFileGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.skinFileGroupBox.Location = new System.Drawing.Point(4, 23); + this.skinFileGroupBox.Name = "skinFileGroupBox"; + this.skinFileGroupBox.Size = new System.Drawing.Size(312, 34); + this.skinFileGroupBox.TabIndex = 6; + this.skinFileGroupBox.TabStop = false; + this.skinFileGroupBox.Text = "Skin File:"; + // + // skinFileLabel + // + this.skinFileLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.skinFileLabel.ForeColor = System.Drawing.Color.Blue; + this.skinFileLabel.Location = new System.Drawing.Point(6, 16); + this.skinFileLabel.Name = "skinFileLabel"; + this.skinFileLabel.Size = new System.Drawing.Size(300, 13); + this.skinFileLabel.TabIndex = 2; + this.skinFileLabel.Text = "-"; + this.skinFileLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // toolTip + // + this.toolTip.ShowAlways = true; + // + // updateButton + // + this.updateButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); + this.updateButton.Location = new System.Drawing.Point(67, 84); + this.updateButton.Name = "updateButton"; + this.updateButton.Size = new System.Drawing.Size(135, 38); + this.updateButton.TabIndex = 32; + this.updateButton.Text = "Save and Close"; + this.updateButton.UseVisualStyleBackColor = false; + this.updateButton.Click += new System.EventHandler(this.updateButton_Click); + // + // resetButton + // + this.resetButton.Location = new System.Drawing.Point(67, 8); + this.resetButton.Name = "resetButton"; + this.resetButton.Size = new System.Drawing.Size(133, 23); + this.resetButton.TabIndex = 33; + this.resetButton.Text = "Reset Configuration"; + this.resetButton.UseVisualStyleBackColor = true; + this.resetButton.Click += new System.EventHandler(this.resetButton_Click); + // + // rowDownButton + // + this.rowDownButton.AutoSize = true; + this.rowDownButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.rowDownButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowDown; + this.rowDownButton.Location = new System.Drawing.Point(221, 264); + this.rowDownButton.Name = "rowDownButton"; + this.rowDownButton.Size = new System.Drawing.Size(38, 38); + this.rowDownButton.TabIndex = 35; + this.rowDownButton.UseVisualStyleBackColor = true; + this.rowDownButton.Click += new System.EventHandler(this.rowDownButton_Click); + // + // rowUpButton + // + this.rowUpButton.AutoSize = true; + this.rowUpButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.rowUpButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowUp; + this.rowUpButton.Location = new System.Drawing.Point(177, 264); + this.rowUpButton.Name = "rowUpButton"; + this.rowUpButton.Size = new System.Drawing.Size(38, 38); + this.rowUpButton.TabIndex = 34; + this.rowUpButton.UseVisualStyleBackColor = true; + this.rowUpButton.Click += new System.EventHandler(this.rowUpButton_Click); + // + // infoPictureBox + // + this.infoPictureBox.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.Info; + this.infoPictureBox.Location = new System.Drawing.Point(990, 5); + this.infoPictureBox.Name = "infoPictureBox"; + this.infoPictureBox.Size = new System.Drawing.Size(24, 24); + this.infoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.infoPictureBox.TabIndex = 30; + this.infoPictureBox.TabStop = false; + this.infoPictureBox.Click += new System.EventHandler(this.infoPictureBox_Click); + // + // rowRemoveButton + // + this.rowRemoveButton.AutoSize = true; + this.rowRemoveButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.rowRemoveButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowRemove; + this.rowRemoveButton.Location = new System.Drawing.Point(50, 264); + this.rowRemoveButton.Name = "rowRemoveButton"; + this.rowRemoveButton.Size = new System.Drawing.Size(38, 38); + this.rowRemoveButton.TabIndex = 26; + this.rowRemoveButton.UseVisualStyleBackColor = true; + this.rowRemoveButton.Click += new System.EventHandler(this.rowRemoveButton_Click); + // + // rowAddButton + // + this.rowAddButton.AutoSize = true; + this.rowAddButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.rowAddButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowAdd; + this.rowAddButton.Location = new System.Drawing.Point(6, 264); + this.rowAddButton.Name = "rowAddButton"; + this.rowAddButton.Size = new System.Drawing.Size(38, 38); + this.rowAddButton.TabIndex = 25; + this.rowAddButton.UseVisualStyleBackColor = true; + this.rowAddButton.Click += new System.EventHandler(this.rowAddButton_Click); + // + // propLeftPictureBox + // + this.propLeftPictureBox.Enabled = false; + this.propLeftPictureBox.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.ArrowDown; + this.propLeftPictureBox.Location = new System.Drawing.Point(360, 257); + this.propLeftPictureBox.Name = "propLeftPictureBox"; + this.propLeftPictureBox.Size = new System.Drawing.Size(131, 56); + this.propLeftPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.propLeftPictureBox.TabIndex = 23; + this.propLeftPictureBox.TabStop = false; + this.propLeftPictureBox.Visible = false; + // + // saveButton + // + this.saveButton.Location = new System.Drawing.Point(67, 35); + this.saveButton.Name = "saveButton"; + this.saveButton.Size = new System.Drawing.Size(133, 23); + this.saveButton.TabIndex = 36; + this.saveButton.Text = "Save Configuration"; + this.saveButton.UseVisualStyleBackColor = true; + this.saveButton.Click += new System.EventHandler(this.saveButton_Click); + // + // overridesGroupBox + // + this.overridesGroupBox.Controls.Add(this.numLockGroupBox); + this.overridesGroupBox.Controls.Add(this.capsLockGroupBox); + this.overridesGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.overridesGroupBox.Location = new System.Drawing.Point(50, 133); + this.overridesGroupBox.Name = "overridesGroupBox"; + this.overridesGroupBox.Size = new System.Drawing.Size(165, 111); + this.overridesGroupBox.TabIndex = 37; + this.overridesGroupBox.TabStop = false; + this.overridesGroupBox.Text = "Overrides at Start-Up"; + // + // numLockGroupBox + // + this.numLockGroupBox.Controls.Add(this.numLockComboBox); + this.numLockGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.numLockGroupBox.Location = new System.Drawing.Point(6, 63); + this.numLockGroupBox.Name = "numLockGroupBox"; + this.numLockGroupBox.Size = new System.Drawing.Size(152, 42); + this.numLockGroupBox.TabIndex = 38; + this.numLockGroupBox.TabStop = false; + this.numLockGroupBox.Text = "Num-Lock Forcing:"; + // + // numLockComboBox + // + this.numLockComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.numLockComboBox.FormattingEnabled = true; + this.numLockComboBox.Location = new System.Drawing.Point(9, 15); + this.numLockComboBox.Name = "numLockComboBox"; + this.numLockComboBox.Size = new System.Drawing.Size(133, 21); + this.numLockComboBox.TabIndex = 1; + // + // capsLockGroupBox + // + this.capsLockGroupBox.Controls.Add(this.capsLockComboBox); + this.capsLockGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.capsLockGroupBox.Location = new System.Drawing.Point(6, 15); + this.capsLockGroupBox.Name = "capsLockGroupBox"; + this.capsLockGroupBox.Size = new System.Drawing.Size(152, 42); + this.capsLockGroupBox.TabIndex = 37; + this.capsLockGroupBox.TabStop = false; + this.capsLockGroupBox.Text = "Caps-Lock Forcing:"; + // + // capsLockComboBox + // + this.capsLockComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.capsLockComboBox.FormattingEnabled = true; + this.capsLockComboBox.Location = new System.Drawing.Point(9, 15); + this.capsLockComboBox.Name = "capsLockComboBox"; + this.capsLockComboBox.Size = new System.Drawing.Size(133, 21); + this.capsLockComboBox.TabIndex = 0; + // + // 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.overridesGroupBox); + this.Controls.Add(this.saveButton); + this.Controls.Add(this.rowDownButton); + this.Controls.Add(this.linkPropertiesGroupBox); + this.Controls.Add(this.rowUpButton); + this.Controls.Add(this.resetButton); + this.Controls.Add(this.updateButton); + 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; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.Name = "ShortCuterConfig"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "ShortCut\'er Plugin Configuration"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ShortCuterConfig_FormClosing); + 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(); + this.windowIdGroupBox.ResumeLayout(false); + this.skinFileGroupBox.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.infoPictureBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.propLeftPictureBox)).EndInit(); + this.overridesGroupBox.ResumeLayout(false); + this.numLockGroupBox.ResumeLayout(false); + this.capsLockGroupBox.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #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; + private System.Windows.Forms.PictureBox infoPictureBox; + private System.Windows.Forms.GroupBox linkPropertiesGroupBox; + private System.Windows.Forms.ToolTip toolTip; + private System.Windows.Forms.Button updateButton; + private System.Windows.Forms.Button resetButton; + private System.Windows.Forms.Button rowDownButton; + private System.Windows.Forms.Button rowUpButton; + private System.Windows.Forms.GroupBox windowIdGroupBox; + private System.Windows.Forms.Label windowIdLabel; + 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; + private System.Windows.Forms.GroupBox capsLockGroupBox; + private System.Windows.Forms.GroupBox numLockGroupBox; + private System.Windows.Forms.ComboBox capsLockComboBox; + private System.Windows.Forms.ComboBox numLockComboBox; + + } +} \ No newline at end of file Added: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs (rev 0) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-01-13 16:51:01 UTC (rev 4724) @@ -0,0 +1,511 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; +using MediaPortal.Configuration; +using MediaPortal.GUI.Library; +using MediaPortal.Profile; +using My.Common; + +namespace ProcessPlugins.ShortCuter +{ + [PluginIcons("ProcessPlugins.ShortCuter.Resources.Images.ShortCuterEnable.png", "ProcessPlugins.ShortCuter.Resources.Images.ShortCuterDisable.png")] + public partial class ShortCuterConfig : Form, ISetupForm //Form per la configurazione del plugin, con implementazione interfaccia ISetupForm (per lancio da configurazione MediaPortal) + { + #region Dati + private Skin mySkin; //Istanza classe Skin (dati relativi alla skin di MediaPortal) + private ShortCuts myShortCuts; //Istanza classe ShortCuts (dati relativi ai shortcuts configurati) + private bool unsavedChanges; //Presenza modifiche da salvare + private bool forceCell; //Azione di forzatura valore cella WindowID dello shortcut + #endregion + + #region Costruttore + public ShortCuterConfig() + { + InitializeComponent(); + } + #endregion + + #region Metodi Privati + private void InitializeGUI() //Inizializzazione interfaccia + { + skinFilesListBox.DataSource = mySkin.SkinFiles; + skinFilesListBox.SelectedIndex = -1; + mySkin.FillTreeViewSkinLinks(skinLinksTreeView); + skinLinksTreeView.CollapseAll(); + FormatShortCutsGrid(); + + capsLockComboBox.DataSource = Enum.GetNames(typeof(LockKeys.LockKeyActions)); + capsLockComboBox.SelectedItem = Enum.GetName(typeof(LockKeys.LockKeyActions), myShortCuts.GeneralForcingCapsLock); + 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(rowAddButton, "Add shortcut to list"); + toolTip.SetToolTip(rowRemoveButton, "Remove selected shortcut from list"); + toolTip.SetToolTip(rowUpButton, "Move up selected shortcut in list"); + toolTip.SetToolTip(rowDownButton, "Move down selected shortcut in list"); + toolTip.SetToolTip(resetButton, "Reset actual settings and load the default configuration"); + toolTip.SetToolTip(saveButton, "Save actual settings"); + toolTip.SetToolTip(updateButton, "Save actual setting and close the application"); + toolTip.SetToolTip(capsLockComboBox, "Set forcing for Caps-Lock when Mediaportal starts (OFF is recommended)"); + toolTip.SetToolTip(numLockComboBox, "Set forcing for Num-Lock when Mediaportal starts"); + toolTip.SetToolTip(infoPictureBox, "Version information"); + + unsavedChanges = false; //--> necessario a fine aggiornamento controlli grafici + } + private void FormatShortCutsGrid() //Formattazione (e popolazione) tabella shortcuts + { + shortCutsDataGridView.AutoGenerateColumns = false; + + DataGridViewTextBoxColumn captionColumn = new DataGridViewTextBoxColumn(); + captionColumn.DataPropertyName = "Caption"; + captionColumn.HeaderText = "Caption"; + captionColumn.Width = 155; + captionColumn.MaxInputLength = 32; + captionColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + captionColumn.DefaultCellStyle.Font = new Font("Microsoft Sans Serif", 8, FontStyle.Bold); + captionColumn.ToolTipText = "Shortcut's title"; + + DataGridViewTextBoxColumn keyColumn = new DataGridViewTextBoxColumn(); + keyColumn.DataPropertyName = "Key"; + keyColumn.HeaderText = "Key [KeyCode]"; + keyColumn.Width = 120; + keyColumn.MaxInputLength = 24; + keyColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + keyColumn.DefaultCellStyle.Font = new Font("Microsoft Sans Serif", 8, FontStyle.Bold); + keyColumn.DefaultCellStyle.BackColor = Color.Yellow; + keyColumn.ReadOnly = true; + keyColumn.ToolTipText = "Key assigned to the shortcut"; + + DataGridViewCheckBoxColumn ctrlColumn = new DataGridViewCheckBoxColumn(); + ctrlColumn.DataPropertyName = "Ctrl"; + ctrlColumn.HeaderText = "Ctrl"; + ctrlColumn.Width = 30; + ctrlColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + ctrlColumn.DefaultCellStyle.BackColor = Color.LightCyan; + ctrlColumn.ToolTipText = "Use CTRL modifier + Key assigned"; + + DataGridViewCheckBoxColumn altColumn = new DataGridViewCheckBoxColumn(); + altColumn.DataPropertyName = "Alt"; + altColumn.HeaderText = "Alt"; + altColumn.Width = 30; + altColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + altColumn.DefaultCellStyle.BackColor = Color.LightCyan; + altColumn.ToolTipText = "Use ALT modifier + Key assigned"; + + DataGridViewCheckBoxColumn shiftColumn = new DataGridViewCheckBoxColumn(); + shiftColumn.DataPropertyName = "Shift"; + shiftColumn.HeaderText = "Shift"; + shiftColumn.Width = 30; + shiftColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + shiftColumn.DefaultCellStyle.BackColor = Color.LightCyan; + shiftColumn.ToolTipText = "Use SHIFT modifier + Key assigned"; + + DataGridViewTextBoxColumn windowIdColumn = new DataGridViewTextBoxColumn(); + windowIdColumn.DataPropertyName = "WindowID"; + windowIdColumn.HeaderText = "Window ID"; + windowIdColumn.Width = 70; + windowIdColumn.MaxInputLength = 10; + windowIdColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + windowIdColumn.ToolTipText = "MediaPorta window ID for the shortcut's destination"; + + DataGridViewTextBoxColumn loadParameterColumn = new DataGridViewTextBoxColumn(); + loadParameterColumn.DataPropertyName = "LoadParameter"; + loadParameterColumn.HeaderText = "Load Parameter"; + loadParameterColumn.Width = 358; + loadParameterColumn.MaxInputLength = 300; + loadParameterColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + loadParameterColumn.ToolTipText = "Any parameter for load window (see destination plugin's documentation)"; + + DataGridViewCheckBoxColumn returnColumn = new DataGridViewCheckBoxColumn(); + returnColumn.DataPropertyName = "Return"; + returnColumn.HeaderText = "Return"; + returnColumn.Width = 50; + returnColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + returnColumn.ToolTipText = "If you're already on the window ID, another activation of the shortcut will display the previous window"; + + DataGridViewComboBoxColumn soundEffectColumn = new DataGridViewComboBoxColumn(); + soundEffectColumn.DataPropertyName = "SoundEffect"; + soundEffectColumn.HeaderText = "Sound Effect"; + soundEffectColumn.Width = 140; + soundEffectColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + soundEffectColumn.FlatStyle = FlatStyle.Flat; //--> necessario con Win7 per aggiornare il colore di sfondo se selezionato + soundEffectColumn.DataSource = mySkin.SkinSounds; + soundEffectColumn.ToolTipText = "Sound effect played on the shortcut"; + + shortCutsDataGridView.Columns.Add(captionColumn); + shortCutsDataGridView.Columns.Add(keyColumn); + shortCutsDataGridView.Columns.Add(ctrlColumn); + shortCutsDataGridView.Columns.Add(altColumn); + shortCutsDataGridView.Columns.Add(shiftColumn); + shortCutsDataGridView.Columns.Add(windowIdColumn); + shortCutsDataGridView.Columns.Add(loadParameterColumn); + shortCutsDataGridView.Columns.Add(returnColumn); + shortCutsDataGridView.Columns.Add(soundEffectColumn); + + shortCutsDataGridView.DataSource = myShortCuts.Items; + } + private void ShowLinkProperties(object listControl) //Visualizzazione proprietà link + { + Control itemsList = (Control)listControl; //Casting sender -> Control + int selectedIndex; //Indice eventuale elemento selezionato + + if (itemsList is ListBox) + { + 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) + { + case "skinFilesListBox": //Lista files della skin + skinFileLabel.Text = mySkin.SkinFiles[selectedIndex].Name; + windowIdLabel.Text = mySkin.SkinFiles[selectedIndex].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; + break; + } + } + } + private void ShowLinkItem() //Visualizzazione link corrispondente allo shortcut + { + if (shortCutsDataGridView.CurrentCell != null) + { + 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) + { + string loadParameter = Convert.ToString(shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[6].Value); + showIndex = mySkin.SkinLinks.FindIndex(x => x.WindowID == windowID && x.LoadParameter == loadParameter); + mySkin.SetSkinLinkIndex(skinLinksTreeView, showIndex); //--> selezione eventuale link corrispondente a WindowID & LoadParameter + } + else + { + showIndex = mySkin.SkinFiles.FindLastIndex(x => x.Id == windowID); + skinFilesListBox.SelectedIndex = showIndex; //--> selezione eventuale file corrispondente a WindowID + } + } + } + } + private void MoveItemList(bool dirUp) //Spostamento shortcut + { + if (shortCutsDataGridView.CurrentCell != null) + { + forceCell = true; + int index = shortCutsDataGridView.CurrentRow.Index; + shortCutsDataGridView.CurrentCell = shortCutsDataGridView[0, index]; //Importante cambiare la colonna prima di muovere la riga se posizionati su KeyCode (Hook attivo) + ShortCut sc = myShortCuts.Items[index]; + myShortCuts.Items.RemoveAt(index); + if (dirUp) + index--; + else + index++; + myShortCuts.Items.Insert(index, sc); + shortCutsDataGridView.CurrentCell = shortCutsDataGridView[0, index]; + shortCutsDataGridView.Rows[index].Selected = true; + shortCutsDataGridView.Focus(); + forceCell = false; + } + } + private void MoveItemsListButtonsEnable() //Abilitazione/disabilitazione pulsanti di spostamento shortcuts + { + if (shortCutsDataGridView.CurrentCell != null) + { + rowUpButton.Enabled = (shortCutsDataGridView.CurrentRow.Index > 0); + rowDownButton.Enabled = (shortCutsDataGridView.CurrentRow.Index < myShortCuts.Items.Count - 1); + } + else + { + rowUpButton.Enabled = false; + rowDownButton.Enabled = false; + } + } + private bool Save() //Salvataggio configurazione plugin + { + myShortCuts.GeneralForcingCapsLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), capsLockComboBox.SelectedItem.ToString()); + myShortCuts.GeneralForcingNumLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), numLockComboBox.SelectedItem.ToString()); + return myShortCuts.SaveConfig(); + } + #endregion + + #region Consumazione Eventi + #region Eventi Form + private void ShortCuterConfig_Load(object sender, EventArgs e) + { + using (Settings confReader = new MPSettings()) + { + //Raccolta dati relativi alla skin + mySkin = new Skin(confReader.GetValueAsString("skin", "name", "DefaultWide"), Config.GetFolder(Config.Dir.Skin) + @"\", Config.GetFolder(Config.Dir.Cache) + @"\"); + } + if (mySkin.Initialized) + { + string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml"); + //Lettura impostazioni e gestione shorcuts + myShortCuts = new ShortCuts(settingsFile, true); + if (myShortCuts.Initialized) + { + //Sottoscrizione evento di modifica lista shortcuts + myShortCuts.Items.ListChanged += new ListChangedEventHandler(myShortCutsItems_ListChanged); + + //Inizializzazione interfaccia grafica + InitializeGUI(); + } + } + //Se inizializzazione classi non completata + if (!mySkin.Initialized || !myShortCuts.Initialized) + { + this.Close(); + this.Dispose(); + } + } + private void ShortCuterConfig_Shown(object sender, EventArgs e) + { + shortCutsDataGridView.Focus(); + } + private void ShortCuterConfig_FormClosing(object sender, FormClosingEventArgs e) + { + //Se presenti modifiche non salvate: richiesta conferma per chiusura applicazione + if (unsavedChanges && !Tools.QuestionMessage("Unsaved changes will be lost...\nDo you want to proceed?")) + e.Cancel = true; //--> annullamento chiusura form + } + #endregion + #region Eventi Modifica Griglia + private void shortCutsDataGridView_Enter(object sender, EventArgs e) + { + propLeftPictureBox.Visible = true; //--> il link è collegato allo shortcut selezionato + ShowLinkItem(); + MoveItemsListButtonsEnable(); + } + private void shortCutsDataGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) + { + e.Control.KeyPress -= idTextBox_KeyPress; + + if (e.Control is TextBox && ((DataGridView)(sender)).CurrentCell.ColumnIndex == 5) + e.Control.KeyPress += new KeyPressEventHandler(idTextBox_KeyPress); //--> sottoscrizione evento KeyPress per la cella WindowID + } + void idTextBox_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(char.IsDigit(e.KeyChar))) //Filtro per input numerico per la cella WindowID + { + Keys key = (Keys)e.KeyChar; + if (!(key == Keys.Back || key == Keys.Delete)) + { + e.Handled = true; //--> carattere inputato da ignorare + } + } + } + private void shortCutsDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) + { + //Eventuale visualizzazione form per assegnazione key allo shortcut corrente + if (shortCutsDataGridView.CurrentCell != null && shortCutsDataGridView.CurrentCell.ColumnIndex == 1) + new ShortCuterKeyConfig(myShortCuts.Items[shortCutsDataGridView.CurrentCell.RowIndex], + new Point(Location.X + shortCutsDataGridView.Location.X + 305, + Location.Y + shortCutsDataGridView.Location.Y + shortCutsDataGridView.CurrentRow.Height * shortCutsDataGridView.CurrentCell.RowIndex) + ).ShowDialog(); + } + private void shortCutsDataGridView_CellEndEdit(object sender, DataGridViewCellEventArgs e) + { + ShowLinkItem(); + } + private void shortCutsDataGridView_CurrentCellChanged(object sender, EventArgs e) + { + ShowLinkItem(); + MoveItemsListButtonsEnable(); + } + private void shortCutsDataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e) + { + //Gestione evento per evitare messaggi di errore (esempio se file effetto sonoro non disponibile nella skin) + } + #endregion + #region Eventi Modifica Impostazioni Plugin & Shortcuts + private void myShortCutsItems_ListChanged(object sender, EventArgs e) + { + unsavedChanges = true; + rowRemoveButton.Enabled = (myShortCuts.Items.Count > 0); + MoveItemsListButtonsEnable(); + } + private void rowAddButton_Click(object sender, EventArgs e) + { + ShortCut sc = new ShortCut(); + myShortCuts.Items.Add(sc); + shortCutsDataGridView.CurrentCell = shortCutsDataGridView[0, shortCutsDataGridView.RowCount - 1]; + shortCutsDataGridView.Rows[shortCutsDataGridView.RowCount - 1].Selected = true; + } + private void rowRemoveButton_Click(object sender, EventArgs e) + { + if (myShortCuts.Items.Count > 0) + { + myShortCuts.Items.RemoveAt(shortCutsDataGridView.CurrentRow.Index); + if (shortCutsDataGridView.RowCount > 0) + shortCutsDataGridView.CurrentCell = shortCutsDataGridView[0, 0]; + } + } + private void rowUpButton_Click(object sender, EventArgs e) + { + MoveItemList(true); + } + private void rowDownButton_Click(object sender, EventArgs e) + { + MoveItemList(false); + } + private void resetCapsLockCheckBox_CheckedChanged(object sender, EventArgs e) + { + unsavedChanges = true; + } + private void resetNumLockCheckBox_CheckedChanged(object sender, EventArgs e) + { + unsavedChanges = true; + } + #endregion + #region Eventi Liste Files & Links Skin + private void itemsTabControl_SelectedIndexChanged(object sender, EventArgs e) + { + 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); + } + private void skinFilesListBox_DoubleClick(object sender, EventArgs e) + { + 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; + } + } + private void skinLinksTreeView_AfterSelect(object sender, TreeViewEventArgs e) + { + 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) + { + 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; + forceCell = true; + shortCutsDataGridView.CurrentCell = shortCutsDataGridView[5, shortCutsDataGridView.CurrentRow.Index]; + forceCell = false; + } + } + #endregion + private void saveButton_Click(object sender, EventArgs e) + { + if (Save()) + unsavedChanges = false; + } + private void updateButton_Click(object sender, EventArgs e) + { + if (Save()) + { + unsavedChanges = false; + this.Close(); + this.Dispose(); + } + } + private void resetButton_Click(object sender, EventArgs e) + { + if (Tools.QuestionMessage("Configuration data will be overwritten...\nDo you want to proceed?")) + { + myShortCuts.LoadConfig(true); + } + } + private void infoPictureBox_Click(object sender, EventArgs e) + { + VersionInfo.ShowInfo(ProcessPlugins.ShortCuter.Properties.Resources.ShortCuter, "...a big thank to MoPath for old version of this plugin!", + "http://forum.team-mediaportal.com/threads/shortcuter-plugin-v2.121721/", + "http://wiki.team-mediaportal.com/1_MEDIAPORTAL_1/17_Extensions/3_Plugins/ShortCut'er"); + } + #endregion + + #region Implementazione ISetupForm + public string PluginName() + { + return Tools.MyAssembly.Title; + } + public string Description() + { + return Tools.MyAssembly.Description; + } + public string Author() + { + return Tools.MyAssembly.Author; + } + public void ShowPlugin() + { + new ShortCuterConfig().ShowDialog(); + } + public bool CanEnable() + { + return true; + } + public int GetWindowId() + { + return -1; + } + public bool DefaultEnabled() + { + return false; + } + public bool HasSetup() + { + return true; + } + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = String.Empty; + strButtonImage = String.Empty; + strButtonImageFocus = String.Empty; + strPictureImage = String.Empty; + return false; + } + #endregion + } +} Added: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.resx =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.resx (rev 0) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.resx 2014-01-13 16:51:01 UTC (rev 4724) @@ -0,0 +1,287 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class tha... [truncated message content] |
From: <nic...@us...> - 2014-01-13 16:51:28
|
Revision: 4725 http://sourceforge.net/p/mp-plugins/code/4725 Author: nicsergio Date: 2014-01-13 16:51:24 +0000 (Mon, 13 Jan 2014) Log Message: ----------- Removed Paths: ------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.resx Deleted: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.Designer.cs 2014-01-13 16:51:01 UTC (rev 4724) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.Designer.cs 2014-01-13 16:51:24 UTC (rev 4725) @@ -1,484 +0,0 @@ -namespace ProcessPlugins.ShortCuter -{ - partial class ShortCuterForm - { - /// <summary> - /// Required designer variable. - /// </summary> - private System.ComponentModel.IContainer components = null; - - /// <summary> - /// Clean up any resources being used. - /// </summary> - /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// <summary> - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// </summary> - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShortCuterForm)); - 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(); - this.windowIdGroupBox = new System.Windows.Forms.GroupBox(); - this.windowIdLabel = new System.Windows.Forms.Label(); - this.skinFileGroupBox = new System.Windows.Forms.GroupBox(); - this.skinFileLabel = new System.Windows.Forms.Label(); - this.toolTip = new System.Windows.Forms.ToolTip(this.components); - this.updateButton = new System.Windows.Forms.Button(); - this.resetButton = new System.Windows.Forms.Button(); - this.rowDownButton = new System.Windows.Forms.Button(); - this.rowUpButton = new System.Windows.Forms.Button(); - this.infoPictureBox = new System.Windows.Forms.PictureBox(); - this.rowRemoveButton = new System.Windows.Forms.Button(); - this.rowAddButton = new System.Windows.Forms.Button(); - this.propLeftPictureBox = new System.Windows.Forms.PictureBox(); - this.saveButton = new System.Windows.Forms.Button(); - this.overridesGroupBox = new System.Windows.Forms.GroupBox(); - this.numLockGroupBox = new System.Windows.Forms.GroupBox(); - this.numLockComboBox = new System.Windows.Forms.ComboBox(); - this.capsLockGroupBox = new System.Windows.Forms.GroupBox(); - this.capsLockComboBox = new System.Windows.Forms.ComboBox(); - ((System.ComponentModel.ISupportInitialize)(this.shortCutsDataGridView)).BeginInit(); - this.itemsTabControl.SuspendLayout(); - this.linksTabPage.SuspendLayout(); - this.skinTabPage.SuspendLayout(); - this.linkPropertiesGroupBox.SuspendLayout(); - this.loadParameterGroupBox.SuspendLayout(); - this.windowIdGroupBox.SuspendLayout(); - this.skinFileGroupBox.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.infoPictureBox)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.propLeftPictureBox)).BeginInit(); - this.overridesGroupBox.SuspendLayout(); - this.numLockGroupBox.SuspendLayout(); - this.capsLockGroupBox.SuspendLayout(); - this.SuspendLayout(); - // - // shortCutsDataGridView - // - this.shortCutsDataGridView.AllowUserToAddRows = false; - this.shortCutsDataGridView.AllowUserToDeleteRows = false; - this.shortCutsDataGridView.AllowUserToResizeRows = false; - this.shortCutsDataGridView.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(220)))), ((int)(((byte)(227))))); - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.shortCutsDataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; - this.shortCutsDataGridView.ColumnHeadersHeight = 30; - this.shortCutsDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - this.shortCutsDataGridView.Location = new System.Drawing.Point(6, 304); - this.shortCutsDataGridView.MultiSelect = false; - this.shortCutsDataGridView.Name = "shortCutsDataGridView"; - this.shortCutsDataGridView.RowHeadersWidth = 20; - this.shortCutsDataGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; - this.shortCutsDataGridView.Size = new System.Drawing.Size(1006, 429); - this.shortCutsDataGridView.TabIndex = 0; - this.shortCutsDataGridView.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.shortCutsDataGridView_CellEndEdit); - this.shortCutsDataGridView.CurrentCellChanged += new System.EventHandler(this.shortCutsDataGridView_CurrentCellChanged); - this.shortCutsDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.shortCutsDataGridView_DataError); - 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); - this.linkPropertiesGroupBox.Controls.Add(this.windowIdGroupBox); - this.linkPropertiesGroupBox.Controls.Add(this.skinFileGroupBox); - this.linkPropertiesGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.linkPropertiesGroupBox.Location = new System.Drawing.Point(602, 30); - this.linkPropertiesGroupBox.Name = "linkPropertiesGroupBox"; - this.linkPropertiesGroupBox.Size = new System.Drawing.Size(320, 175); - this.linkPropertiesGroupBox.TabIndex = 31; - this.linkPropertiesGroupBox.TabStop = false; - this.linkPropertiesGroupBox.Text = "Link Properties"; - // - // loadParameterGroupBox - // - this.loadParameterGroupBox.Controls.Add(this.loadParameterTextBox); - this.loadParameterGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.loadParameterGroupBox.Location = new System.Drawing.Point(4, 103); - this.loadParameterGroupBox.Name = "loadParameterGroupBox"; - this.loadParameterGroupBox.Size = new System.Drawing.Size(312, 68); - this.loadParameterGroupBox.TabIndex = 37; - this.loadParameterGroupBox.TabStop = false; - this.loadParameterGroupBox.Text = "Load Parameter:"; - // - // loadParameterTextBox - // - this.loadParameterTextBox.BackColor = System.Drawing.SystemColors.Control; - this.loadParameterTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.loadParameterTextBox.ForeColor = System.Drawing.Color.Blue; - this.loadParameterTextBox.Location = new System.Drawing.Point(6, 19); - this.loadParameterTextBox.Multiline = true; - this.loadParameterTextBox.Name = "loadParameterTextBox"; - this.loadParameterTextBox.ReadOnly = true; - this.loadParameterTextBox.Size = new System.Drawing.Size(300, 43); - this.loadParameterTextBox.TabIndex = 39; - this.loadParameterTextBox.Text = "-"; - this.loadParameterTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // windowIdGroupBox - // - this.windowIdGroupBox.Controls.Add(this.windowIdLabel); - this.windowIdGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.windowIdGroupBox.Location = new System.Drawing.Point(4, 63); - this.windowIdGroupBox.Name = "windowIdGroupBox"; - this.windowIdGroupBox.Size = new System.Drawing.Size(312, 34); - this.windowIdGroupBox.TabIndex = 36; - this.windowIdGroupBox.TabStop = false; - this.windowIdGroupBox.Text = "Window ID:"; - // - // windowIdLabel - // - this.windowIdLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.windowIdLabel.ForeColor = System.Drawing.Color.Blue; - this.windowIdLabel.Location = new System.Drawing.Point(6, 16); - this.windowIdLabel.Name = "windowIdLabel"; - this.windowIdLabel.Size = new System.Drawing.Size(300, 13); - this.windowIdLabel.TabIndex = 6; - this.windowIdLabel.Text = "-"; - this.windowIdLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // skinFileGroupBox - // - this.skinFileGroupBox.Controls.Add(this.skinFileLabel); - this.skinFileGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.skinFileGroupBox.Location = new System.Drawing.Point(4, 23); - this.skinFileGroupBox.Name = "skinFileGroupBox"; - this.skinFileGroupBox.Size = new System.Drawing.Size(312, 34); - this.skinFileGroupBox.TabIndex = 6; - this.skinFileGroupBox.TabStop = false; - this.skinFileGroupBox.Text = "Skin File:"; - // - // skinFileLabel - // - this.skinFileLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.skinFileLabel.ForeColor = System.Drawing.Color.Blue; - this.skinFileLabel.Location = new System.Drawing.Point(6, 16); - this.skinFileLabel.Name = "skinFileLabel"; - this.skinFileLabel.Size = new System.Drawing.Size(300, 13); - this.skinFileLabel.TabIndex = 2; - this.skinFileLabel.Text = "-"; - this.skinFileLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // toolTip - // - this.toolTip.ShowAlways = true; - // - // updateButton - // - this.updateButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); - this.updateButton.Location = new System.Drawing.Point(67, 84); - this.updateButton.Name = "updateButton"; - this.updateButton.Size = new System.Drawing.Size(135, 38); - this.updateButton.TabIndex = 32; - this.updateButton.Text = "Save and Close"; - this.updateButton.UseVisualStyleBackColor = false; - this.updateButton.Click += new System.EventHandler(this.updateButton_Click); - // - // resetButton - // - this.resetButton.Location = new System.Drawing.Point(67, 8); - this.resetButton.Name = "resetButton"; - this.resetButton.Size = new System.Drawing.Size(133, 23); - this.resetButton.TabIndex = 33; - this.resetButton.Text = "Reset Configuration"; - this.resetButton.UseVisualStyleBackColor = true; - this.resetButton.Click += new System.EventHandler(this.resetButton_Click); - // - // rowDownButton - // - this.rowDownButton.AutoSize = true; - this.rowDownButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.rowDownButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowDown; - this.rowDownButton.Location = new System.Drawing.Point(221, 264); - this.rowDownButton.Name = "rowDownButton"; - this.rowDownButton.Size = new System.Drawing.Size(38, 38); - this.rowDownButton.TabIndex = 35; - this.rowDownButton.UseVisualStyleBackColor = true; - this.rowDownButton.Click += new System.EventHandler(this.rowDownButton_Click); - // - // rowUpButton - // - this.rowUpButton.AutoSize = true; - this.rowUpButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.rowUpButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowUp; - this.rowUpButton.Location = new System.Drawing.Point(177, 264); - this.rowUpButton.Name = "rowUpButton"; - this.rowUpButton.Size = new System.Drawing.Size(38, 38); - this.rowUpButton.TabIndex = 34; - this.rowUpButton.UseVisualStyleBackColor = true; - this.rowUpButton.Click += new System.EventHandler(this.rowUpButton_Click); - // - // infoPictureBox - // - this.infoPictureBox.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.Info; - this.infoPictureBox.Location = new System.Drawing.Point(990, 5); - this.infoPictureBox.Name = "infoPictureBox"; - this.infoPictureBox.Size = new System.Drawing.Size(24, 24); - this.infoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.infoPictureBox.TabIndex = 30; - this.infoPictureBox.TabStop = false; - this.infoPictureBox.Click += new System.EventHandler(this.infoPictureBox_Click); - // - // rowRemoveButton - // - this.rowRemoveButton.AutoSize = true; - this.rowRemoveButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.rowRemoveButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowRemove; - this.rowRemoveButton.Location = new System.Drawing.Point(50, 264); - this.rowRemoveButton.Name = "rowRemoveButton"; - this.rowRemoveButton.Size = new System.Drawing.Size(38, 38); - this.rowRemoveButton.TabIndex = 26; - this.rowRemoveButton.UseVisualStyleBackColor = true; - this.rowRemoveButton.Click += new System.EventHandler(this.rowRemoveButton_Click); - // - // rowAddButton - // - this.rowAddButton.AutoSize = true; - this.rowAddButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.rowAddButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowAdd; - this.rowAddButton.Location = new System.Drawing.Point(6, 264); - this.rowAddButton.Name = "rowAddButton"; - this.rowAddButton.Size = new System.Drawing.Size(38, 38); - this.rowAddButton.TabIndex = 25; - this.rowAddButton.UseVisualStyleBackColor = true; - this.rowAddButton.Click += new System.EventHandler(this.rowAddButton_Click); - // - // propLeftPictureBox - // - this.propLeftPictureBox.Enabled = false; - this.propLeftPictureBox.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.ArrowDown; - this.propLeftPictureBox.Location = new System.Drawing.Point(360, 257); - this.propLeftPictureBox.Name = "propLeftPictureBox"; - this.propLeftPictureBox.Size = new System.Drawing.Size(131, 56); - this.propLeftPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.propLeftPictureBox.TabIndex = 23; - this.propLeftPictureBox.TabStop = false; - this.propLeftPictureBox.Visible = false; - // - // saveButton - // - this.saveButton.Location = new System.Drawing.Point(67, 35); - this.saveButton.Name = "saveButton"; - this.saveButton.Size = new System.Drawing.Size(133, 23); - this.saveButton.TabIndex = 36; - this.saveButton.Text = "Save Configuration"; - this.saveButton.UseVisualStyleBackColor = true; - this.saveButton.Click += new System.EventHandler(this.saveButton_Click); - // - // overridesGroupBox - // - this.overridesGroupBox.Controls.Add(this.numLockGroupBox); - this.overridesGroupBox.Controls.Add(this.capsLockGroupBox); - this.overridesGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.overridesGroupBox.Location = new System.Drawing.Point(50, 133); - this.overridesGroupBox.Name = "overridesGroupBox"; - this.overridesGroupBox.Size = new System.Drawing.Size(165, 111); - this.overridesGroupBox.TabIndex = 37; - this.overridesGroupBox.TabStop = false; - this.overridesGroupBox.Text = "Overrides at Start-Up"; - // - // numLockGroupBox - // - this.numLockGroupBox.Controls.Add(this.numLockComboBox); - this.numLockGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.numLockGroupBox.Location = new System.Drawing.Point(6, 63); - this.numLockGroupBox.Name = "numLockGroupBox"; - this.numLockGroupBox.Size = new System.Drawing.Size(152, 42); - this.numLockGroupBox.TabIndex = 38; - this.numLockGroupBox.TabStop = false; - this.numLockGroupBox.Text = "Num-Lock Forcing:"; - // - // numLockComboBox - // - this.numLockComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.numLockComboBox.FormattingEnabled = true; - this.numLockComboBox.Location = new System.Drawing.Point(9, 15); - this.numLockComboBox.Name = "numLockComboBox"; - this.numLockComboBox.Size = new System.Drawing.Size(133, 21); - this.numLockComboBox.TabIndex = 1; - // - // capsLockGroupBox - // - this.capsLockGroupBox.Controls.Add(this.capsLockComboBox); - this.capsLockGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.capsLockGroupBox.Location = new System.Drawing.Point(6, 15); - this.capsLockGroupBox.Name = "capsLockGroupBox"; - this.capsLockGroupBox.Size = new System.Drawing.Size(152, 42); - this.capsLockGroupBox.TabIndex = 37; - this.capsLockGroupBox.TabStop = false; - this.capsLockGroupBox.Text = "Caps-Lock Forcing:"; - // - // capsLockComboBox - // - this.capsLockComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.capsLockComboBox.FormattingEnabled = true; - this.capsLockComboBox.Location = new System.Drawing.Point(9, 15); - this.capsLockComboBox.Name = "capsLockComboBox"; - this.capsLockComboBox.Size = new System.Drawing.Size(133, 21); - this.capsLockComboBox.TabIndex = 0; - // - // ShortCuterForm - // - 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.overridesGroupBox); - this.Controls.Add(this.saveButton); - this.Controls.Add(this.rowDownButton); - this.Controls.Add(this.linkPropertiesGroupBox); - this.Controls.Add(this.rowUpButton); - this.Controls.Add(this.resetButton); - this.Controls.Add(this.updateButton); - 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; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.Name = "ShortCuterForm"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "ShortCut\'er Plugin Configuration"; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ShortCuterForm_FormClosing); - this.Load += new System.EventHandler(this.ShortCuterForm_Load); - this.Shown += new System.EventHandler(this.ShortCuterForm_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(); - this.windowIdGroupBox.ResumeLayout(false); - this.skinFileGroupBox.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.infoPictureBox)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.propLeftPictureBox)).EndInit(); - this.overridesGroupBox.ResumeLayout(false); - this.numLockGroupBox.ResumeLayout(false); - this.capsLockGroupBox.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #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; - private System.Windows.Forms.PictureBox infoPictureBox; - private System.Windows.Forms.GroupBox linkPropertiesGroupBox; - private System.Windows.Forms.ToolTip toolTip; - private System.Windows.Forms.Button updateButton; - private System.Windows.Forms.Button resetButton; - private System.Windows.Forms.Button rowDownButton; - private System.Windows.Forms.Button rowUpButton; - private System.Windows.Forms.GroupBox windowIdGroupBox; - private System.Windows.Forms.Label windowIdLabel; - 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; - private System.Windows.Forms.GroupBox capsLockGroupBox; - private System.Windows.Forms.GroupBox numLockGroupBox; - private System.Windows.Forms.ComboBox capsLockComboBox; - private System.Windows.Forms.ComboBox numLockComboBox; - - } -} \ No newline at end of file Deleted: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.cs 2014-01-13 16:51:01 UTC (rev 4724) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.cs 2014-01-13 16:51:24 UTC (rev 4725) @@ -1,541 +0,0 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; -using MediaPortal.Configuration; -using MediaPortal.GUI.Library; -using MediaPortal.Profile; -using My.Common; - -namespace ProcessPlugins.ShortCuter -{ - [PluginIcons("ProcessPlugins.ShortCuter.Resources.Images.ShortCuterEnable.png", "ProcessPlugins.ShortCuter.Resources.Images.ShortCuterDisable.png")] - public partial class ShortCuterForm : Form, ISetupForm //Form per la configurazione del plugin, con implementazione interfaccia ISetupForm (per lancio da configurazione MediaPortal) - { - #region Dati - private Skin mySkin; //Istanza classe Skin (dati relativi alla skin di MediaPortal) - private ShortCuts myShortCuts; //Istanza classe ShortCuts (dati relativi ai shortcuts configurati) - private KeyboardHookWorker myHookWorker; //Istanza classe HookWorker (gestione hook di tastiera per immissione tasto [KeyCode] associato allo shortcut) - private bool unsavedChanges; //Presenza modifiche da salvare - private bool forceCell; //Azione di forzatura valore cella WindowID dello shortcut - #endregion - - #region Costruttore - public ShortCuterForm() - { - InitializeComponent(); - } - #endregion - - #region Metodi Privati - private void InitializeGUI() //Inizializzazione interfaccia - { - skinFilesListBox.DataSource = mySkin.SkinFiles; - skinFilesListBox.SelectedIndex = -1; - mySkin.FillTreeViewSkinLinks(skinLinksTreeView); - skinLinksTreeView.CollapseAll(); - FormatShortCutsGrid(); - - capsLockComboBox.DataSource = Enum.GetNames(typeof(LockKeys.LockKeyActions)); - capsLockComboBox.SelectedItem = Enum.GetName(typeof(LockKeys.LockKeyActions), myShortCuts.GeneralForcingCapsLock); - 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(rowAddButton, "Add shortcut to list"); - toolTip.SetToolTip(rowRemoveButton, "Remove selected shortcut from list"); - toolTip.SetToolTip(rowUpButton, "Move up selected shortcut in list"); - toolTip.SetToolTip(rowDownButton, "Move down selected shortcut in list"); - toolTip.SetToolTip(infoPictureBox, "Version information"); - - unsavedChanges = false; //--> necessario a fine aggiornamento controlli grafici - } - private void FormatShortCutsGrid() //Formattazione (e popolazione) tabella shortcuts - { - shortCutsDataGridView.AutoGenerateColumns = false; - - DataGridViewTextBoxColumn captionColumn = new DataGridViewTextBoxColumn(); - captionColumn.DataPropertyName = "Caption"; - captionColumn.HeaderText = "Caption"; - captionColumn.Width = 155; - captionColumn.MaxInputLength = 32; - captionColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - captionColumn.DefaultCellStyle.Font = new Font("Microsoft Sans Serif", 8, FontStyle.Bold); - captionColumn.ToolTipText = "Shortcut's title"; - - DataGridViewTextBoxColumn keyColumn = new DataGridViewTextBoxColumn(); - keyColumn.DataPropertyName = "Key"; - keyColumn.HeaderText = "Key [KeyCode]"; - keyColumn.Width = 120; - keyColumn.MaxInputLength = 24; - keyColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - keyColumn.DefaultCellStyle.Font = new Font("Microsoft Sans Serif", 8, FontStyle.Bold); - keyColumn.DefaultCellStyle.BackColor = Color.Yellow; - keyColumn.ToolTipText = "Key assigned to the shortcut"; - - DataGridViewCheckBoxColumn ctrlColumn = new DataGridViewCheckBoxColumn(); - ctrlColumn.DataPropertyName = "Ctrl"; - ctrlColumn.HeaderText = "Ctrl"; - ctrlColumn.Width = 30; - ctrlColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - ctrlColumn.DefaultCellStyle.BackColor = Color.LightCyan; - ctrlColumn.ToolTipText = "Use CTRL modifier + Key assigned"; - - DataGridViewCheckBoxColumn altColumn = new DataGridViewCheckBoxColumn(); - altColumn.DataPropertyName = "Alt"; - altColumn.HeaderText = "Alt"; - altColumn.Width = 30; - altColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - altColumn.DefaultCellStyle.BackColor = Color.LightCyan; - altColumn.ToolTipText = "Use ALT modifier + Key assigned"; - - DataGridViewCheckBoxColumn shiftColumn = new DataGridViewCheckBoxColumn(); - shiftColumn.DataPropertyName = "Shift"; - shiftColumn.HeaderText = "Shift"; - shiftColumn.Width = 30; - shiftColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - shiftColumn.DefaultCellStyle.BackColor = Color.LightCyan; - shiftColumn.ToolTipText = "Use SHIFT modifier + Key assigned"; - - DataGridViewTextBoxColumn windowIdColumn = new DataGridViewTextBoxColumn(); - windowIdColumn.DataPropertyName = "WindowID"; - windowIdColumn.HeaderText = "Window ID"; - windowIdColumn.Width = 70; - windowIdColumn.MaxInputLength = 10; - windowIdColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - windowIdColumn.ToolTipText = "MediaPorta window ID for the shortcut's destination"; - - DataGridViewTextBoxColumn loadParameterColumn = new DataGridViewTextBoxColumn(); - loadParameterColumn.DataPropertyName = "LoadParameter"; - loadParameterColumn.HeaderText = "Load Parameter"; - loadParameterColumn.Width = 358; - loadParameterColumn.MaxInputLength = 300; - loadParameterColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - loadParameterColumn.ToolTipText = "Any parameter for load window (see destination plugin's documentation)"; - - DataGridViewCheckBoxColumn returnColumn = new DataGridViewCheckBoxColumn(); - returnColumn.DataPropertyName = "Return"; - returnColumn.HeaderText = "Return"; - returnColumn.Width = 50; - returnColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - returnColumn.ToolTipText = "If you're already on the window ID, another activation of the shortcut will display the previous window"; - - DataGridViewComboBoxColumn soundEffectColumn = new DataGridViewComboBoxColumn(); - soundEffectColumn.DataPropertyName = "SoundEffect"; - soundEffectColumn.HeaderText = "Sound Effect"; - soundEffectColumn.Width = 140; - soundEffectColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - soundEffectColumn.FlatStyle = FlatStyle.Flat; //--> necessario con Win7 per aggiornare il colore di sfondo se selezionato - soundEffectColumn.DataSource = mySkin.SkinSounds; - soundEffectColumn.ToolTipText = "Sound effect played on the shortcut"; - - shortCutsDataGridView.Columns.Add(captionColumn); - shortCutsDataGridView.Columns.Add(keyColumn); - shortCutsDataGridView.Columns.Add(ctrlColumn); - shortCutsDataGridView.Columns.Add(altColumn); - shortCutsDataGridView.Columns.Add(shiftColumn); - shortCutsDataGridView.Columns.Add(windowIdColumn); - shortCutsDataGridView.Columns.Add(loadParameterColumn); - shortCutsDataGridView.Columns.Add(returnColumn); - shortCutsDataGridView.Columns.Add(soundEffectColumn); - - shortCutsDataGridView.DataSource = myShortCuts.Items; - } - private void ShowLinkProperties(object listControl) //Visualizzazione proprietà link - { - Control itemsList = (Control)listControl; //Casting sender -> Control - int selectedIndex; //Indice eventuale elemento selezionato - - if (itemsList is ListBox) - { - 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) - { - case "skinFilesListBox": //Lista files della skin - skinFileLabel.Text = mySkin.SkinFiles[selectedIndex].Name; - windowIdLabel.Text = mySkin.SkinFiles[selectedIndex].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; - break; - } - } - } - private void ShowLinkItem() //Visualizzazione link corrispondente allo shortcut - { - if (shortCutsDataGridView.CurrentCell != null) - { - 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) - { - string loadParameter = Convert.ToString(shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[6].Value); - showIndex = mySkin.SkinLinks.FindIndex(x => x.WindowID == windowID && x.LoadParameter == loadParameter); - mySkin.SetSkinLinkIndex(skinLinksTreeView, showIndex); //--> selezione eventuale link corrispondente a WindowID & LoadParameter - } - else - { - showIndex = mySkin.SkinFiles.FindLastIndex(x => x.Id == windowID); - skinFilesListBox.SelectedIndex = showIndex; //--> selezione eventuale file corrispondente a WindowID - } - } - } - } - private void MoveItemList(bool dirUp) //Spostamento shortcut - { - if (shortCutsDataGridView.CurrentCell != null) - { - forceCell = true; - int index = shortCutsDataGridView.CurrentRow.Index; - shortCutsDataGridView.CurrentCell = shortCutsDataGridView[0, index]; //Importante cambiare la colonna prima di muovere la riga se posizionati su KeyCode (Hook attivo) - ShortCut sc = myShortCuts.Items[index]; - myShortCuts.Items.RemoveAt(index); - if (dirUp) - index--; - else - index++; - myShortCuts.Items.Insert(index, sc); - shortCutsDataGridView.CurrentCell = shortCutsDataGridView[0, index]; - shortCutsDataGridView.Rows[index].Selected = true; - shortCutsDataGridView.Focus(); - forceCell = false; - } - } - private void MoveItemsListButtonsEnable() //Abilitazione/disabilitazione pulsanti di spostamento shortcuts - { - if (shortCutsDataGridView.CurrentCell != null) - { - rowUpButton.Enabled = (shortCutsDataGridView.CurrentRow.Index > 0); - rowDownButton.Enabled = (shortCutsDataGridView.CurrentRow.Index < myShortCuts.Items.Count - 1); - } - else - { - rowUpButton.Enabled = false; - rowDownButton.Enabled = false; - } - } - private bool Save() //Salvataggio configurazione plugin - { - myShortCuts.GeneralForcingCapsLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), capsLockComboBox.SelectedItem.ToString()); - myShortCuts.GeneralForcingNumLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), numLockComboBox.SelectedItem.ToString()); - return myShortCuts.SaveConfig(); - } - #endregion - - #region Consumazione Eventi - #region Eventi Form - private void ShortCuterForm_Load(object sender, EventArgs e) - { - using (Settings confReader = new MPSettings()) - { - //Raccolta dati relativi alla skin - mySkin = new Skin(confReader.GetValueAsString("skin", "name", "DefaultWide"), Config.GetFolder(Config.Dir.Skin) + @"\", Config.GetFolder(Config.Dir.Cache) + @"\"); - } - if (mySkin.Initialized) - { - string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml"); - //Lettura impostazioni e gestione shorcuts - myShortCuts = new ShortCuts(settingsFile, true); - if (myShortCuts.Initialized) - { - //Sottoscrizione evento di modifica lista shortcuts - myShortCuts.Items.ListChanged += new ListChangedEventHandler(myShortCutsItems_ListChanged); - - //Predisposizione hook di tastiera per immissione tasto (KeyCode) associato allo shortcut - myHookWorker = new KeyboardHookWorker(new KeyboardHookWorker.HookKeyDownDelegate(hook_KeyDown)); - - //Inizializzazione interfaccia grafica - InitializeGUI(); - } - } - //Se inizializzazione classi non completata - if (!mySkin.Initialized || !myShortCuts.Initialized) - { - this.Close(); - this.Dispose(); - } - } - private void ShortCuterForm_Shown(object sender, EventArgs e) - { - shortCutsDataGridView.Focus(); - } - private void ShortCuterForm_FormClosing(object sender, FormClosingEventArgs e) - { - if (unsavedChanges) //Se presenti modifiche non salvate - { //Richiesta conferma per chiusura applicazione - if (!Tools.QuestionMessage("Unsaved changes will be lost...\nDo you want to proceed?")) - { - e.Cancel = true; //--> annullamento chiusura form - return; - } - } - if (myHookWorker != null) - myHookWorker.Stop(); //--> disattivazione hook di tastiera - } - #endregion - #region Eventi Modifica Griglia - private void shortCutsDataGridView_Enter(object sender, EventArgs e) - { - propLeftPictureBox.Visible = true; //--> il link è collegato allo shortcut selezionato - ShowLinkItem(); - MoveItemsListButtonsEnable(); - } - private void shortCutsDataGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) - { - e.Control.KeyPress -= keyTextBox_KeyPress; - e.Control.KeyPress -= idTextBox_KeyPress; - - if (e.Control is TextBox) - { - if ((int)(((DataGridView)(sender)).CurrentCell.ColumnIndex) == 1) - { - e.Control.KeyPress += new KeyPressEventHandler(keyTextBox_KeyPress); //--> sottoscrizione evento KeyPress per la cella Key - //((TextBox)e.Control).CharacterCasing = CharacterCasing.Lower; //--> tasto associato allo shortcut: input minuscolo - } - if ((int)(((DataGridView)(sender)).CurrentCell.ColumnIndex) == 5) - e.Control.KeyPress += new KeyPressEventHandler(idTextBox_KeyPress); //--> sottoscrizione evento KeyPress per la cella WindowID - } - } - void keyTextBox_KeyPress(object sender, KeyPressEventArgs e) - { - e.Handled = true; //--> carattere inputato da ignorare (per trattare la TextBox come una Label) --> azione svolta dall'hook di tastiera (necessario se l'hook fallisse) - } - void idTextBox_KeyPress(object sender, KeyPressEventArgs e) - { - if (!(char.IsDigit(e.KeyChar))) //Filtro per input numerico per la cella WindowID - { - Keys key = (Keys)e.KeyChar; - if (!(key == Keys.Back || key == Keys.Delete)) - { - e.Handled = true; //--> carattere inputato da ignorare - } - } - } - private void shortCutsDataGridView_CellEndEdit(object sender, DataGridViewCellEventArgs e) - { - ShowLinkItem(); - } - private void shortCutsDataGridView_CurrentCellChanged(object sender, EventArgs e) - { - ShowLinkItem(); - MoveItemsListButtonsEnable(); - - if (shortCutsDataGridView.CurrentCell != null && shortCutsDataGridView.CurrentCell.ColumnIndex == 1) - myHookWorker.Start(); //Nel caso di colonna corrispondente a Key --> attivazione hook di tastiera per immissione KeyCode - else - myHookWorker.Stop(); //Nel caso di colonna non corrispondente a Key --> disattivazione hook di tastiera - } - private void shortCutsDataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e) - { - //Gestione evento per evitare messaggi di errore (esempio se file effetto sonoro non disponibile nella skin) - } - #endregion - #region Eventi Modifica Impostazioni Plugin & Shortcuts - private void myShortCutsItems_ListChanged(object sender, EventArgs e) - { - unsavedChanges = true; - rowRemoveButton.Enabled = (myShortCuts.Items.Count > 0); - MoveItemsListButtonsEnable(); - } - private void rowAddButton_Click(object sender, EventArgs e) - { - ShortCut sc = new ShortCut(); - myShortCuts.Items.Add(sc); - shortCutsDataGridView.CurrentCell = shortCutsDataGridView[0, shortCutsDataGridView.RowCount - 1]; - shortCutsDataGridView.Rows[shortCutsDataGridView.RowCount - 1].Selected = true; - } - private void rowRemoveButton_Click(object sender, EventArgs e) - { - if (myShortCuts.Items.Count > 0) - { - myShortCuts.Items.RemoveAt(shortCutsDataGridView.CurrentRow.Index); - if (shortCutsDataGridView.RowCount > 0) - shortCutsDataGridView.CurrentCell = shortCutsDataGridView[0, 0]; - } - } - private void rowUpButton_Click(object sender, EventArgs e) - { - MoveItemList(true); - } - private void rowDownButton_Click(object sender, EventArgs e) - { - MoveItemList(false); - } - private void resetCapsLockCheckBox_CheckedChanged(object sender, EventArgs e) - { - unsavedChanges = true; - } - private void resetNumLockCheckBox_CheckedChanged(object sender, EventArgs e) - { - unsavedChanges = true; - } - #endregion - #region Eventi Liste Files & Links Skin - private void itemsTabControl_SelectedIndexChanged(object sender, EventArgs e) - { - 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); - } - private void skinFilesListBox_DoubleClick(object sender, EventArgs e) - { - 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; - } - } - private void skinLinksTreeView_AfterSelect(object sender, TreeViewEventArgs e) - { - 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) - { - 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; - forceCell = true; - shortCutsDataGridView.CurrentCell = shortCutsDataGridView[5, shortCutsDataGridView.CurrentRow.Index]; - forceCell = false; - } - } - #endregion - private bool hook_KeyDown(Keys keyCode) - { - if (ShortCut.ModifierKeys.Contains(keyCode)) - return true; //Se il tasto premuto corrisponde ad un modificatore, viene ignorato - - if (this.InvokeRequired) //Gestione dell'invocazione sul thread principale - { - this.BeginInvoke(new KeyboardHookWorker.HookKeyDownDelegate(hook_KeyDown), new object[] { keyCode }); - return true; //--> qualunque pressione viene ignorata dal resto del sistema - } - - if (shortCutsDataGridView.CurrentCell != null && shortCutsDataGridView.CurrentCell.ColumnIndex == 1) - //Valorizzazione della cella Key con la stringa corrispondente al KeyCode del tasto premuto - shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[1].Value = keyCode.ToString(); - return true; - } - private void saveButton_Click(object sender, EventArgs e) - { - if (Save()) - unsavedChanges = false; - } - private void updateButton_Click(object sender, EventArgs e) - { - if (Save()) - { - unsavedChanges = false; - this.Close(); - this.Dispose(); - } - } - private void resetButton_Click(object sender, EventArgs e) - { - if (Tools.QuestionMessage("Configuration data will be overwritten...\nDo you want to proceed?")) - { - myShortCuts.LoadConfig(true); - } - } - private void infoPictureBox_Click(object sender, EventArgs e) - { - VersionInfo.ShowInfo(ProcessPlugins.ShortCuter.Properties.Resources.ShortCuter, "...a big thank to MoPath for old version of this plugin!", - "http://forum.team-mediaportal.com/threads/shortcuter-plugin-v2.121721/", - "http://wiki.team-mediaportal.com/1_MEDIAPORTAL_1/17_Extensions/3_Plugins/ShortCut'er"); - } - #endregion - - #region Implementazione ISetupForm - public string PluginName() - { - return Tools.MyAssembly.Title; - } - public string Description() - { - return Tools.MyAssembly.Description; - } - public string Author() - { - return Tools.MyAssembly.Author; - } - public void ShowPlugin() - { - new ShortCuterForm().ShowDialog(); - } - public bool CanEnable() - { - return true; - } - public int GetWindowId() - { - return -1; - } - public bool DefaultEnabled() - { - return false; - } - public bool HasSetup() - { - return true; - } - public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) - { - strButtonText = String.Empty; - strButtonImage = String.Empty; - strButtonImageFocus = String.Empty; - strPictureImage = String.Empty; - return false; - } - #endregion - } -} Deleted: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.resx =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.resx 2014-01-13 16:51:01 UTC (rev 4724) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.resx 2014-01-13 16:51:24 UTC (rev 4725) @@ -1,287 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<root> - <!-- - Microsoft ResX Schema - - Ver... [truncated message content] |
From: <nic...@us...> - 2014-01-14 15:44:22
|
Revision: 4727 http://sourceforge.net/p/mp-plugins/code/4727 Author: nicsergio Date: 2014-01-14 15:44:20 +0000 (Tue, 14 Jan 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.resx Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-01-13 19:33:33 UTC (rev 4726) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-01-14 15:44:20 UTC (rev 4727) @@ -6,7 +6,7 @@ <ProductVersion>8.0.30703</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}</ProjectGuid> - <OutputType>Library</OutputType> + <OutputType>WinExe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>ProcessPlugins.ShortCuter</RootNamespace> <AssemblyName>ShortCuter</AssemblyName> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.Designer.cs 2014-01-13 19:33:33 UTC (rev 4726) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.Designer.cs 2014-01-14 15:44:20 UTC (rev 4727) @@ -52,7 +52,7 @@ this.keyLabel.Name = "keyLabel"; this.keyLabel.Size = new System.Drawing.Size(163, 23); this.keyLabel.TabIndex = 0; - this.keyLabel.Text = "W"; + this.keyLabel.Text = "?"; this.keyLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // okPictureBox @@ -81,6 +81,8 @@ this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.Text = "ShortCut\'s Key"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ShortCuterKeyConfig_FormClosing); + this.Load += new System.EventHandler(this.ShortCuterKeyConfig_Load); this.keyGroupBox.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.okPictureBox)).EndInit(); this.ResumeLayout(false); Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.cs 2014-01-13 19:33:33 UTC (rev 4726) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.cs 2014-01-14 15:44:20 UTC (rev 4727) @@ -8,6 +8,9 @@ { #region Dati private ShortCut mySc; + + private KeyboardHook keyboardHook; //Istanza classe KeyboardHook (gestione hook di tastiera) + #endregion #region Costruttore @@ -18,17 +21,45 @@ mySc = currentShortCut; Text = "'" + mySc.Caption + "' ShortCut"; keyLabel.Text = mySc.Key; + + keyboardHook = new KeyboardHook(); //--> creazione hook di tastiera + keyboardHook.KeyDown += new KeyEventHandler(keyboardHook_KeyDown); //--> sottoscrizione evento di KeyDown + + } #endregion #region Consumazione Eventi private void okPictureBox_Click(object sender, EventArgs e) { - mySc.Key = "X"; + mySc.Key = keyLabel.Text; this.Close(); } + + private void keyboardHook_KeyDown(object sender, KeyEventArgs e) //Evento KeyDown intercettato dall'hook + { //[esecuzione su thread secondario] + if (ShortCut.ModifierKeys.Contains(e.KeyCode)) + e.Handled = true; //Se il tasto premuto corrisponde ad un modificatore, viene ignorato + else + { + keyLabel.Text = e.KeyCode.ToString(); + e.Handled = true; + } + + } #endregion + private void ShortCuterKeyConfig_Load(object sender, EventArgs e) + { + } + + private void ShortCuterKeyConfig_FormClosing(object sender, FormClosingEventArgs e) + { + if (keyboardHook != null) + keyboardHook = null; + } + + } } Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.resx =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.resx 2014-01-13 19:33:33 UTC (rev 4726) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.resx 2014-01-14 15:44:20 UTC (rev 4727) @@ -123,6 +123,9 @@ <metadata name="keyLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> + <metadata name="keyLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> <metadata name="okPictureBox.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. |
From: <nic...@us...> - 2014-01-14 20:55:18
|
Revision: 4728 http://sourceforge.net/p/mp-plugins/code/4728 Author: nicsergio Date: 2014-01-14 20:55:15 +0000 (Tue, 14 Jan 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.cs Removed Paths: ------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/KeyboardHookWorker.cs Deleted: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/KeyboardHookWorker.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/KeyboardHookWorker.cs 2014-01-14 15:44:20 UTC (rev 4727) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/KeyboardHookWorker.cs 2014-01-14 20:55:15 UTC (rev 4728) @@ -1,91 +0,0 @@ -using System.Collections.Generic; -using System.Threading; -using System.Windows.Forms; - -namespace ProcessPlugins.ShortCuter -{ - internal class KeyboardHookWorker //Classe per gestione hook di tastiera su thread separato (problemi con timeout di Windows) - { - #region Delegati/Classi - public delegate bool HookKeyDownDelegate(Keys KeyCode); //Dichiarazione delegato per gestione evento di KeyDown - private class HiddenForm : Form //Classe form nascosta (per attivazione su thread separato) - { - public HiddenForm() - { - Visible = false; - SetTopLevel(false); - } - } - #endregion - - #region Dati - private readonly HookKeyDownDelegate HookKeyDown; //Delegato per gestione evento di KeyDown (passato dal chiamante) - private Thread hookThread; //Thread di attivazione hook - private Form hookForm; //Form del thread per attivazione hook - private KeyboardHook keyboardHook; //Istanza classe KeyboardHook (gestione hook di tastiera) - #endregion - - #region Costruttore - public KeyboardHookWorker(HookKeyDownDelegate hookKeyDown) - { - HookKeyDown = hookKeyDown; //--> assegnazione delegato per gestione evento KeyDown - } - #endregion - - #region Metodi Privati - protected virtual List<Keys> AddHookedKeys() //Metodo virtuale per implementare una lista di tasti da controllare - { //[esecuzione su thread secondario] - return new List<Keys>(); //--> lista vuota (tutti i tasti vengono monitorati) - } - private void Run() //Procedura di avvio thread secondario - { //[esecuzione su thread secondario] - keyboardHook = new KeyboardHook(); //--> creazione hook di tastiera - keyboardHook.HookedKeys = AddHookedKeys(); //--> aggiunta eventuale lista di tasti da monitorare - keyboardHook.KeyDown += new KeyEventHandler(keyboardHook_KeyDown); //--> sottoscrizione evento di KeyDown - hookForm = new HiddenForm(); //--> creazione forma nascosta - Application.Run(hookForm); //--> avvio applicazione con form nascosta - } - #endregion - - #region Metodi Pubblici - public void Start() //Avvio (o ri-avvio) thread di hook - { - Stop(); //--> eventuale stop thread - hookThread = new Thread(Run); //--> creazione thread - hookThread.Priority = ThreadPriority.Highest; //--> impostazione alta priorità (problemi di timeout con Win7) - hookThread.Name = "HookWorker"; //--> impostazione nome - hookThread.Start(); //--> avvio thread - } - public void Stop() //Stop thread di hook - { - if (hookThread != null) - { - if (hookThread.IsAlive) - { - try - { - if (hookForm != null) - hookForm.Invoke((MethodInvoker)delegate //--> invocazione (sul thread secondario) del delegato per stoppare il thread - { - if (keyboardHook != null) - keyboardHook = null; //--> distruzione hook - Application.ExitThread(); //--> terminazione thread secondario - }); - hookThread.Join(); //--> attesa sul thread principale della terminazione del thread secondario - } - catch { } - } - hookThread = null; - } - } - #endregion - - #region Consumazione Eventi - private void keyboardHook_KeyDown(object sender, KeyEventArgs e) //Evento KeyDown intercettato dall'hook - { //[esecuzione su thread secondario] - if (HookKeyDown != null) //Se delegato di gestione evento assegnato - e.Handled = HookKeyDown(e.KeyCode); //--> richiamo del delegato (ritorna true se evento gestito: tasto da non passare al sistema) - } - #endregion - } -} Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-01-14 15:44:20 UTC (rev 4727) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-01-14 20:55:15 UTC (rev 4728) @@ -6,7 +6,7 @@ <ProductVersion>8.0.30703</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}</ProjectGuid> - <OutputType>WinExe</OutputType> + <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>ProcessPlugins.ShortCuter</RootNamespace> <AssemblyName>ShortCuter</AssemblyName> @@ -81,7 +81,6 @@ <Link>VersionInfo.designer.cs</Link> <DependentUpon>VersionInfo.cs</DependentUpon> </Compile> - <Compile Include="KeyboardHookWorker.cs" /> <Compile Include="KeyboardHook.cs" /> <Compile Include="LockKeys.cs" /> <Compile Include="Program.cs" /> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.cs 2014-01-14 15:44:20 UTC (rev 4727) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.cs 2014-01-14 20:55:15 UTC (rev 4728) @@ -1,65 +1,49 @@ using System; +using System.Drawing; using System.Windows.Forms; -using System.Drawing; namespace ProcessPlugins.ShortCuter { public partial class ShortCuterKeyConfig : Form //Form per assegnazione key allo shortcut corrente { #region Dati - private ShortCut mySc; - + private ShortCut mySc; //Istanza classe ShortCut per gestione shorcut corrente private KeyboardHook keyboardHook; //Istanza classe KeyboardHook (gestione hook di tastiera) - #endregion #region Costruttore public ShortCuterKeyConfig(ShortCut currentShortCut, Point startLocation) { InitializeComponent(); - Location = startLocation; - mySc = currentShortCut; - Text = "'" + mySc.Caption + "' ShortCut"; - keyLabel.Text = mySc.Key; - - keyboardHook = new KeyboardHook(); //--> creazione hook di tastiera - keyboardHook.KeyDown += new KeyEventHandler(keyboardHook_KeyDown); //--> sottoscrizione evento di KeyDown - - + Location = startLocation; //--> impostazione posizione form + mySc = currentShortCut; //--> impostazione riferimento a shortcut corrente + Text = "'" + mySc.Caption + "' ShortCut"; //--> titolo della finestra corrispondente a nome shorcut + keyLabel.Text = mySc.Key; //--> visualizzazione tasto correntemente assegnato } #endregion #region Consumazione Eventi - private void okPictureBox_Click(object sender, EventArgs e) - { - mySc.Key = keyLabel.Text; - this.Close(); - } - - private void keyboardHook_KeyDown(object sender, KeyEventArgs e) //Evento KeyDown intercettato dall'hook - { //[esecuzione su thread secondario] - if (ShortCut.ModifierKeys.Contains(e.KeyCode)) - e.Handled = true; //Se il tasto premuto corrisponde ad un modificatore, viene ignorato - else - { - keyLabel.Text = e.KeyCode.ToString(); - e.Handled = true; - } - - } - #endregion - private void ShortCuterKeyConfig_Load(object sender, EventArgs e) { - + keyboardHook = new KeyboardHook(); //--> creazione hook di tastiera + keyboardHook.KeyDown += new KeyEventHandler(keyboardHook_KeyDown); //--> sottoscrizione evento di KeyDown } - private void ShortCuterKeyConfig_FormClosing(object sender, FormClosingEventArgs e) { if (keyboardHook != null) - keyboardHook = null; + keyboardHook = null; //--> distruzione hook } - - + private void okPictureBox_Click(object sender, EventArgs e) + { + mySc.Key = keyLabel.Text; //--> memorizzazione tasto assegnato allo shortcut + this.Close(); //--> chiusura form + } + private void keyboardHook_KeyDown(object sender, KeyEventArgs e) //Evento KeyDown intercettato dall'hook + { + if (!ShortCut.ModifierKeys.Contains(e.KeyCode)) + keyLabel.Text = e.KeyCode.ToString(); //--> visualizzazione tasto premuto, se non corrisponde ad un modificatore + e.Handled = true; //--> il tasto premuto viene ignorato + } + #endregion } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-01-15 21:09:06
|
Revision: 4730 http://sourceforge.net/p/mp-plugins/code/4730 Author: nicsergio Date: 2014-01-15 21:09:04 +0000 (Wed, 15 Jan 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/KeyboardHook.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/KeyboardHook.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/KeyboardHook.cs 2014-01-14 21:31:50 UTC (rev 4729) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/KeyboardHook.cs 2014-01-15 21:09:04 UTC (rev 4730) @@ -55,7 +55,7 @@ IntPtr hInstance = LoadLibrary("User32"); hHook = SetWindowsHookEx(WH_KEYBOARD_LL, hookProc, hInstance, 0); } - private void unhook() //Disinstallazione dell'hook di sistema + public void unhook() //Disinstallazione dell'hook di sistema { UnhookWindowsHookEx(hHook); } Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-01-14 21:31:50 UTC (rev 4729) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-01-15 21:09:04 UTC (rev 4730) @@ -367,7 +367,10 @@ private void rowCopyButton_Click(object sender, EventArgs e) { if (myShortCuts.Items.Count > 0) + { myShortCuts.Items.Insert(shortCutsDataGridView.CurrentRow.Index, myShortCuts.Items[shortCutsDataGridView.CurrentRow.Index].Clone()); + shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Selected = true; + } } private void rowUpButton_Click(object sender, EventArgs e) { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.cs 2014-01-14 21:31:50 UTC (rev 4729) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.cs 2014-01-15 21:09:04 UTC (rev 4730) @@ -36,6 +36,7 @@ private void okPictureBox_Click(object sender, EventArgs e) { mySc.Key = keyLabel.Text; //--> memorizzazione tasto assegnato allo shortcut + keyboardHook.unhook(); this.Close(); //--> chiusura form } private void keyboardHook_KeyDown(object sender, KeyEventArgs e) //Evento KeyDown intercettato dall'hook This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-01-16 13:19:47
|
Revision: 4731 http://sourceforge.net/p/mp-plugins/code/4731 Author: nicsergio Date: 2014-01-16 13:19:41 +0000 (Thu, 16 Jan 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/KeyboardHook.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/KeyboardHook.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/KeyboardHook.cs 2014-01-15 21:09:04 UTC (rev 4730) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/KeyboardHook.cs 2014-01-16 13:19:41 UTC (rev 4731) @@ -35,30 +35,22 @@ #endregion public List<Keys> HookedKeys = new List<Keys>(); //Eventuale lista dei tasti da monitorare/intercettare - private IntPtr hHook = IntPtr.Zero; //Handle dell'hook - #endregion + private IntPtr hHook = IntPtr.Zero; //Handle dell'hook + private IntPtr hInstance = IntPtr.Zero; //Handle dell'istanza della libreria esterna + #endregion #region Costruttore/Distruttore public KeyboardHook() { - hook(); //--> installazione dell'hook di sistema + hInstance = LoadLibrary("User32"); //--> caricamento libreria esterna e memorizzazione handle } ~KeyboardHook() { - unhook(); //--> disinstallazione dell'hook di sistema + unhook(); //--> eventuale disinstallazione dell'hook di sistema } #endregion #region Metodi Privati - private void hook() //Installazione dell'hook di sistema - { - IntPtr hInstance = LoadLibrary("User32"); - hHook = SetWindowsHookEx(WH_KEYBOARD_LL, hookProc, hInstance, 0); - } - public void unhook() //Disinstallazione dell'hook di sistema - { - UnhookWindowsHookEx(hHook); - } private int hookProc(int code, int wParam, ref HookStruct lParam) //Metodo richiamato per l'hook di tastiera { if (code >= 0) //Se codice hook valorizzato @@ -83,8 +75,20 @@ } #endregion - #region Eventi - public event KeyEventHandler KeyDown; //Evento di pressione di uno dei tasti da monitorare + #region Metodi Pubblici + public void hook() //Installazione dell'hook di sistema + { + hHook = SetWindowsHookEx(WH_KEYBOARD_LL, hookProc, hInstance, 0); + } + public void unhook() //Disinstallazione dell'hook di sistema + { + try { UnhookWindowsHookEx(hHook); } + catch { } + } + #endregion + + #region Eventi + public event KeyEventHandler KeyDown; //Evento di pressione di uno dei tasti da monitorare public event KeyEventHandler KeyUp; //Evento di rilascio di uno dei tasti da monitorare #endregion Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs 2014-01-15 21:09:04 UTC (rev 4730) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs 2014-01-16 13:19:41 UTC (rev 4731) @@ -100,6 +100,7 @@ this.shortCutsDataGridView.TabIndex = 0; this.shortCutsDataGridView.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.shortCutsDataGridView_CellDoubleClick); this.shortCutsDataGridView.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.shortCutsDataGridView_CellEndEdit); + this.shortCutsDataGridView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.shortCutsDataGridView_CellFormatting); this.shortCutsDataGridView.CurrentCellChanged += new System.EventHandler(this.shortCutsDataGridView_CurrentCellChanged); this.shortCutsDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.shortCutsDataGridView_DataError); this.shortCutsDataGridView.EditingControlShowing += new System.Windows.Forms.DataGridViewEditingControlShowingEventHandler(this.shortCutsDataGridView_EditingControlShowing); Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-01-15 21:09:04 UTC (rev 4730) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-01-16 13:19:41 UTC (rev 4731) @@ -335,6 +335,10 @@ ShowLinkItem(); MoveItemsListButtonsEnable(); } + private void shortCutsDataGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) + { + shortCutsDataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].ToolTipText = shortCutsDataGridView.Columns[e.ColumnIndex].ToolTipText; + } private void shortCutsDataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e) { //Gestione evento per evitare messaggi di errore (esempio se file effetto sonoro non disponibile nella skin) Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.cs 2014-01-15 21:09:04 UTC (rev 4730) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.cs 2014-01-16 13:19:41 UTC (rev 4731) @@ -19,24 +19,24 @@ mySc = currentShortCut; //--> impostazione riferimento a shortcut corrente Text = "'" + mySc.Caption + "' ShortCut"; //--> titolo della finestra corrispondente a nome shorcut keyLabel.Text = mySc.Key; //--> visualizzazione tasto correntemente assegnato + + keyboardHook = new KeyboardHook(); //--> creazione oggetto per gestione hook di tastiera + keyboardHook.KeyDown += new KeyEventHandler(keyboardHook_KeyDown); //--> sottoscrizione evento di KeyDown } #endregion #region Consumazione Eventi private void ShortCuterKeyConfig_Load(object sender, EventArgs e) { - keyboardHook = new KeyboardHook(); //--> creazione hook di tastiera - keyboardHook.KeyDown += new KeyEventHandler(keyboardHook_KeyDown); //--> sottoscrizione evento di KeyDown + keyboardHook.hook(); //--> attivazione hook di tastiera } private void ShortCuterKeyConfig_FormClosing(object sender, FormClosingEventArgs e) { - if (keyboardHook != null) - keyboardHook = null; //--> distruzione hook + keyboardHook.unhook(); //--> disattivazione hook di tastiera } private void okPictureBox_Click(object sender, EventArgs e) { mySc.Key = keyLabel.Text; //--> memorizzazione tasto assegnato allo shortcut - keyboardHook.unhook(); this.Close(); //--> chiusura form } private void keyboardHook_KeyDown(object sender, KeyEventArgs e) //Evento KeyDown intercettato dall'hook This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-02-24 17:36:25
|
Revision: 4764 http://sourceforge.net/p/mp-plugins/code/4764 Author: nicsergio Date: 2014-02-24 17:36:22 +0000 (Mon, 24 Feb 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 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/ShortCuter.csproj =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-02-24 17:07:28 UTC (rev 4763) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-02-24 17:36:22 UTC (rev 4764) @@ -329,12 +329,6 @@ <EmbeddedResource Include="Resources\Images\ShortCuterDisable.png" /> <EmbeddedResource Include="Resources\Images\ShortCuterEnable.png" /> </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\Common\My.Common.csproj"> - <Project>{4D76B200-01C9-48C6-BA04-DAF0845D56B0}</Project> - <Name>My.Common</Name> - </ProjectReference> - </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs 2014-02-24 17:07:28 UTC (rev 4763) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs 2014-02-24 17:36:22 UTC (rev 4764) @@ -32,6 +32,11 @@ 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(); @@ -55,7 +60,11 @@ 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(); ((System.ComponentModel.ISupportInitialize)(this.shortCutsDataGridView)).BeginInit(); + this.itemsTabControl.SuspendLayout(); + this.linksTabPage.SuspendLayout(); + this.skinTabPage.SuspendLayout(); this.linkPropertiesGroupBox.SuspendLayout(); this.loadParameterGroupBox.SuspendLayout(); this.windowIdGroupBox.SuspendLayout(); @@ -98,6 +107,66 @@ 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); @@ -350,11 +419,19 @@ this.rowCopyButton.UseVisualStyleBackColor = true; this.rowCopyButton.Click += new System.EventHandler(this.rowCopyButton_Click); // + // skinItems1 + // + 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; + // // 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.rowCopyButton); this.Controls.Add(this.overridesGroupBox); this.Controls.Add(this.saveButton); @@ -366,6 +443,7 @@ 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; @@ -378,6 +456,9 @@ 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(); @@ -396,6 +477,10 @@ #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; @@ -411,6 +496,7 @@ 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; @@ -419,5 +505,7 @@ private System.Windows.Forms.ComboBox capsLockComboBox; private System.Windows.Forms.ComboBox numLockComboBox; private System.Windows.Forms.Button rowCopyButton; + private My.Common.SkinItems skinItems1; + } } \ 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:07:28 UTC (rev 4763) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-02-24 17:36:22 UTC (rev 4764) @@ -521,12 +521,5 @@ return false; } #endregion - - - - private void skinItems_DoubleClick(SkinItems.SkinItemsType itemType, int index) - { - - } } } Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.resx =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.resx 2014-02-24 17:07:28 UTC (rev 4763) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.resx 2014-02-24 17:36:22 UTC (rev 4764) @@ -120,6 +120,21 @@ <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. |
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. |
From: <nic...@us...> - 2014-05-03 19:44:07
|
Revision: 4794 http://sourceforge.net/p/mp-plugins/code/4794 Author: nicsergio Date: 2014-05-03 19:44:02 +0000 (Sat, 03 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinNavigatorConfig.Designer.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-03 17:38:29 UTC (rev 4793) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-03 19:44:02 UTC (rev 4794) @@ -1,11 +1,7 @@ using System; -using System.Collections.Generic; -using System.Linq; using System.Windows.Forms; using MediaPortal.Configuration; using MediaPortal.GUI.Library; -using MediaPortal.Util; -using MediaPortal.Player; //using Action = MediaPortal.GUI.Library.Action; using My.Common; @@ -28,12 +24,12 @@ #region Implementazione IPlugin public void Start() //Avvio del plugin { - MpLog(false, "Plugin started"); + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "Plugin started")); if (LockKeys.ChangeCapsLock(myShortCuts.GeneralForcingCapsLock)) - MpLog(false, "CapsLock " + ((myShortCuts.GeneralForcingCapsLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated")); + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "CapsLock " + ((myShortCuts.GeneralForcingCapsLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); if (LockKeys.ChangeNumLock(myShortCuts.GeneralForcingNumLock)) - MpLog(false, "NumLock " + ((myShortCuts.GeneralForcingNumLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated")); + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "NumLock " + ((myShortCuts.GeneralForcingNumLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml"); myShortCuts = new ShortCuts(settingsFile); //Creazione classe per gestione shorcuts @@ -45,9 +41,9 @@ RawInputHook rawInput = new RawInputHook(GUIGraphicsContext.form.Handle); //--> creazione hook mediante RawInput rawInput.KeyDown += new KeyEventHandler(rawInput_KeyDown); //--> sottoscrizione evento KeyDown } - catch + catch (Exception e) { - MpLog(true, "Error creating raw input hook"); + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Error, "Error creating raw input hook", e)); } try @@ -55,36 +51,39 @@ //Sottoscrizione evento di attivazione finestra di MediaPortal GUIWindowManager.OnActivateWindow += new GUIWindowManager.WindowActivationHandler(GUIWindowManager_OnActivateWindow); } - catch + catch (Exception e) { - MpLog(true, "Error subscription ActivateWindow event"); + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Error, "Error subscription ActivateWindow event", e)); } } else - MpLog(true, "Error loading configuration"); + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Error, "Error loading configuration")); } public void Stop() //Terminazione del plugin { - MpLog(false, "Plugin stopped"); + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "Plugin stopped")); } #endregion - #region Metodi Pubblici - public static void MpLog(bool errorLog, string description) //Registrazione evento su log di MediaPortal (senza passare l'eccezione) + #region Metodi Privati + private void MpLog(LogEventArgs e) //Registrazione evento su log di MediaPortal { - MpLog(errorLog, description, null); - } - public static void MpLog(bool errorLog, string description, Exception e) //Registrazione evento su log di MediaPortal - { - description = LogPrefix + description; - if (errorLog) + string message = LogPrefix + e.LogMessage; + + switch (e.LogLevel) { - if (e != null) - description += " [" + e.Message + " (" + e.StackTrace + ")]"; - Log.Error(description); //--> log errore + case LogEventArgs.LogLevels.Error: + if (e.LogException != null) + message += " [" + e.LogException.Message + " (" + e.LogException.StackTrace + ")]"; + Log.Error(message); //--> log errore + break; + case LogEventArgs.LogLevels.Info: + Log.Info(message); //--> log messaggio informativo + break; + case LogEventArgs.LogLevels.Debug: + Log.Debug(message); //--> log informazione per debug + break; } - else - Log.Info(description); //--> log messaggio informativo } #endregion @@ -97,20 +96,9 @@ { myShortCuts.WindowChanged(windowID); //--> pubblicazione a gestore shortcuts } - private void myShortCuts_Log(object sender, LogEventArgs e) + private void myShortCuts_Log(object sender, LogEventArgs e) //Evento di log gestore shortcuts { - switch (e.LogLevel) - { - case LogEventArgs.LogLevels.Error: - if (e.LogException != null) - Tools.ErrorMessage(e.LogMessage, e.LogException.Message); //--> emissione finestra di errore (con descrizione errore) - else - Tools.ErrorMessage(e.LogMessage); //--> emissione finestra di errore - break; - case LogEventArgs.LogLevels.Info: - Tools.InfoMessage(e.LogMessage); //--> emissione finestra informativa - break; - } + MpLog(e); //--> log } #endregion } Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-03 17:38:29 UTC (rev 4793) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-03 19:44:02 UTC (rev 4794) @@ -1,23 +1,22 @@ using System; using System.Collections.Generic; using System.ComponentModel; -using MediaPortal.GUI.Library; using System.IO; using System.Linq; using System.Reflection; using System.Text; using System.Windows.Forms; using System.Xml; +using MediaPortal.GUI.Library; +using MediaPortal.Player; using MediaPortal.Profile; using MediaPortal.Util; -using MediaPortal.Player; -using My.Common; namespace ProcessPlugins.ShortCuter { #region Delegati/Classi - public delegate void LogEventHandler(object sender, LogEventArgs e); //Delegato per evento di log - public class LogEventArgs : EventArgs //Argomenti per evento di log + internal delegate void LogEventHandler(object sender, LogEventArgs e); //Delegato per evento di log + internal class LogEventArgs : EventArgs //Argomenti per evento di log { #region Dati private LogLevels _logLevel; //Livello di log @@ -57,15 +56,25 @@ private int _windowID; //Id finestra per visualizzazione in MediaPortal private string _loadParameter; //Eventuali parametri di caricamento per visualizzazione (sotto-categorie, ecc.) - private const int TrailersPluginControlID = 11899; //Id controllo per attivazione plugin Trailers - private const int InvalidID = -1; //Id finestra invalido + private const int InvalidID = -1; //Id finestra invalido + private const int NavigatorID = -999; //Id per attivazione Skin Navigator + private const int TrailersControlID = 11899; //Id controllo per attivazione plugin Trailers #endregion #region Costruttore - public WindowLink() //Costruttore classe WindowLink + public WindowLink() : this(false) { } //Costruttore classe WindowLink (senza argomenti) + public WindowLink(bool skinNavigator) //Costruttore classe WindowLink { - _caption = "Link"; //--> inizializzazione titolo - _windowID = 0; //--> inizializzazione window ID + if (skinNavigator) //Se richiesta destinazione corrispondente a Skin Navigator + { + _caption = "Skin Navigator"; //--> titolo Skin Navigator + _windowID = NavigatorID; //--> window ID virtuale per attivazione Skin Navigator + } + else + { + _caption = "Link"; //--> inizializzazione titolo + _windowID = 0; //--> inizializzazione window ID + } _loadParameter = ""; //--> inizializzazione parametri di caricamento per visualizzazione } #endregion @@ -112,8 +121,8 @@ else //Richiamo schermata senza parametri di caricamento { GUIMessage msg; - if (_windowID == TrailersPluginControlID) //Se richiesta di attivazione plugin Trailers - msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_CLICKED, 0, TrailersPluginControlID, TrailersPluginControlID, 0, 0, null); + if (_windowID == TrailersControlID) //Se richiesta di attivazione plugin Trailers + msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_CLICKED, 0, TrailersControlID, TrailersControlID, 0, 0, null); else //Caso normale di attivazione finesta MediaPortal msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, _windowID, 0, null); @@ -159,13 +168,8 @@ #endregion #region Proprietà - public bool IsValid - { - get - { - return (this._windowID >= 0); //L'ID della finestra di MediaPortal deve essere valido - } - } + public bool IsValid { get { return (this._windowID > InvalidID) ; } } + public bool IsNavigator { get { return (this._windowID == NavigatorID); } } public string Caption { get { return this._caption; } set { this._caption = value; } } public int WindowID { get { return this._windowID; } set { this._windowID = value; } } public string LoadParameter { get { return this._loadParameter; } set { this._loadParameter = value; } } Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinNavigatorConfig.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinNavigatorConfig.Designer.cs 2014-05-03 17:38:29 UTC (rev 4793) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinNavigatorConfig.Designer.cs 2014-05-03 19:44:02 UTC (rev 4794) @@ -52,7 +52,7 @@ this.MaximizeBox = false; this.Name = "SkinNavigatorConfig"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "SkinNavigatorConfig"; + this.Text = "Skin Navigator Configuration"; this.ResumeLayout(false); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-04 16:34:32
|
Revision: 4795 http://sourceforge.net/p/mp-plugins/code/4795 Author: nicsergio Date: 2014-05-04 16:34:28 +0000 (Sun, 04 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Common.Utils.dll trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Core.dll trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Utils.dll trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Added Paths: ----------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Dialogs.dll Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Common.Utils.dll =================================================================== (Binary files differ) Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Core.dll =================================================================== (Binary files differ) Added: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Dialogs.dll =================================================================== (Binary files differ) Index: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Dialogs.dll =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Dialogs.dll 2014-05-03 19:44:02 UTC (rev 4794) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Dialogs.dll 2014-05-04 16:34:28 UTC (rev 4795) Property changes on: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Dialogs.dll ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Utils.dll =================================================================== (Binary files differ) Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-03 19:44:02 UTC (rev 4794) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-04 16:34:28 UTC (rev 4795) @@ -26,14 +26,15 @@ { MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "Plugin started")); + string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml"); + myShortCuts = new ShortCuts(settingsFile); //Creazione classe per gestione shorcuts + myShortCuts.Log += new LogEventHandler(myShortCuts_Log); //--> sottoscrizione evento di log shortuts + if (LockKeys.ChangeCapsLock(myShortCuts.GeneralForcingCapsLock)) MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "CapsLock " + ((myShortCuts.GeneralForcingCapsLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); if (LockKeys.ChangeNumLock(myShortCuts.GeneralForcingNumLock)) - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "NumLock " + ((myShortCuts.GeneralForcingNumLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); - - string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml"); - myShortCuts = new ShortCuts(settingsFile); //Creazione classe per gestione shorcuts - myShortCuts.Log += new LogEventHandler(myShortCuts_Log); //--> sottoscrizione evento di log shortuts + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "NumLock " + ((myShortCuts.GeneralForcingNumLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); + if (myShortCuts.Initialize()) //Inizializzazione & lettura impostazioni shorcuts { try Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-03 19:44:02 UTC (rev 4794) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-04 16:34:28 UTC (rev 4795) @@ -52,6 +52,10 @@ <SpecificVersion>False</SpecificVersion> <HintPath>ExternalResources\Core.dll</HintPath> </Reference> + <Reference Include="Dialogs, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>ExternalResources\Dialogs.dll</HintPath> + </Reference> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="System.Deployment" /> @@ -173,6 +177,7 @@ </BootstrapperPackage> </ItemGroup> <ItemGroup> + <Content Include="ExternalResources\Dialogs.dll" /> <Content Include="Resources\Images\SkinNav.png" /> <Content Include="Resources\Images\SkinNavAdd.png" /> <EmbeddedResource Include="Resources\XmlFiles\DefaultConfig.xml"> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-05-03 19:44:02 UTC (rev 4794) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-05-04 16:34:28 UTC (rev 4795) @@ -311,12 +311,17 @@ } void idTextBox_KeyPress(object sender, KeyPressEventArgs e) { - if (!(char.IsDigit(e.KeyChar))) //Filtro per input numerico per la cella WindowID + if ((int)shortCutsDataGridView.CurrentCell.Value <= 0) //Se WindowID negativo (possibile solo con Skin Navigator) + e.Handled = true; //--> carattere inputato da ignorare + else { - Keys key = (Keys)e.KeyChar; - if (!(key == Keys.Back || key == Keys.Delete)) + if (!(char.IsDigit(e.KeyChar))) //Filtro per input numerico per la cella WindowID { - e.Handled = true; //--> carattere inputato da ignorare + Keys key = (Keys)e.KeyChar; + if (!(key == Keys.Back || key == Keys.Delete)) + { + e.Handled = true; //--> carattere inputato da ignorare + } } } } @@ -381,7 +386,11 @@ } private void skinNavAddButton_Click(object sender, EventArgs e) { - + ShortCut sc = new ShortCut(true); + myShortCuts.Items.Add(sc); + shortCutsDataGridView.CurrentCell = shortCutsDataGridView[0, shortCutsDataGridView.RowCount - 1]; + shortCutsDataGridView.Rows[shortCutsDataGridView.RowCount - 1].Selected = true; + skinNavAddButton.Enabled = false; } private void rowUpButton_Click(object sender, EventArgs e) { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-03 19:44:02 UTC (rev 4794) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-04 16:34:28 UTC (rev 4795) @@ -11,6 +11,7 @@ using MediaPortal.Player; using MediaPortal.Profile; using MediaPortal.Util; +using MediaPortal.Dialogs; namespace ProcessPlugins.ShortCuter { @@ -168,7 +169,7 @@ #endregion #region Proprietà - public bool IsValid { get { return (this._windowID > InvalidID) ; } } + public bool IsValid { get { return (this._windowID > InvalidID || this.IsNavigator) ; } } public bool IsNavigator { get { return (this._windowID == NavigatorID); } } public string Caption { get { return this._caption; } set { this._caption = value; } } public int WindowID { get { return this._windowID; } set { this._windowID = value; } } @@ -255,11 +256,12 @@ #endregion #region Costruttore - public ShortCut() //Costruttore classe ShortCut + public ShortCut() : this(false) { } //Costruttore classe ShortCut (senza argomenti) + public ShortCut(bool skinNavigator) //Costruttore classe ShortCut { - _caption = "ShortCut"; //--> inizializzazione titolo + _caption = (skinNavigator ? "Skin Navigator" : "ShortCut"); //--> inizializzazione titolo _keys = new KeyCombination(); //--> istanziazione classe KeyCombination - _destination = new WindowLink(); //--> istanziazione classe WindowLink + _destination = new WindowLink(skinNavigator); //--> istanziazione classe WindowLink _destination.Caption = ""; //--> reset caption destinazione (gestita caption shortcut) _return = false; //--> inizializzazione ritorno a finestra precedente se si è già a destinazione _soundEffect = "click.wav"; //--> inizializzazione effetto sonoro @@ -330,7 +332,8 @@ #endregion #region Proprietà - public bool IsValid { get { return this._keys.IsValid && _destination.IsValid; } } + public bool IsValid { get { return this._destination.IsValid && this._keys.IsValid; } } + public bool IsNavigator { get { return this._destination.IsNavigator; } } public string Caption { get { return this._caption; } set { this._caption = value; this.NotifyPropertyChanged("Caption"); } } public string Key { get { return this._keys.Key; } set { this._keys.Key = value; this.NotifyPropertyChanged("Key"); } } public bool Ctrl { get { return this._keys.Ctrl; } set { this._keys.Ctrl = value; this.NotifyPropertyChanged("Ctrl"); } } @@ -629,33 +632,52 @@ List<ShortCut> scList = GetShortCutsGroup(k); //--> raccolta lista shortcut associati alla combinazione di tasti attuale if (scList != null && scList.Count > 0) //Se trovato almeno uno shortcut { - if (scList.Count == 1) //Shortcut a destinazione singola + if (scList.Find(x => x.IsNavigator) != null) //Se combinazione di tasti corrispondente a Skin Navigator { - if (scList[0].Return && AlreadyAtDestination(scList[0])) //Se impostato flag di ritorno e finestra attuale corrispondente a destinazione - scList[0].GoPrevious(Log); //--> visualizzazione finestra precedente - else - if (scList[0].Go(Log)) //--> visualizzazione finestra di destinazione shortcut - { - lastDestination.WindowID = scList[0].WindowID; //--> memorizzazione id finestra - lastDestination.LoadParameter = scList[0].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati - } + + + GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + dlgMenu.Reset(); + dlgMenu.SetHeading("Skin Navigator"); + dlgMenu.ShowQuickNumbers = false; + + dlgMenu.Add("tega"); + dlgMenu.Add("nanda"); + + dlgMenu.DoModal((int)GUIWindowManager.ActiveWindow); + //if (dlgMenu.SelectedLabel >= 0) + } - else //Shortcut a destinazione multipla (ciclico) + else //Shortcuts normali { - int scIndex = 0; - for (int i = 0; i < scList.Count; i++) //Iterazione di verifica se la finestra attuale corrisponde ad una delle destinazioni + if (scList.Count == 1) //Shortcut a destinazione singola { - if (AlreadyAtDestination(scList[i])) + if (scList[0].Return && AlreadyAtDestination(scList[0])) //Se impostato flag di ritorno e finestra attuale corrispondente a destinazione + scList[0].GoPrevious(Log); //--> visualizzazione finestra precedente + else + if (scList[0].Go(Log)) //--> visualizzazione finestra di destinazione shortcut + { + lastDestination.WindowID = scList[0].WindowID; //--> memorizzazione id finestra + lastDestination.LoadParameter = scList[0].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati + } + } + else //Shortcut a destinazione multipla (ciclico) + { + int scIndex = 0; + for (int i = 0; i < scList.Count; i++) //Iterazione di verifica se la finestra attuale corrisponde ad una delle destinazioni { - scIndex = (i + 1) % scList.Count; //--> impostazione indice shortcut successivo - break; + if (AlreadyAtDestination(scList[i])) + { + scIndex = (i + 1) % scList.Count; //--> impostazione indice shortcut successivo + break; + } } + if (scList[scIndex].Go(Log)) //--> visualizzazione finestra di destinazione shortcut + { + lastDestination.WindowID = scList[scIndex].WindowID; //--> memorizzazione id finestra + lastDestination.LoadParameter = scList[scIndex].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati + } } - if (scList[scIndex].Go(Log)) //--> visualizzazione finestra di destinazione shortcut - { - lastDestination.WindowID = scList[scIndex].WindowID; //--> memorizzazione id finestra - lastDestination.LoadParameter = scList[scIndex].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati - } } } else //Combinazione di tasti non corrispondente a nessuno shortcut This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-06 21:54:38
|
Revision: 4797 http://sourceforge.net/p/mp-plugins/code/4797 Author: nicsergio Date: 2014-05-06 21:54:35 +0000 (Tue, 06 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/AssemblyInfo.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/AssemblyInfo.cs 2014-05-04 20:12:54 UTC (rev 4796) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/AssemblyInfo.cs 2014-05-06 21:54:35 UTC (rev 4797) @@ -33,8 +33,8 @@ // È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build // utilizzando l'asterisco (*) come descritto di seguito: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.6.0")] -[assembly: AssemblyFileVersion("2.0.6.0")] +[assembly: AssemblyVersion("2.1.0.0")] +[assembly: AssemblyFileVersion("2.1.0.0")] //Importante per la compatibilità con MediaPortal [assembly: CompatibleVersion("1.1.6.27644")] \ No newline at end of file Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-04 20:12:54 UTC (rev 4796) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-06 21:54:35 UTC (rev 4797) @@ -6,7 +6,7 @@ <ProductVersion>8.0.30703</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}</ProjectGuid> - <OutputType>WinExe</OutputType> + <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>ProcessPlugins.ShortCuter</RootNamespace> <AssemblyName>ShortCuter</AssemblyName> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-05-04 20:12:54 UTC (rev 4796) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-05-06 21:54:35 UTC (rev 4797) @@ -47,8 +47,8 @@ toolTip.SetToolTip(resetButton, "Reset actual settings and load the default configuration"); toolTip.SetToolTip(saveButton, "Save actual settings"); toolTip.SetToolTip(updateButton, "Save actual setting and close the application"); - toolTip.SetToolTip(capsLockComboBox, "Set forcing for Caps-Lock when Mediaportal starts (OFF is recommended)"); - toolTip.SetToolTip(numLockComboBox, "Set forcing for Num-Lock when Mediaportal starts"); + toolTip.SetToolTip(capsLockComboBox, "Set forcing for Caps-Lock when MediaPortal starts (OFF is recommended)"); + toolTip.SetToolTip(numLockComboBox, "Set forcing for Num-Lock when MediaPortal starts"); toolTip.SetToolTip(skinNavConfigButton, "Configure Skin Navigator"); toolTip.SetToolTip(infoPictureBox, "Version information"); @@ -108,7 +108,7 @@ windowIdColumn.Width = 70; windowIdColumn.MaxInputLength = 10; windowIdColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - windowIdColumn.ToolTipText = "MediaPorta window ID for the shortcut's destination"; + windowIdColumn.ToolTipText = "MediaPortal window ID for the shortcut's destination"; DataGridViewTextBoxColumn loadParameterColumn = new DataGridViewTextBoxColumn(); loadParameterColumn.DataPropertyName = "LoadParameter"; @@ -390,8 +390,7 @@ myShortCuts.Items.Add(sc); shortCutsDataGridView.CurrentCell = shortCutsDataGridView[0, shortCutsDataGridView.RowCount - 1]; shortCutsDataGridView.Rows[shortCutsDataGridView.RowCount - 1].Selected = true; - skinNavAddButton.Enabled = false; - } + } private void rowUpButton_Click(object sender, EventArgs e) { MoveItemList(true); Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-04 20:12:54 UTC (rev 4796) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-06 21:54:35 UTC (rev 4797) @@ -157,6 +157,14 @@ return false; //--> comando non completato } } + public WindowLink Clone() //Clonazione collegamento + { + WindowLink lnk = new WindowLink(); + lnk.Caption = _caption; + lnk.WindowID = _windowID; + lnk.LoadParameter = _loadParameter; + return lnk; + } public void Reset() //Reset destinazione (invalidazione) { _windowID = InvalidID; //--> invalidazione Id finestra @@ -245,7 +253,7 @@ public bool Shift { get { return this._shift; } set { this._shift = value; } } #endregion } - internal class ShortCut : INotifyPropertyChanged //Classe shortcut (scorciatoia da tastiera) con notifica variazione proprietà + internal class ShortCut : INotifyPropertyChanged //Classe shortcut (scorciatoia da tastiera) con notifica variazione proprietà per binding su GridView { #region Dati private string _caption; //Titolo link @@ -345,6 +353,7 @@ public string SoundEffect { get { return this._soundEffect; } set { this._soundEffect = value; this.NotifyPropertyChanged("SoundEffect"); } } #endregion } + internal class Window //Classe finestra di MediaPortal { #region Dati @@ -372,7 +381,7 @@ public string XmlFile { get { return this._xmlFile; } set { this._xmlFile = value; } } #endregion } - internal class NavigatorItem //Classe elemento per navigazione + internal class NavItem //Classe elemento per navigazione { #region Dati private string _caption; //Titolo link @@ -381,13 +390,17 @@ #endregion #region Costruttore - public NavigatorItem() //Costruttore classe Window + public NavItem() //Costruttore classe Window { _caption = "Navigator Group"; //--> inizializzazione titolo } #endregion - + #region Proprietà + public string Caption { get { return this._caption; } set { this._caption = value; } } + public BindingList<Window> Windows { get { return this._windows; } } + public BindingList<WindowLink> Destinations { get { return this._destinations; } } + #endregion } internal class ShortCuts //Classe di gestione degli shortcuts configurati @@ -403,7 +416,8 @@ #region Dati private readonly string SettingsFile; //File di salvataggio impostazioni private GeneralSettings _general = new GeneralSettings(); //Impostazioni generali plugin - private BindingList<ShortCut> _items = new BindingList<ShortCut>(); //Lista (con associazione dati) degli shortcuts configurati + private BindingList<ShortCut> _items = new BindingList<ShortCut>(); //Lista (con associazione dati) degli shortcuts configurati + private BindingList<NavItem> _navItems = new BindingList<NavItem>(); private bool _initialized; //Classe inizializzata private WindowLink lastDestination = new WindowLink(); //Dati ultima destinazione attivata dal plugin @@ -484,6 +498,19 @@ else return false; //--> finestra attuale non corrispondente a destinazione shortcut } + private void UpdateLastDestination(ShortCut sc) + { + lastDestination.WindowID = sc.WindowID; //--> memorizzazione id finestra + lastDestination.LoadParameter = sc.LoadParameter; //--> memorizzazione parametri di caricamento utilizzati + } + + + private void UpdateLastDestination(WindowLink lnk) + { + lastDestination.WindowID = lnk.WindowID; //--> memorizzazione id finestra + lastDestination.LoadParameter = lnk.LoadParameter; //--> memorizzazione parametri di caricamento utilizzati + } + #endregion #region Metodi Pubblici @@ -679,19 +706,57 @@ { if (scList.Find(x => x.IsNavigator) != null) //Se combinazione di tasti corrispondente a Skin Navigator { - + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Request Skin Navigator dialog menu")); + + try + { + int actWindowID = (int)GUIWindowManager.ActiveWindow; + GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + dlgMenu.Reset(); + dlgMenu.SetHeading("Skin Navigator"); + dlgMenu.ShowQuickNumbers = false; + + List<WindowLink> dlgLinks = new List<WindowLink>(); + foreach (NavItem item in _navItems) //Iterazione per memorizzazione impostazioni shortcuts + { + if ((item.Windows.First(x => x.WindowID == actWindowID)) != null || item.Windows.Count == 0) + { + bool first = true; + foreach (WindowLink link in item.Destinations) //Iterazione per memorizzazione impostazioni shortcuts + { + if (first && dlgLinks.Count > 0) + { + dlgMenu.Add("---- ----"); + dlgLinks.Add(null); + first = false; + } + dlgMenu.Add(link.Caption); + dlgLinks.Add(link); + } + } + } + + if (dlgLinks.Count > 0) + { + dlgMenu.DoModal(actWindowID); + if (dlgMenu.SelectedLabel >= 0 && dlgMenu.SelectedLabel < dlgLinks.Count) + dlgLinks[dlgMenu.SelectedLabel].Go(Log); + else + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No links selected from Skin Navigator dialog menu, ID = " + actWindowID)); + } + else + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No links found for Skin Navigator, window ID = " + actWindowID)); + } + catch (Exception e) + { + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Error, "Error opening Skin Navigator dialog menu", e)); + } - GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); - dlgMenu.Reset(); - dlgMenu.SetHeading("Skin Navigator"); - dlgMenu.ShowQuickNumbers = false; - dlgMenu.Add("tega"); - dlgMenu.Add("nanda"); - - dlgMenu.DoModal((int)GUIWindowManager.ActiveWindow); - //if (dlgMenu.SelectedLabel >= 0) - } else //Shortcuts normali { @@ -701,10 +766,7 @@ scList[0].GoPrevious(Log); //--> visualizzazione finestra precedente else if (scList[0].Go(Log)) //--> visualizzazione finestra di destinazione shortcut - { - lastDestination.WindowID = scList[0].WindowID; //--> memorizzazione id finestra - lastDestination.LoadParameter = scList[0].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati - } + lastDestination.Get(scList[0].); //--> memorizzazione destinazione } else //Shortcut a destinazione multipla (ciclico) { @@ -730,7 +792,7 @@ Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Key not mapped: " + k.ToString())); } } - public void WindowChanged(int windowID) //Evento di finestra attiva modificata + public void WindowChanged(int windowID) //Evento di finestra attiva modificata (richiamato dall'esterno) { if (lastDestination.WindowID != windowID) //Se attivata una finestra non corrispondente all'ultima destinazione della classe lastDestination.Reset(); //--> invalidazione parametri memorizzati relativi all'ultima destinazione This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-09 15:07:53
|
Revision: 4800 http://sourceforge.net/p/mp-plugins/code/4800 Author: nicsergio Date: 2014-05-09 15:07:50 +0000 (Fri, 09 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-08 15:04:15 UTC (rev 4799) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-09 15:07:50 UTC (rev 4800) @@ -30,10 +30,10 @@ myShortCuts = new ShortCuts(settingsFile); //Creazione classe per gestione shorcuts myShortCuts.Log += new LogEventHandler(myShortCuts_Log); //--> sottoscrizione evento di log shortuts - if (LockKeys.ChangeCapsLock(myShortCuts.GeneralForcingCapsLock)) - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "CapsLock " + ((myShortCuts.GeneralForcingCapsLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); - if (LockKeys.ChangeNumLock(myShortCuts.GeneralForcingNumLock)) - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "NumLock " + ((myShortCuts.GeneralForcingNumLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); + if (LockKeys.ChangeCapsLock(myShortCuts.General.ForcingCapsLock)) + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "CapsLock " + ((myShortCuts.General.ForcingCapsLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); + if (LockKeys.ChangeNumLock(myShortCuts.General.ForcingNumLock)) + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "NumLock " + ((myShortCuts.General.ForcingNumLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); if (myShortCuts.Initialize()) //Inizializzazione & lettura impostazioni shorcuts { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-05-08 15:04:15 UTC (rev 4799) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-05-09 15:07:50 UTC (rev 4800) @@ -33,9 +33,9 @@ FormatShortCutsGrid(); capsLockComboBox.DataSource = Enum.GetNames(typeof(LockKeys.LockKeyActions)); - capsLockComboBox.SelectedItem = Enum.GetName(typeof(LockKeys.LockKeyActions), myShortCuts.GeneralForcingCapsLock); + capsLockComboBox.SelectedItem = Enum.GetName(typeof(LockKeys.LockKeyActions), myShortCuts.General.ForcingCapsLock); numLockComboBox.DataSource = Enum.GetNames(typeof(LockKeys.LockKeyActions)); - numLockComboBox.SelectedItem = Enum.GetName(typeof(LockKeys.LockKeyActions), myShortCuts.GeneralForcingNumLock); + numLockComboBox.SelectedItem = Enum.GetName(typeof(LockKeys.LockKeyActions), myShortCuts.General.ForcingNumLock); toolTip.SetToolTip(skinItems, "Double click to set the link's parameter to shortcut"); toolTip.SetToolTip(rowAddButton, "Add shortcut to list"); @@ -230,8 +230,8 @@ } private bool Save() //Salvataggio configurazione plugin { - myShortCuts.GeneralForcingCapsLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), capsLockComboBox.SelectedItem.ToString()); - myShortCuts.GeneralForcingNumLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), numLockComboBox.SelectedItem.ToString()); + myShortCuts.General.ForcingCapsLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), capsLockComboBox.SelectedItem.ToString()); + myShortCuts.General.ForcingNumLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), numLockComboBox.SelectedItem.ToString()); return myShortCuts.SaveConfig(); } #endregion Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-08 15:04:15 UTC (rev 4799) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-09 15:07:50 UTC (rev 4800) @@ -21,7 +21,7 @@ { #region Dati private LogLevels _logLevel; //Livello di log - private string _logMessage; //Messaggio di log + private string _logMessage; //Messaggio di log private Exception _logException; //Eventuale eccezione public enum LogLevels //Tipologie di livelli di log @@ -43,8 +43,8 @@ #endregion #region Proprietà - public LogLevels LogLevel { get { return this._logLevel; } } - public string LogMessage { get { return this._logMessage; } } + public LogLevels LogLevel { get { return this._logLevel; } } + public string LogMessage { get { return this._logMessage; } } public Exception LogException { get { return this._logException; } } #endregion } @@ -160,8 +160,8 @@ public WindowLink Clone() //Clonazione collegamento { WindowLink lnk = new WindowLink(); - lnk.Caption = _caption; - lnk.WindowID = _windowID; + lnk.Caption = _caption; + lnk.WindowID = _windowID; lnk.LoadParameter = _loadParameter; return lnk; } @@ -177,10 +177,10 @@ #endregion #region Proprietà - public bool IsValid { get { return (this._windowID > InvalidID || this.IsNavigator); } } - public bool IsNavigator { get { return (this._windowID == NavigatorID); } } - public string Caption { get { return this._caption; } set { this._caption = value; } } - public int WindowID { get { return this._windowID; } set { this._windowID = value; } } + public bool IsValid { get { return (this._windowID > InvalidID || this.IsNavigator); } } + public bool IsNavigator { get { return (this._windowID == NavigatorID); } } + public string Caption { get { return this._caption; } set { this._caption = value; } } + public int WindowID { get { return this._windowID; } set { this._windowID = value; } } public string LoadParameter { get { return this._loadParameter; } set { this._loadParameter = value; } } #endregion } @@ -188,9 +188,9 @@ { #region Dati private string _key; //Tasto (stringa corrispondente a KeyCode) - private bool _ctrl; //Utilizzo del modificatore "Ctrl" - combinazione di tasti - private bool _alt; //Utilizzo del modificatore "Alt" - combinazione di tasti - private bool _shift; //Utilizzo del modificatore "Shift" - combinazione di tasti + private bool _ctrl; //Utilizzo del modificatore "Ctrl" - combinazione di tasti + private bool _alt; //Utilizzo del modificatore "Alt" - combinazione di tasti + private bool _shift; //Utilizzo del modificatore "Shift" - combinazione di tasti private static readonly List<Keys> ModifierKeys = new List<Keys>(); //Lista dei tasti modificatori #endregion @@ -210,16 +210,16 @@ } public KeyCombination() //Costruttore classe KeyCombination { - _key = "A"; //--> inizializzazione tasto - _ctrl = true; //--> inizializzazione utilizzo del modificatore "Ctrl" - _alt = false; //--> inizializzazione utilizzo del modificatore "Alt" + _key = "A"; //--> inizializzazione tasto + _ctrl = true; //--> inizializzazione utilizzo del modificatore "Ctrl" + _alt = false; //--> inizializzazione utilizzo del modificatore "Alt" _shift = true; //--> inizializzazione utilizzo del modificatore "Shift" } public KeyCombination(KeyEventArgs k) //Costruttore classe KeyCombination da evento di pressione tasto { - _key = k.KeyCode.ToString(); //--> assegnazione tasto - _ctrl = k.Control; //--> utilizzo del modificatore "Ctrl" - _alt = k.Alt; //--> utilizzo del modificatore "Alt" + _key = k.KeyCode.ToString(); //--> assegnazione tasto + _ctrl = k.Control; //--> utilizzo del modificatore "Ctrl" + _alt = k.Alt; //--> utilizzo del modificatore "Alt" _shift = k.Shift; //--> utilizzo del modificatore "Shift" } #endregion @@ -247,32 +247,32 @@ return (key != Keys.None && !ModifierKeys.Contains(key)); //--> verifica se la stringa corrisponde ad un tasto e che il tasto non sia un modificatore } } - public string Key { get { return this._key; } set { this._key = value; } } - public bool Ctrl { get { return this._ctrl; } set { this._ctrl = value; } } - public bool Alt { get { return this._alt; } set { this._alt = value; } } + public string Key { get { return this._key; } set { this._key = value; } } + public bool Ctrl { get { return this._ctrl; } set { this._ctrl = value; } } + public bool Alt { get { return this._alt; } set { this._alt = value; } } public bool Shift { get { return this._shift; } set { this._shift = value; } } #endregion } internal class ShortCut : INotifyPropertyChanged //Classe shortcut (scorciatoia da tastiera) con notifica variazione proprietà per binding su GridView { #region Dati - private string _caption; //Titolo link + private string _caption; //Titolo link private KeyCombination _keys; //Combinazione di tasti per attivazione shortcut - private WindowLink _destination; //Destinazione dello shortcut - private bool _return; //Ritorno a finestra precedente se si è già a destinazione - private string _soundEffect; //File relativo all'eventuale effetto sonoro + private WindowLink _destination; //Destinazione dello shortcut + private bool _return; //Ritorno a finestra precedente se si è già a destinazione + private string _soundEffect; //File relativo all'eventuale effetto sonoro #endregion #region Costruttore public ShortCut() : this(false) { } //Costruttore classe ShortCut (senza argomenti) public ShortCut(bool skinNavigator) //Costruttore classe ShortCut { - _caption = (skinNavigator ? "Skin Navigator" : "ShortCut"); //--> inizializzazione titolo - _keys = new KeyCombination(); //--> istanziazione classe KeyCombination - _destination = new WindowLink(skinNavigator); //--> istanziazione classe WindowLink + _caption = (skinNavigator ? "Skin Navigator" : "ShortCut"); //--> inizializzazione titolo + _keys = new KeyCombination(); //--> istanziazione classe KeyCombination + _destination = new WindowLink(skinNavigator); //--> istanziazione classe WindowLink _destination.Caption = ""; //--> reset caption destinazione (gestita caption shortcut) - _return = false; //--> inizializzazione ritorno a finestra precedente se si è già a destinazione - _soundEffect = "click.wav"; //--> inizializzazione effetto sonoro + _return = false; //--> inizializzazione ritorno a finestra precedente se si è già a destinazione + _soundEffect = "click.wav"; //--> inizializzazione effetto sonoro } #endregion @@ -340,17 +340,17 @@ #endregion #region Proprietà - public bool IsValid { get { return this._destination.IsValid && this._keys.IsValid; } } - public bool IsNavigator { get { return this._destination.IsNavigator; } } - public string Caption { get { return this._caption; } set { this._caption = value; this.NotifyPropertyChanged("Caption"); } } - public string Key { get { return this._keys.Key; } set { this._keys.Key = value; this.NotifyPropertyChanged("Key"); } } - public bool Ctrl { get { return this._keys.Ctrl; } set { this._keys.Ctrl = value; this.NotifyPropertyChanged("Ctrl"); } } - public bool Alt { get { return this._keys.Alt; } set { this._keys.Alt = value; this.NotifyPropertyChanged("Alt"); } } - public bool Shift { get { return this._keys.Shift; } set { this._keys.Shift = value; this.NotifyPropertyChanged("Shift"); } } - public int WindowID { get { return this._destination.WindowID; } set { this._destination.WindowID = value; this.NotifyPropertyChanged("WindowID"); } } + public bool IsValid { get { return this._destination.IsValid && this._keys.IsValid; } } + public bool IsNavigator { get { return this._destination.IsNavigator; } } + public string Caption { get { return this._caption; } set { this._caption = value; this.NotifyPropertyChanged("Caption"); } } + public string Key { get { return this._keys.Key; } set { this._keys.Key = value; this.NotifyPropertyChanged("Key"); } } + public bool Ctrl { get { return this._keys.Ctrl; } set { this._keys.Ctrl = value; this.NotifyPropertyChanged("Ctrl"); } } + public bool Alt { get { return this._keys.Alt; } set { this._keys.Alt = value; this.NotifyPropertyChanged("Alt"); } } + public bool Shift { get { return this._keys.Shift; } set { this._keys.Shift = value; this.NotifyPropertyChanged("Shift"); } } + public int WindowID { get { return this._destination.WindowID; } set { this._destination.WindowID = value; this.NotifyPropertyChanged("WindowID"); } } public string LoadParameter { get { return this._destination.LoadParameter; } set { this._destination.LoadParameter = value; this.NotifyPropertyChanged("LoadParameter"); } } - public bool Return { get { return this._return; } set { this._return = value; this.NotifyPropertyChanged("Return"); } } - public string SoundEffect { get { return this._soundEffect; } set { this._soundEffect = value; this.NotifyPropertyChanged("SoundEffect"); } } + public bool Return { get { return this._return; } set { this._return = value; this.NotifyPropertyChanged("Return"); } } + public string SoundEffect { get { return this._soundEffect; } set { this._soundEffect = value; this.NotifyPropertyChanged("SoundEffect"); } } #endregion } @@ -381,7 +381,7 @@ public string XmlFile { get { return this._xmlFile; } set { this._xmlFile = value; } } #endregion } - internal class NavItem //Classe elemento per navigazione + internal class NavItem //Classe elemento per navigazione { #region Dati private string _caption; //Titolo link @@ -406,31 +406,40 @@ internal class ShortCuts //Classe di gestione degli shortcuts configurati { #region Strutture - private struct GeneralSettings //Struttura impostazioni generali + + public struct GeneralSettings //Struttura impostazioni generali { public LockKeys.LockKeyActions ForcingCapsLock; //Tipologia di forzatura Caps-Lock all'avvio public LockKeys.LockKeyActions ForcingNumLock; //Tipologia di forzatura Num-Lock all'avvio } + public struct NavigatorSettings + { + public string Header ; //Tipologia di forzatura Caps-Lock all'avvio + public bool ShowSeparator; //Tipologia di forzatura Num-Lock all'avvio + public string Separator; + public bool RemoveDuplicates; + } #endregion #region Dati - private readonly string SettingsFile; //File di salvataggio impostazioni - private GeneralSettings _general = new GeneralSettings(); //Impostazioni generali plugin - private BindingList<ShortCut> _items = new BindingList<ShortCut>(); //Lista (con associazione dati) degli shortcuts configurati - private BindingList<NavItem> _navItems = new BindingList<NavItem>(); - private bool _initialized; //Classe inizializzata + private readonly string SettingsFile; //File di salvataggio impostazioni + private GeneralSettings _general = new GeneralSettings(); //Impostazioni generali plugin + private BindingList<ShortCut> _items = new BindingList<ShortCut>(); //Lista (con associazione dati) degli shortcuts configurati + private BindingList<NavItem> _navItems = new BindingList<NavItem>(); + private bool _initialized; //Classe inizializzata - private WindowLink lastDestination = new WindowLink(); //Dati ultima destinazione attivata dal plugin + private WindowLink lastDestination = new WindowLink(); //Dati ultima destinazione attivata dal plugin + #endregion #region Costruttore public ShortCuts(string settingsFile) //Costruttore classe ShortCuts { - SettingsFile = settingsFile; //--> percorso & nome file delle impostazioni + SettingsFile = settingsFile; //--> percorso & nome file delle impostazioni _general.ForcingCapsLock = LockKeys.LockKeyActions.None; //--> default: nessuna modifica stato Caps-Lock - _general.ForcingNumLock = LockKeys.LockKeyActions.None; //--> default: nessuna modifica stato Num-Lock - _initialized = false; //--> reset classe inizializzata - lastDestination.Caption = "Last destination"; //--> titolo ultima destinazione + _general.ForcingNumLock = LockKeys.LockKeyActions.None; //--> default: nessuna modifica stato Num-Lock + _initialized = false; //--> reset classe inizializzata + lastDestination.Caption = "Last destination"; //--> titolo ultima destinazione lastDestination.Reset(); //--> reset ultima destinazione attivata dal plugin } #endregion @@ -441,25 +450,25 @@ using (Settings confReader = new Settings(SettingsFile)) { const string sectionName = "ShortCuterForm"; - const string capPrefix = "Titel"; - const string keyPrefix = "Key"; - const string widPrefix = "ID"; + const string capPrefix = "Titel"; + const string keyPrefix = "Key"; + const string widPrefix = "ID"; if (!confReader.HasSection<string>(sectionName)) return false; //--> se sezione non presente: il file non corrisponde - bool ctrl = confReader.GetValueAsBool(sectionName, "ModCtrl", false); //--> utilizzo del modificatore ctrl per tutti gli shortcut + bool ctrl = confReader.GetValueAsBool(sectionName, "ModCtrl", false); //--> utilizzo del modificatore ctrl per tutti gli shortcut bool shift = confReader.GetValueAsBool(sectionName, "ModShift", false); //--> utilizzo del modificatore shift per tutti gli shortcut for (int i = 1; i <= 20; i++) //Iterazione di lettura shortcut { ShortCut sc = new ShortCut(); - sc.Caption = confReader.GetValueAsString(sectionName, capPrefix + string.Format("{0:00}", i), ""); - sc.Key = confReader.GetValueAsString(sectionName, keyPrefix + string.Format("{0:00}", i), "").ToUpper(); - sc.WindowID = confReader.GetValueAsInt(sectionName, widPrefix + string.Format("{0:00}", i), -1); - sc.Ctrl = ctrl; - sc.Alt = false; - sc.Shift = shift; + sc.Caption = confReader.GetValueAsString(sectionName, capPrefix + string.Format("{0:00}", i), ""); + sc.Key = confReader.GetValueAsString(sectionName, keyPrefix + string.Format("{0:00}", i), "").ToUpper(); + sc.WindowID = confReader.GetValueAsInt(sectionName, widPrefix + string.Format("{0:00}", i), -1); + sc.Ctrl = ctrl; + sc.Alt = false; + sc.Shift = shift; if (sc.IsValid) //Se shortcut valido _items.Add(sc); //--> aggiunta dello shortcut nella lista } @@ -512,12 +521,12 @@ dlgMenu.ShowQuickNumbers = false; List<WindowLink> dlgLinks = new List<WindowLink>(); - foreach (NavItem item in _navItems) //Iterazione per memorizzazione impostazioni shortcuts + foreach (NavItem item in _navItems) //Iterazione per memorizzazione impostazioni shortcuts { if ((item.Windows.First(x => x.WindowID == actWindowID)) != null || item.Windows.Count == 0) { bool first = true; - foreach (WindowLink link in item.Destinations) //Iterazione per memorizzazione impostazioni shortcuts + foreach (WindowLink link in item.Destinations) //Iterazione per memorizzazione impostazioni shortcuts { if (first && dlgLinks.Count > 0) { @@ -537,7 +546,7 @@ if (dlgMenu.SelectedLabel >= 0 && dlgMenu.SelectedLabel < dlgLinks.Count) if (dlgLinks[dlgMenu.SelectedLabel].Go(Log)) { - lastDestination.WindowID = dlgLinks[dlgMenu.SelectedLabel].WindowID; + lastDestination.WindowID = dlgLinks[dlgMenu.SelectedLabel].WindowID; lastDestination.LoadParameter = dlgLinks[dlgMenu.SelectedLabel].LoadParameter; } else @@ -559,7 +568,7 @@ #region Metodi Pubblici public bool Initialize() //Inizializzazione { - _initialized = LoadConfig(false); //--> caricamento configurazione (standard) shortcuts + _initialized = LoadConfig(false); //--> caricamento configurazione (standard) shortcuts if (!_initialized) { if (Log != null) @@ -602,7 +611,7 @@ _general.ForcingCapsLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), innerNode.InnerText); else { - innerNode = generalNode.SelectSingleNode("ResetCapsLock"); //Necessario per compatibilità con file di configurazione V2.0.5.0 + innerNode = generalNode.SelectSingleNode("ResetCapsLock"); //Necessario per compatibilità con file di configurazione V2.0.5 if (innerNode != null && Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText))) _general.ForcingCapsLock = LockKeys.LockKeyActions.Off; } @@ -611,7 +620,7 @@ _general.ForcingNumLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), innerNode.InnerText); else { - innerNode = generalNode.SelectSingleNode("ResetNumLock"); //Necessario per compatibilità con file di configurazione V2.0.5.0 + innerNode = generalNode.SelectSingleNode("ResetNumLock"); //Necessario per compatibilità con file di configurazione V2.0.5 if (innerNode != null && Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText))) _general.ForcingNumLock = LockKeys.LockKeyActions.Off; } @@ -640,7 +649,7 @@ sc.WindowID = Convert.ToInt32(innerNode.InnerText); else { - innerNode = node.SelectSingleNode("Hyperlink"); //Necessario per compatibilità con file di configurazione V2.0.0.0 + innerNode = node.SelectSingleNode("Hyperlink"); //Necessario per compatibilità con file di configurazione V2.0.0 if (innerNode != null) sc.WindowID = Convert.ToInt32(innerNode.InnerText); } @@ -649,7 +658,7 @@ sc.LoadParameter = innerNode.InnerText; else { - innerNode = node.SelectSingleNode("HyperlinkParameter"); //Necessario per compatibilità con file di configurazione V2.0.0.0 + innerNode = node.SelectSingleNode("HyperlinkParameter"); //Necessario per compatibilità con file di configurazione V2.0.0 if (innerNode != null) sc.LoadParameter = innerNode.InnerText; } @@ -673,7 +682,7 @@ } catch (Exception e) { - if (defaultSettings && Log != null) //Se lettura configurazione predefinita fallita: emissione messaggio di errore + if (defaultSettings && Log != null) //Se lettura configurazione predefinita fallita: emissione messaggio di errore Log(this, new LogEventArgs(LogEventArgs.LogLevels.Error, "Error loading DefaultConfig.xml.", e)); return false; } @@ -699,27 +708,27 @@ xmlSettings.WriteStartDocument(); xmlSettings.WriteStartElement("ShortCuter"); - xmlSettings.WriteStartElement("General"); - xmlSettings.WriteElementString("ForcingCapsLock", _general.ForcingCapsLock.ToString()); - xmlSettings.WriteElementString("ForcingNumLock", _general.ForcingNumLock.ToString()); - xmlSettings.WriteEndElement(); - xmlSettings.WriteStartElement("Items"); - foreach (ShortCut sc in _items) //Iterazione per salvataggio sortcuts - { - xmlSettings.WriteStartElement("Item"); - xmlSettings.WriteElementString("Caption", sc.Caption); - xmlSettings.WriteElementString("Key", sc.Key); - xmlSettings.WriteElementString("Ctrl", Convert.ToInt16(sc.Ctrl).ToString()); - xmlSettings.WriteElementString("Alt", Convert.ToInt16(sc.Alt).ToString()); - xmlSettings.WriteElementString("Shift", Convert.ToInt16(sc.Shift).ToString()); - xmlSettings.WriteElementString("WindowID", sc.WindowID.ToString()); - xmlSettings.WriteElementString("LoadParameter", sc.LoadParameter); - xmlSettings.WriteElementString("Return", Convert.ToInt16(sc.Return).ToString()); - xmlSettings.WriteElementString("SoundEffect", sc.SoundEffect); + xmlSettings.WriteStartElement("General"); + xmlSettings.WriteElementString("ForcingCapsLock", _general.ForcingCapsLock.ToString()); + xmlSettings.WriteElementString("ForcingNumLock", _general.ForcingNumLock.ToString()); xmlSettings.WriteEndElement(); - } + xmlSettings.WriteStartElement("Items"); + foreach (ShortCut sc in _items) //Iterazione per salvataggio sortcuts + { + xmlSettings.WriteStartElement("Item"); + xmlSettings.WriteElementString("Caption", sc.Caption); + xmlSettings.WriteElementString("Key", sc.Key); + xmlSettings.WriteElementString("Ctrl", Convert.ToInt16(sc.Ctrl).ToString()); + xmlSettings.WriteElementString("Alt", Convert.ToInt16(sc.Alt).ToString()); + xmlSettings.WriteElementString("Shift", Convert.ToInt16(sc.Shift).ToString()); + xmlSettings.WriteElementString("WindowID", sc.WindowID.ToString()); + xmlSettings.WriteElementString("LoadParameter", sc.LoadParameter); + xmlSettings.WriteElementString("Return", Convert.ToInt16(sc.Return).ToString()); + xmlSettings.WriteElementString("SoundEffect", sc.SoundEffect); + xmlSettings.WriteEndElement(); + } + xmlSettings.WriteEndElement(); xmlSettings.WriteEndElement(); - xmlSettings.WriteEndElement(); xmlSettings.Flush(); xmlSettings.Close(); @@ -746,7 +755,6 @@ { List<ShortCut> scList = GetShortCutsGroup(k); //--> raccolta lista shortcut associati alla combinazione di tasti attuale if (scList != null && scList.Count > 0) //Se trovato almeno uno shortcut - { if (scList.Find(x => x.IsNavigator) != null) //Se combinazione di tasti corrispondente a Skin Navigator Navigation(); //--> gestione navigazione alla destinazione selezionata else //Shortcuts normali @@ -776,7 +784,6 @@ lastDestination.LoadParameter = scList[scIndex].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati } } - } else //Combinazione di tasti non corrispondente a nessuno shortcut if (Log != null) Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Key not mapped: " + k.ToString())); @@ -794,10 +801,13 @@ #endregion #region Proprietà - public bool Initialized { get { return this._initialized; } } - public LockKeys.LockKeyActions GeneralForcingCapsLock { get { return this._general.ForcingCapsLock; } set { this._general.ForcingCapsLock = value; } } - public LockKeys.LockKeyActions GeneralForcingNumLock { get { return this._general.ForcingNumLock; } set { this._general.ForcingNumLock = value; } } - public BindingList<ShortCut> Items { get { return this._items; } } + public bool Initialized { get { return this._initialized; } } + + public GeneralSettings General { get { return this._general; } set { this._general = value; } } + + //public LockKeys.LockKeyActions GeneralForcingCapsLock { get { return this._general.ForcingCapsLock; } set { this._general.ForcingCapsLock = value; } } + //public LockKeys.LockKeyActions GeneralForcingNumLock { get { return this._general.ForcingNumLock; } set { this._general.ForcingNumLock = value; } } + public BindingList<ShortCut> Items { get { return this._items; } } #endregion } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-09 22:39:16
|
Revision: 4801 http://sourceforge.net/p/mp-plugins/code/4801 Author: nicsergio Date: 2014-05-09 22:39:13 +0000 (Fri, 09 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-09 15:07:50 UTC (rev 4800) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-09 22:39:13 UTC (rev 4801) @@ -17,7 +17,7 @@ #region Costruttore static ShortCuter() //Costruttore classe ShortCuter { - LogPrefix = Tools.MyAssembly.Title + " - "; //Header per log su file (titolo assembly) + LogPrefix = Tools.MyAssembly.Title + ": "; //Header per log su file (titolo assembly) } #endregion Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-09 15:07:50 UTC (rev 4800) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-09 22:39:13 UTC (rev 4801) @@ -282,6 +282,15 @@ if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(name)); //--> pubblicazione evento } + private void Play(bool back) //Manda effetto sonoro (da specificare eventuale ritorno a finestra precedente) + { + try + { + if (_soundEffect.Length > 0 && !g_Player.Playing) + Utils.PlaySound(back ? "back.wav" : _soundEffect, false, true); //--> eventuale effetto sonoro + } + catch { } + } #endregion #region Metodi Pubblici @@ -291,13 +300,7 @@ if (_caption.Length > 0 && Log != null) Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Go to shortcut destination, " + this.ToString())); - try - { - if (_soundEffect.Length > 0 && !g_Player.Playing) - Utils.PlaySound(_soundEffect, false, true); //--> eventuale effetto sonoro - } - catch { } - + Play(); //--> eventuale effetto sonoro return _destination.Go(Log); //--> visualizzazione finestra di destinazione } public bool GoPrevious() { return GoPrevious(null); } //Ritorno alla finestra precedente (senza log) @@ -306,15 +309,10 @@ if (_caption.Length > 0 && Log != null) Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Go to previous window")); - try - { - if (_soundEffect.Length > 0 && !g_Player.Playing) - Utils.PlaySound("back.wav", false, true); //--> eventuale effetto sonoro - } - catch { } - + Play(true); //--> eventuale effetto sonoro return _destination.GoPrevious(Log); //--> visualizzazione finestra precedente } + public void Play() { Play(false); } //Manda effetto sonoro dello shortcut public ShortCut Clone() //Clonazione shortcut { ShortCut sc = new ShortCut(); @@ -353,92 +351,249 @@ public string SoundEffect { get { return this._soundEffect; } set { this._soundEffect = value; this.NotifyPropertyChanged("SoundEffect"); } } #endregion } - - internal class Window //Classe finestra di MediaPortal + internal class ShortCuts //Classe di gestione degli shortcuts configurati { - #region Dati - private string _caption; //Titolo finestra - private int _windowID; //Id finestra - private string _xmlFile; //Nome del file xml corrispondente - #endregion + #region Classi + public class GeneralSettings //Sotto-classe di gestione impostazioni generali + { + #region Dati + private LockKeys.LockKeyActions _forcingCapsLock; //Tipologia di forzatura Caps-Lock all'avvio + private LockKeys.LockKeyActions _forcingNumLock; //Tipologia di forzatura Num-Lock all'avvio + #endregion - #region Costruttore - public Window() //Costruttore classe Window + #region Costruttore + public GeneralSettings() //Costruttore classe GeneralSettings + { + _forcingCapsLock = LockKeys.LockKeyActions.None; //--> default: nessuna modifica stato Caps-Lock + _forcingNumLock = LockKeys.LockKeyActions.None; //--> default: nessuna modifica stato Num-Lock + } + #endregion + + #region Proprietà + public LockKeys.LockKeyActions ForcingCapsLock { get { return this._forcingCapsLock; } set { this._forcingCapsLock = value; } } + public LockKeys.LockKeyActions ForcingNumLock { get { return this._forcingNumLock; } set { this._forcingNumLock = value; } } + #endregion + } + public class SkinNavigator //Sotto-classe di gestione Skin Navigator { - _caption = ""; //--> inizializzazione titolo - _windowID = 0; //--> inizializzazione Id finestra - _xmlFile = ""; //--> inizializzazione nome file xml - } - #endregion + #region Classi + public class Item //Sotto-classe elemento per navigazione + { + #region Classi + public class Window //Sotto-classe finestra di abilitazione alla navigazione + { + #region Dati + private string _caption; //Titolo finestra + private int _windowID; //Id finestra + #endregion - #region Metodi Pubblici - public override string ToString() { return (_caption); } //Override metodo ToString per riempire classi ListControl - #endregion + #region Costruttore + public Window() //Costruttore classe Window + { + _caption = ""; //--> inizializzazione titolo + _windowID = 0; //--> inizializzazione Id finestra + } + #endregion - #region Proprietà - public string Caption { get { return this._caption; } set { this._caption = value; } } - public int WindowID { get { return this._windowID; } set { this._windowID = value; } } - public string XmlFile { get { return this._xmlFile; } set { this._xmlFile = value; } } - #endregion - } - internal class NavItem //Classe elemento per navigazione - { - #region Dati - private string _caption; //Titolo link - private BindingList<Window> _windows = new BindingList<Window>(); - private BindingList<WindowLink> _destinations = new BindingList<WindowLink>(); - #endregion + #region Metodi Pubblici + public override string ToString() { return (_caption); } //Override metodo ToString per riempire classi ListControl + #endregion - #region Costruttore - public NavItem() //Costruttore classe Window - { - _caption = "Navigator Group"; //--> inizializzazione titolo - } - #endregion + #region Proprietà + public string Caption { get { return this._caption; } set { this._caption = value; } } + public int WindowID { get { return this._windowID; } set { this._windowID = value; } } + #endregion + } + public class Destination : WindowLink //Sotto-classe destinazione di navigazione + { + #region Dati + private bool _force; //Forzatura destinazione + #endregion - #region Proprietà - public string Caption { get { return this._caption; } set { this._caption = value; } } - public BindingList<Window> Windows { get { return this._windows; } } - public BindingList<WindowLink> Destinations { get { return this._destinations; } } - #endregion - } + #region Costruttore + public Destination() : base() //Costruttore classe Destination + { + _force = false; //--> inizializzazione forzatura destinazione + } + #endregion - internal class ShortCuts //Classe di gestione degli shortcuts configurati - { - #region Strutture - - public struct GeneralSettings //Struttura impostazioni generali - { - public LockKeys.LockKeyActions ForcingCapsLock; //Tipologia di forzatura Caps-Lock all'avvio - public LockKeys.LockKeyActions ForcingNumLock; //Tipologia di forzatura Num-Lock all'avvio + #region Metodi Pubblici + public override string ToString() { return (base.Caption); } //Override metodo ToString per riempire classi ListControl + #endregion + + #region Proprietà + public bool Force { get { return this._force; } set { this._force = value; } } + #endregion + } + #endregion + + #region Dati + private string _caption; //Titolo elemento di navigazione + private BindingList<Window> _windows; //Lista (con associazione dati) delle finestre di abilitazione alle destinazioni + private BindingList<Destination> _destinations; //Lista (con associazione dati) delle destinazioni + #endregion + + #region Costruttore + public Item() //Costruttore classe Item + { + _caption = "Navigator Group"; //--> inizializzazione titolo + _windows = new BindingList<Window>(); //--> istanziazione finestre di abilitazione alle destinazioni + _destinations = new BindingList<Destination>(); //--> istanziazione destinazioni + } + #endregion + + #region Proprietà + public string Caption { get { return this._caption; } set { this._caption = value; } } + public BindingList<Window> Windows { get { return this._windows; } } + public BindingList<Destination> Destinations { get { return this._destinations; } } + #endregion + } + #endregion + + #region Dati + private string _menuHeader; //Titolo menu di navigazione + private bool _showSeparator; //Visualizzazione separatore gruppi di destinazioni + private string _separator; //Eventuale separatore da visualizzare + private bool _removeDuplicates; //Rimozione destinazioni duplicate + private BindingList<Item> _items; //Lista (con associazione dati) elementi di navigazione + #endregion + + #region Costruttore + public SkinNavigator() //Costruttore classe NavigatorSettings + { + _menuHeader = "Skin Navigator"; //--> titolo menu di navigazione + _showSeparator = true; //--> visualizzazione separatore attiva + _separator = "-- -- -- -- -- --"; //--> separatore da visualizzare + _removeDuplicates = true; //--> rimozione di destinazioni duplicate + _items = new BindingList<Item>(); //--> istanziazione lista elementi di navigazione + + + + Item iii1 = new Item(); + Item.Destination ddd1 = new Item.Destination(); + iii1.Caption = "www"; + ddd1.Caption = "Home"; + ddd1.WindowID = 35; + iii1.Destinations.Add(ddd1); + Item.Destination ddd2 = new Item.Destination(); + ddd2.Caption = "Movie"; + ddd2.WindowID =96742; + iii1.Destinations.Add(ddd2); + _items.Add(iii1); + + Item.Window www = new Item.Window(); + www.WindowID = 1; + Item iii2 = new Item(); + iii2.Caption = "www"; + iii2.Windows.Add(www); + Item.Destination ddd3 = new Item.Destination(); + ddd3.Caption = "Music"; + ddd3.WindowID = 501; + iii2.Destinations.Add(ddd3); + _items.Add(iii2); + + + + } + #endregion + + #region Metodi Pubblici + public WindowLink Go(LogEventHandler Log) //Gestione finestra di dialogo e navigazione alla destinazione selezionata + { + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Request Skin Navigator dialog menu")); + + try + { + int actWindowID = (int)GUIWindowManager.ActiveWindow; //--> id finestra attuale + GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + dlgMenu.Reset(); + dlgMenu.SetHeading(_menuHeader); //--> titolo menu + dlgMenu.ShowQuickNumbers = false; + + List<WindowLink> dlgLinks = new List<WindowLink>(); //--> lista links corrispondenti agli elementi di menu + foreach (Item item in _items) //Iterazione per valutazione elementi di navigazione impostati + { + if (item.Windows.Count == 0 || item.Windows.ToList().Find(x => x.WindowID == actWindowID) != null) + { //Controllo se finestra attuale contenuta nel gruppo di finestre di abilitazione destinazioni + bool first = true; + foreach (Item.Destination dst in item.Destinations) //Iterazione di aggiunta destinazioni + { + if ((dlgLinks.Find(x => x.WindowID == dst.WindowID && x.LoadParameter == dst.LoadParameter) == null || !_removeDuplicates) && (dst.WindowID != actWindowID || dst.Force)) + { //Controllo destinazione duplicata o corrispondente a finestra attuale + if (_showSeparator && first && dlgLinks.Count > 0) //Eventuale inserzione separatore destinazioni + { + dlgMenu.Add(_separator); + dlgLinks.Add(null); + } + dlgMenu.Add(dst.Caption); //--> aggiunta voce di menu + + WindowLink lnk = new WindowLink(); + lnk.WindowID = dst.WindowID; + lnk.Caption = dst.Caption; + lnk.LoadParameter = dst.LoadParameter; + dlgLinks.Add(lnk); //--> aggiunta destinazione corrispondente + first = false; + } + } + } + } + + if (dlgLinks.Count > 0) //Se selezionabile almeno una destinazione + { + dlgMenu.DoModal(actWindowID); //--> visualizzazione menu + if (dlgMenu.SelectedLabel >= 0 && dlgMenu.SelectedLabel < dlgLinks.Count && dlgLinks[dlgMenu.SelectedLabel] != null) + { + if (dlgLinks[dlgMenu.SelectedLabel].Go(Log)) //--> attivazione destinazione selezionata + return dlgLinks[dlgMenu.SelectedLabel]; //--> ritorno destinazione attivata + } + else + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No links selected from Skin Navigator dialog menu, WindowID=" + actWindowID)); + } + else + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No links found for Skin Navigator, WindowID=" + actWindowID)); + return null; + } + catch (Exception e) + { + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Error, "Error opening Skin Navigator dialog menu", e)); + return null; + } + } + #endregion + + #region Proprietà + public string MenuHeader { get { return this._menuHeader; } set { this._menuHeader = value; } } + public bool ShowSeparator { get { return this._showSeparator; } set { this._showSeparator = value; } } + public string Separator { get { return this._separator; } set { this._separator = value; } } + public bool RemoveDuplicates { get { return this._removeDuplicates; } set { this._removeDuplicates = value; } } + public BindingList<Item> Items { get { return this._items; } } + #endregion } - public struct NavigatorSettings - { - public string Header ; //Tipologia di forzatura Caps-Lock all'avvio - public bool ShowSeparator; //Tipologia di forzatura Num-Lock all'avvio - public string Separator; - public bool RemoveDuplicates; - } #endregion #region Dati private readonly string SettingsFile; //File di salvataggio impostazioni - private GeneralSettings _general = new GeneralSettings(); //Impostazioni generali plugin - private BindingList<ShortCut> _items = new BindingList<ShortCut>(); //Lista (con associazione dati) degli shortcuts configurati - private BindingList<NavItem> _navItems = new BindingList<NavItem>(); - private bool _initialized; //Classe inizializzata - - private WindowLink lastDestination = new WindowLink(); //Dati ultima destinazione attivata dal plugin - + private GeneralSettings _general; //Impostazioni generali + private BindingList<ShortCut> _items; //Lista (con associazione dati) degli shortcuts configurati + private SkinNavigator _navigator; //Skin Navigator + private bool _initialized; //Classe inizializzata + private WindowLink lastDestination; //Dati ultima destinazione attivata #endregion #region Costruttore public ShortCuts(string settingsFile) //Costruttore classe ShortCuts { SettingsFile = settingsFile; //--> percorso & nome file delle impostazioni - _general.ForcingCapsLock = LockKeys.LockKeyActions.None; //--> default: nessuna modifica stato Caps-Lock - _general.ForcingNumLock = LockKeys.LockKeyActions.None; //--> default: nessuna modifica stato Num-Lock + _general = new GeneralSettings(); //--> istanziazione impostazioni generali + _items = new BindingList<ShortCut>(); //--> istanziazione lista shortcuts + _navigator = new SkinNavigator(); //--> istanziazione Skin Navigator _initialized = false; //--> reset classe inizializzata + + lastDestination = new WindowLink(); //--> istanziazione ultima destinazione attivata dal plugin lastDestination.Caption = "Last destination"; //--> titolo ultima destinazione lastDestination.Reset(); //--> reset ultima destinazione attivata dal plugin } @@ -507,62 +662,6 @@ else return false; //--> finestra attuale non corrispondente a destinazione shortcut } - private void Navigation() //Gestione finestra di dialogo e navigazione alla destinazione selezionata - { - if (Log != null) - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Request Skin Navigator dialog menu")); - - try - { - int actWindowID = (int)GUIWindowManager.ActiveWindow; - GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); - dlgMenu.Reset(); - dlgMenu.SetHeading("Skin Navigator"); - dlgMenu.ShowQuickNumbers = false; - - List<WindowLink> dlgLinks = new List<WindowLink>(); - foreach (NavItem item in _navItems) //Iterazione per memorizzazione impostazioni shortcuts - { - if ((item.Windows.First(x => x.WindowID == actWindowID)) != null || item.Windows.Count == 0) - { - bool first = true; - foreach (WindowLink link in item.Destinations) //Iterazione per memorizzazione impostazioni shortcuts - { - if (first && dlgLinks.Count > 0) - { - dlgMenu.Add("---- ----"); - dlgLinks.Add(null); - first = false; - } - dlgMenu.Add(link.Caption); - dlgLinks.Add(link); - } - } - } - - if (dlgLinks.Count > 0) - { - dlgMenu.DoModal(actWindowID); - if (dlgMenu.SelectedLabel >= 0 && dlgMenu.SelectedLabel < dlgLinks.Count) - if (dlgLinks[dlgMenu.SelectedLabel].Go(Log)) - { - lastDestination.WindowID = dlgLinks[dlgMenu.SelectedLabel].WindowID; - lastDestination.LoadParameter = dlgLinks[dlgMenu.SelectedLabel].LoadParameter; - } - else - if (Log != null) - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No links selected from Skin Navigator dialog menu, ID = " + actWindowID)); - } - else - if (Log != null) - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No links found for Skin Navigator, window ID = " + actWindowID)); - } - catch (Exception e) - { - if (Log != null) - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Error, "Error opening Skin Navigator dialog menu", e)); - } - } #endregion #region Metodi Pubblici @@ -755,10 +854,21 @@ { List<ShortCut> scList = GetShortCutsGroup(k); //--> raccolta lista shortcut associati alla combinazione di tasti attuale if (scList != null && scList.Count > 0) //Se trovato almeno uno shortcut - if (scList.Find(x => x.IsNavigator) != null) //Se combinazione di tasti corrispondente a Skin Navigator - Navigation(); //--> gestione navigazione alla destinazione selezionata + { + ShortCut sc = scList.Find(x => x.IsNavigator); //Ricerca eventuali corrispondenze a Skin Navigator + if (sc != null) //Se combinazione di tasti corrispondente a Skin Navigator + { + sc.Play(); //--> eventuale effetto sonoro + WindowLink dst = Navigator.Go(Log); //--> gestione navigazione alla destinazione selezionata + if (dst != null) //Se attivata correttamente una destinazione + { + lastDestination.WindowID = dst.WindowID; //--> memorizzazione id finestra + lastDestination.LoadParameter = dst.LoadParameter; //--> memorizzazione parametri di caricamento utilizzati + } + } else //Shortcuts normali if (scList.Count == 1) //Shortcut a destinazione singola + { if (scList[0].Return && AlreadyAtDestination(scList[0])) //Se impostato flag di ritorno e finestra attuale corrispondente a destinazione scList[0].GoPrevious(Log); //--> visualizzazione finestra precedente else @@ -767,6 +877,7 @@ lastDestination.WindowID = scList[0].WindowID; //--> memorizzazione id finestra lastDestination.LoadParameter = scList[0].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati } + } else //Shortcut a destinazione multipla (ciclico) { int scIndex = 0; @@ -784,6 +895,7 @@ lastDestination.LoadParameter = scList[scIndex].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati } } + } else //Combinazione di tasti non corrispondente a nessuno shortcut if (Log != null) Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Key not mapped: " + k.ToString())); @@ -801,13 +913,10 @@ #endregion #region Proprietà - public bool Initialized { get { return this._initialized; } } - - public GeneralSettings General { get { return this._general; } set { this._general = value; } } - - //public LockKeys.LockKeyActions GeneralForcingCapsLock { get { return this._general.ForcingCapsLock; } set { this._general.ForcingCapsLock = value; } } - //public LockKeys.LockKeyActions GeneralForcingNumLock { get { return this._general.ForcingNumLock; } set { this._general.ForcingNumLock = value; } } - public BindingList<ShortCut> Items { get { return this._items; } } + public bool Initialized { get { return this._initialized; } } + public GeneralSettings General { get { return this._general; } } + public BindingList<ShortCut> Items { get { return this._items; } } + public SkinNavigator Navigator { get { return this._navigator; } } #endregion } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-12 08:46:14
|
Revision: 4803 http://sourceforge.net/p/mp-plugins/code/4803 Author: nicsergio Date: 2014-05-12 08:46:12 +0000 (Mon, 12 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Added Paths: ----------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml Added: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml (rev 0) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml 2014-05-12 08:46:12 UTC (rev 4803) @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8"?> +<Navigator> + <General> + <MenuHeader>Skin Navigator</MenuHeader> + <ShowSeparator>1</ShowSeparator> + <Separator>1</Separator> + <ShowSeparator>--------------------------------</ShowSeparator> + <ShowNumbers>1</ShowNumbers> + <RemoveDuplicates>1</RemoveDuplicates> + </General> + <Items> + <Item> + <Caption>Always</Caption> + <Windows /> + <Destinations> + <Destination> + <Caption>Basic Home</Caption> + <WindowID>35</WindowID> + <LoadParameter /> + <Force>0</Force> + </Destination> + <Destination> + <Caption>Movies</Caption> + <WindowID>96742</WindowID> + <LoadParameter /> + <Force>0</Force> + </Destination> + </Destinations> + </Item> + <Item> + <Caption>Music</Caption> + <Windows> + <Window> + <Caption>TV</Caption> + <WindowID>1</WindowID> + </Window> + </Windows> + <Destinations> + <Destination> + <Caption>Music</Caption> + <WindowID>502</WindowID> + <LoadParameter /> + <Force>0</Force> + </Destination> + <Destination> + <Caption>Movies</Caption> + <WindowID>96742</WindowID> + <LoadParameter /> + <Force>0</Force> + </Destination> + </Destinations> + </Item> + </Items> +</Navigator> \ No newline at end of file Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-11 12:58:31 UTC (rev 4802) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-12 08:46:12 UTC (rev 4803) @@ -6,7 +6,7 @@ <ProductVersion>8.0.30703</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}</ProjectGuid> - <OutputType>Library</OutputType> + <OutputType>WinExe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>ProcessPlugins.ShortCuter</RootNamespace> <AssemblyName>ShortCuter</AssemblyName> @@ -143,6 +143,9 @@ <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>Resources.Designer.cs</LastGenOutput> </EmbeddedResource> + <EmbeddedResource Include="Resources\XmlFiles\DefaultConfig.xml"> + <SubType>Designer</SubType> + </EmbeddedResource> <EmbeddedResource Include="ShortCuterConfig.resx"> <DependentUpon>ShortCuterConfig.cs</DependentUpon> </EmbeddedResource> @@ -180,7 +183,7 @@ <Content Include="ExternalResources\Dialogs.dll" /> <Content Include="Resources\Images\SkinNav.png" /> <Content Include="Resources\Images\SkinNavAdd.png" /> - <EmbeddedResource Include="Resources\XmlFiles\DefaultConfig.xml"> + <EmbeddedResource Include="Resources\XmlFiles\DefaultNavigatorConfig.xml"> <SubType>Designer</SubType> </EmbeddedResource> <Content Include="..\Common\Resources\Images\ArrowDown.png"> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-11 12:58:31 UTC (rev 4802) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-12 08:46:12 UTC (rev 4803) @@ -7,11 +7,11 @@ using System.Text; using System.Windows.Forms; using System.Xml; +using MediaPortal.Dialogs; using MediaPortal.GUI.Library; using MediaPortal.Player; using MediaPortal.Profile; using MediaPortal.Util; -using MediaPortal.Dialogs; namespace ProcessPlugins.ShortCuter { @@ -466,6 +466,7 @@ private string _menuHeader; //Titolo menu di navigazione private bool _showSeparator; //Visualizzazione separatore gruppi di destinazioni private string _separator; //Eventuale separatore da visualizzare + private bool _showNumbers; //Visualizzazione numeri cossispondenti a voci menu (per accesso da telecomando) private bool _removeDuplicates; //Rimozione destinazioni duplicate private BindingList<Item> _items; //Lista (con associazione dati) elementi di navigazione #endregion @@ -521,7 +522,7 @@ GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); dlgMenu.Reset(); dlgMenu.SetHeading(_menuHeader); //--> titolo menu - dlgMenu.ShowQuickNumbers = false; + dlgMenu.ShowQuickNumbers = _showNumbers; List<WindowLink> dlgLinks = new List<WindowLink>(); //--> lista links corrispondenti agli elementi di menu foreach (Item item in _items) //Iterazione per valutazione elementi di navigazione impostati @@ -576,6 +577,7 @@ public string MenuHeader { get { return this._menuHeader; } set { this._menuHeader = value; } } public bool ShowSeparator { get { return this._showSeparator; } set { this._showSeparator = value; } } public string Separator { get { return this._separator; } set { this._separator = value; } } + public bool ShowNumbers { get { return this._showNumbers; } set { this._showNumbers = value; } } public bool RemoveDuplicates { get { return this._removeDuplicates; } set { this._removeDuplicates = value; } } public BindingList<Item> Items { get { return this._items; } } #endregion @@ -601,7 +603,6 @@ _initialized = false; //--> reset classe inizializzata lastDestination = new WindowLink(); //--> istanziazione ultima destinazione attivata dal plugin - lastDestination.Caption = "Last destination"; //--> titolo ultima destinazione lastDestination.Reset(); //--> reset ultima destinazione attivata dal plugin } #endregion This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-18 16:40:14
|
Revision: 4806 http://sourceforge.net/p/mp-plugins/code/4806 Author: nicsergio Date: 2014-05-18 16:40:08 +0000 (Sun, 18 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml 2014-05-16 13:19:01 UTC (rev 4805) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml 2014-05-18 16:40:08 UTC (rev 4806) @@ -3,8 +3,7 @@ <General> <MenuHeader>Skin Navigator</MenuHeader> <ShowSeparator>1</ShowSeparator> - <Separator>1</Separator> - <ShowSeparator>--------------------------------</ShowSeparator> + <Separator>--------------------------------</Separator> <ShowNumbers>1</ShowNumbers> <RemoveDuplicates>1</RemoveDuplicates> </General> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-16 13:19:01 UTC (rev 4805) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-18 16:40:08 UTC (rev 4806) @@ -461,9 +461,9 @@ #endregion #region Proprietà - public new bool IsValid { get { return (base.IsValid && !base.IsNavigator); } } - private new bool IsNavigator { get { return false; } } - public bool Force { get { return this._force; } set { this._force = value; } } + public new bool IsValid { get { return (base.IsValid && !base.IsNavigator); } } + public new bool IsNavigator { get { return false; } } + public bool Force { get { return this._force; } set { this._force = value; } } #endregion } #endregion @@ -508,97 +508,109 @@ #endregion #region Metodi Pubblici + public bool LoadConfig() { return LoadConfig(string.Empty); } //Caricamento configurazione predefinita public bool LoadConfig(string settingsFile) //Caricamento configurazione { _items.Clear(); //--> pulizia lista elementi di navigazione + string nodeHeader; FileStream userConfig = null; try { XmlDocument xmlFile = new XmlDocument(); - if (settingsFile.Length>0) + if (settingsFile.Length > 0) { userConfig = new FileStream(settingsFile, FileMode.Open, FileAccess.Read); xmlFile.Load(userConfig); //Lettura file xml delle ultime impostazioni userConfig.Close(); //--> chiusura file + nodeHeader = "/ShortCuter/Navigator/"; } else + { using (Stream defaultConfig = Assembly.GetExecutingAssembly().GetManifestResourceStream("ProcessPlugins.ShortCuter.Resources.XmlFiles.DefaultNavigatorConfig.xml")) { xmlFile.Load(defaultConfig); //Configurazione predefinita --> lettura file xml incapsulato } + nodeHeader = "/Navigator/"; + } - XmlNode innerNode; - XmlNode generalNode = xmlFile.DocumentElement.SelectSingleNode("/ShortCuter/Navigator/General"); + XmlNode generalNode = xmlFile.DocumentElement.SelectSingleNode(nodeHeader + "General"); if (generalNode != null) //Se presente sezione "General" { - innerNode = generalNode.SelectSingleNode("ForcingCapsLock"); + innerNode = generalNode.SelectSingleNode("MenuHeader"); if (innerNode != null) - _general.ForcingCapsLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), innerNode.InnerText); - else + _general.MenuHeader = innerNode.InnerText; + innerNode = generalNode.SelectSingleNode("ShowSeparator"); + if (innerNode != null) + _general.ShowSeparator = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); + innerNode = generalNode.SelectSingleNode("Separator"); + if (innerNode != null) + _general.Separator = innerNode.InnerText; + innerNode = generalNode.SelectSingleNode("ShowNumbers"); + if (innerNode != null) + _general.ShowNumbers = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); + innerNode = generalNode.SelectSingleNode("RemoveDuplicates"); + if (innerNode != null) + _general.RemoveDuplicates = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); + } + else + { + if (settingsFile.Length > 0) { - innerNode = generalNode.SelectSingleNode("ResetCapsLock"); //Necessario per compatibilità con file di configurazione V2.0.5 - if (innerNode != null && Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText))) - _general.ForcingCapsLock = LockKeys.LockKeyActions.Off; + if (Log != null) //Se impostazioni non trovate --> si carica la configurazione predefinita + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Debug, "Navigator settings not found: default config will be loaded..")); + return LoadConfig(); //--> caricamento configurazione predefinita } - innerNode = generalNode.SelectSingleNode("ForcingNumLock"); - if (innerNode != null) - _general.ForcingNumLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), innerNode.InnerText); else { - innerNode = generalNode.SelectSingleNode("ResetNumLock"); //Necessario per compatibilità con file di configurazione V2.0.5 - if (innerNode != null && Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText))) - _general.ForcingNumLock = LockKeys.LockKeyActions.Off; + if (Log != null) //Se impostazioni non trovate nella configurazione predefinita + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Navigator settings not found loading DefaultNavigatorConfig.xml.")); + return false; } } - else - return false; //--> altrimenti configurazione non presente - XmlNodeList nodeList = xmlFile.DocumentElement.SelectNodes("/ShortCuter/Items/Item"); - foreach (XmlNode node in nodeList) //Iterazione per memorizzazione impostazioni shortcuts + + XmlNodeList nodeList = xmlFile.DocumentElement.SelectNodes(nodeHeader + "Items/Item"); + foreach (XmlNode node in nodeList) //Iterazione per memorizzazione elementi di navigazione { - ShortCut sc = new ShortCut(); + Item navItem = new Item(); innerNode = node.SelectSingleNode("Caption"); if (innerNode != null) - sc.Caption = innerNode.InnerText; - innerNode = node.SelectSingleNode("Key"); - if (innerNode != null) - sc.Key = innerNode.InnerText; - innerNode = node.SelectSingleNode("Ctrl"); - if (innerNode != null) - sc.Ctrl = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); - innerNode = node.SelectSingleNode("Alt"); - if (innerNode != null) - sc.Alt = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); - innerNode = node.SelectSingleNode("Shift"); - if (innerNode != null) - sc.Shift = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); - innerNode = node.SelectSingleNode("WindowID"); - if (innerNode != null) - sc.WindowID = Convert.ToInt32(innerNode.InnerText); - else + navItem.Caption = innerNode.InnerText; + XmlNodeList wndList = node.SelectNodes("Windows/Window"); + foreach (XmlNode wndNode in wndList) //Iterazione per memorizzazione finestre di abilitazione alle destinazioni { - innerNode = node.SelectSingleNode("Hyperlink"); //Necessario per compatibilità con file di configurazione V2.0.0 + Item.Window wnd = new Item.Window(); + innerNode = wndNode.SelectSingleNode("Caption"); if (innerNode != null) - sc.WindowID = Convert.ToInt32(innerNode.InnerText); + wnd.Caption = innerNode.InnerText; + innerNode = wndNode.SelectSingleNode("WindowID"); + if (innerNode != null) + wnd.WindowID = Convert.ToInt32(innerNode.InnerText); + navItem.Windows.Add(wnd); //--> } - innerNode = node.SelectSingleNode("LoadParameter"); - if (innerNode != null) - sc.LoadParameter = innerNode.InnerText; - else + XmlNodeList dstList = node.SelectNodes("Destinations/Destination"); + foreach (XmlNode dstNode in dstList) //Iterazione per memorizzazione destinazioni { - innerNode = node.SelectSingleNode("HyperlinkParameter"); //Necessario per compatibilità con file di configurazione V2.0.0 + Item.Destination dst = new Item.Destination(); + innerNode = dstNode.SelectSingleNode("Caption"); if (innerNode != null) - sc.LoadParameter = innerNode.InnerText; + dst.Caption = innerNode.InnerText; + innerNode = dstNode.SelectSingleNode("WindowID"); + if (innerNode != null) + dst.WindowID = Convert.ToInt32(innerNode.InnerText); + innerNode = dstNode.SelectSingleNode("LoadParameter"); + if (innerNode != null) + dst.LoadParameter = innerNode.InnerText; + innerNode = dstNode.SelectSingleNode("Force"); + if (innerNode != null) + dst.Force = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); + if (dst.IsValid) + navItem.Destinations.Add(dst); } - innerNode = node.SelectSingleNode("Return"); - if (innerNode != null) - sc.Return = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); - innerNode = node.SelectSingleNode("SoundEffect"); - if (innerNode != null) - sc.SoundEffect = innerNode.InnerText; - if (sc.IsValid) //Se shortcut valido - _items.Add(sc); //--> aggiunta dello shortcut nella lista + _items.Add(navItem); //--> aggiunta elemento di navigazione } + + if (_items.Count > 0) return true; //--> lettura configurazione effettuata else @@ -884,7 +896,10 @@ _items.Add(sc); //--> aggiunta dello shortcut nella lista } if (_items.Count > 0) + { + _navigator.LoadConfig(defaultSettings ? null : SettingsFile); //--> caricamento configurazione Skin Navigator return true; //--> lettura configurazione effettuata + } else { if (defaultSettings && Log != null) //Se nessun shortcut trovato nella configurazione predefinita: emissione messaggio This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-18 19:03:51
|
Revision: 4807 http://sourceforge.net/p/mp-plugins/code/4807 Author: nicsergio Date: 2014-05-18 19:03:47 +0000 (Sun, 18 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Removed Paths: ------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml 2014-05-18 16:40:08 UTC (rev 4806) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml 2014-05-18 19:03:47 UTC (rev 4807) @@ -182,4 +182,56 @@ <SoundEffect>click.wav</SoundEffect> </Item> </Items> + <Navigator> + <General> + <MenuHeader>Skin Navigator</MenuHeader> + <ShowSeparator>1</ShowSeparator> + <Separator>--------------------------------</Separator> + <ShowNumbers>1</ShowNumbers> + <RemoveDuplicates>1</RemoveDuplicates> + </General> + <Items> + <Item> + <Caption>Always</Caption> + <Windows /> + <Destinations> + <Destination> + <Caption>Basic Home</Caption> + <WindowID>35</WindowID> + <LoadParameter /> + <Force>0</Force> + </Destination> + <Destination> + <Caption>Movies</Caption> + <WindowID>96742</WindowID> + <LoadParameter /> + <Force>0</Force> + </Destination> + </Destinations> + </Item> + <Item> + <Caption>Music</Caption> + <Windows> + <Window> + <Caption>TV</Caption> + <WindowID>1</WindowID> + </Window> + </Windows> + <Destinations> + <Destination> + <Caption>Music</Caption> + <WindowID>502</WindowID> + <LoadParameter /> + <Force>0</Force> + </Destination> + <Destination> + <Caption>Movies</Caption> + <WindowID>96742</WindowID> + <LoadParameter /> + <Force>0</Force> + </Destination> + </Destinations> + </Item> + </Items> + </Navigator> </ShortCuter> \ No newline at end of file Deleted: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml 2014-05-18 16:40:08 UTC (rev 4806) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml 2014-05-18 19:03:47 UTC (rev 4807) @@ -1,53 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Navigator> - <General> - <MenuHeader>Skin Navigator</MenuHeader> - <ShowSeparator>1</ShowSeparator> - <Separator>--------------------------------</Separator> - <ShowNumbers>1</ShowNumbers> - <RemoveDuplicates>1</RemoveDuplicates> - </General> - <Items> - <Item> - <Caption>Always</Caption> - <Windows /> - <Destinations> - <Destination> - <Caption>Basic Home</Caption> - <WindowID>35</WindowID> - <LoadParameter /> - <Force>0</Force> - </Destination> - <Destination> - <Caption>Movies</Caption> - <WindowID>96742</WindowID> - <LoadParameter /> - <Force>0</Force> - </Destination> - </Destinations> - </Item> - <Item> - <Caption>Music</Caption> - <Windows> - <Window> - <Caption>TV</Caption> - <WindowID>1</WindowID> - </Window> - </Windows> - <Destinations> - <Destination> - <Caption>Music</Caption> - <WindowID>502</WindowID> - <LoadParameter /> - <Force>0</Force> - </Destination> - <Destination> - <Caption>Movies</Caption> - <WindowID>96742</WindowID> - <LoadParameter /> - <Force>0</Force> - </Destination> - </Destinations> - </Item> - </Items> -</Navigator> \ No newline at end of file Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-18 16:40:08 UTC (rev 4806) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-18 19:03:47 UTC (rev 4807) @@ -183,9 +183,6 @@ <Content Include="ExternalResources\Dialogs.dll" /> <Content Include="Resources\Images\SkinNav.png" /> <Content Include="Resources\Images\SkinNavAdd.png" /> - <EmbeddedResource Include="Resources\XmlFiles\DefaultNavigatorConfig.xml"> - <SubType>Designer</SubType> - </EmbeddedResource> <Content Include="..\Common\Resources\Images\ArrowDown.png"> <Link>Resources\Images\ArrowDown.png</Link> </Content> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-18 16:40:08 UTC (rev 4806) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-18 19:03:47 UTC (rev 4807) @@ -508,35 +508,18 @@ #endregion #region Metodi Pubblici - public bool LoadConfig() { return LoadConfig(string.Empty); } //Caricamento configurazione predefinita - public bool LoadConfig(string settingsFile) //Caricamento configurazione + //public bool LoadConfig() { return LoadConfig(string.Empty); } //Caricamento configurazione predefinita + public void LoadConfig(XmlDocument xmlFile) //Caricamento configurazione { _items.Clear(); //--> pulizia lista elementi di navigazione - string nodeHeader; - FileStream userConfig = null; - try + + XmlNode innerNode; + XmlNode navigatorNode = xmlFile.DocumentElement.SelectSingleNode("/ShortCuter/Navigator"); + if (navigatorNode != null) //Se presenti impostazioni di navigazione { - XmlDocument xmlFile = new XmlDocument(); - if (settingsFile.Length > 0) + XmlNode generalNode = navigatorNode.SelectSingleNode("General"); + if (generalNode != null) //Se presenti impostazioni generali { - userConfig = new FileStream(settingsFile, FileMode.Open, FileAccess.Read); - xmlFile.Load(userConfig); //Lettura file xml delle ultime impostazioni - userConfig.Close(); //--> chiusura file - nodeHeader = "/ShortCuter/Navigator/"; - } - else - { - using (Stream defaultConfig = Assembly.GetExecutingAssembly().GetManifestResourceStream("ProcessPlugins.ShortCuter.Resources.XmlFiles.DefaultNavigatorConfig.xml")) - { - xmlFile.Load(defaultConfig); //Configurazione predefinita --> lettura file xml incapsulato - } - nodeHeader = "/Navigator/"; - } - - XmlNode innerNode; - XmlNode generalNode = xmlFile.DocumentElement.SelectSingleNode(nodeHeader + "General"); - if (generalNode != null) //Se presente sezione "General" - { innerNode = generalNode.SelectSingleNode("MenuHeader"); if (innerNode != null) _general.MenuHeader = innerNode.InnerText; @@ -553,23 +536,7 @@ if (innerNode != null) _general.RemoveDuplicates = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); } - else - { - if (settingsFile.Length > 0) - { - if (Log != null) //Se impostazioni non trovate --> si carica la configurazione predefinita - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Debug, "Navigator settings not found: default config will be loaded..")); - return LoadConfig(); //--> caricamento configurazione predefinita - } - else - { - if (Log != null) //Se impostazioni non trovate nella configurazione predefinita - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Navigator settings not found loading DefaultNavigatorConfig.xml.")); - return false; - } - } - - XmlNodeList nodeList = xmlFile.DocumentElement.SelectNodes(nodeHeader + "Items/Item"); + XmlNodeList nodeList = navigatorNode.SelectNodes("Items/Item"); foreach (XmlNode node in nodeList) //Iterazione per memorizzazione elementi di navigazione { Item navItem = new Item(); @@ -586,7 +553,7 @@ innerNode = wndNode.SelectSingleNode("WindowID"); if (innerNode != null) wnd.WindowID = Convert.ToInt32(innerNode.InnerText); - navItem.Windows.Add(wnd); //--> + navItem.Windows.Add(wnd); //--> aggiunta finestra di abilitazione } XmlNodeList dstList = node.SelectNodes("Destinations/Destination"); foreach (XmlNode dstNode in dstList) //Iterazione per memorizzazione destinazioni @@ -605,33 +572,53 @@ if (innerNode != null) dst.Force = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); if (dst.IsValid) - navItem.Destinations.Add(dst); + navItem.Destinations.Add(dst); //--> aggiunta destinazione } _items.Add(navItem); //--> aggiunta elemento di navigazione } - - - if (_items.Count > 0) - return true; //--> lettura configurazione effettuata - else - { - if (defaultSettings && Log != null) //Se nessun shortcut trovato nella configurazione predefinita: emissione messaggio - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No shortcuts found loading DefaultConfig.xml.")); - return false; - } } - catch (Exception e) - { - if (defaultSettings && Log != null) //Se lettura configurazione predefinita fallita: emissione messaggio di errore - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Error, "Error loading DefaultConfig.xml.", e)); - return false; - } - finally - { - if (userConfig != null) - userConfig.Close(); //--> eventuale chiusura oggetto FileStream - } } + public void SaveConfig(XmlTextWriter xmlSettings) //Salvataggio configurazione + { + xmlSettings.WriteStartElement("Navigator"); + xmlSettings.WriteStartElement("General"); + xmlSettings.WriteElementString("MenuHeader", _general.MenuHeader); + xmlSettings.WriteElementString("ShowSeparator", Convert.ToInt16(_general.ShowSeparator).ToString()); + xmlSettings.WriteElementString("Separator", _general.Separator); + xmlSettings.WriteElementString("ShowNumbers", Convert.ToInt16(_general.ShowNumbers).ToString()); + xmlSettings.WriteElementString("RemoveDuplicates", Convert.ToInt16(_general.RemoveDuplicates).ToString()); + xmlSettings.WriteEndElement(); + + xmlSettings.WriteStartElement("Items"); + foreach (Item navItem in _items) //Iterazione per salvataggio elementi di navigazione + { + xmlSettings.WriteStartElement("Item"); + xmlSettings.WriteElementString("Caption", navItem.Caption); + xmlSettings.WriteStartElement("Windows"); + foreach (Item.Window wnd in navItem.Windows) //Iterazione per salvataggio finestre di abilitazione + { + xmlSettings.WriteStartElement("Window"); + xmlSettings.WriteElementString("Caption", wnd.Caption); + xmlSettings.WriteElementString("WindowID", wnd.WindowID.ToString()); + xmlSettings.WriteEndElement(); + } + xmlSettings.WriteEndElement(); + xmlSettings.WriteStartElement("Destinations"); + foreach (Item.Destination dst in navItem.Destinations) //Iterazione per salvataggio destinazioni + { + xmlSettings.WriteStartElement("Destination"); + xmlSettings.WriteElementString("Caption", dst.Caption); + xmlSettings.WriteElementString("WindowID", dst.WindowID.ToString()); + xmlSettings.WriteElementString("LoadParameter", dst.LoadParameter); + xmlSettings.WriteElementString("Force", Convert.ToInt16(dst.Force).ToString()); + xmlSettings.WriteEndElement(); + } + xmlSettings.WriteEndElement(); + xmlSettings.WriteEndElement(); + } + xmlSettings.WriteEndElement(); + xmlSettings.WriteEndElement(); + } public WindowLink Go() //Gestione finestra di dialogo e navigazione alla destinazione selezionata { if (Log != null) @@ -897,7 +884,7 @@ } if (_items.Count > 0) { - _navigator.LoadConfig(defaultSettings ? null : SettingsFile); //--> caricamento configurazione Skin Navigator + _navigator.LoadConfig(xmlFile); //--> caricamento configurazione Skin Navigator return true; //--> lettura configurazione effettuata } else @@ -957,6 +944,8 @@ xmlSettings.WriteEndElement(); xmlSettings.WriteEndElement(); + _navigator.SaveConfig(xmlSettings); //--> salvataggio configurazione Skin Navigator + xmlSettings.Flush(); xmlSettings.Close(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-21 21:05:46
|
Revision: 4812 http://sourceforge.net/p/mp-plugins/code/4812 Author: nicsergio Date: 2014-05-21 21:05:44 +0000 (Wed, 21 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-20 13:03:01 UTC (rev 4811) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-21 21:05:44 UTC (rev 4812) @@ -6,7 +6,7 @@ <ProductVersion>8.0.30703</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}</ProjectGuid> - <OutputType>WinExe</OutputType> + <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>ProcessPlugins.ShortCuter</RootNamespace> <AssemblyName>ShortCuter</AssemblyName> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-20 13:03:01 UTC (rev 4811) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-21 21:05:44 UTC (rev 4812) @@ -641,7 +641,7 @@ try { - int actWindowID = (int)GUIWindowManager.ActiveWindow; //--> id finestra attuale + int actWindowID = GUIWindowManager.ActiveWindow; //--> id finestra attuale GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); dlgMenu.Reset(); dlgMenu.SetHeading(_general.MenuHeader); //--> titolo menu @@ -662,7 +662,12 @@ dlgMenu.Add(_general.Separator); dlgLinks.Add(null); } - dlgMenu.Add(dst.Caption); //--> aggiunta voce di menu + + using (GUIListItem listItem = new GUIListItem(dst.Caption)) + { + listItem.PinImage = @"d:\tvseries.png"; + dlgMenu.Add(listItem); //--> aggiunta voce di menu + } dlgLinks.Add(new WindowLink().GetData(dst)); //--> aggiunta destinazione corrispondente (classe WindowLink) first = false; } @@ -767,7 +772,7 @@ } private bool AlreadyAtDestination(ShortCut sc) //Verifica se finestra attuale corrispondente a destinazione shortcut { - if ((int)GUIWindowManager.ActiveWindow == sc.WindowID) //Prima verifica: da gestore finestre di mediaPortal + if (GUIWindowManager.ActiveWindow == sc.WindowID) //Prima verifica: da gestore finestre di mediaPortal { if (lastDestination.WindowID == sc.WindowID) //Seconda verifica: utilizzo dei parametri memorizzati dalla classe se attendibili if (lastDestination.LoadParameter == sc.LoadParameter) //--> verifica corrispondenza eventuali parametri di caricamento per visualizzazione This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-23 13:36:17
|
Revision: 4813 http://sourceforge.net/p/mp-plugins/code/4813 Author: nicsergio Date: 2014-05-23 13:36:12 +0000 (Fri, 23 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Program.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Added Paths: ----------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/KeyboardHook.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.resx trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.resx trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.resx trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinWithSounds.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LogHandler.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/RawInputHook.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/ShortCuter.cs Added: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/KeyboardHook.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/KeyboardHook.cs (rev 0) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/KeyboardHook.cs 2014-05-23 13:36:12 UTC (rev 4813) @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Windows.Forms; + +namespace ProcessPlugins.ShortCuter.Configuration +{ + internal class KeyboardHook //Classe per gestione hook di sistema + { + #region Delegati/Strutture + /// Delegato da richiamare all'intercettazione del messaggio + /// Parametri: + /// code : codice hook + /// wParam: ID evento intercettato + /// lParam: informazioni sull'evento intercettato + public delegate int HookProc(int code, int wParam, ref HookStruct lParam); + + public struct HookStruct //Struttura hook + { + public int vkCode; + public int scanCode; + public int flags; + public int time; + public int dwExtraInfo; + } + #endregion + + #region Dati + #region Costanti + private const int WH_KEYBOARD_LL = 13; //Id evento per hook di tastiera di basso livello + private const int WM_KEYDOWN = 0x100; //Id messaggio KeyDown + private const int WM_KEYUP = 0x101; //Id messaggio KeyUp + private const int WM_SYSKEYDOWN = 0x104; //Id messaggio KeyDown (tasto di sistema) + private const int WM_SYSKEYUP = 0x105; //Id messaggio KeyUp (tasto di sistema) + #endregion + + public List<Keys> HookedKeys = new List<Keys>(); //Eventuale lista dei tasti da monitorare/intercettare + private IntPtr hHook = IntPtr.Zero; //Handle dell'hook + private IntPtr hInstance = IntPtr.Zero; //Handle dell'istanza della libreria esterna + private bool _hooked = false; //Hook attivato + #endregion + + #region Costruttore/Distruttore + public KeyboardHook() + { + hInstance = LoadLibrary("User32"); //--> caricamento libreria esterna e memorizzazione handle + } + ~KeyboardHook() + { + unhook(); //--> eventuale disinstallazione dell'hook di sistema + } + #endregion + + #region Metodi Privati + private int hookProc(int code, int wParam, ref HookStruct lParam) //Metodo richiamato per l'hook di tastiera + { + if (code >= 0) //Se codice hook valorizzato + { + Keys key = (Keys)lParam.vkCode; + if (HookedKeys == null || HookedKeys.Count == 0 || HookedKeys.Contains(key)) //Se il tasto appartiene alla lista dei tasti da intercettare (o lista non utilizzata) + { + KeyEventArgs kea = new KeyEventArgs(key); + if ((wParam == WM_KEYDOWN || wParam == WM_SYSKEYDOWN) && (KeyDown != null)) + { + KeyDown(this, kea); //--> richiamo dell'evento KeyDown + } + else if ((wParam == WM_KEYUP || wParam == WM_SYSKEYUP) && (KeyUp != null)) + { + KeyUp(this, kea); //--> richiamo dell'evento KeyUp + } + if (kea.Handled) //Se l'evento \xE8 stato gestito + return 1; //--> il tasto non viene passato al sistema + } + } + return CallNextHookEx(hHook, code, wParam, ref lParam); + } + #endregion + + #region Metodi Pubblici + public void hook() //Installazione dell'hook di sistema + { + unhook(); //--> eventuale disinstallazione hook + hHook = SetWindowsHookEx(WH_KEYBOARD_LL, hookProc, hInstance, 0); //--> installazione hook + _hooked = true; //--> memorizzazione hook attivo + } + public void unhook() //Disinstallazione dell'hook di sistema + { + if (_hooked) //Se hook attivo + { + UnhookWindowsHookEx(hHook); //--> disinstallazione hook + _hooked = false; //--> memorizzazione hook disattivo + } + } + #endregion + + #region Eventi + public event KeyEventHandler KeyDown; //Evento di pressione di uno dei tasti da monitorare + public event KeyEventHandler KeyUp; //Evento di rilascio di uno dei tasti da monitorare + #endregion + + #region Propriet\xE0 + public bool Hooked { get { return this._hooked; } } + #endregion + + #region Importazione DLL + //Installazione dell'hook, esecuzione dell'evento desiderato [uno dei parametri hInstance o threadId deve essere valorizzato] + [DllImport("user32.dll")] + static extern IntPtr SetWindowsHookEx(int idHook, HookProc callback, IntPtr hInstance, uint threadId); + + //Disinstallazione dell'hook (ritorna true se esecuzione con successo) + [DllImport("user32.dll")] + static extern bool UnhookWindowsHookEx(IntPtr hInstance); + + //Chiamata a hook successivo + [DllImport("user32.dll")] + static extern int CallNextHookEx(IntPtr idHook, int nCode, int wParam, ref HookStruct lParam); + + //Caricamento di una libreria (ritorna l'handle associato) + [DllImport("kernel32.dll")] + static extern IntPtr LoadLibrary(string lpFileName); + #endregion + } +} Added: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.Designer.cs (rev 0) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.Designer.cs 2014-05-23 13:36:12 UTC (rev 4813) @@ -0,0 +1,468 @@ +namespace ProcessPlugins.ShortCuter.Configuration +{ + partial class ShortCuterConfig + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + 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.linkPropertiesGroupBox = new System.Windows.Forms.GroupBox(); + this.loadParameterGroupBox = new System.Windows.Forms.GroupBox(); + this.loadParameterTextBox = new System.Windows.Forms.TextBox(); + this.windowIdGroupBox = new System.Windows.Forms.GroupBox(); + this.windowIdLabel = new System.Windows.Forms.Label(); + this.skinFileGroupBox = new System.Windows.Forms.GroupBox(); + this.skinFileLabel = new System.Windows.Forms.Label(); + this.toolTip = new System.Windows.Forms.ToolTip(this.components); + this.updateButton = new System.Windows.Forms.Button(); + this.resetButton = new System.Windows.Forms.Button(); + this.rowDownButton = new System.Windows.Forms.Button(); + this.rowUpButton = new System.Windows.Forms.Button(); + this.infoPictureBox = new System.Windows.Forms.PictureBox(); + this.rowRemoveButton = new System.Windows.Forms.Button(); + this.rowAddButton = new System.Windows.Forms.Button(); + this.propLeftPictureBox = new System.Windows.Forms.PictureBox(); + this.saveButton = new System.Windows.Forms.Button(); + this.overridesGroupBox = new System.Windows.Forms.GroupBox(); + this.numLockGroupBox = new System.Windows.Forms.GroupBox(); + this.numLockComboBox = new System.Windows.Forms.ComboBox(); + this.capsLockGroupBox = new System.Windows.Forms.GroupBox(); + this.capsLockComboBox = new System.Windows.Forms.ComboBox(); + this.rowCopyButton = new System.Windows.Forms.Button(); + this.skinNavAddButton = new System.Windows.Forms.Button(); + this.skinNavConfigButton = new System.Windows.Forms.Button(); + this.skinItems = new My.Common.SkinItems(); + ((System.ComponentModel.ISupportInitialize)(this.shortCutsDataGridView)).BeginInit(); + this.linkPropertiesGroupBox.SuspendLayout(); + this.loadParameterGroupBox.SuspendLayout(); + this.windowIdGroupBox.SuspendLayout(); + this.skinFileGroupBox.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.infoPictureBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.propLeftPictureBox)).BeginInit(); + this.overridesGroupBox.SuspendLayout(); + this.numLockGroupBox.SuspendLayout(); + this.capsLockGroupBox.SuspendLayout(); + this.SuspendLayout(); + // + // shortCutsDataGridView + // + this.shortCutsDataGridView.AllowUserToAddRows = false; + this.shortCutsDataGridView.AllowUserToDeleteRows = false; + this.shortCutsDataGridView.AllowUserToResizeRows = false; + this.shortCutsDataGridView.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(220)))), ((int)(((byte)(227))))); + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.shortCutsDataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + this.shortCutsDataGridView.ColumnHeadersHeight = 30; + this.shortCutsDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; + this.shortCutsDataGridView.Location = new System.Drawing.Point(6, 304); + this.shortCutsDataGridView.MultiSelect = false; + this.shortCutsDataGridView.Name = "shortCutsDataGridView"; + this.shortCutsDataGridView.RowHeadersWidth = 20; + this.shortCutsDataGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; + this.shortCutsDataGridView.Size = new System.Drawing.Size(1006, 429); + this.shortCutsDataGridView.TabIndex = 0; + this.shortCutsDataGridView.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.shortCutsDataGridView_CellDoubleClick); + this.shortCutsDataGridView.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.shortCutsDataGridView_CellEndEdit); + this.shortCutsDataGridView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.shortCutsDataGridView_CellFormatting); + this.shortCutsDataGridView.CurrentCellChanged += new System.EventHandler(this.shortCutsDataGridView_CurrentCellChanged); + this.shortCutsDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.shortCutsDataGridView_DataError); + this.shortCutsDataGridView.EditingControlShowing += new System.Windows.Forms.DataGridViewEditingControlShowingEventHandler(this.shortCutsDataGridView_EditingControlShowing); + this.shortCutsDataGridView.Enter += new System.EventHandler(this.shortCutsDataGridView_Enter); + // + // linkPropertiesGroupBox + // + this.linkPropertiesGroupBox.Controls.Add(this.loadParameterGroupBox); + this.linkPropertiesGroupBox.Controls.Add(this.windowIdGroupBox); + this.linkPropertiesGroupBox.Controls.Add(this.skinFileGroupBox); + this.linkPropertiesGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.linkPropertiesGroupBox.Location = new System.Drawing.Point(602, 30); + this.linkPropertiesGroupBox.Name = "linkPropertiesGroupBox"; + this.linkPropertiesGroupBox.Size = new System.Drawing.Size(320, 175); + this.linkPropertiesGroupBox.TabIndex = 31; + this.linkPropertiesGroupBox.TabStop = false; + this.linkPropertiesGroupBox.Text = "Link Properties"; + // + // loadParameterGroupBox + // + this.loadParameterGroupBox.Controls.Add(this.loadParameterTextBox); + this.loadParameterGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.loadParameterGroupBox.Location = new System.Drawing.Point(4, 103); + this.loadParameterGroupBox.Name = "loadParameterGroupBox"; + this.loadParameterGroupBox.Size = new System.Drawing.Size(312, 68); + this.loadParameterGroupBox.TabIndex = 37; + this.loadParameterGroupBox.TabStop = false; + this.loadParameterGroupBox.Text = "Load Parameter:"; + // + // loadParameterTextBox + // + this.loadParameterTextBox.BackColor = System.Drawing.SystemColors.Control; + this.loadParameterTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.loadParameterTextBox.ForeColor = System.Drawing.Color.Blue; + this.loadParameterTextBox.Location = new System.Drawing.Point(6, 19); + this.loadParameterTextBox.Multiline = true; + this.loadParameterTextBox.Name = "loadParameterTextBox"; + this.loadParameterTextBox.ReadOnly = true; + this.loadParameterTextBox.Size = new System.Drawing.Size(300, 43); + this.loadParameterTextBox.TabIndex = 39; + this.loadParameterTextBox.Text = "-"; + this.loadParameterTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // windowIdGroupBox + // + this.windowIdGroupBox.Controls.Add(this.windowIdLabel); + this.windowIdGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.windowIdGroupBox.Location = new System.Drawing.Point(4, 63); + this.windowIdGroupBox.Name = "windowIdGroupBox"; + this.windowIdGroupBox.Size = new System.Drawing.Size(312, 34); + this.windowIdGroupBox.TabIndex = 36; + this.windowIdGroupBox.TabStop = false; + this.windowIdGroupBox.Text = "Window ID:"; + // + // windowIdLabel + // + this.windowIdLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.windowIdLabel.ForeColor = System.Drawing.Color.Blue; + this.windowIdLabel.Location = new System.Drawing.Point(6, 16); + this.windowIdLabel.Name = "windowIdLabel"; + this.windowIdLabel.Size = new System.Drawing.Size(300, 13); + this.windowIdLabel.TabIndex = 6; + this.windowIdLabel.Text = "-"; + this.windowIdLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // skinFileGroupBox + // + this.skinFileGroupBox.Controls.Add(this.skinFileLabel); + this.skinFileGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.skinFileGroupBox.Location = new System.Drawing.Point(4, 23); + this.skinFileGroupBox.Name = "skinFileGroupBox"; + this.skinFileGroupBox.Size = new System.Drawing.Size(312, 34); + this.skinFileGroupBox.TabIndex = 6; + this.skinFileGroupBox.TabStop = false; + this.skinFileGroupBox.Text = "Skin File:"; + // + // skinFileLabel + // + this.skinFileLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.skinFileLabel.ForeColor = System.Drawing.Color.Blue; + this.skinFileLabel.Location = new System.Drawing.Point(6, 16); + this.skinFileLabel.Name = "skinFileLabel"; + this.skinFileLabel.Size = new System.Drawing.Size(300, 13); + this.skinFileLabel.TabIndex = 2; + this.skinFileLabel.Text = "-"; + this.skinFileLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // toolTip + // + this.toolTip.ShowAlways = true; + // + // updateButton + // + this.updateButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); + this.updateButton.Location = new System.Drawing.Point(67, 84); + this.updateButton.Name = "updateButton"; + this.updateButton.Size = new System.Drawing.Size(135, 38); + this.updateButton.TabIndex = 32; + this.updateButton.Text = "Save and Close"; + this.updateButton.UseVisualStyleBackColor = false; + this.updateButton.Click += new System.EventHandler(this.updateButton_Click); + // + // resetButton + // + this.resetButton.Location = new System.Drawing.Point(67, 8); + this.resetButton.Name = "resetButton"; + this.resetButton.Size = new System.Drawing.Size(133, 23); + this.resetButton.TabIndex = 33; + this.resetButton.Text = "Reset Configuration"; + this.resetButton.UseVisualStyleBackColor = true; + this.resetButton.Click += new System.EventHandler(this.resetButton_Click); + // + // rowDownButton + // + this.rowDownButton.AutoSize = true; + this.rowDownButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.rowDownButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowDown; + this.rowDownButton.Location = new System.Drawing.Point(226, 264); + this.rowDownButton.Name = "rowDownButton"; + this.rowDownButton.Size = new System.Drawing.Size(38, 38); + this.rowDownButton.TabIndex = 35; + this.rowDownButton.UseVisualStyleBackColor = true; + this.rowDownButton.Click += new System.EventHandler(this.rowDownButton_Click); + // + // rowUpButton + // + this.rowUpButton.AutoSize = true; + this.rowUpButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.rowUpButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowUp; + this.rowUpButton.Location = new System.Drawing.Point(186, 264); + this.rowUpButton.Name = "rowUpButton"; + this.rowUpButton.Size = new System.Drawing.Size(38, 38); + this.rowUpButton.TabIndex = 34; + this.rowUpButton.UseVisualStyleBackColor = true; + this.rowUpButton.Click += new System.EventHandler(this.rowUpButton_Click); + // + // infoPictureBox + // + this.infoPictureBox.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.Info; + this.infoPictureBox.Location = new System.Drawing.Point(990, 5); + this.infoPictureBox.Name = "infoPictureBox"; + this.infoPictureBox.Size = new System.Drawing.Size(24, 24); + this.infoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.infoPictureBox.TabIndex = 30; + this.infoPictureBox.TabStop = false; + this.infoPictureBox.Click += new System.EventHandler(this.infoPictureBox_Click); + // + // rowRemoveButton + // + this.rowRemoveButton.AutoSize = true; + this.rowRemoveButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.rowRemoveButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowRemove; + this.rowRemoveButton.Location = new System.Drawing.Point(46, 264); + this.rowRemoveButton.Name = "rowRemoveButton"; + this.rowRemoveButton.Size = new System.Drawing.Size(38, 38); + this.rowRemoveButton.TabIndex = 26; + this.rowRemoveButton.UseVisualStyleBackColor = true; + this.rowRemoveButton.Click += new System.EventHandler(this.rowRemoveButton_Click); + // + // rowAddButton + // + this.rowAddButton.AutoSize = true; + this.rowAddButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.rowAddButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowAdd; + this.rowAddButton.Location = new System.Drawing.Point(6, 264); + this.rowAddButton.Name = "rowAddButton"; + this.rowAddButton.Size = new System.Drawing.Size(38, 38); + this.rowAddButton.TabIndex = 25; + this.rowAddButton.UseVisualStyleBackColor = true; + this.rowAddButton.Click += new System.EventHandler(this.rowAddButton_Click); + // + // propLeftPictureBox + // + this.propLeftPictureBox.Enabled = false; + this.propLeftPictureBox.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.ArrowDown; + this.propLeftPictureBox.Location = new System.Drawing.Point(360, 257); + this.propLeftPictureBox.Name = "propLeftPictureBox"; + this.propLeftPictureBox.Size = new System.Drawing.Size(131, 56); + this.propLeftPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.propLeftPictureBox.TabIndex = 23; + this.propLeftPictureBox.TabStop = false; + this.propLeftPictureBox.Visible = false; + // + // saveButton + // + this.saveButton.Location = new System.Drawing.Point(67, 35); + this.saveButton.Name = "saveButton"; + this.saveButton.Size = new System.Drawing.Size(133, 23); + this.saveButton.TabIndex = 36; + this.saveButton.Text = "Save Configuration"; + this.saveButton.UseVisualStyleBackColor = true; + this.saveButton.Click += new System.EventHandler(this.saveButton_Click); + // + // overridesGroupBox + // + this.overridesGroupBox.Controls.Add(this.numLockGroupBox); + this.overridesGroupBox.Controls.Add(this.capsLockGroupBox); + this.overridesGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.overridesGroupBox.Location = new System.Drawing.Point(50, 133); + this.overridesGroupBox.Name = "overridesGroupBox"; + this.overridesGroupBox.Size = new System.Drawing.Size(165, 111); + this.overridesGroupBox.TabIndex = 37; + this.overridesGroupBox.TabStop = false; + this.overridesGroupBox.Text = "Overrides at Start-Up"; + // + // numLockGroupBox + // + this.numLockGroupBox.Controls.Add(this.numLockComboBox); + this.numLockGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.numLockGroupBox.Location = new System.Drawing.Point(6, 63); + this.numLockGroupBox.Name = "numLockGroupBox"; + this.numLockGroupBox.Size = new System.Drawing.Size(152, 42); + this.numLockGroupBox.TabIndex = 38; + this.numLockGroupBox.TabStop = false; + this.numLockGroupBox.Text = "Num-Lock Forcing:"; + // + // numLockComboBox + // + this.numLockComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.numLockComboBox.FormattingEnabled = true; + this.numLockComboBox.Location = new System.Drawing.Point(9, 15); + this.numLockComboBox.Name = "numLockComboBox"; + this.numLockComboBox.Size = new System.Drawing.Size(133, 21); + this.numLockComboBox.TabIndex = 1; + // + // capsLockGroupBox + // + this.capsLockGroupBox.Controls.Add(this.capsLockComboBox); + this.capsLockGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.capsLockGroupBox.Location = new System.Drawing.Point(6, 15); + this.capsLockGroupBox.Name = "capsLockGroupBox"; + this.capsLockGroupBox.Size = new System.Drawing.Size(152, 42); + this.capsLockGroupBox.TabIndex = 37; + this.capsLockGroupBox.TabStop = false; + this.capsLockGroupBox.Text = "Caps-Lock Forcing:"; + // + // capsLockComboBox + // + this.capsLockComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.capsLockComboBox.FormattingEnabled = true; + this.capsLockComboBox.Location = new System.Drawing.Point(9, 15); + this.capsLockComboBox.Name = "capsLockComboBox"; + this.capsLockComboBox.Size = new System.Drawing.Size(133, 21); + this.capsLockComboBox.TabIndex = 0; + // + // rowCopyButton + // + this.rowCopyButton.AutoSize = true; + this.rowCopyButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.rowCopyButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowCopy; + this.rowCopyButton.Location = new System.Drawing.Point(96, 264); + this.rowCopyButton.Name = "rowCopyButton"; + this.rowCopyButton.Size = new System.Drawing.Size(38, 38); + this.rowCopyButton.TabIndex = 38; + this.rowCopyButton.UseVisualStyleBackColor = true; + this.rowCopyButton.Click += new System.EventHandler(this.rowCopyButton_Click); + // + // skinNavAddButton + // + this.skinNavAddButton.AutoSize = true; + this.skinNavAddButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.skinNavAddButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.SkinNavAdd; + this.skinNavAddButton.Location = new System.Drawing.Point(136, 264); + this.skinNavAddButton.Name = "skinNavAddButton"; + this.skinNavAddButton.Size = new System.Drawing.Size(38, 38); + this.skinNavAddButton.TabIndex = 40; + this.skinNavAddButton.UseVisualStyleBackColor = true; + this.skinNavAddButton.Click += new System.EventHandler(this.skinNavAddButton_Click); + // + // skinNavConfigButton + // + this.skinNavConfigButton.BackgroundImage = global::ProcessPlugins.ShortCuter.Properties.Resources.SkinNav; + this.skinNavConfigButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.skinNavConfigButton.Location = new System.Drawing.Point(726, 220); + this.skinNavConfigButton.Name = "skinNavConfigButton"; + this.skinNavConfigButton.Size = new System.Drawing.Size(70, 70); + this.skinNavConfigButton.TabIndex = 41; + this.skinNavConfigButton.UseVisualStyleBackColor = true; + this.skinNavConfigButton.Click += new System.EventHandler(this.skinNavConfigButton_Click); + // + // skinItems + // + this.skinItems.Location = new System.Drawing.Point(266, 8); + this.skinItems.Name = "skinItems"; + this.skinItems.SelectedIndex = -1; + this.skinItems.SelectedTab = My.Common.SkinItems.SkinItemsType.Links; + this.skinItems.Size = new System.Drawing.Size(330, 260); + this.skinItems.TabIndex = 39; + this.skinItems.Enter += new System.EventHandler(this.skinItems_Enter); + this.skinItems.DoubleClick += new System.EventHandler(this.skinItems_DoubleClick); + this.skinItems.SelectedIndexChanged += new System.EventHandler(this.skinItems_SelectedIndexChanged); + // + // 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.skinNavConfigButton); + this.Controls.Add(this.skinNavAddButton); + this.Controls.Add(this.skinItems); + this.Controls.Add(this.rowCopyButton); + this.Controls.Add(this.overridesGroupBox); + this.Controls.Add(this.saveButton); + this.Controls.Add(this.rowDownButton); + this.Controls.Add(this.linkPropertiesGroupBox); + this.Controls.Add(this.rowUpButton); + this.Controls.Add(this.resetButton); + this.Controls.Add(this.updateButton); + this.Controls.Add(this.infoPictureBox); + this.Controls.Add(this.rowRemoveButton); + this.Controls.Add(this.rowAddButton); + this.Controls.Add(this.shortCutsDataGridView); + this.Controls.Add(this.propLeftPictureBox); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.Name = "ShortCuterConfig"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "ShortCut\'er Plugin Configuration"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ShortCuterConfig_FormClosing); + this.Load += new System.EventHandler(this.ShortCuterConfig_Load); + this.Shown += new System.EventHandler(this.ShortCuterConfig_Shown); + ((System.ComponentModel.ISupportInitialize)(this.shortCutsDataGridView)).EndInit(); + this.linkPropertiesGroupBox.ResumeLayout(false); + this.loadParameterGroupBox.ResumeLayout(false); + this.loadParameterGroupBox.PerformLayout(); + this.windowIdGroupBox.ResumeLayout(false); + this.skinFileGroupBox.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.infoPictureBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.propLeftPictureBox)).EndInit(); + this.overridesGroupBox.ResumeLayout(false); + this.numLockGroupBox.ResumeLayout(false); + this.capsLockGroupBox.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.DataGridView shortCutsDataGridView; + private System.Windows.Forms.PictureBox propLeftPictureBox; + private System.Windows.Forms.Button rowAddButton; + private System.Windows.Forms.Button rowRemoveButton; + private System.Windows.Forms.PictureBox infoPictureBox; + private System.Windows.Forms.GroupBox linkPropertiesGroupBox; + private System.Windows.Forms.ToolTip toolTip; + private System.Windows.Forms.Button updateButton; + private System.Windows.Forms.Button resetButton; + private System.Windows.Forms.Button rowDownButton; + private System.Windows.Forms.Button rowUpButton; + private System.Windows.Forms.GroupBox windowIdGroupBox; + private System.Windows.Forms.Label windowIdLabel; + private System.Windows.Forms.GroupBox skinFileGroupBox; + private System.Windows.Forms.Label skinFileLabel; + private System.Windows.Forms.GroupBox loadParameterGroupBox; + private System.Windows.Forms.Button saveButton; + private System.Windows.Forms.TextBox loadParameterTextBox; + private System.Windows.Forms.GroupBox overridesGroupBox; + private System.Windows.Forms.GroupBox capsLockGroupBox; + private System.Windows.Forms.GroupBox numLockGroupBox; + private System.Windows.Forms.ComboBox capsLockComboBox; + private System.Windows.Forms.ComboBox numLockComboBox; + private System.Windows.Forms.Button rowCopyButton; + private My.Common.SkinItems skinItems; + private System.Windows.Forms.Button skinNavAddButton; + private System.Windows.Forms.Button skinNavConfigButton; + + } +} \ No newline at end of file Added: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs (rev 0) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs 2014-05-23 13:36:12 UTC (rev 4813) @@ -0,0 +1,517 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; +using MediaPortal.Configuration; +using MediaPortal.GUI.Library; +using MediaPortal.Profile; +using My.Common; + +namespace ProcessPlugins.ShortCuter.Configuration +{ + [PluginIcons("ProcessPlugins.ShortCuter.Resources.Images.ShortCuterEnable.png", "ProcessPlugins.ShortCuter.Resources.Images.ShortCuterDisable.png")] + public partial class ShortCuterConfig : Form, ISetupForm //Form per la configurazione del plugin, con implementazione interfaccia ISetupForm (per lancio da configurazione MediaPortal) + { + #region Dati + private Skin mySkin; //Istanza classe Skin (dati relativi alla skin di MediaPortal) + private ShortCuts myShortCuts; //Istanza classe ShortCuts (dati relativi ai shortcuts configurati) + private bool unsavedChanges; //Presenza modifiche da salvare + private bool forceCell; //Azione di forzatura valore cella WindowID dello shortcut + #endregion + + #region Costruttore + public ShortCuterConfig() + { + InitializeComponent(); + } + #endregion + + #region Metodi Privati + private void InitializeGUI() //Inizializzazione interfaccia + { + skinItems.Populate(mySkin.SkinFiles, mySkin.SkinLinks, false, true); + FormatShortCutsGrid(); + + capsLockComboBox.DataSource = Enum.GetNames(typeof(LockKeys.LockKeyActions)); + capsLockComboBox.SelectedItem = Enum.GetName(typeof(LockKeys.LockKeyActions), myShortCuts.General.ForcingCapsLock); + numLockComboBox.DataSource = Enum.GetNames(typeof(LockKeys.LockKeyActions)); + numLockComboBox.SelectedItem = Enum.GetName(typeof(LockKeys.LockKeyActions), myShortCuts.General.ForcingNumLock); + + 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"); + toolTip.SetToolTip(skinNavAddButton, "Add a shortcut to Skin Navigator in list"); + toolTip.SetToolTip(rowUpButton, "Move up selected shortcut in list"); + toolTip.SetToolTip(rowDownButton, "Move down selected shortcut in list"); + toolTip.SetToolTip(resetButton, "Reset actual settings and load the default configuration"); + toolTip.SetToolTip(saveButton, "Save actual settings"); + toolTip.SetToolTip(updateButton, "Save actual setting and close the application"); + toolTip.SetToolTip(capsLockComboBox, "Set forcing for Caps-Lock when MediaPortal starts (OFF is recommended)"); + toolTip.SetToolTip(numLockComboBox, "Set forcing for Num-Lock when MediaPortal starts"); + toolTip.SetToolTip(skinNavConfigButton, "Configure Skin Navigator"); + toolTip.SetToolTip(infoPictureBox, "Version information"); + + unsavedChanges = false; //--> necessario a fine aggiornamento controlli grafici + } + private void FormatShortCutsGrid() //Formattazione (e popolazione) tabella shortcuts + { + shortCutsDataGridView.AutoGenerateColumns = false; + + DataGridViewTextBoxColumn captionColumn = new DataGridViewTextBoxColumn(); + captionColumn.DataPropertyName = "Caption"; + captionColumn.HeaderText = "Caption"; + captionColumn.Width = 155; + captionColumn.MaxInputLength = 32; + captionColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + captionColumn.DefaultCellStyle.Font = new Font("Microsoft Sans Serif", 8, FontStyle.Bold); + captionColumn.ToolTipText = "Shortcut's title"; + + DataGridViewTextBoxColumn keyColumn = new DataGridViewTextBoxColumn(); + keyColumn.DataPropertyName = "Key"; + keyColumn.HeaderText = "Key [KeyCode]"; + keyColumn.Width = 120; + keyColumn.MaxInputLength = 24; + keyColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + keyColumn.DefaultCellStyle.Font = new Font("Microsoft Sans Serif", 8, FontStyle.Bold); + keyColumn.DefaultCellStyle.BackColor = Color.Yellow; + keyColumn.ReadOnly = true; + keyColumn.ToolTipText = "Key assigned to the shortcut (double click on the cell)"; + + DataGridViewCheckBoxColumn ctrlColumn = new DataGridViewCheckBoxColumn(); + ctrlColumn.DataPropertyName = "Ctrl"; + ctrlColumn.HeaderText = "Ctrl"; + ctrlColumn.Width = 30; + ctrlColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + ctrlColumn.DefaultCellStyle.BackColor = Color.LightCyan; + ctrlColumn.ToolTipText = "Use CTRL modifier + Key assigned"; + + DataGridViewCheckBoxColumn altColumn = new DataGridViewCheckBoxColumn(); + altColumn.DataPropertyName = "Alt"; + altColumn.HeaderText = "Alt"; + altColumn.Width = 30; + altColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + altColumn.DefaultCellStyle.BackColor = Color.LightCyan; + altColumn.ToolTipText = "Use ALT modifier + Key assigned"; + + DataGridViewCheckBoxColumn shiftColumn = new DataGridViewCheckBoxColumn(); + shiftColumn.DataPropertyName = "Shift"; + shiftColumn.HeaderText = "Shift"; + shiftColumn.Width = 30; + shiftColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + shiftColumn.DefaultCellStyle.BackColor = Color.LightCyan; + shiftColumn.ToolTipText = "Use SHIFT modifier + Key assigned"; + + DataGridViewTextBoxColumn windowIdColumn = new DataGridViewTextBoxColumn(); + windowIdColumn.DataPropertyName = "WindowID"; + windowIdColumn.HeaderText = "Window ID"; + windowIdColumn.Width = 70; + windowIdColumn.MaxInputLength = 10; + windowIdColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + windowIdColumn.ToolTipText = "MediaPortal window ID for the shortcut's destination"; + + DataGridViewTextBoxColumn loadParameterColumn = new DataGridViewTextBoxColumn(); + loadParameterColumn.DataPropertyName = "LoadParameter"; + loadParameterColumn.HeaderText = "Load Parameter"; + loadParameterColumn.Width = 358; + loadParameterColumn.MaxInputLength = 300; + loadParameterColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + loadParameterColumn.ToolTipText = "Any parameter for load window (see destination plugin's documentation)"; + + DataGridViewCheckBoxColumn returnColumn = new DataGridViewCheckBoxColumn(); + returnColumn.DataPropertyName = "Return"; + returnColumn.HeaderText = "Return"; + returnColumn.Width = 50; + returnColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + returnColumn.ToolTipText = "If you're already on the window ID, another activation of the shortcut will display the previous window"; + + DataGridViewComboBoxColumn soundEffectColumn = new DataGridViewComboBoxColumn(); + soundEffectColumn.DataPropertyName = "SoundEffect"; + soundEffectColumn.HeaderText = "Sound Effect"; + soundEffectColumn.Width = 140; + soundEffectColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + soundEffectColumn.FlatStyle = FlatStyle.Flat; //--> necessario con Win7 per aggiornare il colore di sfondo se selezionato + soundEffectColumn.DataSource = mySkin.SkinSounds; + soundEffectColumn.ToolTipText = "Sound effect played on the shortcut"; + + shortCutsDataGridView.Columns.Add(captionColumn); + shortCutsDataGridView.Columns.Add(keyColumn); + shortCutsDataGridView.Columns.Add(ctrlColumn); + shortCutsDataGridView.Columns.Add(altColumn); + shortCutsDataGridView.Columns.Add(shiftColumn); + shortCutsDataGridView.Columns.Add(windowIdColumn); + shortCutsDataGridView.Columns.Add(loadParameterColumn); + shortCutsDataGridView.Columns.Add(returnColumn); + shortCutsDataGridView.Columns.Add(soundEffectColumn); + + shortCutsDataGridView.DataSource = myShortCuts.Items; + } + private void ShowLinkProperties() //Visualizzazione proprietà link + { + if (skinItems.SelectedIndex < 0) //Se indice invalido --> reset proprietà + { + skinFileLabel.Text = "-"; + windowIdLabel.Text = "-"; + loadParameterTextBox.Text = "-"; + } + else //Visualizzazione proprietà elemento selezionato + { + switch (skinItems.SelectedTab) + { + case SkinItems.SkinItemsType.Files: //Lista files della skin + skinFileLabel.Text = mySkin.SkinFiles[skinItems.SelectedIndex].Name; + windowIdLabel.Text = mySkin.SkinFiles[skinItems.SelectedIndex].Id.ToString(); + loadParameterTextBox.Text = "-"; + break; + + case SkinItems.SkinItemsType.Links: //Lista links predefiniti della skin + skinFileLabel.Text = mySkin.SkinLinks[skinItems.SelectedIndex].XmlFile; + windowIdLabel.Text = mySkin.SkinLinks[skinItems.SelectedIndex].WindowID.ToString(); + loadParameterTextBox.Text = mySkin.SkinLinks[skinItems.SelectedIndex].LoadParameter; + break; + } + } + } + private void ShowLinkItem() //Visualizzazione link corrispondente allo shortcut + { + if (shortCutsDataGridView.CurrentCell != null) + { + 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 (skinItems.SelectedTab == SkinItems.SkinItemsType.Links) + { + //Selezione eventuale link corrispondente a WindowID & LoadParameter + string loadParameter = Convert.ToString(shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[6].Value); + showIndex = mySkin.SkinLinks.FindIndex(x => x.WindowID == windowID && x.LoadParameter == loadParameter); + } + else + //Selezione eventuale file corrispondente a WindowID + showIndex = mySkin.SkinFiles.FindLastIndex(x => x.Id == windowID); + + skinItems.SelectedIndex = showIndex; + } + } + } + private void MoveItemList(bool dirUp) //Spostamento shortcut + { + if (shortCutsDataGridView.CurrentCell != null) + { + forceCell = true; + int index = shortCutsDataGridView.CurrentRow.Index; + shortCutsDataGridView.CurrentCell = shortCutsDataGridView[0, index]; //Importante cambiare la colonna prima di muovere la riga se posizionati su KeyCode (Hook attivo) + ShortCut sc = myShortCuts.Items[index]; + myShortCuts.Items.RemoveAt(index); + if (dirUp) + index--; + else + index++; + myShortCuts.Items.Insert(index, sc); + shortCutsDataGridView.CurrentCell = shortCutsDataGridView[0, index]; + shortCutsDataGridView.Rows[index].Selected = true; + shortCutsDataGridView.Focus(); + forceCell = false; + } + } + private void MoveItemsListButtonsEnable() //Abilitazione/disabilitazione pulsanti di spostamento shortcuts + { + if (shortCutsDataGridView.CurrentCell != null) + { + rowUpButton.Enabled = (shortCutsDataGridView.CurrentRow.Index > 0); + rowDownButton.Enabled = (shortCutsDataGridView.CurrentRow.Index < myShortCuts.Items.Count - 1); + } + else + { + rowUpButton.Enabled = false; + rowDownButton.Enabled = false; + } + } + private bool Save() //Salvataggio configurazione plugin + { + myShortCuts.General.ForcingCapsLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), capsLockComboBox.SelectedItem.ToString()); + myShortCuts.General.ForcingNumLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), numLockComboBox.SelectedItem.ToString()); + return myShortCuts.SaveConfig(); + } + #endregion + + #region Consumazione Eventi + #region Eventi Form + private void ShortCuterConfig_Load(object sender, EventArgs e) + { + using (Settings confReader = new MPSettings()) + { + //Raccolta dati relativi alla skin + mySkin = new Skin(confReader.GetValueAsString("skin", "name", "DefaultWide"), Config.GetFolder(Config.Dir.Skin) + @"\", Config.GetFolder(Config.Dir.Cache) + @"\"); + } + if (mySkin.Initialized) + { + string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml"); + + myShortCuts = new ShortCuts(settingsFile); //Creazione classe per gestione shorcuts + myShortCuts.Log += new LogEventHandler(myShortCuts_Log); //Sottoscrizione evento di log shortuts + if (myShortCuts.Initialize()) //Inizializzazione & lettura impostazioni shorcuts + { + //Sottoscrizione evento di modifica lista shortcuts + myShortCuts.Items.ListChanged += new ListChangedEventHandler(myShortCutsItems_ListChanged); + + //Inizializzazione interfaccia grafica + InitializeGUI(); + } + } + //Se inizializzazione classi non completata + if (!mySkin.Initialized || !myShortCuts.Initialized) + { + this.Close(); + this.Dispose(); + } + } + private void ShortCuterConfig_Shown(object sender, EventArgs e) + { + shortCutsDataGridView.Focus(); + } + private void ShortCuterConfig_FormClosing(object sender, FormClosingEventArgs e) + { + //Se presenti modifiche non salvate: richiesta conferma per chiusura applicazione + if (unsavedChanges && !Tools.QuestionMessage("Unsaved changes will be lost...\nDo you want to proceed?")) + e.Cancel = true; //--> annullamento chiusura form + } + #endregion + #region Evento di Log Shortcuts + private void myShortCuts_Log(object sender, LogEventArgs e) + { + switch (e.LogLevel) + { + case LogEventArgs.LogLevels.Error: + if (e.LogException != null) + Tools.ErrorMessage(e.LogMessage, e.LogException.Message); //--> emissione finestra di errore (con descrizione errore) + else + Tools.ErrorMessage(e.LogMessage); //--> emissione finestra di errore + break; + case LogEventArgs.LogLevels.Info: + Tools.InfoMessage(e.LogMessage); //--> emissione finestra informativa + break; + } + } + #endregion + #region Eventi Modifica Griglia + private void shortCutsDataGridView_Enter(object sender, EventArgs e) + { + propLeftPictureBox.Visible = true; //--> il link è collegato allo shortcut selezionato + ShowLinkItem(); + MoveItemsListButtonsEnable(); + } + private void shortCutsDataGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) + { + e.Control.KeyPress -= idTextBox_KeyPress; + + if (e.Control is TextBox && ((DataGridView)(sender)).CurrentCell.ColumnIndex == 5) + e.Control.KeyPress += new KeyPressEventHandler(idTextBox_KeyPress); //--> sottoscrizione evento KeyPress per la cella WindowID + } + void idTextBox_KeyPress(object sender, KeyPressEventArgs e) + { + if ((int)shortCutsDataGridView.CurrentCell.Value <= 0) //Se WindowID negativo (possibile solo con Skin Navigator) + e.Handled = true; //--> carattere inputato da ignorare + else + { + if (!(char.IsDigit(e.KeyChar))) //Filtro per input numerico per la cella WindowID + { + Keys key = (Keys)e.KeyChar; + if (!(key == Keys.Back || key == Keys.Delete)) + { + e.Handled = true; //--> carattere inputato da ignorare + } + } + } + } + private void shortCutsDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) + { + //Eventuale visualizzazione form per assegnazione key allo shortcut corrente + if (shortCutsDataGridView.CurrentCell != null && shortCutsDataGridView.CurrentCell.ColumnIndex == 1) + new ShortCuterKeyConfig(myShortCuts.Items[shortCutsDataGridView.CurrentCell.RowIndex], + new Point(Location.X + shortCutsDataGridView.Location.X + 305, + Location.Y + shortCutsDataGridView.Location.Y + shortCutsDataGridView.CurrentRow.Height * shortCutsDataGridView.CurrentCell.RowIndex) + ).ShowDialog(); + } + private void shortCutsDataGridView_CellEndEdit(object sender, DataGridViewCellEventArgs e) + { + ShowLinkItem(); + } + private void shortCutsDataGridView_CurrentCellChanged(object sender, EventArgs e) + { + ShowLinkItem(); + MoveItemsListButtonsEnable(); + } + private void shortCutsDataGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) + { + shortCutsDataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].ToolTipText = shortCutsDataGridView.Columns[e.ColumnIndex].ToolTipText; + } + private void shortCutsDataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e) + { + //Gestione evento per evitare messaggi di errore (esempio se file effetto sonoro non disponibile nella skin) + } + #endregion + #region Eventi Modifica Impostazioni Plugin & Shortcuts + private void myShortCutsItems_ListChanged(object sender, EventArgs e) + { + unsavedChanges = true; + rowRemoveButton.Enabled = (myShortCuts.Items.Count > 0); + rowCopyButton.Enabled = (myShortCuts.Items.Count > 0); + MoveItemsListButtonsEnable(); + } + private void rowAddButton_Click(object sender, EventArgs e) + { + ShortCut sc = new ShortCut(); + myShortCuts.Items.Add(sc); + shortCutsDataGridView.CurrentCell = shortCutsDataGridView[0, shortCutsDataGridView.RowCount - 1]; + shortCutsDat... [truncated message content] |
From: <nic...@us...> - 2014-05-23 13:47:16
|
Revision: 4814 http://sourceforge.net/p/mp-plugins/code/4814 Author: nicsergio Date: 2014-05-23 13:47:11 +0000 (Fri, 23 May 2014) Log Message: ----------- Removed Paths: ------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/KeyboardHook.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/RawInputHook.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 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 trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.resx trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinNavigatorConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinNavigatorConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinNavigatorConfig.resx trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinWithSounds.cs Deleted: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/KeyboardHook.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/KeyboardHook.cs 2014-05-23 13:36:12 UTC (rev 4813) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/KeyboardHook.cs 2014-05-23 13:47:11 UTC (rev 4814) @@ -1,123 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Windows.Forms; - -namespace ProcessPlugins.ShortCuter -{ - internal class KeyboardHook //Classe per gestione hook di sistema - { - #region Delegati/Strutture - /// Delegato da richiamare all'intercettazione del messaggio - /// Parametri: - /// code : codice hook - /// wParam: ID evento intercettato - /// lParam: informazioni sull'evento intercettato - public delegate int HookProc(int code, int wParam, ref HookStruct lParam); - - public struct HookStruct //Struttura hook - { - public int vkCode; - public int scanCode; - public int flags; - public int time; - public int dwExtraInfo; - } - #endregion - - #region Dati - #region Costanti - private const int WH_KEYBOARD_LL = 13; //Id evento per hook di tastiera di basso livello - private const int WM_KEYDOWN = 0x100; //Id messaggio KeyDown - private const int WM_KEYUP = 0x101; //Id messaggio KeyUp - private const int WM_SYSKEYDOWN = 0x104; //Id messaggio KeyDown (tasto di sistema) - private const int WM_SYSKEYUP = 0x105; //Id messaggio KeyUp (tasto di sistema) - #endregion - - public List<Keys> HookedKeys = new List<Keys>(); //Eventuale lista dei tasti da monitorare/intercettare - private IntPtr hHook = IntPtr.Zero; //Handle dell'hook - private IntPtr hInstance = IntPtr.Zero; //Handle dell'istanza della libreria esterna - private bool _hooked = false; //Hook attivato - #endregion - - #region Costruttore/Distruttore - public KeyboardHook() - { - hInstance = LoadLibrary("User32"); //--> caricamento libreria esterna e memorizzazione handle - } - ~KeyboardHook() - { - unhook(); //--> eventuale disinstallazione dell'hook di sistema - } - #endregion - - #region Metodi Privati - private int hookProc(int code, int wParam, ref HookStruct lParam) //Metodo richiamato per l'hook di tastiera - { - if (code >= 0) //Se codice hook valorizzato - { - Keys key = (Keys)lParam.vkCode; - if (HookedKeys == null || HookedKeys.Count == 0 || HookedKeys.Contains(key)) //Se il tasto appartiene alla lista dei tasti da intercettare (o lista non utilizzata) - { - KeyEventArgs kea = new KeyEventArgs(key); - if ((wParam == WM_KEYDOWN || wParam == WM_SYSKEYDOWN) && (KeyDown != null)) - { - KeyDown(this, kea); //--> richiamo dell'evento KeyDown - } - else if ((wParam == WM_KEYUP || wParam == WM_SYSKEYUP) && (KeyUp != null)) - { - KeyUp(this, kea); //--> richiamo dell'evento KeyUp - } - if (kea.Handled) //Se l'evento \xE8 stato gestito - return 1; //--> il tasto non viene passato al sistema - } - } - return CallNextHookEx(hHook, code, wParam, ref lParam); - } - #endregion - - #region Metodi Pubblici - public void hook() //Installazione dell'hook di sistema - { - unhook(); //--> eventuale disinstallazione hook - hHook = SetWindowsHookEx(WH_KEYBOARD_LL, hookProc, hInstance, 0); //--> installazione hook - _hooked = true; //--> memorizzazione hook attivo - } - public void unhook() //Disinstallazione dell'hook di sistema - { - if (_hooked) //Se hook attivo - { - UnhookWindowsHookEx(hHook); //--> disinstallazione hook - _hooked = false; //--> memorizzazione hook disattivo - } - } - #endregion - - #region Eventi - public event KeyEventHandler KeyDown; //Evento di pressione di uno dei tasti da monitorare - public event KeyEventHandler KeyUp; //Evento di rilascio di uno dei tasti da monitorare - #endregion - - #region Propriet\xE0 - public bool Hooked { get { return this._hooked; } } - #endregion - - #region Importazione DLL - //Installazione dell'hook, esecuzione dell'evento desiderato [uno dei parametri hInstance o threadId deve essere valorizzato] - [DllImport("user32.dll")] - static extern IntPtr SetWindowsHookEx(int idHook, HookProc callback, IntPtr hInstance, uint threadId); - - //Disinstallazione dell'hook (ritorna true se esecuzione con successo) - [DllImport("user32.dll")] - static extern bool UnhookWindowsHookEx(IntPtr hInstance); - - //Chiamata a hook successivo - [DllImport("user32.dll")] - static extern int CallNextHookEx(IntPtr idHook, int nCode, int wParam, ref HookStruct lParam); - - //Caricamento di una libreria (ritorna l'handle associato) - [DllImport("kernel32.dll")] - static extern IntPtr LoadLibrary(string lpFileName); - #endregion - } -} Deleted: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/RawInputHook.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/RawInputHook.cs 2014-05-23 13:36:12 UTC (rev 4813) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/RawInputHook.cs 2014-05-23 13:47:11 UTC (rev 4814) @@ -1,178 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Windows.Forms; - -namespace ProcessPlugins.ShortCuter -{ - public class RawInputHook : IMessageFilter //Classe per gestione hook mediante raw input - { - #region Dati - private const int WM_INPUT = 0x00ff; //Id messaggio per RawInput - private List<RAWINPUTDEVICE> devices = new List<RAWINPUTDEVICE>(); //Lista dispositivi di input controllati - private bool _backgroundInput; //Consenti ricezione eventi anche con finestra in background - #endregion - - #region Costruttore - public RawInputHook(IntPtr windowHandle) - { - _backgroundInput = false; //--> default: monitoraggio solo con finestra in primo piano - AddKeyboardDevice(windowHandle); //--> monitoraggio input da tastiera - RegisterDevices(); //--> registrazione dispositivi - Application.AddMessageFilter(this); //--> aggiunta del filtro messaggi - } - #endregion - - #region Implementazione IMessageFilter - public bool PreFilterMessage(ref Message m) //Ricezione del messaggio di Windows - { - if (m.Msg == WM_INPUT) //Se messaggio per eventi RawInput - { - if (m.WParam == (IntPtr)0 || _backgroundInput) //Verifica se applicazione in primo piano o abilitazione anche in background - { - if (KeyDown != null) //Se evento sottoscritto - { - ProcessRawInput(m.LParam); //--> processazione evento - return true; //--> stop del messaggio - } - } - } - return false; //--> altrimenti messaggio gestito dal sistema - } - #endregion - - #region Metodi Privati - private void AddKeyboardDevice(IntPtr windowHandle) //Aggiunta della tastiera come dispositivo da monitorare - { - const ushort UsagePage = 1; //Device per il controllo generico del desktop - const ushort Usage = 6; //Tipologia di device (tastiera) - const Int32 Flags = 0x100; //[RIDEV_INPUTSINK] Abilita a ricevere gli eventi anche se l'applicazione non è in primo piano (windowHandle deve essere specificato) - - devices.Add(new RAWINPUTDEVICE(UsagePage, Usage, Flags, windowHandle)); //--> agiunta nella lista dei dispositivi da monitorare - } - private bool RegisterDevices() //Registrazione dei dispositivi specificati - { - if (devices.Count == 0) return false; - - RAWINPUTDEVICE[] d = devices.ToArray(); - return RegisterRawInputDevices(d, devices.Count, Marshal.SizeOf(typeof(RAWINPUTDEVICE))); - } - private void ProcessRawInput(IntPtr hRawInput) //Processazione RawInput - { - RAWINPUT pData = new RAWINPUT(); - int pcbSize = Marshal.SizeOf(typeof(RAWINPUT)); - - int result = GetRawInputData(hRawInput, RawInputCommand.Input, out pData, ref pcbSize, Marshal.SizeOf(typeof(RAWINPUTHEADER))); - - if (result != -1) - { - if (pData.Header.Type == RawInputType.Keyboard) //Se input da tastiera - { - if ((pData.Keyboard.Flags & 0x0001) == 0) //Primo bit di Flags = 0 --> evento KeyDown (a 1 --> KeyUp) - { - try - { - Keys key = (Keys)pData.Keyboard.VirtualKey; //KeyCode del tasto premuto - - //GetAsyncKeyState sembra più sicuro di Control.ModifierKeys - if ((GetAsyncKeyState(Keys.ControlKey) & 0x8000) != 0) - key = key | Keys.Control; //--> aggiunta eventuale modificatore CTRL - if ((GetAsyncKeyState(Keys.Menu) & 0x8000) != 0) - key = key | Keys.Alt; //--> aggiunta eventuale modificatore ALT - if ((GetAsyncKeyState(Keys.ShiftKey) & 0x8000) != 0) - key = key | Keys.Shift; //--> aggiunta eventuale modificatore SHIFT - KeyEventArgs kea = new KeyEventArgs(key); //--> generazione argomenti per evento KeyEvent - - KeyDown(this, kea); //--> richiamo dell'evento KeyDown - } - catch { } - } - } - } - } - #endregion - - #region Eventi - public event KeyEventHandler KeyDown; //Evento di pressione tasto - #endregion - - #region Proprietà - public bool BackgroundInput { get { return this._backgroundInput; } set { this._backgroundInput = value; } } - #endregion - - #region Importazione DLL - //Registrazione dispositivi da monitorare - [DllImport("user32.dll")] - static extern bool RegisterRawInputDevices([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] RAWINPUTDEVICE[] pRawInputDevices, int uiNumDevices, int cbSize); - - //Ottenimento dati relativi all'evento di RawInput - [DllImport("user32.dll")] - static extern int GetRawInputData(IntPtr hRawInput, RawInputCommand uiCommand, out RAWINPUT pData, ref int pcbSize, int cbSizeHeader); - - //Controllo dello stato di un tasto - [DllImport("user32.dll", CharSet = CharSet.Auto)] - private static extern short GetAsyncKeyState(Keys key); - #endregion - } - - #region Strutture/Enumerativi - [StructLayout(LayoutKind.Sequential)] - struct RAWINPUTDEVICE //Struttura dispositivo per RawInput - { - public ushort UsagePage; //Tipologia di device - public ushort Usage; //Sotto-tipologia di device (tastiera/mouse/..) - public Int32 Flags; //Modalità di monitoraggio - public IntPtr WindowHandle; //Handle della finestra (necessario con Flags = RIDEV_INPUTSINK) - - public RAWINPUTDEVICE(ushort usagePage, ushort usage, Int32 flags, IntPtr windowHandle) - { - UsagePage = usagePage; - Usage = usage; - Flags = flags; - WindowHandle = windowHandle; - } - } - - [StructLayout(LayoutKind.Explicit)] - public struct RAWINPUT //Struttura dati per RawInput - { - [FieldOffset(0)] - public RAWINPUTHEADER Header; - [FieldOffset(16)] - public RAWKEYBOARD Keyboard; - } - - [StructLayout(LayoutKind.Sequential)] - public struct RAWINPUTHEADER //Struttura dati Header per evento RawInput - { - public RawInputType Type; - public int Size; - public IntPtr Device; - public IntPtr wParam; - } - - [StructLayout(LayoutKind.Sequential)] - public struct RAWKEYBOARD //Struttura dati Keyboard per evento RawInput - { - public ushort MakeCode; //Codice "grezzo" del tasto, prima della traduzione in funzione della tastiera (corrisponde a DirectInput) - public ushort Flags; //Flags per la tipologa di scansione (0=KeyDown, 1=KeyUp, 2=Versione sx del tasto, 4=Versione dx del tasto) - public ushort Reserved; //--- - public ushort VirtualKey; //KeyCode compatibile con il messaggio - public int Message; //Tipo di messaggio - public int ExtraInformation; //Informazioni addizionali del dispositivo che ha generato l'evento - } - - public enum RawInputType //Tipologie di dispositivo per RawInput - { - Mouse = 0, - Keyboard = 1, - HID = 2 - } - - enum RawInputCommand //Tipologie di comando per ottenimento dati su evento RawInput - { - Input = 0x10000003, - Header = 0x10000005 - } - #endregion -} Deleted: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-23 13:36:12 UTC (rev 4813) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-23 13:47:11 UTC (rev 4814) @@ -1,106 +0,0 @@ -using System; -using System.Windows.Forms; -using MediaPortal.Configuration; -using MediaPortal.GUI.Library; -//using Action = MediaPortal.GUI.Library.Action; -using My.Common; - -namespace ProcessPlugins.ShortCuter -{ - public class ShortCuter : IPlugin //Classe gestore shortcuts - { - #region Dati - private ShortCuts myShortCuts; //Istanza classe ShortCuts (dati relativi ai shortcuts configurati) - private static readonly string LogPrefix; //Prefisso per log eventi - #endregion - - #region Costruttore - static ShortCuter() //Costruttore classe ShortCuter - { - LogPrefix = Tools.MyAssembly.Title + ": "; //Header per log su file (titolo assembly) - } - #endregion - - #region Implementazione IPlugin - public void Start() //Avvio del plugin - { - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "Plugin started")); - - string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml"); - myShortCuts = new ShortCuts(settingsFile); //Creazione classe per gestione shorcuts - myShortCuts.Log += new LogEventHandler(myShortCuts_Log); //--> sottoscrizione evento di log shortuts - - if (LockKeys.ChangeCapsLock(myShortCuts.General.ForcingCapsLock)) - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "CapsLock " + ((myShortCuts.General.ForcingCapsLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); - if (LockKeys.ChangeNumLock(myShortCuts.General.ForcingNumLock)) - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "NumLock " + ((myShortCuts.General.ForcingNumLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); - - if (myShortCuts.Initialize()) //Inizializzazione & lettura impostazioni shorcuts - { - try - { - RawInputHook rawInput = new RawInputHook(GUIGraphicsContext.form.Handle); //--> creazione hook mediante RawInput - rawInput.KeyDown += new KeyEventHandler(rawInput_KeyDown); //--> sottoscrizione evento KeyDown - } - catch (Exception e) - { - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Error, "Error creating raw input hook", e)); - } - - try - { - //Sottoscrizione evento di attivazione finestra di MediaPortal - GUIWindowManager.OnActivateWindow += new GUIWindowManager.WindowActivationHandler(GUIWindowManager_OnActivateWindow); - } - catch (Exception e) - { - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Error, "Error subscription ActivateWindow event", e)); - } - } - else - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Error, "Error loading configuration")); - } - public void Stop() //Terminazione del plugin - { - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "Plugin stopped")); - } - #endregion - - #region Metodi Privati - private void MpLog(LogEventArgs e) //Registrazione evento su log di MediaPortal - { - string message = LogPrefix + e.LogMessage; - - switch (e.LogLevel) - { - case LogEventArgs.LogLevels.Error: - if (e.LogException != null) - message += " [" + e.LogException.Message + " (" + e.LogException.StackTrace + ")]"; - Log.Error(message); //--> log errore - break; - case LogEventArgs.LogLevels.Info: - Log.Info(message); //--> log messaggio informativo - break; - case LogEventArgs.LogLevels.Debug: - Log.Debug(message); //--> log informazione per debug - break; - } - } - #endregion - - #region Consumazione Eventi - private void rawInput_KeyDown(object sender, KeyEventArgs e) //Evento di pressione tasto - { - myShortCuts.KeysReceiving(e); //--> pubblicazione a gestore shortcuts - } - private void GUIWindowManager_OnActivateWindow(int windowID) //Evento di attivazione finestra di MediaPortal - { - myShortCuts.WindowChanged(windowID); //--> pubblicazione a gestore shortcuts - } - private void myShortCuts_Log(object sender, LogEventArgs e) //Evento di log gestore shortcuts - { - MpLog(e); //--> log - } - #endregion - } -} Deleted: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs 2014-05-23 13:36:12 UTC (rev 4813) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs 2014-05-23 13:47:11 UTC (rev 4814) @@ -1,468 +0,0 @@ -namespace ProcessPlugins.ShortCuter -{ - partial class ShortCuterConfig - { - /// <summary> - /// Required designer variable. - /// </summary> - private System.ComponentModel.IContainer components = null; - - /// <summary> - /// Clean up any resources being used. - /// </summary> - /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// <summary> - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// </summary> - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - 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.linkPropertiesGroupBox = new System.Windows.Forms.GroupBox(); - this.loadParameterGroupBox = new System.Windows.Forms.GroupBox(); - this.loadParameterTextBox = new System.Windows.Forms.TextBox(); - this.windowIdGroupBox = new System.Windows.Forms.GroupBox(); - this.windowIdLabel = new System.Windows.Forms.Label(); - this.skinFileGroupBox = new System.Windows.Forms.GroupBox(); - this.skinFileLabel = new System.Windows.Forms.Label(); - this.toolTip = new System.Windows.Forms.ToolTip(this.components); - this.updateButton = new System.Windows.Forms.Button(); - this.resetButton = new System.Windows.Forms.Button(); - this.rowDownButton = new System.Windows.Forms.Button(); - this.rowUpButton = new System.Windows.Forms.Button(); - this.infoPictureBox = new System.Windows.Forms.PictureBox(); - this.rowRemoveButton = new System.Windows.Forms.Button(); - this.rowAddButton = new System.Windows.Forms.Button(); - this.propLeftPictureBox = new System.Windows.Forms.PictureBox(); - this.saveButton = new System.Windows.Forms.Button(); - this.overridesGroupBox = new System.Windows.Forms.GroupBox(); - this.numLockGroupBox = new System.Windows.Forms.GroupBox(); - this.numLockComboBox = new System.Windows.Forms.ComboBox(); - this.capsLockGroupBox = new System.Windows.Forms.GroupBox(); - this.capsLockComboBox = new System.Windows.Forms.ComboBox(); - this.rowCopyButton = new System.Windows.Forms.Button(); - this.skinNavAddButton = new System.Windows.Forms.Button(); - this.skinNavConfigButton = new System.Windows.Forms.Button(); - this.skinItems = new My.Common.SkinItems(); - ((System.ComponentModel.ISupportInitialize)(this.shortCutsDataGridView)).BeginInit(); - this.linkPropertiesGroupBox.SuspendLayout(); - this.loadParameterGroupBox.SuspendLayout(); - this.windowIdGroupBox.SuspendLayout(); - this.skinFileGroupBox.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.infoPictureBox)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.propLeftPictureBox)).BeginInit(); - this.overridesGroupBox.SuspendLayout(); - this.numLockGroupBox.SuspendLayout(); - this.capsLockGroupBox.SuspendLayout(); - this.SuspendLayout(); - // - // shortCutsDataGridView - // - this.shortCutsDataGridView.AllowUserToAddRows = false; - this.shortCutsDataGridView.AllowUserToDeleteRows = false; - this.shortCutsDataGridView.AllowUserToResizeRows = false; - this.shortCutsDataGridView.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(220)))), ((int)(((byte)(227))))); - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.shortCutsDataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; - this.shortCutsDataGridView.ColumnHeadersHeight = 30; - this.shortCutsDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - this.shortCutsDataGridView.Location = new System.Drawing.Point(6, 304); - this.shortCutsDataGridView.MultiSelect = false; - this.shortCutsDataGridView.Name = "shortCutsDataGridView"; - this.shortCutsDataGridView.RowHeadersWidth = 20; - this.shortCutsDataGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; - this.shortCutsDataGridView.Size = new System.Drawing.Size(1006, 429); - this.shortCutsDataGridView.TabIndex = 0; - this.shortCutsDataGridView.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.shortCutsDataGridView_CellDoubleClick); - this.shortCutsDataGridView.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.shortCutsDataGridView_CellEndEdit); - this.shortCutsDataGridView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.shortCutsDataGridView_CellFormatting); - this.shortCutsDataGridView.CurrentCellChanged += new System.EventHandler(this.shortCutsDataGridView_CurrentCellChanged); - this.shortCutsDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.shortCutsDataGridView_DataError); - this.shortCutsDataGridView.EditingControlShowing += new System.Windows.Forms.DataGridViewEditingControlShowingEventHandler(this.shortCutsDataGridView_EditingControlShowing); - this.shortCutsDataGridView.Enter += new System.EventHandler(this.shortCutsDataGridView_Enter); - // - // linkPropertiesGroupBox - // - this.linkPropertiesGroupBox.Controls.Add(this.loadParameterGroupBox); - this.linkPropertiesGroupBox.Controls.Add(this.windowIdGroupBox); - this.linkPropertiesGroupBox.Controls.Add(this.skinFileGroupBox); - this.linkPropertiesGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.linkPropertiesGroupBox.Location = new System.Drawing.Point(602, 30); - this.linkPropertiesGroupBox.Name = "linkPropertiesGroupBox"; - this.linkPropertiesGroupBox.Size = new System.Drawing.Size(320, 175); - this.linkPropertiesGroupBox.TabIndex = 31; - this.linkPropertiesGroupBox.TabStop = false; - this.linkPropertiesGroupBox.Text = "Link Properties"; - // - // loadParameterGroupBox - // - this.loadParameterGroupBox.Controls.Add(this.loadParameterTextBox); - this.loadParameterGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.loadParameterGroupBox.Location = new System.Drawing.Point(4, 103); - this.loadParameterGroupBox.Name = "loadParameterGroupBox"; - this.loadParameterGroupBox.Size = new System.Drawing.Size(312, 68); - this.loadParameterGroupBox.TabIndex = 37; - this.loadParameterGroupBox.TabStop = false; - this.loadParameterGroupBox.Text = "Load Parameter:"; - // - // loadParameterTextBox - // - this.loadParameterTextBox.BackColor = System.Drawing.SystemColors.Control; - this.loadParameterTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.loadParameterTextBox.ForeColor = System.Drawing.Color.Blue; - this.loadParameterTextBox.Location = new System.Drawing.Point(6, 19); - this.loadParameterTextBox.Multiline = true; - this.loadParameterTextBox.Name = "loadParameterTextBox"; - this.loadParameterTextBox.ReadOnly = true; - this.loadParameterTextBox.Size = new System.Drawing.Size(300, 43); - this.loadParameterTextBox.TabIndex = 39; - this.loadParameterTextBox.Text = "-"; - this.loadParameterTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // windowIdGroupBox - // - this.windowIdGroupBox.Controls.Add(this.windowIdLabel); - this.windowIdGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.windowIdGroupBox.Location = new System.Drawing.Point(4, 63); - this.windowIdGroupBox.Name = "windowIdGroupBox"; - this.windowIdGroupBox.Size = new System.Drawing.Size(312, 34); - this.windowIdGroupBox.TabIndex = 36; - this.windowIdGroupBox.TabStop = false; - this.windowIdGroupBox.Text = "Window ID:"; - // - // windowIdLabel - // - this.windowIdLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.windowIdLabel.ForeColor = System.Drawing.Color.Blue; - this.windowIdLabel.Location = new System.Drawing.Point(6, 16); - this.windowIdLabel.Name = "windowIdLabel"; - this.windowIdLabel.Size = new System.Drawing.Size(300, 13); - this.windowIdLabel.TabIndex = 6; - this.windowIdLabel.Text = "-"; - this.windowIdLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // skinFileGroupBox - // - this.skinFileGroupBox.Controls.Add(this.skinFileLabel); - this.skinFileGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.skinFileGroupBox.Location = new System.Drawing.Point(4, 23); - this.skinFileGroupBox.Name = "skinFileGroupBox"; - this.skinFileGroupBox.Size = new System.Drawing.Size(312, 34); - this.skinFileGroupBox.TabIndex = 6; - this.skinFileGroupBox.TabStop = false; - this.skinFileGroupBox.Text = "Skin File:"; - // - // skinFileLabel - // - this.skinFileLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.skinFileLabel.ForeColor = System.Drawing.Color.Blue; - this.skinFileLabel.Location = new System.Drawing.Point(6, 16); - this.skinFileLabel.Name = "skinFileLabel"; - this.skinFileLabel.Size = new System.Drawing.Size(300, 13); - this.skinFileLabel.TabIndex = 2; - this.skinFileLabel.Text = "-"; - this.skinFileLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // toolTip - // - this.toolTip.ShowAlways = true; - // - // updateButton - // - this.updateButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); - this.updateButton.Location = new System.Drawing.Point(67, 84); - this.updateButton.Name = "updateButton"; - this.updateButton.Size = new System.Drawing.Size(135, 38); - this.updateButton.TabIndex = 32; - this.updateButton.Text = "Save and Close"; - this.updateButton.UseVisualStyleBackColor = false; - this.updateButton.Click += new System.EventHandler(this.updateButton_Click); - // - // resetButton - // - this.resetButton.Location = new System.Drawing.Point(67, 8); - this.resetButton.Name = "resetButton"; - this.resetButton.Size = new System.Drawing.Size(133, 23); - this.resetButton.TabIndex = 33; - this.resetButton.Text = "Reset Configuration"; - this.resetButton.UseVisualStyleBackColor = true; - this.resetButton.Click += new System.EventHandler(this.resetButton_Click); - // - // rowDownButton - // - this.rowDownButton.AutoSize = true; - this.rowDownButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.rowDownButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowDown; - this.rowDownButton.Location = new System.Drawing.Point(226, 264); - this.rowDownButton.Name = "rowDownButton"; - this.rowDownButton.Size = new System.Drawing.Size(38, 38); - this.rowDownButton.TabIndex = 35; - this.rowDownButton.UseVisualStyleBackColor = true; - this.rowDownButton.Click += new System.EventHandler(this.rowDownButton_Click); - // - // rowUpButton - // - this.rowUpButton.AutoSize = true; - this.rowUpButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.rowUpButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowUp; - this.rowUpButton.Location = new System.Drawing.Point(186, 264); - this.rowUpButton.Name = "rowUpButton"; - this.rowUpButton.Size = new System.Drawing.Size(38, 38); - this.rowUpButton.TabIndex = 34; - this.rowUpButton.UseVisualStyleBackColor = true; - this.rowUpButton.Click += new System.EventHandler(this.rowUpButton_Click); - // - // infoPictureBox - // - this.infoPictureBox.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.Info; - this.infoPictureBox.Location = new System.Drawing.Point(990, 5); - this.infoPictureBox.Name = "infoPictureBox"; - this.infoPictureBox.Size = new System.Drawing.Size(24, 24); - this.infoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.infoPictureBox.TabIndex = 30; - this.infoPictureBox.TabStop = false; - this.infoPictureBox.Click += new System.EventHandler(this.infoPictureBox_Click); - // - // rowRemoveButton - // - this.rowRemoveButton.AutoSize = true; - this.rowRemoveButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.rowRemoveButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowRemove; - this.rowRemoveButton.Location = new System.Drawing.Point(46, 264); - this.rowRemoveButton.Name = "rowRemoveButton"; - this.rowRemoveButton.Size = new System.Drawing.Size(38, 38); - this.rowRemoveButton.TabIndex = 26; - this.rowRemoveButton.UseVisualStyleBackColor = true; - this.rowRemoveButton.Click += new System.EventHandler(this.rowRemoveButton_Click); - // - // rowAddButton - // - this.rowAddButton.AutoSize = true; - this.rowAddButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.rowAddButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowAdd; - this.rowAddButton.Location = new System.Drawing.Point(6, 264); - this.rowAddButton.Name = "rowAddButton"; - this.rowAddButton.Size = new System.Drawing.Size(38, 38); - this.rowAddButton.TabIndex = 25; - this.rowAddButton.UseVisualStyleBackColor = true; - this.rowAddButton.Click += new System.EventHandler(this.rowAddButton_Click); - // - // propLeftPictureBox - // - this.propLeftPictureBox.Enabled = false; - this.propLeftPictureBox.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.ArrowDown; - this.propLeftPictureBox.Location = new System.Drawing.Point(360, 257); - this.propLeftPictureBox.Name = "propLeftPictureBox"; - this.propLeftPictureBox.Size = new System.Drawing.Size(131, 56); - this.propLeftPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.propLeftPictureBox.TabIndex = 23; - this.propLeftPictureBox.TabStop = false; - this.propLeftPictureBox.Visible = false; - // - // saveButton - // - this.saveButton.Location = new System.Drawing.Point(67, 35); - this.saveButton.Name = "saveButton"; - this.saveButton.Size = new System.Drawing.Size(133, 23); - this.saveButton.TabIndex = 36; - this.saveButton.Text = "Save Configuration"; - this.saveButton.UseVisualStyleBackColor = true; - this.saveButton.Click += new System.EventHandler(this.saveButton_Click); - // - // overridesGroupBox - // - this.overridesGroupBox.Controls.Add(this.numLockGroupBox); - this.overridesGroupBox.Controls.Add(this.capsLockGroupBox); - this.overridesGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.overridesGroupBox.Location = new System.Drawing.Point(50, 133); - this.overridesGroupBox.Name = "overridesGroupBox"; - this.overridesGroupBox.Size = new System.Drawing.Size(165, 111); - this.overridesGroupBox.TabIndex = 37; - this.overridesGroupBox.TabStop = false; - this.overridesGroupBox.Text = "Overrides at Start-Up"; - // - // numLockGroupBox - // - this.numLockGroupBox.Controls.Add(this.numLockComboBox); - this.numLockGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.numLockGroupBox.Location = new System.Drawing.Point(6, 63); - this.numLockGroupBox.Name = "numLockGroupBox"; - this.numLockGroupBox.Size = new System.Drawing.Size(152, 42); - this.numLockGroupBox.TabIndex = 38; - this.numLockGroupBox.TabStop = false; - this.numLockGroupBox.Text = "Num-Lock Forcing:"; - // - // numLockComboBox - // - this.numLockComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.numLockComboBox.FormattingEnabled = true; - this.numLockComboBox.Location = new System.Drawing.Point(9, 15); - this.numLockComboBox.Name = "numLockComboBox"; - this.numLockComboBox.Size = new System.Drawing.Size(133, 21); - this.numLockComboBox.TabIndex = 1; - // - // capsLockGroupBox - // - this.capsLockGroupBox.Controls.Add(this.capsLockComboBox); - this.capsLockGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.capsLockGroupBox.Location = new System.Drawing.Point(6, 15); - this.capsLockGroupBox.Name = "capsLockGroupBox"; - this.capsLockGroupBox.Size = new System.Drawing.Size(152, 42); - this.capsLockGroupBox.TabIndex = 37; - this.capsLockGroupBox.TabStop = false; - this.capsLockGroupBox.Text = "Caps-Lock Forcing:"; - // - // capsLockComboBox - // - this.capsLockComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.capsLockComboBox.FormattingEnabled = true; - this.capsLockComboBox.Location = new System.Drawing.Point(9, 15); - this.capsLockComboBox.Name = "capsLockComboBox"; - this.capsLockComboBox.Size = new System.Drawing.Size(133, 21); - this.capsLockComboBox.TabIndex = 0; - // - // rowCopyButton - // - this.rowCopyButton.AutoSize = true; - this.rowCopyButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.rowCopyButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowCopy; - this.rowCopyButton.Location = new System.Drawing.Point(96, 264); - this.rowCopyButton.Name = "rowCopyButton"; - this.rowCopyButton.Size = new System.Drawing.Size(38, 38); - this.rowCopyButton.TabIndex = 38; - this.rowCopyButton.UseVisualStyleBackColor = true; - this.rowCopyButton.Click += new System.EventHandler(this.rowCopyButton_Click); - // - // skinNavAddButton - // - this.skinNavAddButton.AutoSize = true; - this.skinNavAddButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.skinNavAddButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.SkinNavAdd; - this.skinNavAddButton.Location = new System.Drawing.Point(136, 264); - this.skinNavAddButton.Name = "skinNavAddButton"; - this.skinNavAddButton.Size = new System.Drawing.Size(38, 38); - this.skinNavAddButton.TabIndex = 40; - this.skinNavAddButton.UseVisualStyleBackColor = true; - this.skinNavAddButton.Click += new System.EventHandler(this.skinNavAddButton_Click); - // - // skinNavConfigButton - // - this.skinNavConfigButton.BackgroundImage = global::ProcessPlugins.ShortCuter.Properties.Resources.SkinNav; - this.skinNavConfigButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.skinNavConfigButton.Location = new System.Drawing.Point(726, 220); - this.skinNavConfigButton.Name = "skinNavConfigButton"; - this.skinNavConfigButton.Size = new System.Drawing.Size(70, 70); - this.skinNavConfigButton.TabIndex = 41; - this.skinNavConfigButton.UseVisualStyleBackColor = true; - this.skinNavConfigButton.Click += new System.EventHandler(this.skinNavConfigButton_Click); - // - // skinItems - // - this.skinItems.Location = new System.Drawing.Point(266, 8); - this.skinItems.Name = "skinItems"; - this.skinItems.SelectedIndex = -1; - this.skinItems.SelectedTab = My.Common.SkinItems.SkinItemsType.Links; - this.skinItems.Size = new System.Drawing.Size(330, 260); - this.skinItems.TabIndex = 39; - this.skinItems.Enter += new System.EventHandler(this.skinItems_Enter); - this.skinItems.DoubleClick += new System.EventHandler(this.skinItems_DoubleClick); - this.skinItems.SelectedIndexChanged += new System.EventHandler(this.skinItems_SelectedIndexChanged); - // - // 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.skinNavConfigButton); - this.Controls.Add(this.skinNavAddButton); - this.Controls.Add(this.skinItems); - this.Controls.Add(this.rowCopyButton); - this.Controls.Add(this.overridesGroupBox); - this.Controls.Add(this.saveButton); - this.Controls.Add(this.rowDownButton); - this.Controls.Add(this.linkPropertiesGroupBox); - this.Controls.Add(this.rowUpButton); - this.Controls.Add(this.resetButton); - this.Controls.Add(this.updateButton); - this.Controls.Add(this.infoPictureBox); - this.Controls.Add(this.rowRemoveButton); - this.Controls.Add(this.rowAddButton); - this.Controls.Add(this.shortCutsDataGridView); - this.Controls.Add(this.propLeftPictureBox); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.Name = "ShortCuterConfig"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "ShortCut\'er Plugin Configuration"; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ShortCuterConfig_FormClosing); - this.Load += new System.EventHandler(this.ShortCuterConfig_Load); - this.Shown += new System.EventHandler(this.ShortCuterConfig_Shown); - ((System.ComponentModel.ISupportInitialize)(this.shortCutsDataGridView)).EndInit(); - this.linkPropertiesGroupBox.ResumeLayout(false); - this.loadParameterGroupBox.ResumeLayout(false); - this.loadParameterGroupBox.PerformLayout(); - this.windowIdGroupBox.ResumeLayout(false); - this.skinFileGroupBox.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.infoPictureBox)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.propLeftPictureBox)).EndInit(); - this.overridesGroupBox.ResumeLayout(false); - this.numLockGroupBox.ResumeLayout(false); - this.capsLockGroupBox.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.DataGridView shortCutsDataGridView; - private System.Windows.Forms.PictureBox propLeftPictureBox; - private System.Windows.Forms.Button rowAddButton; - private System.Windows.Forms.Button rowRemoveButton; - private System.Windows.Forms.PictureBox infoPictureBox; - private System.Windows.Forms.GroupBox linkPropertiesGroupBox; - private System.Windows.Forms.ToolTip toolTip; - private System.Windows.Forms.Button updateButton; - private System.Windows.Forms.Button resetButton; - private System.Windows.Forms.Button rowDownButton; - private System.Windows.Forms.Button rowUpButton; - private System.Windows.Forms.GroupBox windowIdGroupBox; - private System.Windows.Forms.Label windowIdLabel; - private System.Windows.Forms.GroupBox skinFileGroupBox; - private System.Windows.Forms.Label skinFileLabel; - private System.Windows.Forms.GroupBox loadParameterGroupBox; - private System.Windows.Forms.Button saveButton; - private System.Windows.Forms.TextBox loadParameterTextBox; - private System.Windows.Forms.GroupBox overridesGroupBox; - private System.Windows.Forms.GroupBox capsLockGroupBox; - private System.Windows.Forms.GroupBox numLockGroupBox; - private System.Windows.Forms.ComboBox capsLockComboBox; - private System.Windows.Forms.ComboBox numLockComboBox; - private System.Windows.Forms.Button rowCopyButton; - private My.Common.SkinItems skinItems; - private System.Windows.Forms.Button skinNavAddButton; - private System.Windows.Forms.Button skinNavConfigButton; - - } -} \ No newline at end of file Deleted: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-05-23 13:36:12 UTC (rev 4813) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-05-23 13:47:11 UTC (rev 4814) @@ -1,517 +0,0 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; -using MediaPortal.Configuration; -using MediaPortal.GUI.Library; -using MediaPortal.Profile; -using My.Common; - -namespace ProcessPlugins.ShortCuter -{ - [PluginIcons("ProcessPlugins.ShortCuter.Resources.Images.ShortCuterEnable.png", "ProcessPlugins.ShortCuter.Resources.Images.ShortCuterDisable.png")] - public partial class ShortCuterConfig : Form, ISetupForm //Form per la configurazione del plugin, con implementazione interfaccia ISetupForm (per lancio da configurazione MediaPortal) - { - #region Dati - private Skin mySkin; //Istanza classe Skin (dati relativi alla skin di MediaPortal) - private ShortCuts myShortCuts; //Istanza classe ShortCuts (dati relativi ai shortcuts configurati) - private bool unsavedChanges; //Presenza modifiche da salvare - private bool forceCell; //Azione di forzatura valore cella WindowID dello shortcut - #endregion - - #region Costruttore - public ShortCuterConfig() - { - InitializeComponent(); - } - #endregion - - #region Metodi Privati - private void InitializeGUI() //Inizializzazione interfaccia - { - skinItems.Populate(mySkin.SkinFiles, mySkin.SkinLinks, false, true); - FormatShortCutsGrid(); - - capsLockComboBox.DataSource = Enum.GetNames(typeof(LockKeys.LockKeyActions)); - capsLockComboBox.SelectedItem = Enum.GetName(typeof(LockKeys.LockKeyActions), myShortCuts.General.ForcingCapsLock); - numLockComboBox.DataSource = Enum.GetNames(typeof(LockKeys.LockKeyActions)); - numLockComboBox.SelectedItem = Enum.GetName(typeof(LockKeys.LockKeyActions), myShortCuts.General.ForcingNumLock); - - 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"); - toolTip.SetToolTip(skinNavAddButton, "Add a shortcut to Skin Navigator in list"); - toolTip.SetToolTip(rowUpButton, "Move up selected shortcut in list"); - toolTip.SetToolTip(rowDownButton, "Move down selected shortcut in list"); - toolTip.SetToolTip(resetButton, "Reset actual settings and load the default configuration"); - toolTip.SetToolTip(saveButton, "Save actual settings"); - toolTip.SetToolTip(updateButton, "Save actual setting and close the application"); - toolTip.SetToolTip(capsLockComboBox, "Set forcing for Caps-Lock when MediaPortal starts (OFF is recommended)"); - toolTip.SetToolTip(numLockComboBox, "Set forcing for Num-Lock when MediaPortal starts"); - toolTip.SetToolTip(skinNavConfigButton, "Configure Skin Navigator"); - toolTip.SetToolTip(infoPictureBox, "Version information"); - - unsavedChanges = false; //--> necessario a fine aggiornamento controlli grafici - } - private void FormatShortCutsGrid() //Formattazione (e popolazione) tabella shortcuts - { - shortCutsDataGridView.AutoGenerateColumns = false; - - DataGridViewTextBoxColumn captionColumn = new DataGridViewTextBoxColumn(); - captionColumn.DataPropertyName = "Caption"; - captionColumn.HeaderText = "Caption"; - captionColumn.Width = 155; - captionColumn.MaxInputLength = 32; - captionColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - captionColumn.DefaultCellStyle.Font = new Font("Microsoft Sans Serif", 8, FontStyle.Bold); - captionColumn.ToolTipText = "Shortcut's title"; - - DataGridViewTextBoxColumn keyColumn = new DataGridViewTextBoxColumn(); - keyColumn.DataPropertyName = "Key"; - keyColumn.HeaderText = "Key [KeyCode]"; - keyColumn.Width = 120; - keyColumn.MaxInputLength = 24; - keyColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - keyColumn.DefaultCellStyle.Font = new Font("Microsoft Sans Serif", 8, FontStyle.Bold); - keyColumn.DefaultCellStyle.BackColor = Color.Yellow; - keyColumn.ReadOnly = true; - keyColumn.ToolTipText = "Key assigned to the shortcut (double click on the cell)"; - - DataGridViewCheckBoxColumn ctrlColumn = new DataGridViewCheckBoxColumn(); - ctrlColumn.DataPropertyName = "Ctrl"; - ctrlColumn.HeaderText = "Ctrl"; - ctrlColumn.Width = 30; - ctrlColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - ctrlColumn.DefaultCellStyle.BackColor = Color.LightCyan; - ctrlColumn.ToolTipText = "Use CTRL modifier + Key assigned"; - - DataGridViewCheckBoxColumn altColumn = new DataGridViewCheckBoxColumn(); - altColumn.DataPropertyName = "Alt"; - altColumn.HeaderText = "Alt"; - altColumn.Width = 30; - ... [truncated message content] |
From: <nic...@us...> - 2014-05-25 13:31:48
|
Revision: 4815 http://sourceforge.net/p/mp-plugins/code/4815 Author: nicsergio Date: 2014-05-25 13:31:45 +0000 (Sun, 25 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/KeyboardHook.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinWithSounds.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LockKeys.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LogHandler.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/RawInputHook.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/ShortCuter.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Program.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Resources.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Settings.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj.user trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Added Paths: ----------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/NavigatorDialog.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/KeyboardHook.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/KeyboardHook.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/KeyboardHook.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -3,7 +3,7 @@ using System.Runtime.InteropServices; using System.Windows.Forms; -namespace ProcessPlugins.ShortCuter.Configuration +namespace ShortCuter.Configuration { internal class KeyboardHook //Classe per gestione hook di sistema { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.Designer.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.Designer.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -1,4 +1,4 @@ -namespace ProcessPlugins.ShortCuter.Configuration +namespace ShortCuter.Configuration { partial class ShortCuterConfig { @@ -212,7 +212,7 @@ // this.rowDownButton.AutoSize = true; this.rowDownButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.rowDownButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowDown; + this.rowDownButton.Image = global::ShortCuter.Properties.Resources.RowDown; this.rowDownButton.Location = new System.Drawing.Point(226, 264); this.rowDownButton.Name = "rowDownButton"; this.rowDownButton.Size = new System.Drawing.Size(38, 38); @@ -224,7 +224,7 @@ // this.rowUpButton.AutoSize = true; this.rowUpButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.rowUpButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowUp; + this.rowUpButton.Image = global::ShortCuter.Properties.Resources.RowUp; this.rowUpButton.Location = new System.Drawing.Point(186, 264); this.rowUpButton.Name = "rowUpButton"; this.rowUpButton.Size = new System.Drawing.Size(38, 38); @@ -234,7 +234,7 @@ // // infoPictureBox // - this.infoPictureBox.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.Info; + this.infoPictureBox.Image = global::ShortCuter.Properties.Resources.Info; this.infoPictureBox.Location = new System.Drawing.Point(990, 5); this.infoPictureBox.Name = "infoPictureBox"; this.infoPictureBox.Size = new System.Drawing.Size(24, 24); @@ -247,7 +247,7 @@ // this.rowRemoveButton.AutoSize = true; this.rowRemoveButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.rowRemoveButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowRemove; + this.rowRemoveButton.Image = global::ShortCuter.Properties.Resources.RowRemove; this.rowRemoveButton.Location = new System.Drawing.Point(46, 264); this.rowRemoveButton.Name = "rowRemoveButton"; this.rowRemoveButton.Size = new System.Drawing.Size(38, 38); @@ -259,7 +259,7 @@ // this.rowAddButton.AutoSize = true; this.rowAddButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.rowAddButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowAdd; + this.rowAddButton.Image = global::ShortCuter.Properties.Resources.RowAdd; this.rowAddButton.Location = new System.Drawing.Point(6, 264); this.rowAddButton.Name = "rowAddButton"; this.rowAddButton.Size = new System.Drawing.Size(38, 38); @@ -270,7 +270,7 @@ // propLeftPictureBox // this.propLeftPictureBox.Enabled = false; - this.propLeftPictureBox.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.ArrowDown; + this.propLeftPictureBox.Image = global::ShortCuter.Properties.Resources.ArrowDown; this.propLeftPictureBox.Location = new System.Drawing.Point(360, 257); this.propLeftPictureBox.Name = "propLeftPictureBox"; this.propLeftPictureBox.Size = new System.Drawing.Size(131, 56); @@ -345,7 +345,7 @@ // this.rowCopyButton.AutoSize = true; this.rowCopyButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.rowCopyButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowCopy; + this.rowCopyButton.Image = global::ShortCuter.Properties.Resources.RowCopy; this.rowCopyButton.Location = new System.Drawing.Point(96, 264); this.rowCopyButton.Name = "rowCopyButton"; this.rowCopyButton.Size = new System.Drawing.Size(38, 38); @@ -357,7 +357,7 @@ // this.skinNavAddButton.AutoSize = true; this.skinNavAddButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.skinNavAddButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.SkinNavAdd; + this.skinNavAddButton.Image = global::ShortCuter.Properties.Resources.SkinNavAdd; this.skinNavAddButton.Location = new System.Drawing.Point(136, 264); this.skinNavAddButton.Name = "skinNavAddButton"; this.skinNavAddButton.Size = new System.Drawing.Size(38, 38); @@ -367,7 +367,7 @@ // // skinNavConfigButton // - this.skinNavConfigButton.BackgroundImage = global::ProcessPlugins.ShortCuter.Properties.Resources.SkinNav; + this.skinNavConfigButton.BackgroundImage = global::ShortCuter.Properties.Resources.SkinNav; this.skinNavConfigButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.skinNavConfigButton.Location = new System.Drawing.Point(726, 220); this.skinNavConfigButton.Name = "skinNavConfigButton"; Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -7,9 +7,9 @@ using MediaPortal.Profile; using My.Common; -namespace ProcessPlugins.ShortCuter.Configuration +namespace ShortCuter.Configuration { - [PluginIcons("ProcessPlugins.ShortCuter.Resources.Images.ShortCuterEnable.png", "ProcessPlugins.ShortCuter.Resources.Images.ShortCuterDisable.png")] + [PluginIcons("ShortCuter.Resources.Images.ShortCuterEnable.png", "ShortCuter.Resources.Images.ShortCuterDisable.png")] public partial class ShortCuterConfig : Form, ISetupForm //Form per la configurazione del plugin, con implementazione interfaccia ISetupForm (per lancio da configurazione MediaPortal) { #region Dati @@ -263,6 +263,8 @@ //Se inizializzazione classi non completata if (!mySkin.Initialized || !myShortCuts.Initialized) { + if (myShortCuts != null) + myShortCuts.Log -= myShortCuts_Log; //--> annullamento sottoscrizione evento di log shortuts this.Close(); this.Dispose(); } @@ -275,7 +277,12 @@ { //Se presenti modifiche non salvate: richiesta conferma per chiusura applicazione if (unsavedChanges && !Tools.QuestionMessage("Unsaved changes will be lost...\nDo you want to proceed?")) + { e.Cancel = true; //--> annullamento chiusura form + return; + } + if (myShortCuts != null) + myShortCuts.Log -= myShortCuts_Log; //--> annullamento sottoscrizione evento di log shortuts } #endregion #region Evento di Log Shortcuts @@ -465,7 +472,7 @@ } private void infoPictureBox_Click(object sender, EventArgs e) { - VersionInfo.ShowInfo(ProcessPlugins.ShortCuter.Properties.Resources.ShortCuter, "...a big thank to MoPath for old version of this plugin!", + VersionInfo.ShowInfo(ShortCuter.Properties.Resources.ShortCuter, "...a big thank to MoPath for old version of this plugin!", "http://forum.team-mediaportal.com/threads/shortcuter-plugin-v2.121721/", "http://wiki.team-mediaportal.com/1_MEDIAPORTAL_1/17_Extensions/3_Plugins/ShortCut'er"); } Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.Designer.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.Designer.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -1,4 +1,4 @@ -namespace ProcessPlugins.ShortCuter.Configuration +namespace ShortCuter.Configuration { partial class ShortCuterKeyConfig { @@ -57,7 +57,7 @@ // // okPictureBox // - this.okPictureBox.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.Ok; + this.okPictureBox.Image = global::ShortCuter.Properties.Resources.Ok; this.okPictureBox.Location = new System.Drawing.Point(193, 15); this.okPictureBox.Name = "okPictureBox"; this.okPictureBox.Size = new System.Drawing.Size(32, 32); Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -2,9 +2,9 @@ using System.Drawing; using System.Windows.Forms; -namespace ProcessPlugins.ShortCuter.Configuration +namespace ShortCuter.Configuration { - public partial class ShortCuterKeyConfig : Form //Form per assegnazione key allo shortcut corrente + internal partial class ShortCuterKeyConfig : Form //Form per assegnazione key allo shortcut corrente { #region Dati private ShortCut mySc; //Istanza classe ShortCut per gestione shorcut corrente @@ -21,18 +21,22 @@ keyLabel.Text = mySc.Key; //--> visualizzazione tasto correntemente assegnato keyboardHook = new KeyboardHook(); //--> creazione oggetto per gestione hook di tastiera - keyboardHook.KeyDown += new KeyEventHandler(keyboardHook_KeyDown); //--> sottoscrizione evento di KeyDown } #endregion #region Consumazione Eventi private void ShortCuterKeyConfig_Load(object sender, EventArgs e) { + keyboardHook.KeyDown += new KeyEventHandler(keyboardHook_KeyDown); //--> sottoscrizione evento di KeyDown keyboardHook.hook(); //--> attivazione hook di tastiera } private void ShortCuterKeyConfig_FormClosing(object sender, FormClosingEventArgs e) { - keyboardHook.unhook(); //--> disattivazione hook di tastiera + if (keyboardHook != null) + { + keyboardHook.unhook(); //--> disattivazione hook di tastiera + keyboardHook.KeyDown -= keyboardHook_KeyDown; //--> annullamento sottoscrizione evento di KeyDown + } } private void okPictureBox_Click(object sender, EventArgs e) { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.Designer.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.Designer.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -1,4 +1,4 @@ -namespace ProcessPlugins.ShortCuter.Configuration +namespace ShortCuter.Configuration { partial class SkinNavigatorConfig { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -7,9 +7,9 @@ using System.Text; using System.Windows.Forms; -namespace ProcessPlugins.ShortCuter.Configuration +namespace ShortCuter.Configuration { - public partial class SkinNavigatorConfig : Form + internal partial class SkinNavigatorConfig : Form { public SkinNavigatorConfig() { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinWithSounds.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinWithSounds.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinWithSounds.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -2,7 +2,7 @@ using System.IO; using My.Common; -namespace ProcessPlugins.ShortCuter.Configuration +namespace ShortCuter.Configuration { internal class Skin : MediaPortalSkin //Classe per gestione skin di MediaPortal { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LockKeys.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LockKeys.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LockKeys.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -2,7 +2,7 @@ using System.Runtime.InteropServices; using System.Windows.Forms; -namespace ProcessPlugins.ShortCuter +namespace ShortCuter { internal static class LockKeys //Classe per modifica stato blocco maiuscole/numeri { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LogHandler.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LogHandler.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LogHandler.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -1,6 +1,6 @@ using System; -namespace ProcessPlugins.ShortCuter +namespace ShortCuter { internal delegate void LogEventHandler(object sender, LogEventArgs e); //Delegato per evento di log internal class LogEventArgs : EventArgs //Argomenti per evento di log Added: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/NavigatorDialog.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/NavigatorDialog.cs (rev 0) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/NavigatorDialog.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -0,0 +1,31 @@ +using MediaPortal.Dialogs; +using MediaPortal.GUI.Library; +using My.Common; + +namespace ShortCuter.Plugin +{ + public class NavigatorDialog : GUIDialogMenu //Classe per personalizzazione finestra di dialogo + { + #region Dati + public static const int DialogWindowID = 2821976; //Id finestra di dialogo personalizzata + public static const string DialogSkinFile = "ShortCuter.Navigator.DialogMenu.xml"; //File della skin per personalizzazione finestra di dialogo + #endregion + + #region Metodi Pubblici + public override bool Init() //Override metodo Init + { + return (Load(GUIGraphicsContext.Skin + @"\" + DialogSkinFile)); + //Load(GUIGraphicsContext.Theme + @"\" + DialogSkinFile) || + // Load(GUIGraphicsContext.Skin + @"\" + DialogSkinFile)); //--> inizializzazione solo se presente il file della skin per personalizzare la finestra di dialogo + } + public override string GetModuleName() //Override metodo GetModuleName + { + return Tools.MyAssembly.Title; //--> ritorno del titolo dell'assembly + } + #endregion + + #region Proprietà + public override int GetID { get { return DialogWindowID; } } + #endregion + } +} Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/RawInputHook.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/RawInputHook.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/RawInputHook.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -3,9 +3,9 @@ using System.Runtime.InteropServices; using System.Windows.Forms; -namespace ProcessPlugins.ShortCuter.Plugin +namespace ShortCuter.Plugin { - public class RawInputHook : IMessageFilter //Classe per gestione hook mediante raw input + internal class RawInputHook : IMessageFilter //Classe per gestione hook mediante raw input { #region Dati private const int WM_INPUT = 0x00ff; //Id messaggio per RawInput Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/ShortCuter.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/ShortCuter.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/ShortCuter.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -5,12 +5,13 @@ //using Action = MediaPortal.GUI.Library.Action; using My.Common; -namespace ProcessPlugins.ShortCuter.Plugin +namespace ShortCuter.Plugin { - public class ShortCuter : IPlugin //Classe gestore shortcuts + public class ShortCuter : GUIInternalWindow //: IPlugin //Classe gestore shortcuts { #region Dati private ShortCuts myShortCuts; //Istanza classe ShortCuts (dati relativi ai shortcuts configurati) + private RawInputHook rawInput; //Istanza classe RawInputHook (gestione hook mediante metodo raw input) private static readonly string LogPrefix; //Prefisso per log eventi #endregion @@ -21,8 +22,8 @@ } #endregion - #region Implementazione IPlugin - public void Start() //Avvio del plugin + #region Override GUIInternalWindow + public override bool Init() //Avvio del plugin { MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "Plugin started")); @@ -39,7 +40,7 @@ { try { - RawInputHook rawInput = new RawInputHook(GUIGraphicsContext.form.Handle); //--> creazione hook mediante RawInput + rawInput = new RawInputHook(GUIGraphicsContext.form.Handle); //--> creazione hook mediante RawInput rawInput.KeyDown += new KeyEventHandler(rawInput_KeyDown); //--> sottoscrizione evento KeyDown } catch (Exception e) @@ -59,11 +60,23 @@ } else MpLog(new LogEventArgs(LogEventArgs.LogLevels.Error, "Error loading configuration")); + return false; //--> nessun file principale per visualizzazione plugin } - public void Stop() //Terminazione del plugin + public override void DeInit() //Terminazione del plugin { MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "Plugin stopped")); + if (myShortCuts != null) + myShortCuts.Log -= myShortCuts_Log; //--> annullamento sottoscrizione evento di log shortuts + if (rawInput != null) + rawInput.KeyDown -= rawInput_KeyDown; //--> annullamento sottoscrizione evento shortuts + GUIWindowManager.OnActivateWindow -= GUIWindowManager_OnActivateWindow; //--> annullamento sottoscrizione evento di attivazione finestra di MediaPortal + base.DeInit(); //--> metodo classe base } + public override string GetModuleName() //Valorizzazione proprietà #currentmodule al caricamento + { + return Tools.MyAssembly.Title; + } + public override int GetID { get { return 2821976; } } //--> id finestra #endregion #region Metodi Privati @@ -87,7 +100,7 @@ } } #endregion - + #region Consumazione Eventi private void rawInput_KeyDown(object sender, KeyEventArgs e) //Evento di pressione tasto { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Program.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Program.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Program.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -1,7 +1,7 @@ using System; using System.Windows.Forms; -namespace ProcessPlugins.ShortCuter +namespace ShortCuter { static class Program { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Resources.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Resources.Designer.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Resources.Designer.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -8,7 +8,7 @@ // </auto-generated> //------------------------------------------------------------------------------ -namespace ProcessPlugins.ShortCuter.Properties { +namespace ShortCuter.Properties { using System; @@ -39,7 +39,7 @@ internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ProcessPlugins.ShortCuter.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ShortCuter.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Settings.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Settings.Designer.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Settings.Designer.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -1,14 +1,14 @@ //------------------------------------------------------------------------------ // <auto-generated> // Il codice è stato generato da uno strumento. -// Versione runtime:4.0.30319.296 +// Versione runtime:4.0.30319.17929 // // Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se // il codice viene rigenerato. // </auto-generated> //------------------------------------------------------------------------------ -namespace ProcessPlugins.ShortCuter.Properties { +namespace ShortCuter.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml 2014-05-25 13:31:45 UTC (rev 4815) @@ -189,7 +189,7 @@ <Separator>--------------------------------</Separator> <ShowNumbers>1</ShowNumbers> <RemoveDuplicates>1</RemoveDuplicates> - <UseCustomDialog>0</UseCustomDialog> + <UseCustomDialog>1</UseCustomDialog> </General> <Items> <Item> @@ -223,7 +223,7 @@ <Destinations> <Destination> <Caption>Music</Caption> - <WindowID>502</WindowID> + <WindowID>501</WindowID> <LoadParameter /> <Force>0</Force> <Icon /> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-25 13:31:45 UTC (rev 4815) @@ -8,7 +8,7 @@ <ProjectGuid>{20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}</ProjectGuid> <OutputType>WinExe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>ProcessPlugins.ShortCuter</RootNamespace> + <RootNamespace>ShortCuter</RootNamespace> <AssemblyName>ShortCuter</AssemblyName> <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> @@ -32,9 +32,12 @@ <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <DebugSymbols>true</DebugSymbols> + <PlatformTarget>AnyCPU</PlatformTarget> </PropertyGroup> <PropertyGroup> <StartupObject> @@ -43,6 +46,9 @@ <PropertyGroup> <ApplicationIcon>Resources\Images\ShortCuter.ico</ApplicationIcon> </PropertyGroup> + <PropertyGroup> + <SignAssembly>false</SignAssembly> + </PropertyGroup> <ItemGroup> <Reference Include="Common.Utils, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> @@ -96,6 +102,7 @@ <Compile Include="Configuration\KeyboardHook.cs" /> <Compile Include="LockKeys.cs" /> <Compile Include="LogHandler.cs" /> + <Compile Include="Plugin\NavigatorDialog.cs" /> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\Resources.Designer.cs"> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj.user =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj.user 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj.user 2014-05-25 13:31:45 UTC (rev 4815) @@ -10,4 +10,9 @@ <FallbackCulture>it-IT</FallbackCulture> <VerifyUploadedFiles>false</VerifyUploadedFiles> </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"> + <StartAction>Project</StartAction> + <StartProgram>C:\Program Files (x86)\Team MediaPortal\MediaPortal\MediaPortal.exe</StartProgram> + <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging> + </PropertyGroup> </Project> \ No newline at end of file Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -13,8 +13,9 @@ using MediaPortal.Profile; using MediaPortal.Util; using My.Common; +using ShortCuter.Plugin; -namespace ProcessPlugins.ShortCuter +namespace ShortCuter { internal class WindowLink //Classe collegamento ad una finestra di MediaPortal { @@ -437,28 +438,6 @@ public BindingList<Destination> Destinations { get { return this._destinations; } } #endregion } - public class NavigatorDialog : GUIDialogMenu //Sotto-classe per eventuale personalizzazione finestra di dialogo - { - #region Dati - public const int DialogWindowID = 2821976; //Id finestra di dialogo personalizzata - public const string DialogSkinFile = "ShortCuter.SkinNavigator.DialogMenu.xml"; //File della skin per personalizzazione finestra di dialogo - #endregion - - #region Metodi Pubblici - public override bool Init() //Override metodo Init - { - return Load(GUIGraphicsContext.Skin + @"\" + DialogSkinFile); //--> inizializzazione solo se presente il file della skin per personalizzare la finestra di dialogo - } - public override string GetModuleName() //Override metodo GetModuleName - { - return Tools.MyAssembly.Title; //--> ritorno del titolo dell'assembly - } - #endregion - - #region Proprietà - public override int GetID { get { return DialogWindowID; } } - #endregion - } #endregion #region Dati @@ -477,14 +456,15 @@ #region Metodi Privati private Item.Destination ShowMenuDialog(List<Item.Destination> destinations) //Visualizzazione menu di navigazione { - GUIDialogMenu dlgMenu; + NavigatorDialog dlgMenu = (NavigatorDialog)GUIWindowManager.GetWindow(333); - if (_general.UseCustomDialog && File.Exists(GUIGraphicsContext.Skin + @"\" + NavigatorDialog.DialogSkinFile)) + //if (_general.UseCustomDialog && (File.Exists(GUIGraphicsContext.Skin + @"\" + "ShortCuter.Navigator.DialogMenu.xml") || + // File.Exists(GUIGraphicsContext.Theme + @"\" + "ShortCuter.Navigator.DialogMenu.xml"))) //Utilizzo della finestra di dialogo personalizzata - dlgMenu = (NavigatorDialog)GUIWindowManager.GetWindow(NavigatorDialog.DialogWindowID); - else + //dlgMenu = (NavigatorDialog)GUIWindowManager.GetWindow(2821976); + //else //Utilizzo della finestra di dialogo predefinita - dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + //dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); dlgMenu.Reset(); dlgMenu.SetHeading(_general.MenuHeader); //--> intestazione menu @@ -515,7 +495,7 @@ try { XmlDocument xmlFile = new XmlDocument(); - using (Stream defaultConfig = Assembly.GetExecutingAssembly().GetManifestResourceStream("ProcessPlugins.ShortCuter.Resources.XmlFiles.DefaultConfig.xml")) + using (Stream defaultConfig = Assembly.GetExecutingAssembly().GetManifestResourceStream("ShortCuter.Resources.XmlFiles.DefaultConfig.xml")) { xmlFile.Load(defaultConfig); //Configurazione predefinita --> lettura file xml incapsulato } @@ -845,7 +825,7 @@ { XmlDocument xmlFile = new XmlDocument(); if (defaultSettings) - using (Stream defaultConfig = Assembly.GetExecutingAssembly().GetManifestResourceStream("ProcessPlugins.ShortCuter.Resources.XmlFiles.DefaultConfig.xml")) + using (Stream defaultConfig = Assembly.GetExecutingAssembly().GetManifestResourceStream("ShortCuter.Resources.XmlFiles.DefaultConfig.xml")) { xmlFile.Load(defaultConfig); //Configurazione predefinita --> lettura file xml incapsulato } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-27 06:34:18
|
Revision: 4816 http://sourceforge.net/p/mp-plugins/code/4816 Author: nicsergio Date: 2014-05-27 06:34:15 +0000 (Tue, 27 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/NavigatorDialog.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/ShortCuter.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/NavigatorDialog.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/NavigatorDialog.cs 2014-05-25 13:31:45 UTC (rev 4815) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/NavigatorDialog.cs 2014-05-27 06:34:15 UTC (rev 4816) @@ -7,16 +7,15 @@ public class NavigatorDialog : GUIDialogMenu //Classe per personalizzazione finestra di dialogo { #region Dati - public static const int DialogWindowID = 2821976; //Id finestra di dialogo personalizzata - public static const string DialogSkinFile = "ShortCuter.Navigator.DialogMenu.xml"; //File della skin per personalizzazione finestra di dialogo + public const int DialogWindowID = 2821976; //Id finestra di dialogo personalizzata + public const string DialogSkinFile = "ShortCuter.Navigator.DialogMenu.xml"; //File della skin per personalizzazione finestra di dialogo #endregion #region Metodi Pubblici public override bool Init() //Override metodo Init { - return (Load(GUIGraphicsContext.Skin + @"\" + DialogSkinFile)); - //Load(GUIGraphicsContext.Theme + @"\" + DialogSkinFile) || - // Load(GUIGraphicsContext.Skin + @"\" + DialogSkinFile)); //--> inizializzazione solo se presente il file della skin per personalizzare la finestra di dialogo + return (Load(GUIGraphicsContext.Theme + @"\" + DialogSkinFile) || + Load(GUIGraphicsContext.Skin + @"\" + DialogSkinFile)); //--> inizializzazione solo se presente il file della skin per personalizzare la finestra di dialogo } public override string GetModuleName() //Override metodo GetModuleName { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/ShortCuter.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/ShortCuter.cs 2014-05-25 13:31:45 UTC (rev 4815) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/ShortCuter.cs 2014-05-27 06:34:15 UTC (rev 4816) @@ -76,7 +76,7 @@ { return Tools.MyAssembly.Title; } - public override int GetID { get { return 2821976; } } //--> id finestra + public override int GetID { get { return NavigatorDialog.DialogWindowID; } } //--> id finestra #endregion #region Metodi Privati Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-25 13:31:45 UTC (rev 4815) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-27 06:34:15 UTC (rev 4816) @@ -12,7 +12,6 @@ using MediaPortal.Player; using MediaPortal.Profile; using MediaPortal.Util; -using My.Common; using ShortCuter.Plugin; namespace ShortCuter @@ -456,15 +455,15 @@ #region Metodi Privati private Item.Destination ShowMenuDialog(List<Item.Destination> destinations) //Visualizzazione menu di navigazione { - NavigatorDialog dlgMenu = (NavigatorDialog)GUIWindowManager.GetWindow(333); + GUIDialogMenu dlgMenu; - //if (_general.UseCustomDialog && (File.Exists(GUIGraphicsContext.Skin + @"\" + "ShortCuter.Navigator.DialogMenu.xml") || - // File.Exists(GUIGraphicsContext.Theme + @"\" + "ShortCuter.Navigator.DialogMenu.xml"))) + if (_general.UseCustomDialog && (File.Exists(GUIGraphicsContext.Skin + @"\" + "ShortCuter.Navigator.DialogMenu.xml") || + File.Exists(GUIGraphicsContext.Theme + @"\" + "ShortCuter.Navigator.DialogMenu.xml"))) //Utilizzo della finestra di dialogo personalizzata - //dlgMenu = (NavigatorDialog)GUIWindowManager.GetWindow(2821976); - //else + dlgMenu = (NavigatorDialog)GUIWindowManager.GetWindow(NavigatorDialog.DialogWindowID); + else //Utilizzo della finestra di dialogo predefinita - //dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); dlgMenu.Reset(); dlgMenu.SetHeading(_general.MenuHeader); //--> intestazione menu This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |