- // NB: create [Ok] first to get the right tab order
-
- wxButton *ok = (wxButton *) NULL;
- wxButton *cancel = (wxButton *) NULL;
-
- long x = wDialog / 2;
- if ( hasCancel )
- x -= MARGIN_BETWEEN_BUTTONS / 2 + wButton;
- else
- x -= wButton / 2;
-
- ok = new wxButton( this, wxID_OK, labelOk,
- wxPoint(x, y),
- wxSize(wButton, hButton) );
-
- if ( hasCancel )
- {
- x += MARGIN_BETWEEN_BUTTONS + wButton;
- cancel = new wxButton( this, wxID_CANCEL, labelCancel,
- wxPoint(x, y),
- wxSize(wButton, hButton) );
- }
-
- ok->SetDefault();
- ok->SetFocus();
+ CreateStandardButtons(wDialog, y, wButton, hButton, hasCancel);