GtkListPeer.java (handleEvent): Fix generation of ActionEvents.
2003-12-02 Fernando Nasser <fnasser@redhat.com> * gnu/java/awt/peer/gtk/GtkListPeer.java (handleEvent): Fix generation of ActionEvents. From-SVN: r74248
This commit is contained in:
parent
b7e0ff4538
commit
26d86d940e
2 changed files with 15 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
|||
2003-12-02 Fernando Nasser <fnasser@redhat.com>
|
||||
|
||||
* gnu/java/awt/peer/gtk/GtkListPeer.java (handleEvent): Fix generation
|
||||
of ActionEvents.
|
||||
|
||||
2003-12-03 Michael Koch <konqueror@gmx.de>
|
||||
|
||||
* java/lang/Class.h (hack_signers): Renamed signers to hack_signers.
|
||||
|
|
|
@ -128,10 +128,12 @@ public class GtkListPeer extends GtkComponentPeer
|
|||
{
|
||||
if (e.getID () == MouseEvent.MOUSE_CLICKED && isEnabled ())
|
||||
{
|
||||
/* Only generate the ActionEvent on the second click of
|
||||
a multiple click */
|
||||
MouseEvent me = (MouseEvent) e;
|
||||
if (!me.isConsumed ()
|
||||
&& (me.getModifiers () & MouseEvent.BUTTON1_MASK) != 0
|
||||
&& me.getClickCount() > 1)
|
||||
&& me.getClickCount() == 2)
|
||||
postActionEvent (((List)awtComponent).getSelectedItem (),
|
||||
me.getModifiers ());
|
||||
}
|
||||
|
@ -140,8 +142,13 @@ public class GtkListPeer extends GtkComponentPeer
|
|||
{
|
||||
KeyEvent ke = (KeyEvent) e;
|
||||
if (!ke.isConsumed () && ke.getKeyCode () == KeyEvent.VK_ENTER)
|
||||
postActionEvent (((List)awtComponent).getSelectedItem (),
|
||||
ke.getModifiers ());
|
||||
{
|
||||
String selectedItem = ((List)awtComponent).getSelectedItem ();
|
||||
|
||||
/* Enter only generates an Action event if something is selected */
|
||||
if (selectedItem != null)
|
||||
postActionEvent (selectedItem, ke.getModifiers ());
|
||||
}
|
||||
}
|
||||
|
||||
super.handleEvent (e);
|
||||
|
|
Loading…
Add table
Reference in a new issue