1
Ich habe einen einfachen wxFrame mit 3 Tasten. Nachdem ich Tab gedrückt habe passiert nichts. Im Forum habe ich festgestellt, dass wxFrame Tab-Button-Events normal verarbeiten und den Fokus zwischen den Controls setzen sollte. Ich habe es mit wxTAB_TRAVERSAL versucht und ohne es, aber sehe wie kein Ergebnis aus.wxFrame verarbeitet keine Tab-Taste
Hier ist mein Code. wxWidgets 3.0.2. Bitte, helfen Sie.
class TabWnd
: public wxFrame
{
public:
TabWnd()
: wxFrame(nullptr,
wxID_ANY,
wxEmptyString,
wxDefaultPosition,
wxDefaultSize,
wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL)
{
wxBoxSizer* sz = new wxBoxSizer(wxVERTICAL);
wxButton* b1 = new wxButton(this, wxID_ANY, wxT("First"));
sz->Add(b1, 0, wxALL, 5);
wxButton* b2 = new wxButton(this, wxID_ANY, wxT("Second"));
sz->Add(b2, 0, wxALL, 5);
wxButton* b3 = new wxButton(this, wxID_ANY, wxT("Third"));
sz->Add(b3, 0, wxALL, 5);
SetSizer(sz);
Layout();
Centre(wxBOTH);
}
};
class WxguiApp
: public wxApp
{
public:
bool OnInit() override
{
TabWnd* mainWnd = new TabWnd();
mainWnd->Show();
SetTopWindow(mainWnd);
return true;
}
};
IMPLEMENT_APP(WxguiApp);