how to get RETURN in a derived wxOwnerDrawnComboBox with GTK

Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
Post Reply
giovesas
Earned a small fee
Earned a small fee
Posts: 10
Joined: Mon Sep 29, 2008 6:58 am
Location: Pecetto torinese

how to get RETURN in a derived wxOwnerDrawnComboBox with GTK

Post by giovesas » Tue May 05, 2009 9:10 am

I derived an object from wxOwnerDrawnComboBox. It's a combo that can be edited. But I cannot get the EVT_TEXT_ENTER event when RETURN is pressed.
The DOC says that the wxTE_PROCESS_ENTER is valifd only for WINDOWS.
Any suggetion to solve this problem?
gianni

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria » Wed May 06, 2009 12:30 am

I don't have any clean solution, but you could simply try interrupting key events : http://wiki.wxwidgets.org/Catching_key_events_globally

Though which manual page are you referring too? I can't find this mention

giovesas
Earned a small fee
Earned a small fee
Posts: 10
Joined: Mon Sep 29, 2008 6:58 am
Location: Pecetto torinese

Post by giovesas » Wed May 06, 2009 8:53 am

Thanks for the reply. Now I'll try the suggested solution.
The on line documentation says
# wxTE_PROCESS_ENTER:
The control will generate the event wxEVT_COMMAND_TEXT_ENTER (otherwise pressing Enter key is either processed internally by the control or used for navigation between dialog controls). Windows only.
and no event is generated when ENTER is pressed. I'm working on Linux with wxGTK.
gianni

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria » Thu May 07, 2009 1:21 am

Which wx version is this, and which docs page? I can't see this line : http://docs.wxwidgets.org/stable/wx_wxtextctrl.html

giovesas
Earned a small fee
Earned a small fee
Posts: 10
Joined: Mon Sep 29, 2008 6:58 am
Location: Pecetto torinese

Post by giovesas » Thu May 07, 2009 6:01 am

Normally I use the online doc http://docs.wxwidgets.org/trunk/classes.html that is more detailed, also if I'm working with the 2.8 version.

In the wxComboCtrl windows styles description I found that it's windows only. In the farmer documentation no mention about, but it doesn't work (or I made some mistake).

Now, using the EVT_KEY_DOWN event and filtering the ENTER char, I solved my needs, but I hoped for a more simple solution.
gianni

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria » Thu May 07, 2009 11:55 pm

giovesas wrote:In the farmer documentation no mention about, but it doesn't work (or I made some mistake).
Farmer documentation? cool ;)

This might indeed be a case for bug report / feature request if it's not already in the tracker. good luck

Post Reply