From: <an...@us...> - 2008-02-07 10:08:36
|
Revision: 1342 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1342&view=rev Author: and-81 Date: 2008-02-07 02:08:33 -0800 (Thu, 07 Feb 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.Designer.cs trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.resx trunk/plugins/IR Server Suite/Applications/IR File Tool/IR File Tool.csproj trunk/plugins/IR Server Suite/Applications/IR File Tool/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs trunk/plugins/IR Server Suite/Commands/TestApp/Program.cs trunk/plugins/IR Server Suite/Common/ShellLink/ShellLink.csproj Modified: trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.Designer.cs 2008-02-07 08:27:37 UTC (rev 1341) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.Designer.cs 2008-02-07 10:08:33 UTC (rev 1342) @@ -55,9 +55,12 @@ this.groupBoxCarrier = new System.Windows.Forms.GroupBox(); this.groupBoxTestBlast = new System.Windows.Forms.GroupBox(); this.comboBoxPort = new System.Windows.Forms.ComboBox(); + this.statusStrip = new System.Windows.Forms.StatusStrip(); + this.toolStripStatusLabelConnected = new System.Windows.Forms.ToolStripStatusLabel(); this.menuStrip.SuspendLayout(); this.groupBoxCarrier.SuspendLayout(); this.groupBoxTestBlast.SuspendLayout(); + this.statusStrip.SuspendLayout(); this.SuspendLayout(); // // menuStrip @@ -165,7 +168,7 @@ this.textBoxPronto.Multiline = true; this.textBoxPronto.Name = "textBoxPronto"; this.textBoxPronto.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.textBoxPronto.Size = new System.Drawing.Size(312, 264); + this.textBoxPronto.Size = new System.Drawing.Size(312, 240); this.textBoxPronto.TabIndex = 1; // // buttonSetCarrier @@ -183,7 +186,7 @@ // checkBoxStoreBinary // this.checkBoxStoreBinary.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.checkBoxStoreBinary.Location = new System.Drawing.Point(336, 272); + this.checkBoxStoreBinary.Location = new System.Drawing.Point(336, 248); this.checkBoxStoreBinary.Name = "checkBoxStoreBinary"; this.checkBoxStoreBinary.Size = new System.Drawing.Size(160, 24); this.checkBoxStoreBinary.TabIndex = 6; @@ -208,7 +211,7 @@ this.buttonBlast.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonBlast.Location = new System.Drawing.Point(112, 24); this.buttonBlast.Name = "buttonBlast"; - this.buttonBlast.Size = new System.Drawing.Size(51, 24); + this.buttonBlast.Size = new System.Drawing.Size(48, 24); this.buttonBlast.TabIndex = 1; this.buttonBlast.Text = "&Blast"; this.toolTips.SetToolTip(this.buttonBlast, "Blast the current IR command for testing"); @@ -217,6 +220,7 @@ // // buttonLearn // + this.buttonLearn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonLearn.Enabled = false; this.buttonLearn.Location = new System.Drawing.Point(360, 168); this.buttonLearn.Name = "buttonLearn"; @@ -262,6 +266,7 @@ // // groupBoxTestBlast // + this.groupBoxTestBlast.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.groupBoxTestBlast.Controls.Add(this.buttonBlast); this.groupBoxTestBlast.Controls.Add(this.comboBoxPort); this.groupBoxTestBlast.Enabled = false; @@ -276,17 +281,38 @@ // this.comboBoxPort.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxPort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxPort.FormattingEnabled = true; this.comboBoxPort.Location = new System.Drawing.Point(8, 24); this.comboBoxPort.Name = "comboBoxPort"; this.comboBoxPort.Size = new System.Drawing.Size(96, 21); this.comboBoxPort.TabIndex = 0; // + // statusStrip + // + this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripStatusLabelConnected}); + this.statusStrip.Location = new System.Drawing.Point(0, 283); + this.statusStrip.Name = "statusStrip"; + this.statusStrip.Size = new System.Drawing.Size(504, 22); + this.statusStrip.TabIndex = 7; + this.statusStrip.Text = "statusStrip"; + // + // toolStripStatusLabelConnected + // + this.toolStripStatusLabelConnected.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.toolStripStatusLabelConnected.Name = "toolStripStatusLabelConnected"; + this.toolStripStatusLabelConnected.Size = new System.Drawing.Size(489, 17); + this.toolStripStatusLabelConnected.Spring = true; + this.toolStripStatusLabelConnected.Text = "Not connected"; + this.toolStripStatusLabelConnected.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // FormMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(504, 305); + this.Controls.Add(this.statusStrip); this.Controls.Add(this.buttonLearn); this.Controls.Add(this.groupBoxTestBlast); this.Controls.Add(this.groupBoxCarrier); @@ -304,6 +330,8 @@ this.groupBoxCarrier.ResumeLayout(false); this.groupBoxCarrier.PerformLayout(); this.groupBoxTestBlast.ResumeLayout(false); + this.statusStrip.ResumeLayout(false); + this.statusStrip.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -336,6 +364,8 @@ private System.Windows.Forms.Button buttonBlast; private System.Windows.Forms.ComboBox comboBoxPort; private System.Windows.Forms.Button buttonLearn; + private System.Windows.Forms.StatusStrip statusStrip; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelConnected; } } Modified: trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs 2008-02-07 08:27:37 UTC (rev 1341) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs 2008-02-07 10:08:33 UTC (rev 1342) @@ -42,6 +42,7 @@ string _serverHost = String.Empty; + IRServerInfo _irServerInfo = new IRServerInfo(); #endregion Variables @@ -87,6 +88,10 @@ void Save() { + if (String.IsNullOrEmpty(_fileName)) + if (!GetSaveFileName()) + return; + if (!checkBoxStoreBinary.Checked) { Pronto.WriteProntoFile(_fileName, Pronto.ConvertIrCodeToProntoRaw(_code)); @@ -102,7 +107,19 @@ } } + bool GetSaveFileName() + { + if (String.IsNullOrEmpty(saveFileDialog.InitialDirectory)) + saveFileDialog.InitialDirectory = Common.FolderIRCommands; + if (saveFileDialog.ShowDialog(this) != DialogResult.OK) + return false; + + _fileName = saveFileDialog.FileName; + return true; + } + + void LoadSettings() { try @@ -143,8 +160,28 @@ } } + delegate void UpdateWindowDel(string status); + void UpdateWindow(string status) + { + toolStripStatusLabelConnected.Text = status; + comboBoxPort.Items.Clear(); + comboBoxPort.Items.AddRange(_irServerInfo.Ports); + comboBoxPort.SelectedIndex = 0; + if (_registered) + { + groupBoxTestBlast.Enabled = _irServerInfo.CanTransmit; + buttonLearn.Enabled = _irServerInfo.CanLearn; + } + else + { + groupBoxTestBlast.Enabled = false; + buttonLearn.Enabled = false; + } + } + + void CommsFailure(object obj) { Exception ex = obj as Exception; @@ -214,28 +251,76 @@ case MessageType.RegisterClient: if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) { + _irServerInfo = IRServerInfo.FromBytes(received.GetDataAsBytes()); _registered = true; - groupBoxTestBlast.Enabled = true; - buttonLearn.Enabled = true; + string message = "Connected"; + IrssLog.Info(message); + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { message }); } else if ((received.Flags & MessageFlags.Failure) == MessageFlags.Failure) { _registered = false; - groupBoxTestBlast.Enabled = false; - buttonLearn.Enabled = false; - - MessageBox.Show(this, "Failed to register with server", "IR File Tool Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + string message = "Failed to connect"; + IrssLog.Warn(message); + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { message }); } return; + case MessageType.BlastIR: + if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) + { + string message = "Blast successful"; + IrssLog.Info(message); + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { message }); + } + else if ((received.Flags & MessageFlags.Failure) == MessageFlags.Failure) + { + string message = "Failed to blast IR command"; + IrssLog.Error(message); + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { message }); + } + break; + + case MessageType.LearnIR: + if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) + { + byte[] dataBytes = received.GetDataAsBytes(); + + _code = IrCode.FromByteArray(dataBytes); + + _fileName = null; + + string message = "Learned IR Successfully"; + IrssLog.Info(message); + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { message }); + + RefreshForm(); + } + else if ((received.Flags & MessageFlags.Failure) == MessageFlags.Failure) + { + string message = "Failed to learn IR command"; + + IrssLog.Warn(message); + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { message }); + } + else if ((received.Flags & MessageFlags.Timeout) == MessageFlags.Timeout) + { + string message = "Learn IR command timed-out"; + + IrssLog.Warn(message); + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { message }); + } + break; + case MessageType.ServerShutdown: - MessageBox.Show(this, "Server has been shut down", "IR File Tool Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + _registered = false; + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { "Server shut down" }); return; case MessageType.Error: - MessageBox.Show(this, received.GetDataAsString(), "IR File Tool Error from Server", MessageBoxButtons.OK, MessageBoxIcon.Error); + IrssLog.Error("Error from server: " + received.GetDataAsString()); return; } } @@ -247,28 +332,21 @@ } - - - - - - - private void newToolStripMenuItem_Click(object sender, EventArgs e) { _code = new IrCode(); - _fileName = "New File.IR"; + _fileName = null; RefreshForm(); } private void openToolStripMenuItem_Click(object sender, EventArgs e) { + if (String.IsNullOrEmpty(openFileDialog.InitialDirectory)) + openFileDialog.InitialDirectory = Common.FolderIRCommands; + if (openFileDialog.ShowDialog(this) != DialogResult.OK) return; - if (String.IsNullOrEmpty(openFileDialog.InitialDirectory)) - openFileDialog.InitialDirectory = Common.FolderIRCommands; - using (FileStream file = File.OpenRead(openFileDialog.FileName)) { if (file.Length == 0) @@ -294,15 +372,8 @@ } private void saveasToolStripMenuItem_Click(object sender, EventArgs e) { - if (String.IsNullOrEmpty(saveFileDialog.InitialDirectory)) - saveFileDialog.InitialDirectory = Common.FolderIRCommands; - - if (saveFileDialog.ShowDialog(this) != DialogResult.OK) - return; - - _fileName = saveFileDialog.FileName; - - Save(); + if (GetSaveFileName()) + Save(); } private void quitToolStripMenuItem_Click(object sender, EventArgs e) { @@ -362,32 +433,30 @@ void RemoteEvent(IrProtocol codeType, uint keyCode, bool firstPress) { - MessageBox.Show(this, String.Format("Remote: {0}, {1}", Enum.GetName(typeof(IrProtocol), codeType), keyCode), "Decode IR", MessageBoxButtons.OK, MessageBoxIcon.Information); - - if (textBoxCarrier.Text.Equals("Unknown", StringComparison.OrdinalIgnoreCase)) + if (DialogResult.Yes == MessageBox.Show(this, String.Format("Remote: {0}, {1}\nUse this protocol's carrier frequency?", Enum.GetName(typeof(IrProtocol), codeType), keyCode), "Decode IR", MessageBoxButtons.YesNo, MessageBoxIcon.Question)) { switch (codeType) { - case IrProtocol.Daewoo: textBoxCarrier.Text = "38000"; break; - case IrProtocol.JVC: textBoxCarrier.Text = "38000"; break; + case IrProtocol.Daewoo: textBoxCarrier.Text = "38000"; break; + case IrProtocol.JVC: textBoxCarrier.Text = "38000"; break; case IrProtocol.Matsushita: textBoxCarrier.Text = "56800"; break; case IrProtocol.Mitsubishi: textBoxCarrier.Text = "40000"; break; - case IrProtocol.NEC: textBoxCarrier.Text = "38000"; break; - case IrProtocol.NRC17: textBoxCarrier.Text = "38000"; break; - case IrProtocol.Panasonic: textBoxCarrier.Text = "38000"; break; - case IrProtocol.RC5: textBoxCarrier.Text = "36000"; break; - case IrProtocol.RC5X: textBoxCarrier.Text = "36000"; break; - case IrProtocol.RC6: textBoxCarrier.Text = "36000"; break; - case IrProtocol.RC6A: textBoxCarrier.Text = "36000"; break; - case IrProtocol.RC6_MCE: textBoxCarrier.Text = "36000"; break; + case IrProtocol.NEC: textBoxCarrier.Text = "38000"; break; + case IrProtocol.NRC17: textBoxCarrier.Text = "38000"; break; + case IrProtocol.Panasonic: textBoxCarrier.Text = "38000"; break; + case IrProtocol.RC5: textBoxCarrier.Text = "36000"; break; + case IrProtocol.RC5X: textBoxCarrier.Text = "36000"; break; + case IrProtocol.RC6: textBoxCarrier.Text = "36000"; break; + case IrProtocol.RC6A: textBoxCarrier.Text = "36000"; break; + case IrProtocol.RC6_MCE: textBoxCarrier.Text = "36000"; break; case IrProtocol.RC6_Foxtel: textBoxCarrier.Text = "36000"; break; - case IrProtocol.RCA: textBoxCarrier.Text = "56000"; break; - case IrProtocol.RCMM: textBoxCarrier.Text = "36000"; break; - case IrProtocol.RECS80: textBoxCarrier.Text = "38000"; break; - case IrProtocol.Sharp: textBoxCarrier.Text = "38000"; break; - case IrProtocol.SIRC: textBoxCarrier.Text = "40000"; break; - case IrProtocol.Toshiba: textBoxCarrier.Text = "38000"; break; - case IrProtocol.XSAT: textBoxCarrier.Text = "38000"; break; + case IrProtocol.RCA: textBoxCarrier.Text = "56000"; break; + case IrProtocol.RCMM: textBoxCarrier.Text = "36000"; break; + case IrProtocol.RECS80: textBoxCarrier.Text = "38000"; break; + case IrProtocol.Sharp: textBoxCarrier.Text = "38000"; break; + case IrProtocol.SIRC: textBoxCarrier.Text = "40000"; break; + case IrProtocol.Toshiba: textBoxCarrier.Text = "38000"; break; + case IrProtocol.XSAT: textBoxCarrier.Text = "38000"; break; default: return; @@ -422,6 +491,8 @@ private void connectToolStripMenuItem_Click(object sender, EventArgs e) { + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { "Connecting ..." }); + IPAddress serverIP = Client.GetIPFromName(_serverHost); IPEndPoint endPoint = new IPEndPoint(serverIP, IrssComms.Server.DefaultPort); @@ -437,8 +508,7 @@ _registered = false; } - groupBoxTestBlast.Enabled = false; - buttonLearn.Enabled = false; + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { "Disconnected" }); StopClient(); } @@ -454,15 +524,35 @@ private void buttonBlast_Click(object sender, EventArgs e) { + if (!_registered) + MessageBox.Show(this, "Not registered to an active Input Service", "Cannot blast", MessageBoxButtons.OK, MessageBoxIcon.Warning); + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { "Blasting ..." }); + + string port = comboBoxPort.Text; + byte[] codeBytes = _code.ToByteArray(true); + + byte[] outData = new byte[4 + port.Length + codeBytes.Length]; + + BitConverter.GetBytes(port.Length).CopyTo(outData, 0); + Encoding.ASCII.GetBytes(port).CopyTo(outData, 4); + + Array.Copy(codeBytes, 0, outData, 4 + port.Length, codeBytes.Length); + + IrssMessage message = new IrssMessage(MessageType.BlastIR, MessageFlags.Request, outData); + _client.Send(message); } - private void buttonLearn_Click(object sender, EventArgs e) { + if (!_registered) + MessageBox.Show(this, "Not registered to an active Input Service", "Cannot learn", MessageBoxButtons.OK, MessageBoxIcon.Warning); + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { "Learning ..." }); + + IrssMessage message = new IrssMessage(MessageType.LearnIR, MessageFlags.Request); + _client.Send(message); } - } } Modified: trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.resx =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.resx 2008-02-07 08:27:37 UTC (rev 1341) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.resx 2008-02-07 10:08:33 UTC (rev 1342) @@ -129,6 +129,9 @@ <metadata name="saveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>333, 17</value> </metadata> + <metadata name="statusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>455, 17</value> + </metadata> <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> Modified: trunk/plugins/IR Server Suite/Applications/IR File Tool/IR File Tool.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/IR File Tool.csproj 2008-02-07 08:27:37 UTC (rev 1341) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/IR File Tool.csproj 2008-02-07 10:08:33 UTC (rev 1342) @@ -24,6 +24,8 @@ <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <UseVSHostingProcess>false</UseVSHostingProcess> <DocumentationFile>bin\Debug\IRFileTool.xml</DocumentationFile> + <NoWarn> + </NoWarn> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>none</DebugType> Modified: trunk/plugins/IR Server Suite/Applications/IR File Tool/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/Properties/AssemblyInfo.cs 2008-02-07 08:27:37 UTC (rev 1341) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/Properties/AssemblyInfo.cs 2008-02-07 10:08:33 UTC (rev 1342) @@ -6,7 +6,7 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("IR File Tool")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyDescription("For learning, modifying, testing, correcting and converting IR command files")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("and-81")] [assembly: AssemblyProduct("IR File Tool")] Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs 2008-02-07 08:27:37 UTC (rev 1341) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs 2008-02-07 10:08:33 UTC (rev 1342) @@ -155,6 +155,7 @@ this.pageUpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.scrollLockToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tabToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.windowsKeyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tabPageMouse = new System.Windows.Forms.TabPage(); this.groupBoxMouseScroll = new System.Windows.Forms.GroupBox(); this.checkBoxMouseScrollDown = new System.Windows.Forms.CheckBox(); @@ -177,7 +178,6 @@ this.buttonCancel = new System.Windows.Forms.Button(); this.buttonOK = new System.Windows.Forms.Button(); this.toolTips = new System.Windows.Forms.ToolTip(this.components); - this.windowsKeyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.groupBoxButton.SuspendLayout(); this.groupBoxSet.SuspendLayout(); this.tabControl.SuspendLayout(); @@ -284,10 +284,11 @@ | System.Windows.Forms.AnchorStyles.Right))); this.textBoxCommand.BackColor = System.Drawing.SystemColors.Info; this.textBoxCommand.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.textBoxCommand.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.textBoxCommand.Location = new System.Drawing.Point(64, 264); this.textBoxCommand.Name = "textBoxCommand"; this.textBoxCommand.ReadOnly = true; - this.textBoxCommand.Size = new System.Drawing.Size(336, 20); + this.textBoxCommand.Size = new System.Drawing.Size(336, 22); this.textBoxCommand.TabIndex = 2; // // buttonSet @@ -295,10 +296,10 @@ this.buttonSet.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.buttonSet.Location = new System.Drawing.Point(8, 264); this.buttonSet.Name = "buttonSet"; - this.buttonSet.Size = new System.Drawing.Size(48, 20); + this.buttonSet.Size = new System.Drawing.Size(48, 22); this.buttonSet.TabIndex = 1; this.buttonSet.Text = "Set"; - this.toolTips.SetToolTip(this.buttonSet, "Click here to set the command"); + this.toolTips.SetToolTip(this.buttonSet, "Click here to set the selected command"); this.buttonSet.UseVisualStyleBackColor = true; this.buttonSet.Click += new System.EventHandler(this.buttonSet_Click); // @@ -1019,52 +1020,52 @@ this.toolStripSeparator2, this.specialKeysToolStripMenuItem}); this.contextMenuStripKeystrokes.Name = "contextMenuStripKeystrokes"; - this.contextMenuStripKeystrokes.Size = new System.Drawing.Size(153, 170); + this.contextMenuStripKeystrokes.Size = new System.Drawing.Size(145, 148); // // cutToolStripMenuItem // this.cutToolStripMenuItem.Name = "cutToolStripMenuItem"; - this.cutToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.cutToolStripMenuItem.Size = new System.Drawing.Size(144, 22); this.cutToolStripMenuItem.Text = "Cut"; this.cutToolStripMenuItem.Click += new System.EventHandler(this.cutToolStripMenuItem_Click); // // copyToolStripMenuItem // this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; - this.copyToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.copyToolStripMenuItem.Size = new System.Drawing.Size(144, 22); this.copyToolStripMenuItem.Text = "Copy"; this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click); // // pasteToolStripMenuItem // this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem"; - this.pasteToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.pasteToolStripMenuItem.Size = new System.Drawing.Size(144, 22); this.pasteToolStripMenuItem.Text = "Paste"; this.pasteToolStripMenuItem.Click += new System.EventHandler(this.pasteToolStripMenuItem_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(141, 6); // // selectAllToolStripMenuItem // this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem"; - this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(144, 22); this.selectAllToolStripMenuItem.Text = "Select All"; this.selectAllToolStripMenuItem.Click += new System.EventHandler(this.selectAllToolStripMenuItem_Click); // // selectNoneToolStripMenuItem // this.selectNoneToolStripMenuItem.Name = "selectNoneToolStripMenuItem"; - this.selectNoneToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.selectNoneToolStripMenuItem.Size = new System.Drawing.Size(144, 22); this.selectNoneToolStripMenuItem.Text = "Select None"; this.selectNoneToolStripMenuItem.Click += new System.EventHandler(this.selectNoneToolStripMenuItem_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(149, 6); + this.toolStripSeparator2.Size = new System.Drawing.Size(141, 6); // // specialKeysToolStripMenuItem // @@ -1091,7 +1092,7 @@ this.tabToolStripMenuItem, this.windowsKeyToolStripMenuItem}); this.specialKeysToolStripMenuItem.Name = "specialKeysToolStripMenuItem"; - this.specialKeysToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.specialKeysToolStripMenuItem.Size = new System.Drawing.Size(144, 22); this.specialKeysToolStripMenuItem.Text = "Special Keys"; // // arrowsToolStripMenuItem @@ -1321,28 +1322,28 @@ // altToolStripMenuItem // this.altToolStripMenuItem.Name = "altToolStripMenuItem"; - this.altToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.altToolStripMenuItem.Size = new System.Drawing.Size(128, 22); this.altToolStripMenuItem.Text = "Alt"; this.altToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); // // controlToolStripMenuItem // this.controlToolStripMenuItem.Name = "controlToolStripMenuItem"; - this.controlToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.controlToolStripMenuItem.Size = new System.Drawing.Size(128, 22); this.controlToolStripMenuItem.Text = "Control"; this.controlToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); // // shiftToolStripMenuItem // this.shiftToolStripMenuItem.Name = "shiftToolStripMenuItem"; - this.shiftToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.shiftToolStripMenuItem.Size = new System.Drawing.Size(128, 22); this.shiftToolStripMenuItem.Text = "Shift"; this.shiftToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); // // windowsToolStripMenuItem // this.windowsToolStripMenuItem.Name = "windowsToolStripMenuItem"; - this.windowsToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.windowsToolStripMenuItem.Size = new System.Drawing.Size(128, 22); this.windowsToolStripMenuItem.Text = "Windows"; this.windowsToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); // @@ -1456,6 +1457,13 @@ this.tabToolStripMenuItem.Text = "Tab"; this.tabToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); // + // windowsKeyToolStripMenuItem + // + this.windowsKeyToolStripMenuItem.Name = "windowsKeyToolStripMenuItem"; + this.windowsKeyToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.windowsKeyToolStripMenuItem.Text = "Windows Key"; + this.windowsKeyToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // // tabPageMouse // this.tabPageMouse.Controls.Add(this.groupBoxMouseScroll); @@ -1691,7 +1699,7 @@ this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonTest.Location = new System.Drawing.Point(408, 264); this.buttonTest.Name = "buttonTest"; - this.buttonTest.Size = new System.Drawing.Size(48, 20); + this.buttonTest.Size = new System.Drawing.Size(48, 22); this.buttonTest.TabIndex = 3; this.buttonTest.Text = "Test"; this.toolTips.SetToolTip(this.buttonTest, "Click here to test the currently set command"); @@ -1721,13 +1729,6 @@ this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); // - // windowsKeyToolStripMenuItem - // - this.windowsKeyToolStripMenuItem.Name = "windowsKeyToolStripMenuItem"; - this.windowsKeyToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.windowsKeyToolStripMenuItem.Text = "Windows Key"; - this.windowsKeyToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); - // // ButtonMappingForm // this.AcceptButton = this.buttonOK; Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2008-02-07 08:27:37 UTC (rev 1341) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2008-02-07 10:08:33 UTC (rev 1342) @@ -319,12 +319,20 @@ private void buttonOK_Click(object sender, EventArgs e) { - if (String.IsNullOrEmpty(_keyCode) || String.IsNullOrEmpty(_command)) + if (String.IsNullOrEmpty(_keyCode)) { - MessageBox.Show(this, "You must set a valid button mapping to press OK", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(this, "You must provide a valid button key code to create a button mapping", "KeyCode Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + textBoxKeyCode.Focus(); return; } + if (String.IsNullOrEmpty(_command)) + { + MessageBox.Show(this, "You must click SET to confirm the command you want to assign to this button mapping", "Command Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + buttonSet.Focus(); + return; + } + this.DialogResult = DialogResult.OK; this.Close(); } Modified: trunk/plugins/IR Server Suite/Commands/TestApp/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/TestApp/Program.cs 2008-02-07 08:27:37 UTC (rev 1341) +++ trunk/plugins/IR Server Suite/Commands/TestApp/Program.cs 2008-02-07 10:08:33 UTC (rev 1342) @@ -33,20 +33,34 @@ Processor.CategorySpecial }; - EditMacro edit1 = new EditMacro( - commandProcessor, - @"C:\Documents and Settings\All Users.WINDOWS\Application Data\IR Server Suite\MP Blast Zone Plugin\Macro\", - categories); + try + { + EditMacro edit1 = new EditMacro( + commandProcessor, + @"C:\Documents and Settings\All Users.WINDOWS\Application Data\IR Server Suite\MP Blast Zone Plugin\Macro\", + categories); - edit1.ShowDialog(); + edit1.ShowDialog(); + } + catch (Exception ex) + { + MessageBox.Show(ex.ToString()); + } - EditMacro edit2 = new EditMacro( - commandProcessor, - @"C:\Documents and Settings\All Users.WINDOWS\Application Data\IR Server Suite\MP Blast Zone Plugin\Macro\", - categories, - @"C:\Documents and Settings\All Users.WINDOWS\Application Data\IR Server Suite\MP Blast Zone Plugin\Macro\Toggle Example.Macro"); + try + { + EditMacro edit2 = new EditMacro( + commandProcessor, + @"C:\Documents and Settings\All Users.WINDOWS\Application Data\IR Server Suite\MP Blast Zone Plugin\Macro\", + categories, + @"C:\Documents and Settings\All Users.WINDOWS\Application Data\IR Server Suite\MP Blast Zone Plugin\Macro\Toggle Example.Macro"); - edit2.ShowDialog(); + edit2.ShowDialog(); + } + catch (Exception ex) + { + MessageBox.Show(ex.ToString()); + } } Modified: trunk/plugins/IR Server Suite/Common/ShellLink/ShellLink.csproj =================================================================== --- trunk/plugins/IR Server Suite/Common/ShellLink/ShellLink.csproj 2008-02-07 08:27:37 UTC (rev 1341) +++ trunk/plugins/IR Server Suite/Common/ShellLink/ShellLink.csproj 2008-02-07 10:08:33 UTC (rev 1342) @@ -41,11 +41,12 @@ <Optimize>false</Optimize> <RegisterForComInterop>false</RegisterForComInterop> <RemoveIntegerChecks>false</RemoveIntegerChecks> - <TreatWarningsAsErrors>false</TreatWarningsAsErrors> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <WarningLevel>4</WarningLevel> <DebugType>full</DebugType> <ErrorReport>prompt</ErrorReport> <UseVSHostingProcess>false</UseVSHostingProcess> + <NoWarn>0618</NoWarn> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <OutputPath>bin\Release\</OutputPath> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |