X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a236aa2058ccf3d36e9cafc20fa7375080c4be50..e1efca652844273c3e8d32c7e5f442b87e455ca7:/samples/widgets/choice.cpp?ds=sidebyside diff --git a/samples/widgets/choice.cpp b/samples/widgets/choice.cpp index 872c91a741..97dab56f0e 100644 --- a/samples/widgets/choice.cpp +++ b/samples/widgets/choice.cpp @@ -4,7 +4,7 @@ // Purpose: Part of the widgets sample showing wxChoice // Created: 23.07.07 // Id: $Id$ -// License: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -184,7 +184,7 @@ END_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(ChoiceWidgetsPage, _T("Choice"), +IMPLEMENT_WIDGETS_PAGE(ChoiceWidgetsPage, wxT("Choice"), FAMILY_CTRLS | WITH_ITEMS_CTRLS ); @@ -213,66 +213,66 @@ void ChoiceWidgetsPage::CreateContent() // left pane wxStaticBox *box = new wxStaticBox(this, wxID_ANY, - _T("&Set choice parameters")); + wxT("&Set choice parameters")); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); static const wxString modes[] = { - _T("single"), - _T("extended"), - _T("multiple"), + wxT("single"), + wxT("extended"), + wxT("multiple"), }; - m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Sort items")); + m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Sort items")); - wxButton *btn = new wxButton(this, ChoicePage_Reset, _T("&Reset")); + wxButton *btn = new wxButton(this, ChoicePage_Reset, wxT("&Reset")); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, - _T("&Change choice contents")); + wxT("&Change choice contents")); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ChoicePage_Add, _T("&Add this string")); - m_textAdd = new wxTextCtrl(this, ChoicePage_AddText, _T("test item 0")); + btn = new wxButton(this, ChoicePage_Add, wxT("&Add this string")); + m_textAdd = new wxTextCtrl(this, ChoicePage_AddText, wxT("test item 0")); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textAdd, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ChoicePage_AddSeveral, _T("&Insert a few strings")); + btn = new wxButton(this, ChoicePage_AddSeveral, wxT("&Insert a few strings")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ChoicePage_AddMany, _T("Add &many strings")); + btn = new wxButton(this, ChoicePage_AddMany, wxT("Add &many strings")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ChoicePage_Change, _T("C&hange current")); + btn = new wxButton(this, ChoicePage_Change, wxT("C&hange current")); m_textChange = new wxTextCtrl(this, ChoicePage_ChangeText, wxEmptyString); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textChange, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ChoicePage_Delete, _T("&Delete this item")); + btn = new wxButton(this, ChoicePage_Delete, wxT("&Delete this item")); m_textDelete = new wxTextCtrl(this, ChoicePage_DeleteText, wxEmptyString); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textDelete, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ChoicePage_DeleteSel, _T("Delete &selection")); + btn = new wxButton(this, ChoicePage_DeleteSel, wxT("Delete &selection")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ChoicePage_Clear, _T("&Clear")); + btn = new wxButton(this, ChoicePage_Clear, wxT("&Clear")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ChoicePage_ContainerTests, _T("Run &tests")); + btn = new wxButton(this, ChoicePage_ContainerTests, wxT("Run &tests")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); // right pane wxSizer *sizerRight = new wxBoxSizer(wxVERTICAL); m_choice = new wxChoice(this, ChoicePage_Choice); - sizerRight->Add(m_choice, 1, wxGROW | wxALL, 5); + sizerRight->Add(m_choice, 0, wxALL | wxGROW, 5); sizerRight->SetMinSize(150, 0); m_sizerChoice = sizerRight; // save it to modify it later @@ -380,7 +380,7 @@ void ChoiceWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event)) if ( !m_textAdd->IsModified() ) { // update the default string - m_textAdd->SetValue(wxString::Format(_T("test item %u"), ++s_item)); + m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); } m_choice->Append(s); @@ -392,7 +392,7 @@ void ChoiceWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) wxArrayString strings; for ( unsigned int n = 0; n < 1000; n++ ) { - strings.Add(wxString::Format(_T("item #%u"), n)); + strings.Add(wxString::Format(wxT("item #%u"), n)); } m_choice->Append(strings); } @@ -400,9 +400,9 @@ void ChoiceWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) void ChoiceWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event)) { wxArrayString items; - items.Add(_T("First")); - items.Add(_T("another one")); - items.Add(_T("and the last (very very very very very very very very very very long) one")); + items.Add(wxT("First")); + items.Add(wxT("another one")); + items.Add(wxT("and the last (very very very very very very very very very very long) one")); m_choice->Insert(items, 0); } @@ -437,12 +437,9 @@ void ChoiceWidgetsPage::OnUpdateUIAddSeveral(wxUpdateUIEvent& event) void ChoiceWidgetsPage::OnChoice(wxCommandEvent& event) { long sel = event.GetSelection(); - m_textDelete->SetValue(wxString::Format(_T("%ld"), sel)); + m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel)); - if (event.IsSelection()) - wxLogMessage(_T("Choice item %ld selected"), sel); - else - wxLogMessage(_T("Choice item %ld deselected"), sel); + wxLogMessage(wxT("Choice item %ld selected"), sel); } void ChoiceWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))