Fixed: 'Enter' to accept choice in new set dialog box doesn't work.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@861 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-05-18 18:36:48 +00:00
parent 9a72bf6ac1
commit 4c48049453
+10
View File
@@ -161,6 +161,16 @@ void GalleryList::onChar(wxKeyEvent& ev) {
nev.SetDirection(!ev.ShiftDown());
GetParent()->ProcessEvent(nev);
} break;
case WXK_RETURN: {
// same thing: press dialog box default button
wxButton* btn = wxDynamicCast(GetParent()->GetDefaultItem(), wxButton);
if ( btn && btn->IsEnabled() ) {
// if we do have a default button, do press it
wxCommandEvent evt(wxEVT_COMMAND_BUTTON_CLICKED, btn->GetId());
btn->ProcessEvent(evt);
}
}break;
}
}