58 wxDialog(parent, -1, _T("Edit keyboard shortcut"), wxDefaultPosition),
63 wxBoxSizer* sizer =
new wxBoxSizer(wxVERTICAL);
64 wxPanel* panel =
new wxPanel(
this, -1);
65 createContents(panel,
true,
true);
107 key.Prepend(_T(
"ALT - "));
110 key.Prepend(_T(
"CTRL - "));
128 int keycode =
event.GetKeyCode();
132 if (!((keycode >=
int(
'0') && keycode <=
int(
'9')) ||
133 (keycode >=
int(
'A') && keycode <=
int(
'Z')) ||
135 (keycode >= WXK_F1 && keycode <= WXK_F12))) {
143 !(event.AltDown() || event.ControlDown())) {
154 }
else if(keycode >= WXK_F1 && keycode <= WXK_F12) {
179 wxWindow *parent,
bool call_fit,
bool set_sizer) {
181 wxBoxSizer *item0 =
new wxBoxSizer( wxVERTICAL );
182 wxStaticText *item1 =
new wxStaticText( parent, -1,
183 wxT(
"Redefine the shortcut by pressing\n"
184 "keys for the new key combination."),
185 wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
186 item0->Add( item1, 0, wxALIGN_CENTER|wxALL, 10 );
187 wxStaticBox *item3 =
new wxStaticBox( parent, -1, wxT(
"Shortcut:") );
188 wxStaticBoxSizer *item2 =
new wxStaticBoxSizer( item3, wxHORIZONTAL );
191 new wxStaticText(parent,
ID_SHORTCUT, wxT(
""), wxDefaultPosition,
194 item0->Add( item2, 0, wxGROW|wxALL, 5 );
195 wxStaticLine *item5 =
196 new wxStaticLine(parent, -1, wxDefaultPosition, wxSize(20,-1),
198 item0->Add( item5, 0, wxGROW|wxALL, 5 );
199 wxBoxSizer *item6 =
new wxBoxSizer( wxHORIZONTAL );
201 new wxButton(parent, wxID_OK, wxT(
"OK"), wxDefaultPosition,
203 item6->Add( item7, 0, wxALIGN_CENTER|wxALL, 5 );
205 new wxButton(parent, wxID_CANCEL, wxT(
"Cancel"), wxDefaultPosition,
207 item6->Add( item8, 0, wxALIGN_CENTER|wxALL, 5 );
208 item0->Add( item6, 0, wxALIGN_CENTER|wxALL, 5 );
211 parent->SetAutoLayout(
TRUE );
212 parent->SetSizer( item0 );
215 item0->Fit( parent );
216 item0->SetSizeHints( parent );