--- /dev/null
+// \r
+// Radegast Metaverse Client\r
+// Copyright (c) 2009, Radegast Development Team\r
+// All rights reserved.\r
+// \r
+// Redistribution and use in source and binary forms, with or without\r
+// modification, are permitted provided that the following conditions are met:\r
+// \r
+// * Redistributions of source code must retain the above copyright notice,\r
+// this list of conditions and the following disclaimer.\r
+// * Redistributions in binary form must reproduce the above copyright\r
+// notice, this list of conditions and the following disclaimer in the\r
+// documentation and/or other materials provided with the distribution.\r
+// * Neither the name of the application "Radegast", nor the names of its\r
+// contributors may be used to endorse or promote products derived from\r
+// this software without specific prior written permission.\r
+// \r
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\r
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\r
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\r
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\r
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+//\r
+// $Id: IMTabWindow.Designer.cs 323 2009-10-07 01:08:34Z latifer@gmail.com $\r
+//\r
+using System;\r
+using System.Windows.Forms;\r
+\r
+namespace Radegast\r
+{\r
+ public class ChatInputBox : TextBox\r
+ {\r
+ public static readonly string NewlineMarker = new string('\u00b6', 1);\r
+\r
+ public ChatInputBox()\r
+ : base()\r
+ {\r
+ }\r
+\r
+ protected override void WndProc(ref Message m)\r
+ {\r
+ switch (m.Msg)\r
+ {\r
+ case 0x302: //WM_PASTE\r
+ Paste();\r
+ break;\r
+\r
+ default:\r
+ base.WndProc(ref m);\r
+ break;\r
+ }\r
+ }\r
+\r
+ public new void Paste()\r
+ {\r
+ Paste(Clipboard.GetText());\r
+ }\r
+\r
+ public new void Paste(string text)\r
+ {\r
+ base.Paste(text.Replace(Environment.NewLine, NewlineMarker));\r
+ }\r
+\r
+\r
+ }\r
+}\r
this.components = new System.ComponentModel.Container();\r
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChatConsole));\r
this.rtbChat = new System.Windows.Forms.RichTextBox();\r
- this.cbxInput = new System.Windows.Forms.ComboBox();\r
+ this.cbxInput = new ChatInputBox();\r
this.btnSay = new System.Windows.Forms.Button();\r
this.btnShout = new System.Windows.Forms.Button();\r
this.splitContainer1 = new System.Windows.Forms.SplitContainer();\r
this.cbxInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)\r
| System.Windows.Forms.AnchorStyles.Right)));\r
this.cbxInput.Enabled = false;\r
- this.cbxInput.FormattingEnabled = true;\r
this.cbxInput.Location = new System.Drawing.Point(0, 0);\r
this.cbxInput.Name = "cbxInput";\r
this.cbxInput.Size = new System.Drawing.Size(352, 21);\r
\r
public ListViewNoFlicker lvwObjects;\r
public RichTextBox rtbChat;\r
- public ComboBox cbxInput;\r
+ public ChatInputBox cbxInput;\r
public Button btnSay;\r
public Button btnShout;\r
public SplitContainer splitContainer1;\r
private Dictionary<uint, Avatar> avatars = new Dictionary<uint, Avatar>();\r
private Dictionary<uint, bool> bots = new Dictionary<uint,bool>();\r
private readonly Dictionary<UUID, ulong> agentSimHandle = new Dictionary<UUID, ulong>();\r
- public ComboBox ChatInputText { get { return cbxInput; } }\r
+ public ChatInputBox ChatInputText { get { return cbxInput; } }\r
\r
public ChatConsole(RadegastInstance instance)\r
{\r
msg = input;\r
}\r
\r
+ msg = msg.Replace(ChatInputBox.NewlineMarker, "\n");\r
+\r
int ch = 0;\r
Match m = chatRegex.Match(msg);\r
\r
\r
private void ClearChatInput()\r
{\r
- cbxInput.Items.Add(cbxInput.Text);\r
cbxInput.Text = string.Empty;\r
}\r
\r
private void InitializeComponent()\r
{\r
this.rtbIMText = new System.Windows.Forms.RichTextBox();\r
- this.cbxInput = new System.Windows.Forms.ComboBox();\r
this.btnSend = new System.Windows.Forms.Button();\r
+ this.cbxInput = new Radegast.ChatInputBox();\r
this.SuspendLayout();\r
// \r
// rtbIMText\r
this.rtbIMText.Text = "";\r
this.rtbIMText.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.rtbIMText_LinkClicked);\r
// \r
- // cbxInput\r
- // \r
- this.cbxInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)\r
- | System.Windows.Forms.AnchorStyles.Right)));\r
- this.cbxInput.FormattingEnabled = true;\r
- this.cbxInput.Location = new System.Drawing.Point(3, 306);\r
- this.cbxInput.Name = "cbxInput";\r
- this.cbxInput.Size = new System.Drawing.Size(413, 21);\r
- this.cbxInput.TabIndex = 0;\r
- this.cbxInput.KeyUp += new System.Windows.Forms.KeyEventHandler(this.cbxInput_KeyUp);\r
- this.cbxInput.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbxInput_KeyDown);\r
- this.cbxInput.TextChanged += new System.EventHandler(this.cbxInput_TextChanged);\r
- // \r
// btnSend\r
// \r
this.btnSend.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));\r
this.btnSend.Enabled = false;\r
- this.btnSend.Location = new System.Drawing.Point(422, 304);\r
+ this.btnSend.Location = new System.Drawing.Point(422, 305);\r
this.btnSend.Name = "btnSend";\r
this.btnSend.Size = new System.Drawing.Size(75, 23);\r
this.btnSend.TabIndex = 1;\r
this.btnSend.UseVisualStyleBackColor = true;\r
this.btnSend.Click += new System.EventHandler(this.btnSend_Click);\r
// \r
+ // cbxInput\r
+ // \r
+ this.cbxInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)\r
+ | System.Windows.Forms.AnchorStyles.Right)));\r
+ this.cbxInput.Location = new System.Drawing.Point(3, 306);\r
+ this.cbxInput.Name = "cbxInput";\r
+ this.cbxInput.Size = new System.Drawing.Size(413, 21);\r
+ this.cbxInput.TabIndex = 0;\r
+ this.cbxInput.TextChanged += new System.EventHandler(this.cbxInput_TextChanged);\r
+ this.cbxInput.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbxInput_KeyDown);\r
+ this.cbxInput.KeyUp += new System.Windows.Forms.KeyEventHandler(this.cbxInput_KeyUp);\r
+ // \r
// ConferenceIMTabWindow\r
// \r
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
this.Name = "ConferenceIMTabWindow";\r
this.Size = new System.Drawing.Size(500, 330);\r
this.ResumeLayout(false);\r
+ this.PerformLayout();\r
\r
}\r
\r
#endregion\r
\r
public System.Windows.Forms.RichTextBox rtbIMText;\r
- public System.Windows.Forms.ComboBox cbxInput;\r
+ public ChatInputBox cbxInput;\r
public System.Windows.Forms.Button btnSend;\r
\r
}\r
\r
private void SendMessage(string msg)\r
{\r
- string message = msg;\r
+ string message = msg.Replace(ChatInputBox.NewlineMarker, "\n");\r
+\r
if (message.Length > 1023)\r
{\r
message = message.Remove(1023);\r
\r
private void ClearIMInput()\r
{\r
- cbxInput.Items.Add(cbxInput.Text);\r
cbxInput.Text = string.Empty;\r
}\r
\r
private void InitializeComponent()\r
{\r
this.rtbIMText = new System.Windows.Forms.RichTextBox();\r
- this.cbxInput = new System.Windows.Forms.ComboBox();\r
+ this.cbxInput = new Radegast.ChatInputBox();\r
this.btnSend = new System.Windows.Forms.Button();\r
this.chatSplit = new System.Windows.Forms.SplitContainer();\r
this.Participants = new Radegast.ListViewNoFlicker();\r
// \r
this.cbxInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)\r
| System.Windows.Forms.AnchorStyles.Right)));\r
- this.cbxInput.FormattingEnabled = true;\r
this.cbxInput.Location = new System.Drawing.Point(3, 306);\r
this.cbxInput.Name = "cbxInput";\r
this.cbxInput.Size = new System.Drawing.Size(373, 21);\r
this.cbxInput.TabIndex = 0;\r
- this.cbxInput.KeyUp += new System.Windows.Forms.KeyEventHandler(this.cbxInput_KeyUp);\r
- this.cbxInput.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbxInput_KeyDown);\r
this.cbxInput.TextChanged += new System.EventHandler(this.cbxInput_TextChanged);\r
+ this.cbxInput.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbxInput_KeyDown);\r
+ this.cbxInput.KeyUp += new System.Windows.Forms.KeyEventHandler(this.cbxInput_KeyUp);\r
// \r
// btnSend\r
// \r
this.chatSplit.Panel2.ResumeLayout(false);\r
this.chatSplit.ResumeLayout(false);\r
this.ResumeLayout(false);\r
+ this.PerformLayout();\r
\r
}\r
\r
#endregion\r
\r
public System.Windows.Forms.RichTextBox rtbIMText;\r
- public System.Windows.Forms.ComboBox cbxInput;\r
+ public ChatInputBox cbxInput;\r
public System.Windows.Forms.Button btnSend;\r
public System.Windows.Forms.SplitContainer chatSplit;\r
public ListViewNoFlicker Participants;\r
{\r
if (cbxInput.Text.Length == 0) return;\r
\r
- string message = cbxInput.Text;\r
+ string message = cbxInput.Text.Replace(ChatInputBox.NewlineMarker, "\n");\r
+\r
if (message.Length > 1023) message = message.Remove(1023);\r
\r
if (!client.Self.GroupChatSessions.ContainsKey(session))\r
\r
private void ClearIMInput()\r
{\r
- cbxInput.Items.Add(cbxInput.Text);\r
cbxInput.Text = string.Empty;\r
}\r
\r
private void InitializeComponent()\r
{\r
this.rtbIMText = new System.Windows.Forms.RichTextBox();\r
- this.cbxInput = new System.Windows.Forms.ComboBox();\r
this.btnSend = new System.Windows.Forms.Button();\r
this.toolStrip1 = new System.Windows.Forms.ToolStrip();\r
this.tbtnProfile = new System.Windows.Forms.ToolStripButton();\r
+ this.cbxInput = new Radegast.ChatInputBox();\r
this.toolStrip1.SuspendLayout();\r
this.SuspendLayout();\r
// \r
this.rtbIMText.Text = "";\r
this.rtbIMText.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.rtbIMText_LinkClicked);\r
// \r
- // cbxInput\r
- // \r
- this.cbxInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)\r
- | System.Windows.Forms.AnchorStyles.Right)));\r
- this.cbxInput.FormattingEnabled = true;\r
- this.cbxInput.Location = new System.Drawing.Point(3, 306);\r
- this.cbxInput.Name = "cbxInput";\r
- this.cbxInput.Size = new System.Drawing.Size(413, 21);\r
- this.cbxInput.TabIndex = 0;\r
- this.cbxInput.KeyUp += new System.Windows.Forms.KeyEventHandler(this.cbxInput_KeyUp);\r
- this.cbxInput.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbxInput_KeyDown);\r
- this.cbxInput.TextChanged += new System.EventHandler(this.cbxInput_TextChanged);\r
- // \r
// btnSend\r
// \r
this.btnSend.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));\r
this.btnSend.Enabled = false;\r
- this.btnSend.Location = new System.Drawing.Point(422, 304);\r
+ this.btnSend.Location = new System.Drawing.Point(422, 302);\r
this.btnSend.Name = "btnSend";\r
this.btnSend.Size = new System.Drawing.Size(75, 23);\r
this.btnSend.TabIndex = 1;\r
this.tbtnProfile.Text = "Profile";\r
this.tbtnProfile.Click += new System.EventHandler(this.tbtnProfile_Click);\r
// \r
+ // cbxInput\r
+ // \r
+ this.cbxInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)\r
+ | System.Windows.Forms.AnchorStyles.Right)));\r
+ this.cbxInput.Location = new System.Drawing.Point(3, 304);\r
+ this.cbxInput.Name = "cbxInput";\r
+ this.cbxInput.Size = new System.Drawing.Size(413, 21);\r
+ this.cbxInput.TabIndex = 0;\r
+ this.cbxInput.TextChanged += new System.EventHandler(this.cbxInput_TextChanged);\r
+ this.cbxInput.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbxInput_KeyDown);\r
+ this.cbxInput.KeyUp += new System.Windows.Forms.KeyEventHandler(this.cbxInput_KeyUp);\r
+ // \r
// IMTabWindow\r
// \r
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
#endregion\r
\r
public System.Windows.Forms.RichTextBox rtbIMText;\r
- public System.Windows.Forms.ComboBox cbxInput;\r
+ public ChatInputBox cbxInput;\r
public System.Windows.Forms.Button btnSend;\r
public System.Windows.Forms.ToolStrip toolStrip1;\r
public System.Windows.Forms.ToolStripButton tbtnProfile;\r
\r
private void btnSend_Click(object sender, EventArgs e)\r
{\r
- netcom.SendInstantMessage(cbxInput.Text, target, session);\r
+ netcom.SendInstantMessage(cbxInput.Text.Replace(ChatInputBox.NewlineMarker, "\n"), target, session);\r
this.ClearIMInput();\r
}\r
\r
e.SuppressKeyPress = true;\r
if (cbxInput.Text.Length == 0) return;\r
\r
- netcom.SendInstantMessage(cbxInput.Text, target, session);\r
+ netcom.SendInstantMessage(cbxInput.Text.Replace(ChatInputBox.NewlineMarker, "\n"), target, session);\r
this.ClearIMInput();\r
}\r
\r
private void ClearIMInput()\r
{\r
- cbxInput.Items.Add(cbxInput.Text);\r
cbxInput.Text = string.Empty;\r
}\r
\r
get { return textManager; }\r
set { textManager = value; }\r
}\r
+\r
+ private void chatInput_TextChanged(object sender, EventArgs e)\r
+ {\r
+\r
+ }\r
+\r
+ private void chatInput_KeyDown(object sender, KeyEventArgs e)\r
+ {\r
+\r
+ }\r
+\r
+ private void chatInput_KeyUp(object sender, KeyEventArgs e)\r
+ {\r
+\r
+ }\r
}\r
}\r
<Compile Include="Core\Types\AgentNameTextBox.cs">\r
<SubType>Component</SubType>\r
</Compile>\r
+ <Compile Include="Core\Types\ChatInputBox.cs">\r
+ <SubType>Component</SubType>\r
+ </Compile>\r
<Compile Include="Core\Types\CircularList.cs" />\r
<Compile Include="Core\Types\DettachableControl.cs">\r
<SubType>UserControl</SubType>\r