From: <an...@us...> - 2007-04-14 04:44:06
|
Revision: 327 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=327&view=rev Author: and-81 Date: 2007-04-13 21:44:03 -0700 (Fri, 13 Apr 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/Forms/MacroEditor.cs trunk/plugins/MCEReplacement/Forms/MessageCommand.Designer.cs trunk/plugins/MCEReplacement/Forms/MessageCommand.cs trunk/plugins/MCEReplacement/Forms/MessageCommand.resx trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/MCEReplacement.csproj Modified: trunk/plugins/MCEReplacement/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-04-14 03:44:42 UTC (rev 326) +++ trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-04-14 04:44:03 UTC (rev 327) @@ -18,30 +18,6 @@ public partial class MacroEditor : Form { - #region Constants - - public const string RunProgramText = "Run Program"; - public const string PauseText = "Pause"; - public const string SerialCommandText = "Serial Command"; - public const string MessageCommandText = "Message Command"; - public const string KeystrokesCommandText = "Keystrokes Command"; - public const string GoToScreenText = "Go To Screen"; - public const string PopupMessageText = "Popup Message"; - public const string ForceBlasterPortText = "Force Blaster Port"; - public const string ForceBlasterSpeedText = "Force Blaster Speed"; - public const string SetMultiMappingText = "Set Multi-Mapping"; - public const string SetMouseModeText = "Set Mouse Mode"; - public const string ToggleInputLayerText = "Toggle Input Handler Layer"; - public const string ChangeWindowStateText = "Change Window State"; - public const string GetFocusText = "Get Focus"; - public const string ExitCommandText = "Exit MediaPortal"; - public const string StandByCommandText = "Standby"; - public const string HibernateCommandText = "Hibernate"; - public const string RebootCommandText = "Reboot"; - public const string ShutdownCommandText = "Shutdown"; - - #endregion Constants - #region Variables MceIrApi.BlasterPort _blastPort; @@ -71,25 +47,25 @@ { comboBoxCommands.Items.Clear(); - comboBoxCommands.Items.Add(RunProgramText); - comboBoxCommands.Items.Add(PauseText); - comboBoxCommands.Items.Add(SerialCommandText); - comboBoxCommands.Items.Add(MessageCommandText); - comboBoxCommands.Items.Add(KeystrokesCommandText); - comboBoxCommands.Items.Add(GoToScreenText); - comboBoxCommands.Items.Add(PopupMessageText); - comboBoxCommands.Items.Add(ForceBlasterPortText); - comboBoxCommands.Items.Add(ForceBlasterSpeedText); - comboBoxCommands.Items.Add(SetMultiMappingText); - comboBoxCommands.Items.Add(SetMouseModeText); - comboBoxCommands.Items.Add(ToggleInputLayerText); - comboBoxCommands.Items.Add(ChangeWindowStateText); - comboBoxCommands.Items.Add(GetFocusText); - comboBoxCommands.Items.Add(ExitCommandText); - comboBoxCommands.Items.Add(StandByCommandText); - comboBoxCommands.Items.Add(HibernateCommandText); - comboBoxCommands.Items.Add(RebootCommandText); - comboBoxCommands.Items.Add(ShutdownCommandText); + comboBoxCommands.Items.Add(MCEReplacement.RunProgramText); + comboBoxCommands.Items.Add(MCEReplacement.PauseText); + comboBoxCommands.Items.Add(MCEReplacement.SerialCommandText); + comboBoxCommands.Items.Add(MCEReplacement.MessageCommandText); + comboBoxCommands.Items.Add(MCEReplacement.KeystrokesCommandText); + comboBoxCommands.Items.Add(MCEReplacement.GoToScreenText); + comboBoxCommands.Items.Add(MCEReplacement.PopupMessageText); + comboBoxCommands.Items.Add(MCEReplacement.ForceBlasterPortText); + comboBoxCommands.Items.Add(MCEReplacement.ForceBlasterSpeedText); + comboBoxCommands.Items.Add(MCEReplacement.SetMultiMappingText); + comboBoxCommands.Items.Add(MCEReplacement.SetMouseModeText); + comboBoxCommands.Items.Add(MCEReplacement.ToggleInputLayerText); + //comboBoxCommands.Items.Add(MCEReplacement.ChangeWindowStateText); + comboBoxCommands.Items.Add(MCEReplacement.GetFocusText); + comboBoxCommands.Items.Add(MCEReplacement.ExitCommandText); + comboBoxCommands.Items.Add(MCEReplacement.StandByCommandText); + comboBoxCommands.Items.Add(MCEReplacement.HibernateCommandText); + comboBoxCommands.Items.Add(MCEReplacement.RebootCommandText); + comboBoxCommands.Items.Add(MCEReplacement.ShutdownCommandText); comboBoxCommands.Items.AddRange(MCEReplacement.GetIRList()); } @@ -178,11 +154,13 @@ writer.WriteAttributeString("command", MCEReplacement.InputLayerMacroText); writer.WriteAttributeString("cmdproperty", "TOGGLE"); } + /* else if (item.StartsWith(MCEReplacement.WindowStateCommand)) { writer.WriteAttributeString("command", MCEReplacement.WindowStateMacroText); writer.WriteAttributeString("cmdproperty", "TOGGLE"); } + */ else if (item.StartsWith(MCEReplacement.GetFocusCommand)) { writer.WriteAttributeString("command", MCEReplacement.GetFocusMacroText); @@ -300,11 +278,11 @@ case MCEReplacement.InputLayerMacroText: listBoxMacro.Items.Add(MCEReplacement.InputLayerCommand); break; - +/* case MCEReplacement.WindowStateMacroText: listBoxMacro.Items.Add(MCEReplacement.WindowStateCommand); break; - +*/ case MCEReplacement.GetFocusMacroText: listBoxMacro.Items.Add(MCEReplacement.GetFocusCommand); break; @@ -352,7 +330,7 @@ string selected = (string)comboBoxCommands.SelectedItem; - if (selected == RunProgramText) + if (selected == MCEReplacement.RunProgramText) { ExternalProgram externalProgram = new ExternalProgram(); @@ -361,7 +339,7 @@ listBoxMacro.Items.Add(MCEReplacement.RunCommandPrefix + externalProgram.CommandString); } - else if (selected == PauseText) + else if (selected == MCEReplacement.PauseText) { PauseTime pauseTime = new PauseTime(); @@ -370,7 +348,7 @@ listBoxMacro.Items.Add(MCEReplacement.PauseCommandPrefix + pauseTime.Time.ToString()); } - else if (selected == SerialCommandText) + else if (selected == MCEReplacement.SerialCommandText) { SerialCommand serialCommand = new SerialCommand(); if (serialCommand.ShowDialog(this) == DialogResult.Cancel) @@ -378,7 +356,7 @@ listBoxMacro.Items.Add(MCEReplacement.SerialCommandPrefix + serialCommand.CommandString); } - else if (selected == MessageCommandText) + else if (selected == MCEReplacement.MessageCommandText) { MessageCommand messageCommand = new MessageCommand(); if (messageCommand.ShowDialog(this) == DialogResult.Cancel) @@ -386,7 +364,7 @@ listBoxMacro.Items.Add(MCEReplacement.MessageCommandPrefix + messageCommand.CommandString); } - else if (selected == KeystrokesCommandText) + else if (selected == MCEReplacement.KeystrokesCommandText) { KeysCommand keysCommand = new KeysCommand(); if (keysCommand.ShowDialog(this) == DialogResult.Cancel) @@ -394,7 +372,7 @@ listBoxMacro.Items.Add(MCEReplacement.KeyCommandPrefix + keysCommand.CommandString); } - else if (selected == GoToScreenText) + else if (selected == MCEReplacement.GoToScreenText) { GoToScreen goToScreen = new GoToScreen(); if (goToScreen.ShowDialog(this) == DialogResult.Cancel) @@ -402,7 +380,7 @@ listBoxMacro.Items.Add(MCEReplacement.GoToCommandPrefix + goToScreen.Screen); } - else if (selected == PopupMessageText) + else if (selected == MCEReplacement.PopupMessageText) { PopupMessage popupMessage = new PopupMessage(); if (popupMessage.ShowDialog(this) == DialogResult.Cancel) @@ -410,7 +388,7 @@ listBoxMacro.Items.Add(MCEReplacement.PopupCommandPrefix + popupMessage.CommandString); } - else if (selected == ForceBlasterPortText) + else if (selected == MCEReplacement.ForceBlasterPortText) { SelectBlasterPort selectBlasterPort = new SelectBlasterPort(_blastPort); if (selectBlasterPort.ShowDialog(this) == DialogResult.Cancel) @@ -418,7 +396,7 @@ listBoxMacro.Items.Add(MCEReplacement.PortCommandPrefix + selectBlasterPort.CommandString); } - else if (selected == ForceBlasterSpeedText) + else if (selected == MCEReplacement.ForceBlasterSpeedText) { SelectBlasterSpeed selectBlasterSpeed = new SelectBlasterSpeed(_blastSpeed); if (selectBlasterSpeed.ShowDialog(this) == DialogResult.Cancel) @@ -426,7 +404,7 @@ listBoxMacro.Items.Add(MCEReplacement.SpeedCommandPrefix + selectBlasterSpeed.CommandString); } - else if (selected == SetMultiMappingText) + else if (selected == MCEReplacement.SetMultiMappingText) { //SelectBlasterSpeed selectBlasterSpeed = new SelectBlasterSpeed(_blastSpeed); //if (selectBlasterSpeed.ShowDialog(this) == DialogResult.Cancel) @@ -434,7 +412,7 @@ listBoxMacro.Items.Add(MCEReplacement.SetMapCommandPrefix + "TOGGLE"); } - else if (selected == SetMouseModeText) + else if (selected == MCEReplacement.SetMouseModeText) { //SelectBlasterSpeed selectBlasterSpeed = new SelectBlasterSpeed(_blastSpeed); //if (selectBlasterSpeed.ShowDialog(this) == DialogResult.Cancel) @@ -442,35 +420,37 @@ listBoxMacro.Items.Add(MCEReplacement.SetMouseCommandPrefix + "TOGGLE"); } - else if (selected == ToggleInputLayerText) + else if (selected == MCEReplacement.ToggleInputLayerText) { listBoxMacro.Items.Add(MCEReplacement.InputLayerCommand); } - else if (selected == ChangeWindowStateText) + /* + else if (selected == MCEReplacement.ChangeWindowStateText) { listBoxMacro.Items.Add(MCEReplacement.WindowStateCommand); } - else if (selected == GetFocusText) + */ + else if (selected == MCEReplacement.GetFocusText) { listBoxMacro.Items.Add(MCEReplacement.GetFocusCommand); } - else if (selected == ExitCommandText) + else if (selected == MCEReplacement.ExitCommandText) { listBoxMacro.Items.Add(MCEReplacement.ExitCommand); } - else if (selected == StandByCommandText) + else if (selected == MCEReplacement.StandByCommandText) { listBoxMacro.Items.Add(MCEReplacement.StandByCommand); } - else if (selected == HibernateCommandText) + else if (selected == MCEReplacement.HibernateCommandText) { listBoxMacro.Items.Add(MCEReplacement.HibernateCommand); } - else if (selected == RebootCommandText) + else if (selected == MCEReplacement.RebootCommandText) { listBoxMacro.Items.Add(MCEReplacement.RebootCommand); } - else if (selected == ShutdownCommandText) + else if (selected == MCEReplacement.ShutdownCommandText) { listBoxMacro.Items.Add(MCEReplacement.ShutdownCommand); } Modified: trunk/plugins/MCEReplacement/Forms/MessageCommand.Designer.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/MessageCommand.Designer.cs 2007-04-14 03:44:42 UTC (rev 326) +++ trunk/plugins/MCEReplacement/Forms/MessageCommand.Designer.cs 2007-04-14 04:44:03 UTC (rev 327) @@ -31,10 +31,8 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - this.checkBoxMsgCurrApp = new System.Windows.Forms.CheckBox(); - this.labelMsgApp = new System.Windows.Forms.Label(); - this.buttonFindMsgApp = new System.Windows.Forms.Button(); - this.textBoxMsgApp = new System.Windows.Forms.TextBox(); + this.buttonFindMsgTarget = new System.Windows.Forms.Button(); + this.textBoxMsgTarget = new System.Windows.Forms.TextBox(); this.numericUpDownLParam = new System.Windows.Forms.NumericUpDown(); this.numericUpDownWParam = new System.Windows.Forms.NumericUpDown(); this.numericUpDownMsg = new System.Windows.Forms.NumericUpDown(); @@ -46,93 +44,85 @@ this.labelMessage = new System.Windows.Forms.Label(); this.buttonCancel = new System.Windows.Forms.Button(); this.buttonOK = new System.Windows.Forms.Button(); + this.groupBoxTarget = new System.Windows.Forms.GroupBox(); + this.groupBoxDetails = new System.Windows.Forms.GroupBox(); + this.toolTip = new System.Windows.Forms.ToolTip(this.components); + this.radioButtonActiveWindow = new System.Windows.Forms.RadioButton(); + this.radioButtonApplication = new System.Windows.Forms.RadioButton(); + this.radioButtonClass = new System.Windows.Forms.RadioButton(); + this.radioButtonWindowTitle = new System.Windows.Forms.RadioButton(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLParam)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownWParam)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMsg)).BeginInit(); this.contextMenuStripWM.SuspendLayout(); + this.groupBoxTarget.SuspendLayout(); + this.groupBoxDetails.SuspendLayout(); this.SuspendLayout(); // - // checkBoxMsgCurrApp + // buttonFindMsgTarget // - this.checkBoxMsgCurrApp.Location = new System.Drawing.Point(96, 32); - this.checkBoxMsgCurrApp.Name = "checkBoxMsgCurrApp"; - this.checkBoxMsgCurrApp.Size = new System.Drawing.Size(160, 16); - this.checkBoxMsgCurrApp.TabIndex = 3; - this.checkBoxMsgCurrApp.Text = "Send to active window"; - this.checkBoxMsgCurrApp.UseVisualStyleBackColor = true; - this.checkBoxMsgCurrApp.CheckedChanged += new System.EventHandler(this.checkBoxMsgCurrApp_CheckedChanged); + this.buttonFindMsgTarget.Location = new System.Drawing.Point(240, 80); + this.buttonFindMsgTarget.Name = "buttonFindMsgTarget"; + this.buttonFindMsgTarget.Size = new System.Drawing.Size(24, 20); + this.buttonFindMsgTarget.TabIndex = 5; + this.buttonFindMsgTarget.Text = "..."; + this.toolTip.SetToolTip(this.buttonFindMsgTarget, "Locate a target for the message"); + this.buttonFindMsgTarget.UseVisualStyleBackColor = true; + this.buttonFindMsgTarget.Click += new System.EventHandler(this.buttonFindMsgApp_Click); // - // labelMsgApp + // textBoxMsgTarget // - this.labelMsgApp.Location = new System.Drawing.Point(8, 8); - this.labelMsgApp.Name = "labelMsgApp"; - this.labelMsgApp.Size = new System.Drawing.Size(88, 20); - this.labelMsgApp.TabIndex = 0; - this.labelMsgApp.Text = "Application:"; - this.labelMsgApp.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.textBoxMsgTarget.Location = new System.Drawing.Point(8, 80); + this.textBoxMsgTarget.Name = "textBoxMsgTarget"; + this.textBoxMsgTarget.Size = new System.Drawing.Size(224, 20); + this.textBoxMsgTarget.TabIndex = 4; + this.toolTip.SetToolTip(this.textBoxMsgTarget, "Message target"); // - // buttonFindMsgApp - // - this.buttonFindMsgApp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonFindMsgApp.Location = new System.Drawing.Point(352, 8); - this.buttonFindMsgApp.Name = "buttonFindMsgApp"; - this.buttonFindMsgApp.Size = new System.Drawing.Size(24, 20); - this.buttonFindMsgApp.TabIndex = 2; - this.buttonFindMsgApp.Text = "..."; - this.buttonFindMsgApp.UseVisualStyleBackColor = true; - this.buttonFindMsgApp.Click += new System.EventHandler(this.buttonFindMsgApp_Click); - // - // textBoxMsgApp - // - this.textBoxMsgApp.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxMsgApp.Location = new System.Drawing.Point(96, 8); - this.textBoxMsgApp.Name = "textBoxMsgApp"; - this.textBoxMsgApp.Size = new System.Drawing.Size(248, 20); - this.textBoxMsgApp.TabIndex = 1; - // // numericUpDownLParam // - this.numericUpDownLParam.Location = new System.Drawing.Point(96, 128); + this.numericUpDownLParam.Location = new System.Drawing.Point(144, 88); this.numericUpDownLParam.Maximum = new decimal(new int[] { -1, 0, 0, 0}); this.numericUpDownLParam.Name = "numericUpDownLParam"; - this.numericUpDownLParam.Size = new System.Drawing.Size(104, 20); - this.numericUpDownLParam.TabIndex = 9; + this.numericUpDownLParam.Size = new System.Drawing.Size(120, 20); + this.numericUpDownLParam.TabIndex = 5; this.numericUpDownLParam.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.numericUpDownLParam.ThousandsSeparator = true; + this.toolTip.SetToolTip(this.numericUpDownLParam, "Long Parameter (or LParam)"); // // numericUpDownWParam // - this.numericUpDownWParam.Location = new System.Drawing.Point(96, 96); + this.numericUpDownWParam.Location = new System.Drawing.Point(144, 56); this.numericUpDownWParam.Maximum = new decimal(new int[] { -1, 0, 0, 0}); this.numericUpDownWParam.Name = "numericUpDownWParam"; - this.numericUpDownWParam.Size = new System.Drawing.Size(104, 20); - this.numericUpDownWParam.TabIndex = 7; + this.numericUpDownWParam.Size = new System.Drawing.Size(120, 20); + this.numericUpDownWParam.TabIndex = 3; this.numericUpDownWParam.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.numericUpDownWParam.ThousandsSeparator = true; + this.toolTip.SetToolTip(this.numericUpDownWParam, "Word Paramater (or WParam)"); // // numericUpDownMsg // this.numericUpDownMsg.ContextMenuStrip = this.contextMenuStripWM; - this.numericUpDownMsg.Location = new System.Drawing.Point(96, 64); + this.numericUpDownMsg.Location = new System.Drawing.Point(144, 24); this.numericUpDownMsg.Maximum = new decimal(new int[] { -1, 0, 0, 0}); this.numericUpDownMsg.Name = "numericUpDownMsg"; - this.numericUpDownMsg.Size = new System.Drawing.Size(104, 20); - this.numericUpDownMsg.TabIndex = 5; + this.numericUpDownMsg.Size = new System.Drawing.Size(120, 20); + this.numericUpDownMsg.TabIndex = 1; this.numericUpDownMsg.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.numericUpDownMsg.ThousandsSeparator = true; + this.toolTip.SetToolTip(this.numericUpDownMsg, "Message identifier"); // // contextMenuStripWM // @@ -158,28 +148,28 @@ // // labelLParam // - this.labelLParam.Location = new System.Drawing.Point(8, 128); + this.labelLParam.Location = new System.Drawing.Point(8, 88); this.labelLParam.Name = "labelLParam"; - this.labelLParam.Size = new System.Drawing.Size(88, 20); - this.labelLParam.TabIndex = 8; + this.labelLParam.Size = new System.Drawing.Size(128, 20); + this.labelLParam.TabIndex = 4; this.labelLParam.Text = "Long Param:"; this.labelLParam.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // labelWParam // - this.labelWParam.Location = new System.Drawing.Point(8, 96); + this.labelWParam.Location = new System.Drawing.Point(8, 56); this.labelWParam.Name = "labelWParam"; - this.labelWParam.Size = new System.Drawing.Size(88, 20); - this.labelWParam.TabIndex = 6; + this.labelWParam.Size = new System.Drawing.Size(128, 20); + this.labelWParam.TabIndex = 2; this.labelWParam.Text = "Word Param:"; this.labelWParam.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // labelMessage // - this.labelMessage.Location = new System.Drawing.Point(8, 64); + this.labelMessage.Location = new System.Drawing.Point(8, 24); this.labelMessage.Name = "labelMessage"; - this.labelMessage.Size = new System.Drawing.Size(88, 20); - this.labelMessage.TabIndex = 4; + this.labelMessage.Size = new System.Drawing.Size(128, 20); + this.labelMessage.TabIndex = 0; this.labelMessage.Text = "Message:"; this.labelMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // @@ -187,10 +177,10 @@ // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(312, 152); + this.buttonCancel.Location = new System.Drawing.Point(216, 256); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(64, 24); - this.buttonCancel.TabIndex = 11; + this.buttonCancel.TabIndex = 3; this.buttonCancel.Text = "Cancel"; this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); @@ -198,35 +188,104 @@ // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.Location = new System.Drawing.Point(240, 152); + this.buttonOK.Location = new System.Drawing.Point(144, 256); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(64, 24); - this.buttonOK.TabIndex = 10; + this.buttonOK.TabIndex = 2; this.buttonOK.Text = "OK"; this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); // + // groupBoxTarget + // + this.groupBoxTarget.Controls.Add(this.radioButtonWindowTitle); + this.groupBoxTarget.Controls.Add(this.radioButtonClass); + this.groupBoxTarget.Controls.Add(this.radioButtonApplication); + this.groupBoxTarget.Controls.Add(this.radioButtonActiveWindow); + this.groupBoxTarget.Controls.Add(this.textBoxMsgTarget); + this.groupBoxTarget.Controls.Add(this.buttonFindMsgTarget); + this.groupBoxTarget.Location = new System.Drawing.Point(8, 8); + this.groupBoxTarget.Name = "groupBoxTarget"; + this.groupBoxTarget.Size = new System.Drawing.Size(272, 112); + this.groupBoxTarget.TabIndex = 0; + this.groupBoxTarget.TabStop = false; + this.groupBoxTarget.Text = "Target"; + // + // groupBoxDetails + // + this.groupBoxDetails.Controls.Add(this.labelMessage); + this.groupBoxDetails.Controls.Add(this.labelWParam); + this.groupBoxDetails.Controls.Add(this.labelLParam); + this.groupBoxDetails.Controls.Add(this.numericUpDownMsg); + this.groupBoxDetails.Controls.Add(this.numericUpDownWParam); + this.groupBoxDetails.Controls.Add(this.numericUpDownLParam); + this.groupBoxDetails.Location = new System.Drawing.Point(8, 128); + this.groupBoxDetails.Name = "groupBoxDetails"; + this.groupBoxDetails.Size = new System.Drawing.Size(272, 120); + this.groupBoxDetails.TabIndex = 1; + this.groupBoxDetails.TabStop = false; + this.groupBoxDetails.Text = "Message Details"; + // + // radioButtonActiveWindow + // + this.radioButtonActiveWindow.Location = new System.Drawing.Point(8, 24); + this.radioButtonActiveWindow.Name = "radioButtonActiveWindow"; + this.radioButtonActiveWindow.Size = new System.Drawing.Size(112, 16); + this.radioButtonActiveWindow.TabIndex = 0; + this.radioButtonActiveWindow.Text = "Active window"; + this.toolTip.SetToolTip(this.radioButtonActiveWindow, "Send the message to the active window"); + this.radioButtonActiveWindow.UseVisualStyleBackColor = true; + this.radioButtonActiveWindow.CheckedChanged += new System.EventHandler(this.radioButtonActiveWindow_CheckedChanged); + // + // radioButtonApplication + // + this.radioButtonApplication.Location = new System.Drawing.Point(152, 24); + this.radioButtonApplication.Name = "radioButtonApplication"; + this.radioButtonApplication.Size = new System.Drawing.Size(112, 16); + this.radioButtonApplication.TabIndex = 1; + this.radioButtonApplication.TabStop = true; + this.radioButtonApplication.Text = "Application"; + this.toolTip.SetToolTip(this.radioButtonApplication, "Send the message to the specified application"); + this.radioButtonApplication.UseVisualStyleBackColor = true; + this.radioButtonApplication.CheckedChanged += new System.EventHandler(this.radioButtonApplication_CheckedChanged); + // + // radioButtonClass + // + this.radioButtonClass.Location = new System.Drawing.Point(8, 48); + this.radioButtonClass.Name = "radioButtonClass"; + this.radioButtonClass.Size = new System.Drawing.Size(112, 16); + this.radioButtonClass.TabIndex = 2; + this.radioButtonClass.TabStop = true; + this.radioButtonClass.Text = "Class"; + this.toolTip.SetToolTip(this.radioButtonClass, "Send the message to the specified class"); + this.radioButtonClass.UseVisualStyleBackColor = true; + this.radioButtonClass.CheckedChanged += new System.EventHandler(this.radioButtonClass_CheckedChanged); + // + // radioButtonWindowTitle + // + this.radioButtonWindowTitle.Location = new System.Drawing.Point(152, 48); + this.radioButtonWindowTitle.Name = "radioButtonWindowTitle"; + this.radioButtonWindowTitle.Size = new System.Drawing.Size(112, 16); + this.radioButtonWindowTitle.TabIndex = 3; + this.radioButtonWindowTitle.TabStop = true; + this.radioButtonWindowTitle.Text = "Window title"; + this.toolTip.SetToolTip(this.radioButtonWindowTitle, "Send the message to the window with the specified title"); + this.radioButtonWindowTitle.UseVisualStyleBackColor = true; + this.radioButtonWindowTitle.CheckedChanged += new System.EventHandler(this.radioButtonWindowTitle_CheckedChanged); + // // MessageCommand // this.AcceptButton = this.buttonOK; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.buttonCancel; - this.ClientSize = new System.Drawing.Size(384, 185); - this.Controls.Add(this.checkBoxMsgCurrApp); + this.ClientSize = new System.Drawing.Size(288, 288); + this.Controls.Add(this.groupBoxDetails); + this.Controls.Add(this.groupBoxTarget); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); - this.Controls.Add(this.labelMsgApp); - this.Controls.Add(this.buttonFindMsgApp); - this.Controls.Add(this.textBoxMsgApp); - this.Controls.Add(this.numericUpDownLParam); - this.Controls.Add(this.numericUpDownWParam); - this.Controls.Add(this.numericUpDownMsg); - this.Controls.Add(this.labelLParam); - this.Controls.Add(this.labelWParam); - this.Controls.Add(this.labelMessage); this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(392, 212); + this.MinimumSize = new System.Drawing.Size(296, 322); this.Name = "MessageCommand"; this.ShowIcon = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; @@ -235,17 +294,17 @@ ((System.ComponentModel.ISupportInitialize)(this.numericUpDownWParam)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMsg)).EndInit(); this.contextMenuStripWM.ResumeLayout(false); + this.groupBoxTarget.ResumeLayout(false); + this.groupBoxTarget.PerformLayout(); + this.groupBoxDetails.ResumeLayout(false); this.ResumeLayout(false); - this.PerformLayout(); } #endregion - private System.Windows.Forms.CheckBox checkBoxMsgCurrApp; - private System.Windows.Forms.Label labelMsgApp; - private System.Windows.Forms.Button buttonFindMsgApp; - private System.Windows.Forms.TextBox textBoxMsgApp; + private System.Windows.Forms.Button buttonFindMsgTarget; + private System.Windows.Forms.TextBox textBoxMsgTarget; private System.Windows.Forms.NumericUpDown numericUpDownLParam; private System.Windows.Forms.NumericUpDown numericUpDownWParam; private System.Windows.Forms.NumericUpDown numericUpDownMsg; @@ -257,6 +316,13 @@ private System.Windows.Forms.ContextMenuStrip contextMenuStripWM; private System.Windows.Forms.ToolStripMenuItem wMAPPToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem wMUSERToolStripMenuItem; + private System.Windows.Forms.GroupBox groupBoxTarget; + private System.Windows.Forms.GroupBox groupBoxDetails; + private System.Windows.Forms.ToolTip toolTip; + private System.Windows.Forms.RadioButton radioButtonActiveWindow; + private System.Windows.Forms.RadioButton radioButtonWindowTitle; + private System.Windows.Forms.RadioButton radioButtonClass; + private System.Windows.Forms.RadioButton radioButtonApplication; } } Modified: trunk/plugins/MCEReplacement/Forms/MessageCommand.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/MessageCommand.cs 2007-04-14 03:44:42 UTC (rev 326) +++ trunk/plugins/MCEReplacement/Forms/MessageCommand.cs 2007-04-14 04:44:03 UTC (rev 327) @@ -19,8 +19,29 @@ { get { - return string.Format("{0}|{1}|{2}|{3}", - checkBoxMsgCurrApp.Checked ? "*" : textBoxMsgApp.Text, + string target = "error"; + + if (radioButtonActiveWindow.Checked) + { + target = "active"; + textBoxMsgTarget.Text = "*"; + } + else if (radioButtonApplication.Checked) + { + target = "application"; + } + else if (radioButtonClass.Checked) + { + target = "class"; + } + else if (radioButtonWindowTitle.Checked) + { + target = "window"; + } + + return string.Format("{0}|{1}|{2}|{3}|{4}", + target, + textBoxMsgTarget.Text, numericUpDownMsg.Value.ToString(), numericUpDownWParam.Value.ToString(), numericUpDownLParam.Value.ToString()); @@ -31,27 +52,33 @@ #region Constructors - public MessageCommand() : this(null) { } + public MessageCommand() : this(new string[] { "active", "", "32768", "0", "0" }) { } public MessageCommand(string[] commands) { InitializeComponent(); if (commands != null) { - if (commands[0] == "*") + switch (commands[0].ToLowerInvariant()) { - checkBoxMsgCurrApp.Checked = true; - textBoxMsgApp.Text = ""; + case "active": + radioButtonActiveWindow.Checked = true; + break; + case "application": + radioButtonApplication.Checked = true; + break; + case "class": + radioButtonClass.Checked = true; + break; + case "window": + radioButtonWindowTitle.Checked = true; + break; } - else - { - checkBoxMsgCurrApp.Checked = false; - textBoxMsgApp.Text = commands[0]; - } - numericUpDownMsg.Value = decimal.Parse(commands[1]); - numericUpDownWParam.Value = decimal.Parse(commands[2]); - numericUpDownLParam.Value = decimal.Parse(commands[3]); + textBoxMsgTarget.Text = commands[1]; + numericUpDownMsg.Value = decimal.Parse(commands[2]); + numericUpDownWParam.Value = decimal.Parse(commands[3]); + numericUpDownLParam.Value = decimal.Parse(commands[4]); } } @@ -59,13 +86,24 @@ private void buttonFindMsgApp_Click(object sender, EventArgs e) { - OpenFileDialog find = new OpenFileDialog(); - find.Filter = "All files|*.*"; - find.Multiselect = false; - find.Title = "Application to send message to"; + if (radioButtonApplication.Checked) + { + OpenFileDialog find = new OpenFileDialog(); + find.Filter = "All files|*.*"; + find.Multiselect = false; + find.Title = "Application to send message to"; - if (find.ShowDialog(this) == DialogResult.OK) - textBoxMsgApp.Text = find.FileName; + if (find.ShowDialog(this) == DialogResult.OK) + textBoxMsgTarget.Text = find.FileName; + } + /* + else if (radioButtonClass.Checked) + { + } + else if (radioButtonWindowTitle.Checked) + { + } + */ } private void buttonOK_Click(object sender, EventArgs e) @@ -84,17 +122,31 @@ { numericUpDownMsg.Value = new decimal(Win32.WM_APP); } - private void wMUSERToolStripMenuItem_Click(object sender, EventArgs e) { numericUpDownMsg.Value = new decimal(Win32.WM_USER); } - private void checkBoxMsgCurrApp_CheckedChanged(object sender, EventArgs e) + private void radioButtonActiveWindow_CheckedChanged(object sender, EventArgs e) { - textBoxMsgApp.Enabled = !checkBoxMsgCurrApp.Checked; - buttonFindMsgApp.Enabled = !checkBoxMsgCurrApp.Checked; + buttonFindMsgTarget.Enabled = false; + textBoxMsgTarget.Enabled = false; } + private void radioButtonApplication_CheckedChanged(object sender, EventArgs e) + { + buttonFindMsgTarget.Enabled = true; + textBoxMsgTarget.Enabled = true; + } + private void radioButtonClass_CheckedChanged(object sender, EventArgs e) + { + buttonFindMsgTarget.Enabled = false; + textBoxMsgTarget.Enabled = true; + } + private void radioButtonWindowTitle_CheckedChanged(object sender, EventArgs e) + { + buttonFindMsgTarget.Enabled = false; + textBoxMsgTarget.Enabled = true; + } } Modified: trunk/plugins/MCEReplacement/Forms/MessageCommand.resx =================================================================== --- trunk/plugins/MCEReplacement/Forms/MessageCommand.resx 2007-04-14 03:44:42 UTC (rev 326) +++ trunk/plugins/MCEReplacement/Forms/MessageCommand.resx 2007-04-14 04:44:03 UTC (rev 327) @@ -117,7 +117,13 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> + <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>174, 17</value> + </metadata> <metadata name="contextMenuStripWM.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> + <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>174, 17</value> + </metadata> </root> \ No newline at end of file Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-04-14 03:44:42 UTC (rev 326) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-04-14 04:44:03 UTC (rev 327) @@ -52,7 +52,7 @@ public const string SetMapCommandPrefix = "Multi-Mapping: "; public const string SetMouseCommandPrefix = "Mouse Mode: "; public const string InputLayerCommand = "Toggle Input Layer"; - public const string WindowStateCommand = "Toggle Window State"; + //public const string WindowStateCommand = "Toggle Window State"; public const string GetFocusCommand = "Get Focus"; public const string ExitCommand = "Exit MediaPortal"; public const string StandByCommand = "Standby"; @@ -74,7 +74,7 @@ public const string MapMacroText = "MULTI_MAPPING"; public const string MouseMacroText = "MOUSE_MODE"; public const string InputLayerMacroText = "INPUT_LAYER"; - public const string WindowStateMacroText = "WINDOW_STATE"; + //public const string WindowStateMacroText = "WINDOW_STATE"; public const string GetFocusMacroText = "GET_FOCUS"; public const string ExitMacroText = "EXIT"; public const string StandbyMacroText = "STANDBY"; @@ -82,6 +82,27 @@ public const string RebootMacroText = "REBOOT"; public const string ShutdownMacroText = "SHUTDOWN"; + // English text for Macro commands + public const string RunProgramText = "Run Program"; + public const string PauseText = "Pause"; + public const string SerialCommandText = "Serial Command"; + public const string MessageCommandText = "Message Command"; + public const string KeystrokesCommandText = "Keystrokes Command"; + public const string GoToScreenText = "Go To Screen"; + public const string PopupMessageText = "Popup Message"; + public const string ForceBlasterPortText = "Force Blaster Port"; + public const string ForceBlasterSpeedText = "Force Blaster Speed"; + public const string SetMultiMappingText = "Set Multi-Mapping"; + public const string SetMouseModeText = "Set Mouse Mode"; + public const string ToggleInputLayerText = "Toggle Input Handler Layer"; + //public const string ChangeWindowStateText = "Change Window State"; + public const string GetFocusText = "Get Focus"; + public const string ExitCommandText = "Exit MediaPortal"; + public const string StandByCommandText = "Standby"; + public const string HibernateCommandText = "Hibernate"; + public const string RebootCommandText = "Reboot"; + public const string ShutdownCommandText = "Shutdown"; + public static readonly string AppDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\MediaPortal MCE Replacement Plugin\\"; @@ -1697,7 +1718,7 @@ break; } - +/* case WindowStateMacroText: { if (InConfiguration) @@ -1714,7 +1735,7 @@ GUIWindowManager.SendMessage(msg); break; } - +*/ case GetFocusMacroText: { if (InConfiguration) @@ -2179,7 +2200,7 @@ string[] commands = messageCommand.Split(new char[] { '|' }, StringSplitOptions.None); - if (commands.Length != 4) + if (commands.Length != 5) { Log.Error("MCEReplacement: Message command structure is invalid: {0}", messageCommand); return null; @@ -2207,34 +2228,36 @@ { IntPtr windowHandle = IntPtr.Zero; - if (commands[0] == "*") + switch (commands[0].ToLowerInvariant()) { - windowHandle = Win32.GetForegroundWindow(); - } - else - { - foreach (Process proc in Process.GetProcesses()) - { - try + case "active": + windowHandle = Win32.GetForegroundWindow(); + break; + + case "application": + foreach (Process proc in Process.GetProcesses()) { - if (proc.MainModule.FileName == commands[0]) + try { - windowHandle = proc.MainWindowHandle; - break; + if (proc.MainModule.FileName == commands[1]) + { + windowHandle = proc.MainWindowHandle; + break; + } } + catch + { + } } - catch - { - } - } - - // if it wasn't an application, try a class - if (windowHandle == IntPtr.Zero) - windowHandle = Win32.FindWindow(commands[0], null); - - // if still not found, try window title - if (windowHandle == IntPtr.Zero) - windowHandle = Win32.FindWindow(null, commands[0]); + break; + + case "class": + windowHandle = Win32.FindWindow(commands[1], null); + break; + + case "window": + windowHandle = Win32.FindWindow(null, commands[1]); + break; } if (windowHandle == IntPtr.Zero) @@ -2243,14 +2266,14 @@ return false; } - int msg = int.Parse(commands[1]); - IntPtr wordParam = new IntPtr(int.Parse(commands[2])); - IntPtr longParam = new IntPtr(int.Parse(commands[3])); + int msg = int.Parse(commands[2]); + IntPtr wordParam = new IntPtr(int.Parse(commands[3])); + IntPtr longParam = new IntPtr(int.Parse(commands[4])); Win32.SendMessage(windowHandle, msg, wordParam, longParam); if (LogVerbose) - Log.Info("MCEReplacement: Message Sent({0}, {1}, {2}, {3})", commands[0], msg, wordParam, longParam); + Log.Info("MCEReplacement: Message Sent({0}, {1}, {2}, {3}, {4})", commands[0], commands[1], msg, wordParam, longParam); return true; } Modified: trunk/plugins/MCEReplacement/MCEReplacement.csproj =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.csproj 2007-04-14 03:44:42 UTC (rev 326) +++ trunk/plugins/MCEReplacement/MCEReplacement.csproj 2007-04-14 04:44:03 UTC (rev 327) @@ -167,11 +167,6 @@ <HintPath>..\..\MediaPortal\Dialogs\bin\Release\Dialogs.dll</HintPath> <Private>False</Private> </Reference> - <Reference Include="Microsoft.DirectX.Direct3D, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal\xbmc\bin\Release\Microsoft.DirectX.Direct3D.dll</HintPath> - <Private>False</Private> - </Reference> <Reference Include="RemotePlugins, Version=1.0.2581.1913, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\MediaPortal\RemotePlugins\bin\Release\RemotePlugins.dll</HintPath> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |