+ wxStdDialogButtonSizer *sizer = new wxStdDialogButtonSizer();
+
+ wxButton *ok = NULL;
+ wxButton *yes = NULL;
+ wxButton *no = NULL;
+
+ if (flags & wxOK){
+ ok = new wxButton(this, wxID_OK);
+ sizer->AddButton(ok);
+ }
+
+ if (flags & wxCANCEL){
+ wxButton *cancel = new wxButton(this, wxID_CANCEL);
+ sizer->AddButton(cancel);
+ }
+
+ if (flags & wxYES){
+ yes = new wxButton(this, wxID_YES);
+ sizer->AddButton(yes);
+ }
+
+ if (flags & wxNO){
+ no = new wxButton(this, wxID_NO);
+ sizer->AddButton(no);
+ }
+
+ if (flags & wxHELP){
+ wxButton *help = new wxButton(this, wxID_HELP);
+ sizer->AddButton(help);
+ }
+
+ if (flags & wxNO_DEFAULT)
+ {
+ if (no)
+ {
+ no->SetDefault();
+ no->SetFocus();
+ }
+ }
+ else
+ {
+ if (ok)
+ {
+ ok->SetDefault();
+ ok->SetFocus();
+ }
+ else if (yes)
+ {
+ yes->SetDefault();
+ yes->SetFocus();
+ }
+ }
+
+ if (flags & wxOK)
+ SetAffirmativeId(wxID_OK);
+ else if (flags & wxYES)
+ SetAffirmativeId(wxID_YES);
+
+ sizer->Realize();
+
+ return sizer;