use stock buttons in generic dialogs
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28792 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -205,26 +205,35 @@ wxSizer *wxDialogBase::CreateButtonSizer( long flags )
|
||||
|
||||
if (flags & wxYES)
|
||||
{
|
||||
yes = new wxButton( this, wxID_YES, _("Yes"),wxDefaultPosition,wxDefaultSize,wxCLIP_SIBLINGS );
|
||||
yes = new wxButton(this, wxID_YES, wxSTOCK_YES,
|
||||
wxEmptyString, wxDefaultPosition, wxCLIP_SIBLINGS);
|
||||
inner_yes_no->Add( yes, 0, wxLEFT|wxRIGHT, margin );
|
||||
}
|
||||
if (flags & wxNO)
|
||||
{
|
||||
no = new wxButton( this, wxID_NO, _("No"),wxDefaultPosition,wxDefaultSize,wxCLIP_SIBLINGS );
|
||||
no = new wxButton(this, wxID_NO, wxSTOCK_NO,
|
||||
wxEmptyString, wxDefaultPosition, wxCLIP_SIBLINGS);
|
||||
inner_yes_no->Add( no, 0, wxLEFT|wxRIGHT, margin );
|
||||
}
|
||||
|
||||
if (flags & wxOK)
|
||||
{
|
||||
ok = new wxButton( this, wxID_OK, _("OK"),wxDefaultPosition,wxDefaultSize,wxCLIP_SIBLINGS );
|
||||
ok = new wxButton(this, wxID_OK, wxSTOCK_OK,
|
||||
wxEmptyString, wxDefaultPosition, wxCLIP_SIBLINGS);
|
||||
inner_rest->Add( ok, 0, wxLEFT|wxRIGHT, margin );
|
||||
}
|
||||
|
||||
if (flags & wxFORWARD)
|
||||
inner_rest->Add( new wxButton( this, wxID_FORWARD, _("Forward"),wxDefaultPosition,wxDefaultSize,wxCLIP_SIBLINGS ), 0, wxLEFT|wxRIGHT, margin );
|
||||
inner_rest->Add(new wxButton(this, wxID_FORWARD, wxSTOCK_GO_FORWARD,
|
||||
wxEmptyString, wxDefaultPosition,
|
||||
wxCLIP_SIBLINGS),
|
||||
0, wxLEFT|wxRIGHT, margin);
|
||||
|
||||
if (flags & wxBACKWARD)
|
||||
inner_rest->Add( new wxButton( this, wxID_BACKWARD, _("Backward"),wxDefaultPosition,wxDefaultSize,wxCLIP_SIBLINGS ), 0, wxLEFT|wxRIGHT, margin );
|
||||
inner_rest->Add(new wxButton(this, wxID_BACKWARD, wxSTOCK_GO_BACK,
|
||||
wxEmptyString, wxDefaultPosition,
|
||||
wxCLIP_SIBLINGS),
|
||||
0, wxLEFT|wxRIGHT, margin);
|
||||
|
||||
if (flags & wxSETUP)
|
||||
inner_rest->Add( new wxButton( this, wxID_SETUP, _("Setup"),wxDefaultPosition,wxDefaultSize,wxCLIP_SIBLINGS ), 0, wxLEFT|wxRIGHT, margin );
|
||||
@@ -233,11 +242,16 @@ wxSizer *wxDialogBase::CreateButtonSizer( long flags )
|
||||
inner_rest->Add( new wxButton( this, wxID_MORE, _("More..."),wxDefaultPosition,wxDefaultSize,wxCLIP_SIBLINGS ), 0, wxLEFT|wxRIGHT, margin );
|
||||
|
||||
if (flags & wxHELP)
|
||||
inner_rest->Add( new wxButton( this, wxID_HELP, _("Help"),wxDefaultPosition,wxDefaultSize,wxCLIP_SIBLINGS ), 0, wxLEFT|wxRIGHT, margin );
|
||||
inner_rest->Add(new wxButton(this, wxID_HELP, wxSTOCK_HELP,
|
||||
wxEmptyString, wxDefaultPosition,
|
||||
wxCLIP_SIBLINGS),
|
||||
0, wxLEFT|wxRIGHT, margin);
|
||||
|
||||
if (flags & wxCANCEL)
|
||||
{
|
||||
wxButton *cancel = new wxButton( this, wxID_CANCEL, _("Cancel"),wxDefaultPosition,wxDefaultSize,wxCLIP_SIBLINGS );
|
||||
wxButton *cancel = new wxButton(this, wxID_CANCEL, wxSTOCK_CANCEL,
|
||||
wxEmptyString, wxDefaultPosition,
|
||||
wxCLIP_SIBLINGS);
|
||||
inner_rest->Add( cancel, 0, wxLEFT|wxRIGHT, margin );
|
||||
}
|
||||
|
||||
|
@@ -150,9 +150,9 @@ wxGenericDirDialog::wxGenericDirDialog(wxWindow* parent, const wxString& title,
|
||||
buttonsizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
// OK and Cancel button should be at the right bottom
|
||||
wxButton* okButton = new wxButton(this, wxID_OK, _("OK"));
|
||||
wxButton* okButton = new wxButton(this, wxID_OK, wxSTOCK_OK);
|
||||
buttonsizer->Add( okButton, 0, wxLEFT|wxRIGHT, 10 );
|
||||
wxButton* cancelButton = new wxButton(this, wxID_CANCEL, _("Cancel"));
|
||||
wxButton* cancelButton = new wxButton(this, wxID_CANCEL, wxSTOCK_CANCEL);
|
||||
buttonsizer->Add( cancelButton, 0, wxLEFT|wxRIGHT, 10 );
|
||||
|
||||
topsizer->Add( buttonsizer, 0, wxLEFT|wxTOP|wxBOTTOM | wxALIGN_RIGHT, 10 );
|
||||
|
@@ -159,9 +159,9 @@ bool wxGenericFindReplaceDialog::Create(wxWindow *parent,
|
||||
|
||||
wxBoxSizer *bttnsizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
bttnsizer->Add(new wxButton(this, wxID_FIND, _("&Find")), 0, wxALL, 3);
|
||||
bttnsizer->Add(new wxButton(this, wxID_FIND, wxSTOCK_FIND), 0, wxALL, 3);
|
||||
|
||||
bttnsizer->Add(new wxButton(this, wxID_CANCEL, _("&Cancel")), 0, wxALL, 3);
|
||||
bttnsizer->Add(new wxButton(this, wxID_CANCEL, wxSTOCK_CANCEL), 0, wxALL, 3);
|
||||
|
||||
if ( style & wxFR_REPLACEDIALOG )
|
||||
{
|
||||
|
@@ -993,8 +993,8 @@ wxGenericFileDialog::wxGenericFileDialog(wxWindow *parent,
|
||||
textsizer->Add( m_choice, 1, wxCENTER|wxALL, 5 );
|
||||
|
||||
buttonsizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
buttonsizer->Add( new wxButton( this, wxID_OK, _("OK") ), 0, wxCENTER | wxALL, 5 );
|
||||
buttonsizer->Add( new wxButton( this, wxID_CANCEL, _("Cancel") ), 0, wxCENTER | wxALL, 5 );
|
||||
buttonsizer->Add( new wxButton( this, wxID_OK, wxSTOCK_OK ), 0, wxCENTER | wxALL, 5 );
|
||||
buttonsizer->Add( new wxButton( this, wxID_CANCEL, wxSTOCK_CANCEL ), 0, wxCENTER | wxALL, 5 );
|
||||
mainsizer->Add( buttonsizer, 0, wxALIGN_RIGHT );
|
||||
}
|
||||
else
|
||||
@@ -1004,7 +1004,7 @@ wxGenericFileDialog::wxGenericFileDialog(wxWindow *parent,
|
||||
wxBoxSizer *textsizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
m_text = new wxTextCtrl( this, ID_TEXT, m_fileName, wxDefaultPosition, wxDefaultSize, wxPROCESS_ENTER );
|
||||
textsizer->Add( m_text, 1, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 );
|
||||
textsizer->Add( new wxButton( this, wxID_OK, _("OK") ), 0, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 );
|
||||
textsizer->Add( new wxButton( this, wxID_OK, wxSTOCK_OK ), 0, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 );
|
||||
mainsizer->Add( textsizer, 0, wxEXPAND );
|
||||
|
||||
wxBoxSizer *choicesizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
@@ -1013,7 +1013,7 @@ wxGenericFileDialog::wxGenericFileDialog(wxWindow *parent,
|
||||
m_check = new wxCheckBox( this, ID_CHECK, _("Show hidden files") );
|
||||
m_check->SetValue( ms_lastShowHidden );
|
||||
choicesizer->Add( m_check, 0, wxCENTER|wxALL, 10 );
|
||||
choicesizer->Add( new wxButton( this, wxID_CANCEL, _("Cancel") ), 0, wxCENTER | wxALL, 10 );
|
||||
choicesizer->Add( new wxButton( this, wxID_CANCEL, wxSTOCK_CANCEL ), 0, wxCENTER | wxALL, 10 );
|
||||
mainsizer->Add( choicesizer, 0, wxEXPAND );
|
||||
}
|
||||
|
||||
|
@@ -744,7 +744,7 @@ wxLogDialog::wxLogDialog(wxWindow *parent,
|
||||
// this "Ok" button has wxID_CANCEL id - not very logical, but this allows
|
||||
// to close the log dialog with <Esc> which wouldn't work otherwise (as it
|
||||
// translates into click on cancel button)
|
||||
wxButton *btnOk = new wxButton(this, wxID_CANCEL, _("OK"));
|
||||
wxButton *btnOk = new wxButton(this, wxID_CANCEL, wxSTOCK_OK);
|
||||
sizerButtons->Add(btnOk, 0, wxCENTRE | wxBOTTOM, MARGIN/2);
|
||||
m_btnDetails = new wxButton(this, wxID_MORE, ms_details + EXPAND_SUFFIX);
|
||||
sizerButtons->Add(m_btnDetails, 0, wxCENTRE | wxTOP, MARGIN/2 - 1);
|
||||
@@ -820,7 +820,7 @@ void wxLogDialog::CreateDetailsControls()
|
||||
{
|
||||
// create the save button and separator line if possible
|
||||
#if wxUSE_FILE
|
||||
m_btnSave = new wxButton(this, wxID_SAVE, _("&Save..."));
|
||||
m_btnSave = new wxButton(this, wxID_SAVE, wxSTOCK_SAVE);
|
||||
#endif // wxUSE_FILE
|
||||
|
||||
#if wxUSE_STATLINE
|
||||
|
@@ -190,7 +190,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
|
||||
|
||||
if ( hasAbortButton )
|
||||
{
|
||||
m_btnAbort = new wxButton(this, wxID_CANCEL, _("Cancel"));
|
||||
m_btnAbort = new wxButton(this, wxID_CANCEL, wxSTOCK_CANCEL);
|
||||
|
||||
// Windows dialogs usually have buttons in the lower right corner
|
||||
#if defined(__WXMSW__) || defined(__WXPM__)
|
||||
|
@@ -225,7 +225,7 @@ wxTipDialog::wxTipDialog(wxWindow *parent,
|
||||
// 1) create all controls in tab order
|
||||
|
||||
#ifndef __SMARTPHONE__
|
||||
wxButton *btnClose = new wxButton(this, wxID_CANCEL, _("&Close"));
|
||||
wxButton *btnClose = new wxButton(this, wxID_CANCEL, wxSTOCK_CLOSE);
|
||||
#endif
|
||||
|
||||
m_checkbox = new wxCheckBox(this, wxID_ANY, _("&Show tips at startup"));
|
||||
|
Reference in New Issue
Block a user