keyboard event not called on subclass of wxScrolledWindow (on mac)
Riccardo Cohen
rcohen at articque.com
Mon Sep 24 05:15:34 PDT 2007
Hi
I use wx2.9 on windows/mac/linux (but this problem appeared already with
2.7)
I made a little class that inherit from wxScrolledWindow and that handle
all typical events (motion, leftclic, keydown...):
class artwx:public wxScrolledWindow
{
protected:
DECLARE_CLASS(artwx)
DECLARE_EVENT_TABLE()
public:
artwx(wxWindow* parent, wxWindowID id);
virtual ~artwx();
//
void paint(wxPaintEvent& event);
void mouse_motion(wxMouseEvent& event);
void mouse_leftdown(wxMouseEvent& event);
void mouse_rightdown(wxMouseEvent& event);
void mouse_leftup(wxMouseEvent& event);
void mouse_rightup(wxMouseEvent& event);
void mouse_double_click(wxMouseEvent&event);
void key_down(wxKeyEvent& event);
};
for information I call SetFocus() at leftclic event. (if not I do not
get the focus all the time)
I can get all events called, on all plateforms, but on Mac, key_down is
not called.
Now if I replace wxScrolledWindow by wxWindow, then key_down is called.
I found a mail from Robin Dunn in october 2004 saying that container
windows usually gives focus to children windows. Now it works on
windows/linux, why not on mac ? I found nothing about this in the wiki.
Is it possible to redirect focus to the scrolled window itself (on mac) ?
Thanks for any help
--
Très cordialement,
Riccardo Cohen
ligne directe : 02-47-49-63-24
-------------------------------------------
Articque
http://www.articque.com
149 av Général de Gaulle
37230 Fondettes - France
tel : 02-47-49-90-49
fax : 02-47-49-91-49
More information about the wx-users
mailing list