From c50e42a1223f6da4a07f5c8472a3fe7bf682356a Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 15 Aug 2004 15:48:44 +0000 Subject: [PATCH] use stock buttons in generic dialogs git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28792 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/dlgcmn.cpp | 28 +++++++++++++++++++++------- src/generic/dirdlgg.cpp | 4 ++-- src/generic/fdrepdlg.cpp | 4 ++-- src/generic/filedlgg.cpp | 8 ++++---- src/generic/logg.cpp | 4 ++-- src/generic/progdlgg.cpp | 2 +- src/generic/tipdlg.cpp | 2 +- 7 files changed, 33 insertions(+), 19 deletions(-) diff --git a/src/common/dlgcmn.cpp b/src/common/dlgcmn.cpp index 260bb28bc8..4894b08cbb 100644 --- a/src/common/dlgcmn.cpp +++ b/src/common/dlgcmn.cpp @@ -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 ); } diff --git a/src/generic/dirdlgg.cpp b/src/generic/dirdlgg.cpp index 0d55d44a80..548b508c71 100644 --- a/src/generic/dirdlgg.cpp +++ b/src/generic/dirdlgg.cpp @@ -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 ); diff --git a/src/generic/fdrepdlg.cpp b/src/generic/fdrepdlg.cpp index 3c2b2a0465..bb7c60a979 100644 --- a/src/generic/fdrepdlg.cpp +++ b/src/generic/fdrepdlg.cpp @@ -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 ) { diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp index e3af623719..de3170c035 100644 --- a/src/generic/filedlgg.cpp +++ b/src/generic/filedlgg.cpp @@ -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 ); } diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index a82efb7163..bb9ec867a3 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -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 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 diff --git a/src/generic/progdlgg.cpp b/src/generic/progdlgg.cpp index 10c5e65e9e..9d4c252751 100644 --- a/src/generic/progdlgg.cpp +++ b/src/generic/progdlgg.cpp @@ -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__) diff --git a/src/generic/tipdlg.cpp b/src/generic/tipdlg.cpp index fbea2405e0..94370f2542 100644 --- a/src/generic/tipdlg.cpp +++ b/src/generic/tipdlg.cpp @@ -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")); -- 2.45.2