use stock buttons in generic dialogs
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 15 Aug 2004 15:48:44 +0000 (15:48 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 15 Aug 2004 15:48:44 +0000 (15:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28792 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/dlgcmn.cpp
src/generic/dirdlgg.cpp
src/generic/fdrepdlg.cpp
src/generic/filedlgg.cpp
src/generic/logg.cpp
src/generic/progdlgg.cpp
src/generic/tipdlg.cpp

index 260bb28bc8dcb61b5a1a628a14ba640174865b8e..4894b08cbb7245857f39ad859fdd8aed79a786d3 100644 (file)
@@ -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 );
     }
 
index 0d55d44a801e18ef41ee754e0a71ab7f15f6d82a..548b508c7184cb957982a50f99bb0cbc48b9fd55 100644 (file)
@@ -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 );
index 3c2b2a0465cd2ab0cb2bb3d52f97fbd97c642856..bb7c60a979cbbd72cc697b68f306fe55ab4d1bb2 100644 (file)
@@ -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 )
     {
index e3af6237194bacd9f309e1e4e23e89d4c17d3148..de3170c0358ae723cddc66a327ccd19dbd5dc077 100644 (file)
@@ -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 );
     }
 
index a82efb71637eba9103d4865803fb10a749d832c2..bb9ec867a3d7c3e71e73985937d45c4d69ab8319 100644 (file)
@@ -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
index 10c5e65e9e5f390b35f135c9fc571ae97edcbaed..9d4c2527516d6d8333ac9026dc6cdf65db5bf9c6 100644 (file)
@@ -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__)
index fbea2405e0b8fc3281ca69a0c9d1a5f0d246064c..94370f2542335572a05ed735f0e733dde4b6da49 100644 (file)
@@ -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"));