Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-tweak.git;a=commitdiff;h=b4a2b4d8258637168593c7736e379a3795ef445c

commit b4a2b4d8258637168593c7736e379a3795ef445c
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Fri Nov 12 13:21:09 2010 +0000

*added shortcut enter for send message

diff --git a/frugal-irc/MainWindow.cs b/frugal-irc/MainWindow.cs
index aa257de..95f00d6 100644
--- a/frugal-irc/MainWindow.cs
+++ b/frugal-irc/MainWindow.cs
@@ -335,8 +335,7 @@ public partial class MainWindow : Gtk.Window
});
//Console.WriteLine(text);
}
-
-       protected virtual void OnBTNSendClicked (object sender, 
System.EventArgs e)
+       private void _sendMessage()
{
if(!_initOk) return;
if(SAI_Envoi.Text=="") return;
@@ -344,6 +343,10 @@ public partial class MainWindow : Gtk.Window
AppendText(SAI_User.Text+" : "+SAI_Envoi.Text);
SAI_Envoi.Text="";
}
+       protected virtual void OnBTNSendClicked (object sender, 
System.EventArgs e)
+       {
+               _sendMessage();
+       }
private static void Inform(string title,string text)
{
try{
@@ -355,5 +358,14 @@ public partial class MainWindow : Gtk.Window
Console.WriteLine(title+" : "+text);
}
}
+               protected virtual void OnSAIEnvoiKeyReleaseEvent (object o, 
Gtk.KeyReleaseEventArgs args)
+               {
+                       if (args.Event.Key.ToString()=="Return")
+                       {
+                               _sendMessage();
+                       }
+               }
+
+
}

diff --git a/frugal-irc/gtk-gui/MainWindow.cs b/frugal-irc/gtk-gui/MainWindow.cs
index b6785cb..273661c 100644
--- a/frugal-irc/gtk-gui/MainWindow.cs
+++ b/frugal-irc/gtk-gui/MainWindow.cs
@@ -216,6 +216,7 @@ public partial class MainWindow
this.Show ();
this.DeleteEvent += new global::Gtk.DeleteEventHandler (this.OnDeleteEvent);
this.BTN_Connect.Clicked += new global::System.EventHandler 
(this.OnBTNConnectClicked);
+               this.SAI_Envoi.KeyReleaseEvent += new 
global::Gtk.KeyReleaseEventHandler (this.OnSAIEnvoiKeyReleaseEvent);
this.BTN_Send.Clicked += new global::System.EventHandler 
(this.OnBTNSendClicked);
}
}
diff --git a/frugal-irc/gtk-gui/gui.stetic b/frugal-irc/gtk-gui/gui.stetic
index 8f8eab5..93b4a67 100644
--- a/frugal-irc/gtk-gui/gui.stetic
+++ b/frugal-irc/gtk-gui/gui.stetic
@@ -154,6 +154,7 @@
<property name="CanFocus">True</property>
<property name="IsEditable">True</property>
<property name="InvisibleChar">•</property>
+                    <signal name="KeyReleaseEvent" 
handler="OnSAIEnvoiKeyReleaseEvent" />
</widget>
<packing>
<property name="Position">0</property>
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to