// Purpose: Part of the widgets sample showing wxChoice
// Created: 23.07.07
// Id: $Id$
-// License: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
-IMPLEMENT_WIDGETS_PAGE(ChoiceWidgetsPage, _T("Choice"),
+IMPLEMENT_WIDGETS_PAGE(ChoiceWidgetsPage, wxT("Choice"),
FAMILY_CTRLS | WITH_ITEMS_CTRLS
);
// 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
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);
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);
}
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);
}
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))