Mnemonics and different containers

Richter, Jörg Joerg.Richter at pdv-FS.de
Wed Oct 25 06:42:24 PDT 2006


(Sorry, send the previous mail to early)

Hi,

I'm using 2.7.1 on MSW

I have the problem that mnemonics for wxStaticText or wxButton don't work between different containers. 

Consider this sample code (pasted in a constructor of a wxFrame):

int x = 0, y = 0;
#define POS(row,col) wxPoint( col*100, row*30 )
#define SIZE(rows,cols) wxSize( cols*100, rows*30 )
wxWindow* p1 = new wxPanel( this );
wxWindow* p = new wxPanel( p1, -1,			POS(0,0), SIZE(2,2) );
new wxStaticText( p, -1, wxT("Nr &1"),	POS(0,0) );
new wxTextCtrl( p, -1, wxT(""),		POS(0,1) );
new wxStaticText( p, -1, wxT("Nr &2"),	POS(1,0) );
new wxTextCtrl( p, -1, wxT(""),		POS(1,1) );
p = new wxPanel( p1, -1,			POS(2,0), SIZE(2,2) );
new wxStaticText( p, -1, wxT("Nr &3"),	POS(0,0) );
new wxTextCtrl( p, -1, wxT(""),		POS(0,1) );
new wxStaticText( p, -1, wxT("Nr &4"),	POS(1,0) );
new wxTextCtrl( p, -1, wxT(""),		POS(1,1) );


It has 2 wxPanel. On every panel are 2 wxStaticText and 2 wxTextCtrl.

Now you can use mnemonics only on one wxPanel. But you can't use them to jump from one wxPanel to the other one. Its possible to use tab to jump to the other panel and now mnemonics are working on the panel only.

This sample works without problems on GTK.

I couldn't find a hint with google. Does anybody know what to do to make this work?


   Jörg




More information about the wx-users mailing list