Remove more wxT() macros from samples

Also use wxString instead of wxChar* strings.

Closes https://github.com/wxWidgets/wxWidgets/pull/950
This commit is contained in:
Blake Eryx
2018-09-28 21:45:15 -04:00
committed by Vadim Zeitlin
parent 480047ee9a
commit b70ed2d8c8
67 changed files with 1926 additions and 1932 deletions

View File

@@ -109,7 +109,7 @@ wxEND_EVENT_TABLE()
// ============================================================================
IMPLEMENT_WIDGETS_PAGE(ActivityIndicatorWidgetsPage,
wxT("ActivityIndicator"), NATIVE_CTRLS);
"ActivityIndicator", NATIVE_CTRLS);
void ActivityIndicatorWidgetsPage::CreateContent()
{

View File

@@ -242,7 +242,7 @@ wxEND_EVENT_TABLE()
#define NATIVE_OR_GENERIC_CTRLS GENERIC_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(BitmapComboBoxWidgetsPage, wxT("BitmapCombobox"),
IMPLEMENT_WIDGETS_PAGE(BitmapComboBoxWidgetsPage, "BitmapCombobox",
NATIVE_OR_GENERIC_CTRLS | WITH_ITEMS_CTRLS | COMBO_CTRLS
);
@@ -298,39 +298,39 @@ void BitmapComboBoxWidgetsPage::CreateContent()
wxSizer *sizerLeft = new wxBoxSizer(wxVERTICAL);
// left pane - style box
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style"));
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style");
// should be in sync with ComboKind_XXX values
static const wxString kinds[] =
{
wxT("default"),
wxT("simple"),
wxT("drop down"),
"default",
"simple",
"drop down",
};
m_radioKind = new wxRadioBox(this, wxID_ANY, wxT("Combobox &kind:"),
m_radioKind = new wxRadioBox(this, wxID_ANY, "Combobox &kind:",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(kinds), kinds,
1, wxRA_SPECIFY_COLS);
wxSizer *sizerStyle = new wxStaticBoxSizer(box, wxVERTICAL);
m_chkSort = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Sort items"));
m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Read only"));
m_chkSort = CreateCheckBoxAndAddToSizer(sizerStyle, "&Sort items");
m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerStyle, "&Read only");
wxButton *btn = new wxButton(this, BitmapComboBoxPage_Reset, wxT("&Reset"));
wxButton *btn = new wxButton(this, BitmapComboBoxPage_Reset, "&Reset");
sizerStyle->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 3);
sizerLeft->Add(sizerStyle, wxSizerFlags().Expand());
sizerLeft->Add(m_radioKind, 0, wxGROW | wxALL, 5);
// left pane - other options box
box = new wxStaticBox(this, wxID_ANY, wxT("Demo options"));
box = new wxStaticBox(this, wxID_ANY, "Demo options");
wxSizer *sizerOptions = new wxStaticBoxSizer(box, wxVERTICAL);
sizerRow = CreateSizerWithSmallTextAndLabel(wxT("Control &height:"),
sizerRow = CreateSizerWithSmallTextAndLabel("Control &height:",
BitmapComboBoxPage_ChangeHeight,
&m_textChangeHeight);
m_textChangeHeight->SetSize(20, wxDefaultCoord);
@@ -340,42 +340,42 @@ void BitmapComboBoxWidgetsPage::CreateContent()
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY,
wxT("&Change wxBitmapComboBox contents"));
"&Change wxBitmapComboBox contents");
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
btn = new wxButton(this, BitmapComboBoxPage_ContainerTests, wxT("Run &tests"));
btn = new wxButton(this, BitmapComboBoxPage_ContainerTests, "Run &tests");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
#if wxUSE_IMAGE
btn = new wxButton(this, BitmapComboBoxPage_AddWidgetIcons, wxT("Add &widget icons"));
btn = new wxButton(this, BitmapComboBoxPage_AddWidgetIcons, "Add &widget icons");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, BitmapComboBoxPage_LoadFromFile, wxT("Insert image from &file"));
btn = new wxButton(this, BitmapComboBoxPage_LoadFromFile, "Insert image from &file");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, BitmapComboBoxPage_SetFromFile, wxT("&Set image from file"));
btn = new wxButton(this, BitmapComboBoxPage_SetFromFile, "&Set image from file");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
#endif
btn = new wxButton(this, BitmapComboBoxPage_AddSeveralWithImages, wxT("A&ppend a few strings with images"));
btn = new wxButton(this, BitmapComboBoxPage_AddSeveralWithImages, "A&ppend a few strings with images");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, BitmapComboBoxPage_AddSeveral, wxT("Append a &few strings"));
btn = new wxButton(this, BitmapComboBoxPage_AddSeveral, "Append a &few strings");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, BitmapComboBoxPage_AddMany, wxT("Append &many strings"));
btn = new wxButton(this, BitmapComboBoxPage_AddMany, "Append &many strings");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(BitmapComboBoxPage_Delete,
wxT("&Delete this item"),
"&Delete this item",
BitmapComboBoxPage_DeleteText,
&m_textDelete);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, BitmapComboBoxPage_DeleteSel, wxT("Delete &selection"));
btn = new wxButton(this, BitmapComboBoxPage_DeleteSel, "Delete &selection");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, BitmapComboBoxPage_Clear, wxT("&Clear"));
btn = new wxButton(this, BitmapComboBoxPage_Clear, "&Clear");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
#if wxUSE_IMAGE
@@ -432,7 +432,7 @@ void BitmapComboBoxWidgetsPage::CreateCombo()
switch ( m_radioKind->GetSelection() )
{
default:
wxFAIL_MSG( wxT("unknown combo kind") );
wxFAIL_MSG( "unknown combo kind" );
// fall through
case ComboKind_Default:
@@ -512,7 +512,7 @@ void BitmapComboBoxWidgetsPage::OnButtonChange(wxCommandEvent& WXUNUSED(event))
#ifndef __WXGTK__
m_combobox->SetString(sel, m_textChange->GetValue());
#else
wxLogMessage(wxT("Not implemented in wxGTK"));
wxLogMessage("Not implemented in wxGTK");
#endif
}
}
@@ -551,7 +551,7 @@ void BitmapComboBoxWidgetsPage::OnButtonInsert(wxCommandEvent& WXUNUSED(event))
if ( !m_textInsert->IsModified() )
{
// update the default string
m_textInsert->SetValue(wxString::Format(wxT("test item %u"), ++s_item));
m_textInsert->SetValue(wxString::Format("test item %u", ++s_item));
}
int sel = m_combobox->GetSelection();
@@ -595,15 +595,15 @@ void BitmapComboBoxWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event))
// "many" means 1000 here
for ( unsigned int n = 0; n < 1000; n++ )
{
m_combobox->Append(wxString::Format(wxT("item #%u"), n));
m_combobox->Append(wxString::Format("item #%u", n));
}
}
void BitmapComboBoxWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event))
{
m_combobox->Append(wxT("First"));
m_combobox->Append(wxT("another one"));
m_combobox->Append(wxT("and the last (very very very very very very very very very very long) one"));
m_combobox->Append("First");
m_combobox->Append("another one");
m_combobox->Append("and the last (very very very very very very very very very very long) one");
}
void BitmapComboBoxWidgetsPage::OnButtonAddSeveralWithImages(wxCommandEvent& WXUNUSED(event))
@@ -640,10 +640,10 @@ void BitmapComboBoxWidgetsPage::RescaleImage(wxImage& image, int w, int h)
if ( isFirstScale && m_combobox->GetCount() > 0 )
{
wxMessageBox( wxT("wxBitmapComboBox normally only supports images of one size. ")
wxT("However, for demonstration purposes, loaded bitmaps are scaled to fit ")
wxT("using wxImage::Rescale."),
wxT("Notice"),
wxMessageBox( "wxBitmapComboBox normally only supports images of one size. "
"However, for demonstration purposes, loaded bitmaps are scaled to fit "
"using wxImage::Rescale.",
"Notice",
wxOK,
this );
@@ -658,32 +658,32 @@ void BitmapComboBoxWidgetsPage::LoadWidgetImages( wxArrayString* strings, wxImag
{
wxFileName fn;
fn.AssignCwd();
fn.AppendDir(wxT("icons"));
fn.AppendDir("icons");
wxSetCursor(*wxHOURGLASS_CURSOR);
if ( !wxDir::Exists(fn.GetFullPath()) ||
!wxDir::GetAllFiles(fn.GetFullPath(),strings,wxT("*.xpm")) )
!wxDir::GetAllFiles(fn.GetFullPath(),strings,"*.xpm") )
{
// Try ../../samples/widgets/icons
fn.RemoveLastDir();
fn.RemoveLastDir();
fn.AppendDir(wxT("icons"));
fn.AppendDir("icons");
if ( !wxDir::Exists(fn.GetFullPath()) ||
!wxDir::GetAllFiles(fn.GetFullPath(),strings,wxT("*.xpm")) )
!wxDir::GetAllFiles(fn.GetFullPath(),strings,"*.xpm") )
{
// Try ../../../samples/widgets/icons
fn.AssignCwd();
fn.RemoveLastDir();
fn.RemoveLastDir();
fn.RemoveLastDir();
fn.AppendDir(wxT("samples"));
fn.AppendDir(wxT("widgets"));
fn.AppendDir(wxT("icons"));
fn.AppendDir("samples");
fn.AppendDir("widgets");
fn.AppendDir("icons");
if ( !wxDir::Exists(fn.GetFullPath()) ||
!wxDir::GetAllFiles(fn.GetFullPath(),strings,wxT("*.xpm")) )
!wxDir::GetAllFiles(fn.GetFullPath(),strings,"*.xpm") )
{
wxLogWarning(wxT("Could not load widget icons."));
wxLogWarning("Could not load widget icons.");
wxSetCursor(*wxSTANDARD_CURSOR);
return;
}
@@ -703,7 +703,7 @@ void BitmapComboBoxWidgetsPage::LoadWidgetImages( wxArrayString* strings, wxImag
wxString name = fn.GetName();
// Handle few exceptions
if ( name == wxT("bmpbtn") )
if ( name == "bmpbtn" )
{
strings->RemoveAt(i);
i--;
@@ -802,26 +802,26 @@ void BitmapComboBoxWidgetsPage::OnComboText(wxCommandEvent& event)
wxString s = event.GetString();
wxASSERT_MSG( s == m_combobox->GetValue(),
wxT("event and combobox values should be the same") );
"event and combobox values should be the same" );
if (event.GetEventType() == wxEVT_TEXT_ENTER)
{
wxLogMessage(wxT("BitmapCombobox enter pressed (now '%s')"), s.c_str());
wxLogMessage("BitmapCombobox enter pressed (now '%s')", s.c_str());
}
else
{
wxLogMessage(wxT("BitmapCombobox text changed (now '%s')"), s.c_str());
wxLogMessage("BitmapCombobox text changed (now '%s')", s.c_str());
}
}
void BitmapComboBoxWidgetsPage::OnComboBox(wxCommandEvent& event)
{
long sel = event.GetInt();
m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel));
m_textDelete->SetValue(wxString::Format("%ld", sel));
wxLogMessage(wxT("BitmapCombobox item %ld selected"), sel);
wxLogMessage("BitmapCombobox item %ld selected", sel);
wxLogMessage(wxT("BitmapCombobox GetValue(): %s"), m_combobox->GetValue().c_str() );
wxLogMessage("BitmapCombobox GetValue(): %s", m_combobox->GetValue().c_str() );
}
void BitmapComboBoxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
@@ -876,7 +876,7 @@ wxBitmap BitmapComboBoxWidgetsPage::LoadBitmap(const wxString& WXUNUSED(filepath
wxBitmap BitmapComboBoxWidgetsPage::QueryBitmap(wxString* pStr)
{
wxString filepath = wxLoadFileSelector(wxT("image"),
wxString filepath = wxLoadFileSelector("image",
wxEmptyString,
wxEmptyString,
this);
@@ -897,7 +897,7 @@ wxBitmap BitmapComboBoxWidgetsPage::QueryBitmap(wxString* pStr)
if (bitmap.IsOk())
{
wxLogDebug(wxT("%i, %i"),bitmap.GetWidth(), bitmap.GetHeight());
wxLogDebug("%i, %i",bitmap.GetWidth(), bitmap.GetHeight());
}
::wxSetCursor( *wxSTANDARD_CURSOR );
@@ -936,12 +936,12 @@ wxBitmap BitmapComboBoxWidgetsPage::CreateBitmap(const wxColour& colour)
void BitmapComboBoxWidgetsPage::OnDropDown(wxCommandEvent& WXUNUSED(event))
{
wxLogMessage(wxT("Combobox dropped down"));
wxLogMessage("Combobox dropped down");
}
void BitmapComboBoxWidgetsPage::OnCloseUp(wxCommandEvent& WXUNUSED(event))
{
wxLogMessage(wxT("Combobox closed up"));
wxLogMessage("Combobox closed up");
}
#endif // wxUSE_BITMAPCOMBOBOX

View File

@@ -197,7 +197,7 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(ButtonWidgetsPage, wxT("Button"), FAMILY_CTRLS );
IMPLEMENT_WIDGETS_PAGE(ButtonWidgetsPage, "Button", FAMILY_CTRLS );
ButtonWidgetsPage::ButtonWidgetsPage(WidgetsBookCtrl *book,
wxImageList *imaglist)
@@ -236,21 +236,21 @@ void ButtonWidgetsPage::CreateContent()
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style"));
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style");
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
m_chkBitmapOnly = CreateCheckBoxAndAddToSizer(sizerLeft, "&Bitmap only");
m_chkTextAndBitmap = CreateCheckBoxAndAddToSizer(sizerLeft, "Text &and bitmap");
m_chkFit = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Fit exactly"));
m_chkAuthNeeded = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Require a&uth"));
m_chkFit = CreateCheckBoxAndAddToSizer(sizerLeft, "&Fit exactly");
m_chkAuthNeeded = CreateCheckBoxAndAddToSizer(sizerLeft, "Require a&uth");
#if wxUSE_COMMANDLINKBUTTON
m_chkCommandLink = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Use command &link button"));
m_chkCommandLink = CreateCheckBoxAndAddToSizer(sizerLeft, "Use command &link button");
#endif
#if wxUSE_MARKUP
m_chkUseMarkup = CreateCheckBoxAndAddToSizer(sizerLeft, "Interpret &markup");
#endif // wxUSE_MARKUP
m_chkDefault = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Default"));
m_chkDefault = CreateCheckBoxAndAddToSizer(sizerLeft, "&Default");
m_chkUseBitmapClass = CreateCheckBoxAndAddToSizer(sizerLeft,
"Use wxBitmapButton");
@@ -286,22 +286,22 @@ void ButtonWidgetsPage::CreateContent()
// should be in sync with enums Button[HV]Align!
static const wxString halign[] =
{
wxT("left"),
wxT("centre"),
wxT("right"),
"left",
"centre",
"right",
};
static const wxString valign[] =
{
wxT("top"),
wxT("centre"),
wxT("bottom"),
"top",
"centre",
"bottom",
};
m_radioHAlign = new wxRadioBox(this, wxID_ANY, wxT("&Horz alignment"),
m_radioHAlign = new wxRadioBox(this, wxID_ANY, "&Horz alignment",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(halign), halign);
m_radioVAlign = new wxRadioBox(this, wxID_ANY, wxT("&Vert alignment"),
m_radioVAlign = new wxRadioBox(this, wxID_ANY, "&Vert alignment",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(valign), valign);
@@ -310,26 +310,26 @@ void ButtonWidgetsPage::CreateContent()
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
wxButton *btn = new wxButton(this, ButtonPage_Reset, wxT("&Reset"));
wxButton *btn = new wxButton(this, ButtonPage_Reset, "&Reset");
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Operations"));
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Operations");
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxSizer *sizerRow = CreateSizerWithTextAndButton(ButtonPage_ChangeLabel,
wxT("Change label"),
"Change label",
wxID_ANY,
&m_textLabel);
m_textLabel->SetValue(wxT("&Press me!"));
m_textLabel->SetValue("&Press me!");
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
#if wxUSE_COMMANDLINKBUTTON
m_sizerNote = CreateSizerWithTextAndButton(ButtonPage_ChangeNote,
wxT("Change note"),
"Change note",
wxID_ANY,
&m_textNote);
m_textNote->SetValue(wxT("Writes down button clicks in the log."));
m_textNote->SetValue("Writes down button clicks in the log.");
sizerMiddle->Add(m_sizerNote, 0, wxALL | wxGROW, 5);
#endif
@@ -415,7 +415,7 @@ void ButtonWidgetsPage::CreateButton()
break;
default:
wxFAIL_MSG(wxT("unexpected radiobox selection"));
wxFAIL_MSG("unexpected radiobox selection");
// fall through
case ButtonHAlign_Centre:
@@ -433,7 +433,7 @@ void ButtonWidgetsPage::CreateButton()
break;
default:
wxFAIL_MSG(wxT("unexpected radiobox selection"));
wxFAIL_MSG("unexpected radiobox selection");
// fall through
case ButtonVAlign_Centre:
@@ -456,22 +456,22 @@ void ButtonWidgetsPage::CreateButton()
if ( m_chkUseBitmapClass->GetValue() )
{
bbtn = new wxBitmapButton(this, ButtonPage_Button,
CreateBitmap(wxT("normal")),
CreateBitmap("normal"),
wxDefaultPosition, wxDefaultSize, flags);
}
else
{
bbtn = new wxButton(this, ButtonPage_Button);
bbtn->SetBitmapLabel(CreateBitmap(wxT("normal")));
bbtn->SetBitmapLabel(CreateBitmap("normal"));
}
if ( m_chkUsePressed->GetValue() )
bbtn->SetBitmapPressed(CreateBitmap(wxT("pushed")));
bbtn->SetBitmapPressed(CreateBitmap("pushed"));
if ( m_chkUseFocused->GetValue() )
bbtn->SetBitmapFocus(CreateBitmap(wxT("focused")));
bbtn->SetBitmapFocus(CreateBitmap("focused"));
if ( m_chkUseCurrent->GetValue() )
bbtn->SetBitmapCurrent(CreateBitmap(wxT("hover")));
bbtn->SetBitmapCurrent(CreateBitmap("hover"));
if ( m_chkUseDisabled->GetValue() )
bbtn->SetBitmapDisabled(CreateBitmap(wxT("disabled")));
bbtn->SetBitmapDisabled(CreateBitmap("disabled"));
m_button = bbtn;
#if wxUSE_COMMANDLINKBUTTON
m_cmdLnkButton = NULL;
@@ -611,7 +611,7 @@ void ButtonWidgetsPage::OnButtonChangeNote(wxCommandEvent& WXUNUSED(event))
void ButtonWidgetsPage::OnButton(wxCommandEvent& WXUNUSED(event))
{
wxLogMessage(wxT("Test button clicked."));
wxLogMessage("Test button clicked.");
}
// ----------------------------------------------------------------------------
@@ -626,8 +626,8 @@ wxBitmap ButtonWidgetsPage::CreateBitmap(const wxString& label)
dc.SetBackground(*wxCYAN_BRUSH);
dc.Clear();
dc.SetTextForeground(*wxBLACK);
dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + wxT("\n")
wxT("(") + label + wxT(" state)"),
dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + "\n"
"(" + label + " state)",
wxArtProvider::GetBitmap(wxART_INFORMATION),
wxRect(10, 10, bmp.GetWidth() - 20, bmp.GetHeight() - 20),
wxALIGN_CENTRE);

View File

@@ -155,7 +155,7 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(CheckBoxWidgetsPage, wxT("CheckBox"), FAMILY_CTRLS );
IMPLEMENT_WIDGETS_PAGE(CheckBoxWidgetsPage, "CheckBox", FAMILY_CTRLS );
CheckBoxWidgetsPage::CheckBoxWidgetsPage(WidgetsBookCtrl *book,
wxImageList *imaglist)
@@ -168,14 +168,14 @@ void CheckBoxWidgetsPage::CreateContent()
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style"));
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style");
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
m_chkRight = CreateCheckBoxAndAddToSizer
(
sizerLeft,
wxT("&Right aligned"),
"&Right aligned",
CheckboxPage_ChkRight
);
@@ -183,39 +183,39 @@ void CheckBoxWidgetsPage::CreateContent()
static const wxString kinds[] =
{
wxT("usual &2-state checkbox"),
wxT("&3rd state settable by program"),
wxT("&user-settable 3rd state"),
"usual &2-state checkbox",
"&3rd state settable by program",
"&user-settable 3rd state",
};
m_radioKind = new wxRadioBox(this, wxID_ANY, wxT("&Kind"),
m_radioKind = new wxRadioBox(this, wxID_ANY, "&Kind",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(kinds), kinds,
1);
sizerLeft->Add(m_radioKind, 0, wxGROW | wxALL, 5);
wxButton *btn = new wxButton(this, CheckboxPage_Reset, wxT("&Reset"));
wxButton *btn = new wxButton(this, CheckboxPage_Reset, "&Reset");
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Operations"));
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Operations");
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
sizerMiddle->Add(CreateSizerWithTextAndButton(CheckboxPage_ChangeLabel,
wxT("Change label"),
"Change label",
wxID_ANY,
&m_textLabel),
0, wxALL | wxGROW, 5);
sizerMiddle->Add(new wxButton(this, CheckboxPage_Check, wxT("&Check it")),
sizerMiddle->Add(new wxButton(this, CheckboxPage_Check, "&Check it"),
0, wxALL | wxGROW, 5);
sizerMiddle->Add(new wxButton(this, CheckboxPage_Uncheck, wxT("&Uncheck it")),
sizerMiddle->Add(new wxButton(this, CheckboxPage_Uncheck, "&Uncheck it"),
0, wxALL | wxGROW, 5);
sizerMiddle->Add(new wxButton(this, CheckboxPage_PartCheck,
wxT("Put in &3rd state")),
"Put in &3rd state"),
0, wxALL | wxGROW, 5);
// right pane
wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL);
m_checkbox = new wxCheckBox(this, CheckboxPage_Checkbox, wxT("&Check me!"));
m_checkbox = new wxCheckBox(this, CheckboxPage_Checkbox, "&Check me!");
sizerRight->Add(0, 0, 1, wxCENTRE);
sizerRight->Add(m_checkbox, 1, wxCENTRE);
sizerRight->Add(0, 0, 1, wxCENTRE);
@@ -258,7 +258,7 @@ void CheckBoxWidgetsPage::CreateCheckbox()
switch ( m_radioKind->GetSelection() )
{
default:
wxFAIL_MSG(wxT("unexpected radiobox selection"));
wxFAIL_MSG("unexpected radiobox selection");
// fall through
case CheckboxKind_2State:
@@ -307,8 +307,8 @@ void CheckBoxWidgetsPage::OnButtonChangeLabel(wxCommandEvent& WXUNUSED(event))
void CheckBoxWidgetsPage::OnCheckBox(wxCommandEvent& event)
{
wxLogMessage(wxT("Test checkbox %schecked (value = %d)."),
event.IsChecked() ? wxT("") : wxT("un"),
wxLogMessage("Test checkbox %schecked (value = %d).",
event.IsChecked() ? "" : "un",
(int)m_checkbox->Get3StateValue());
}

View File

@@ -178,7 +178,7 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(ChoiceWidgetsPage, wxT("Choice"),
IMPLEMENT_WIDGETS_PAGE(ChoiceWidgetsPage, "Choice",
FAMILY_CTRLS | WITH_ITEMS_CTRLS
);
@@ -207,53 +207,53 @@ void ChoiceWidgetsPage::CreateContent()
// left pane
wxStaticBox *box = new wxStaticBox(this, wxID_ANY,
wxT("&Set choice parameters"));
"&Set choice parameters");
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Sort items"));
m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, "&Sort items");
wxButton *btn = new wxButton(this, ChoicePage_Reset, wxT("&Reset"));
wxButton *btn = new wxButton(this, ChoicePage_Reset, "&Reset");
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY,
wxT("&Change choice contents"));
"&Change choice contents");
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL);
btn = new wxButton(this, ChoicePage_Add, wxT("&Add this string"));
m_textAdd = new wxTextCtrl(this, ChoicePage_AddText, wxT("test item 0"));
btn = new wxButton(this, ChoicePage_Add, "&Add this string");
m_textAdd = new wxTextCtrl(this, ChoicePage_AddText, "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, wxT("&Insert a few strings"));
btn = new wxButton(this, ChoicePage_AddSeveral, "&Insert a few strings");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, ChoicePage_AddMany, wxT("Add &many strings"));
btn = new wxButton(this, ChoicePage_AddMany, "Add &many strings");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
sizerRow = new wxBoxSizer(wxHORIZONTAL);
btn = new wxButton(this, ChoicePage_Change, wxT("C&hange current"));
btn = new wxButton(this, ChoicePage_Change, "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, wxT("&Delete this item"));
btn = new wxButton(this, ChoicePage_Delete, "&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, wxT("Delete &selection"));
btn = new wxButton(this, ChoicePage_DeleteSel, "Delete &selection");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, ChoicePage_Clear, wxT("&Clear"));
btn = new wxButton(this, ChoicePage_Clear, "&Clear");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, ChoicePage_ContainerTests, wxT("Run &tests"));
btn = new wxButton(this, ChoicePage_ContainerTests, "Run &tests");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
// right pane
@@ -367,7 +367,7 @@ void ChoiceWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event))
if ( !m_textAdd->IsModified() )
{
// update the default string
m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item));
m_textAdd->SetValue(wxString::Format("test item %u", ++s_item));
}
m_choice->Append(s);
@@ -379,7 +379,7 @@ void ChoiceWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event))
wxArrayString strings;
for ( unsigned int n = 0; n < 1000; n++ )
{
strings.Add(wxString::Format(wxT("item #%u"), n));
strings.Add(wxString::Format("item #%u", n));
}
m_choice->Append(strings);
}
@@ -387,9 +387,9 @@ void ChoiceWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event))
void ChoiceWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event))
{
wxArrayString items;
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"));
items.Add("First");
items.Add("another one");
items.Add("and the last (very very very very very very very very very very long) one");
m_choice->Insert(items, 0);
}
@@ -424,9 +424,9 @@ void ChoiceWidgetsPage::OnUpdateUIAddSeveral(wxUpdateUIEvent& event)
void ChoiceWidgetsPage::OnChoice(wxCommandEvent& event)
{
long sel = event.GetSelection();
m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel));
m_textDelete->SetValue(wxString::Format("%ld", sel));
wxLogMessage(wxT("Choice item %ld selected"), sel);
wxLogMessage("Choice item %ld selected", sel);
}
void ChoiceWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))

View File

@@ -125,7 +125,7 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS GENERIC_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(ColourPickerWidgetsPage, wxT("ColourPicker"),
IMPLEMENT_WIDGETS_PAGE(ColourPickerWidgetsPage, "ColourPicker",
PICKER_CTRLS | FAMILY_CTRLS);
ColourPickerWidgetsPage::ColourPickerWidgetsPage(WidgetsBookCtrl *book,
@@ -139,13 +139,13 @@ void ColourPickerWidgetsPage::CreateContent()
// left pane
wxSizer *boxleft = new wxBoxSizer(wxVERTICAL);
wxStaticBoxSizer *clrbox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&ColourPicker style"));
m_chkColourTextCtrl = CreateCheckBoxAndAddToSizer(clrbox, wxT("With textctrl"));
m_chkColourShowLabel = CreateCheckBoxAndAddToSizer(clrbox, wxT("With label"));
m_chkColourShowAlpha = CreateCheckBoxAndAddToSizer(clrbox, wxT("With opacity"));
wxStaticBoxSizer *clrbox = new wxStaticBoxSizer(wxVERTICAL, this, "&ColourPicker style");
m_chkColourTextCtrl = CreateCheckBoxAndAddToSizer(clrbox, "With textctrl");
m_chkColourShowLabel = CreateCheckBoxAndAddToSizer(clrbox, "With label");
m_chkColourShowAlpha = CreateCheckBoxAndAddToSizer(clrbox, "With opacity");
boxleft->Add(clrbox, 0, wxALL|wxGROW, 5);
boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")),
boxleft->Add(new wxButton(this, PickerPage_Reset, "&Reset"),
0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
Reset(); // set checkboxes state
@@ -217,7 +217,7 @@ void ColourPickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event))
void ColourPickerWidgetsPage::OnColourChange(wxColourPickerEvent& event)
{
wxLogMessage(wxT("The colour changed to '%s' !"),
wxLogMessage("The colour changed to '%s' !",
event.GetColour().GetAsString(wxC2S_CSS_SYNTAX).c_str());
}

View File

@@ -234,7 +234,7 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(ComboboxWidgetsPage, wxT("Combobox"),
IMPLEMENT_WIDGETS_PAGE(ComboboxWidgetsPage, "Combobox",
FAMILY_CTRLS | WITH_ITEMS_CTRLS | COMBO_CTRLS
);
@@ -266,26 +266,26 @@ void ComboboxWidgetsPage::CreateContent()
// should be in sync with ComboKind_XXX values
static const wxString kinds[] =
{
wxT("default"),
wxT("simple"),
wxT("drop down"),
"default",
"simple",
"drop down",
};
m_radioKind = new wxRadioBox(this, wxID_ANY, wxT("Combobox &kind:"),
m_radioKind = new wxRadioBox(this, wxID_ANY, "Combobox &kind:",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(kinds), kinds,
1, wxRA_SPECIFY_COLS);
wxSizer *sizerLeftTop = new wxStaticBoxSizer(wxVERTICAL, this, "&Set style");
m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeftTop, wxT("&Sort items"));
m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerLeftTop, wxT("&Read only"));
m_chkProcessEnter = CreateCheckBoxAndAddToSizer(sizerLeftTop, wxT("Process &Enter"));
m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeftTop, "&Sort items");
m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerLeftTop, "&Read only");
m_chkProcessEnter = CreateCheckBoxAndAddToSizer(sizerLeftTop, "Process &Enter");
sizerLeftTop->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
sizerLeftTop->Add(m_radioKind, 0, wxGROW | wxALL, 5);
wxButton *btn = new wxButton(this, ComboPage_Reset, wxT("&Reset"));
wxButton *btn = new wxButton(this, ComboPage_Reset, "&Reset");
sizerLeftTop->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// lower left pane
@@ -303,20 +303,20 @@ void ComboboxWidgetsPage::CreateContent()
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY,
wxT("&Change combobox contents"));
"&Change combobox contents");
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxSizer *sizerRow;
sizerRow = CreateSizerWithTextAndButton(ComboPage_SetCurrent,
wxT("Current &selection"),
"Current &selection",
ComboPage_CurText,
&m_textCur);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
wxTextCtrl *text;
sizerRow = CreateSizerWithTextAndLabel(wxT("Insertion Point"),
sizerRow = CreateSizerWithTextAndLabel("Insertion Point",
ComboPage_InsertionPointText,
&text);
text->SetEditable(false);
@@ -324,54 +324,54 @@ void ComboboxWidgetsPage::CreateContent()
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(ComboPage_Insert,
wxT("&Insert this string"),
"&Insert this string",
ComboPage_InsertText,
&m_textInsert);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(ComboPage_Add,
wxT("&Add this string"),
"&Add this string",
ComboPage_AddText,
&m_textAdd);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(ComboPage_SetFirst,
wxT("Change &1st string"),
"Change &1st string",
ComboPage_SetFirstText,
&m_textSetFirst);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, ComboPage_AddSeveral, wxT("&Append a few strings"));
btn = new wxButton(this, ComboPage_AddSeveral, "&Append a few strings");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, ComboPage_AddMany, wxT("Append &many strings"));
btn = new wxButton(this, ComboPage_AddMany, "Append &many strings");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(ComboPage_Change,
wxT("C&hange current"),
"C&hange current",
ComboPage_ChangeText,
&m_textChange);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(ComboPage_Delete,
wxT("&Delete this item"),
"&Delete this item",
ComboPage_DeleteText,
&m_textDelete);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, ComboPage_DeleteSel, wxT("Delete &selection"));
btn = new wxButton(this, ComboPage_DeleteSel, "Delete &selection");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, ComboPage_Clear, wxT("&Clear"));
btn = new wxButton(this, ComboPage_Clear, "&Clear");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(ComboPage_SetValue,
wxT("SetValue"),
"SetValue",
ComboPage_SetValueText,
&m_textSetValue);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, ComboPage_ContainerTests, wxT("Run &tests"));
btn = new wxButton(this, ComboPage_ContainerTests, "Run &tests");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
@@ -430,7 +430,7 @@ void ComboboxWidgetsPage::CreateCombo()
switch ( m_radioKind->GetSelection() )
{
default:
wxFAIL_MSG( wxT("unknown combo kind") );
wxFAIL_MSG( "unknown combo kind" );
// fall through
case ComboKind_Default:
@@ -533,7 +533,7 @@ void ComboboxWidgetsPage::OnButtonInsert(wxCommandEvent& WXUNUSED(event))
if ( !m_textInsert->IsModified() )
{
// update the default string
m_textInsert->SetValue(wxString::Format(wxT("test item %u"), ++s_item));
m_textInsert->SetValue(wxString::Format("test item %u", ++s_item));
}
if (m_combobox->GetSelection() >= 0)
@@ -548,7 +548,7 @@ void ComboboxWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event))
if ( !m_textAdd->IsModified() )
{
// update the default string
m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item));
m_textAdd->SetValue(wxString::Format("test item %u", ++s_item));
}
m_combobox->Append(s);
@@ -570,7 +570,7 @@ void ComboboxWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event))
// "many" means 1000 here
for ( unsigned int n = 0; n < 1000; n++ )
{
m_combobox->Append(wxString::Format(wxT("item #%u"), n));
m_combobox->Append(wxString::Format("item #%u", n));
}
}
@@ -585,15 +585,15 @@ void ComboboxWidgetsPage::OnButtonSetCurrent(wxCommandEvent& WXUNUSED(event))
void ComboboxWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event))
{
m_combobox->Append(wxT("First"));
m_combobox->Append(wxT("another one"));
m_combobox->Append(wxT("and the last (very very very very very very very very very very long) one"));
m_combobox->Append("First");
m_combobox->Append("another one");
m_combobox->Append("and the last (very very very very very very very very very very long) one");
}
void ComboboxWidgetsPage::OnUpdateUIInsertionPointText(wxUpdateUIEvent& event)
{
if (m_combobox)
event.SetText( wxString::Format(wxT("%ld"), m_combobox->GetInsertionPoint()) );
event.SetText( wxString::Format("%ld", m_combobox->GetInsertionPoint()) );
}
void ComboboxWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event)
@@ -658,15 +658,15 @@ void ComboboxWidgetsPage::OnComboText(wxCommandEvent& event)
wxString s = event.GetString();
wxASSERT_MSG( s == m_combobox->GetValue(),
wxT("event and combobox values should be the same") );
"event and combobox values should be the same" );
if (event.GetEventType() == wxEVT_TEXT_ENTER)
{
wxLogMessage(wxT("Combobox enter pressed (now '%s')"), s.c_str());
wxLogMessage("Combobox enter pressed (now '%s')", s.c_str());
}
else
{
wxLogMessage(wxT("Combobox text changed (now '%s')"), s.c_str());
wxLogMessage("Combobox text changed (now '%s')", s.c_str());
}
}
@@ -679,13 +679,13 @@ void ComboboxWidgetsPage::OnComboTextPasted(wxClipboardTextEvent& event)
void ComboboxWidgetsPage::OnComboBox(wxCommandEvent& event)
{
long sel = event.GetInt();
const wxString selstr = wxString::Format(wxT("%ld"), sel);
const wxString selstr = wxString::Format("%ld", sel);
m_textDelete->SetValue(selstr);
m_textCur->SetValue(selstr);
wxLogMessage(wxT("Combobox item %ld selected"), sel);
wxLogMessage("Combobox item %ld selected", sel);
wxLogMessage(wxT("Combobox GetValue(): %s"), m_combobox->GetValue().c_str() );
wxLogMessage("Combobox GetValue(): %s", m_combobox->GetValue().c_str() );
if ( event.GetString() != m_combobox->GetValue() )
{
@@ -701,12 +701,12 @@ void ComboboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
void ComboboxWidgetsPage::OnDropdown(wxCommandEvent& WXUNUSED(event))
{
wxLogMessage(wxT("Combobox dropped down"));
wxLogMessage("Combobox dropped down");
}
void ComboboxWidgetsPage::OnCloseup(wxCommandEvent& WXUNUSED(event))
{
wxLogMessage(wxT("Combobox closed up"));
wxLogMessage("Combobox closed up");
}
void ComboboxWidgetsPage::OnPopup(wxCommandEvent &WXUNUSED(event))

View File

@@ -134,7 +134,7 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS GENERIC_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(DatePickerWidgetsPage, wxT("DatePicker"),
IMPLEMENT_WIDGETS_PAGE(DatePickerWidgetsPage, "DatePicker",
FAMILY_CTRLS | PICKER_CTRLS
);

View File

@@ -61,16 +61,16 @@ enum
static const wxString stdPaths[] =
{
wxT("&none"),
wxT("&config"),
wxT("&data"),
wxT("&documents"),
wxT("&local data"),
wxT("&plugins"),
wxT("&resources"),
wxT("&user config"),
wxT("&user data"),
wxT("&user local data")
"&none",
"&config",
"&data",
"&documents",
"&local data",
"&plugins",
"&resources",
"&user config",
"&user data",
"&user local data"
};
enum
@@ -164,7 +164,7 @@ wxEND_EVENT_TABLE()
// implementation
// ============================================================================
IMPLEMENT_WIDGETS_PAGE(DirCtrlWidgetsPage, wxT("DirCtrl"),
IMPLEMENT_WIDGETS_PAGE(DirCtrlWidgetsPage, "DirCtrl",
GENERIC_CTRLS
);
@@ -180,39 +180,39 @@ void DirCtrlWidgetsPage::CreateContent()
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("Dir control details"));
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "Dir control details");
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
sizerLeft->Add( CreateSizerWithTextAndButton( DirCtrlPage_SetPath , wxT("Set &path"), wxID_ANY, &m_path ),
sizerLeft->Add( CreateSizerWithTextAndButton( DirCtrlPage_SetPath , "Set &path", wxID_ANY, &m_path ),
0, wxALL | wxALIGN_RIGHT , 5 );
wxSizer *sizerUseFlags =
new wxStaticBoxSizer(wxVERTICAL, this, wxT("&Flags"));
m_chkDirOnly = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_DIR_ONLY"));
m_chk3D = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_3D_INTERNAL"));
m_chkFirst = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_SELECT_FIRST"));
m_chkFilters = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_SHOW_FILTERS"));
m_chkLabels = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_EDIT_LABELS"));
m_chkMulti = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_MULTIPLE"));
new wxStaticBoxSizer(wxVERTICAL, this, "&Flags");
m_chkDirOnly = CreateCheckBoxAndAddToSizer(sizerUseFlags, "wxDIRCTRL_DIR_ONLY");
m_chk3D = CreateCheckBoxAndAddToSizer(sizerUseFlags, "wxDIRCTRL_3D_INTERNAL");
m_chkFirst = CreateCheckBoxAndAddToSizer(sizerUseFlags, "wxDIRCTRL_SELECT_FIRST");
m_chkFilters = CreateCheckBoxAndAddToSizer(sizerUseFlags, "wxDIRCTRL_SHOW_FILTERS");
m_chkLabels = CreateCheckBoxAndAddToSizer(sizerUseFlags, "wxDIRCTRL_EDIT_LABELS");
m_chkMulti = CreateCheckBoxAndAddToSizer(sizerUseFlags, "wxDIRCTRL_MULTIPLE");
sizerLeft->Add(sizerUseFlags, wxSizerFlags().Expand().Border());
wxSizer *sizerFilters =
new wxStaticBoxSizer(wxVERTICAL, this, wxT("&Filters"));
m_fltr[0] = CreateCheckBoxAndAddToSizer(sizerFilters, wxString::Format(wxT("all files (%s)|%s"),
new wxStaticBoxSizer(wxVERTICAL, this, "&Filters");
m_fltr[0] = CreateCheckBoxAndAddToSizer(sizerFilters, wxString::Format("all files (%s)|%s",
wxFileSelectorDefaultWildcardStr, wxFileSelectorDefaultWildcardStr));
m_fltr[1] = CreateCheckBoxAndAddToSizer(sizerFilters, wxT("C++ files (*.cpp; *.h)|*.cpp;*.h"));
m_fltr[2] = CreateCheckBoxAndAddToSizer(sizerFilters, wxT("PNG images (*.png)|*.png"));
m_fltr[1] = CreateCheckBoxAndAddToSizer(sizerFilters, "C++ files (*.cpp; *.h)|*.cpp;*.h");
m_fltr[2] = CreateCheckBoxAndAddToSizer(sizerFilters, "PNG images (*.png)|*.png");
sizerLeft->Add(sizerFilters, wxSizerFlags().Expand().Border());
wxButton *btn = new wxButton(this, DirCtrlPage_Reset, wxT("&Reset"));
wxButton *btn = new wxButton(this, DirCtrlPage_Reset, "&Reset");
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// keep consistency between enum and labels of radiobox
wxCOMPILE_TIME_ASSERT( stdPathMax == WXSIZEOF(stdPaths), EnumForRadioBoxMismatch);
// middle pane
m_radioStdPath = new wxRadioBox(this, wxID_ANY, wxT("Standard path"),
m_radioStdPath = new wxRadioBox(this, wxID_ANY, "Standard path",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(stdPaths), stdPaths, 1);
@@ -275,7 +275,7 @@ void DirCtrlWidgetsPage::CreateDirCtrl()
if (m_fltr[i]->IsChecked())
{
if (!filter.IsEmpty())
filter += wxT("|");
filter += "|";
filter += m_fltr[i]->GetLabel();
}
}
@@ -317,7 +317,7 @@ void DirCtrlWidgetsPage::OnRadioBox(wxCommandEvent& WXUNUSED(event))
{
wxString path;
wxTheApp->SetAppName(wxT("widgets"));
wxTheApp->SetAppName("widgets");
wxStandardPathsBase& stdp = wxStandardPaths::Get();
switch ( m_radioStdPath->GetSelection() )

View File

@@ -133,7 +133,7 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS GENERIC_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(DirPickerWidgetsPage, wxT("DirPicker"),
IMPLEMENT_WIDGETS_PAGE(DirPickerWidgetsPage, "DirPicker",
PICKER_CTRLS | FAMILY_CTRLS);
DirPickerWidgetsPage::DirPickerWidgetsPage(WidgetsBookCtrl *book,
@@ -147,10 +147,10 @@ void DirPickerWidgetsPage::CreateContent()
// left pane
wxSizer *boxleft = new wxBoxSizer(wxVERTICAL);
wxStaticBoxSizer *dirbox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&DirPicker style"));
m_chkDirTextCtrl = CreateCheckBoxAndAddToSizer(dirbox, wxT("With textctrl"));
m_chkDirMustExist = CreateCheckBoxAndAddToSizer(dirbox, wxT("Dir must exist"));
m_chkDirChangeDir = CreateCheckBoxAndAddToSizer(dirbox, wxT("Change working dir"));
wxStaticBoxSizer *dirbox = new wxStaticBoxSizer(wxVERTICAL, this, "&DirPicker style");
m_chkDirTextCtrl = CreateCheckBoxAndAddToSizer(dirbox, "With textctrl");
m_chkDirMustExist = CreateCheckBoxAndAddToSizer(dirbox, "Dir must exist");
m_chkDirChangeDir = CreateCheckBoxAndAddToSizer(dirbox, "Change working dir");
m_chkSmall = CreateCheckBoxAndAddToSizer(dirbox, "&Small version");
boxleft->Add(dirbox, 0, wxALL|wxGROW, 5);
@@ -164,7 +164,7 @@ void DirPickerWidgetsPage::CreateContent()
boxleft->AddSpacer(10);
boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")),
boxleft->Add(new wxButton(this, PickerPage_Reset, "&Reset"),
0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
Reset(); // set checkboxes state
@@ -206,7 +206,7 @@ void DirPickerWidgetsPage::CreatePicker()
style |= wxDIRP_SMALL;
m_dirPicker = new wxDirPickerCtrl(this, PickerPage_Dir,
wxGetHomeDir(), wxT("Hello!"),
wxGetHomeDir(), "Hello!",
wxDefaultPosition, wxDefaultSize,
style);
}
@@ -246,7 +246,7 @@ void DirPickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event))
void DirPickerWidgetsPage::OnDirChange(wxFileDirPickerEvent& event)
{
wxLogMessage(wxT("The directory changed to '%s' ! The current working directory is '%s'"),
wxLogMessage("The directory changed to '%s' ! The current working directory is '%s'",
event.GetPath().c_str(), wxGetCwd().c_str());
}

View File

@@ -115,7 +115,7 @@ wxEND_EVENT_TABLE()
// implementation
// ============================================================================
IMPLEMENT_WIDGETS_PAGE(EditableListboxWidgetsPage, wxT("EditableListbox"), GENERIC_CTRLS);
IMPLEMENT_WIDGETS_PAGE(EditableListboxWidgetsPage, "EditableListbox", GENERIC_CTRLS);
EditableListboxWidgetsPage::EditableListboxWidgetsPage(WidgetsBookCtrl *book,
wxImageList *imaglist)
@@ -134,15 +134,15 @@ void EditableListboxWidgetsPage::CreateContent()
// left pane
wxStaticBox *box = new wxStaticBox(this, wxID_ANY,
wxT("&Set listbox parameters"));
"&Set listbox parameters");
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
m_chkAllowNew = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Allow new items"));
m_chkAllowEdit = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Allow editing items"));
m_chkAllowDelete = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Allow deleting items"));
m_chkAllowNoReorder = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Block user reordering"));
m_chkAllowNew = CreateCheckBoxAndAddToSizer(sizerLeft, "Allow new items");
m_chkAllowEdit = CreateCheckBoxAndAddToSizer(sizerLeft, "Allow editing items");
m_chkAllowDelete = CreateCheckBoxAndAddToSizer(sizerLeft, "Allow deleting items");
m_chkAllowNoReorder = CreateCheckBoxAndAddToSizer(sizerLeft, "Block user reordering");
wxButton *btn = new wxButton(this, EditableListboxPage_Reset, wxT("&Reset"));
wxButton *btn = new wxButton(this, EditableListboxPage_Reset, "&Reset");
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// right pane

View File

@@ -145,7 +145,7 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS GENERIC_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE( FileCtrlWidgetsPage, wxT( "FileCtrl" ),
IMPLEMENT_WIDGETS_PAGE( FileCtrlWidgetsPage, "FileCtrl",
FAMILY_CTRLS );
FileCtrlWidgetsPage::FileCtrlWidgetsPage( WidgetsBookCtrl *book,
@@ -161,37 +161,37 @@ void FileCtrlWidgetsPage::CreateContent()
// left pane
wxSizer *sizerLeft = new wxBoxSizer( wxVERTICAL );
static const wxString mode[] = { wxT( "open" ), wxT( "save" ) };
m_radioFileCtrlMode = new wxRadioBox( this, wxID_ANY, wxT( "wxFileCtrl mode" ),
static const wxString mode[] = { "open", "save" };
m_radioFileCtrlMode = new wxRadioBox( this, wxID_ANY, "wxFileCtrl mode",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF( mode ), mode );
sizerLeft->Add( m_radioFileCtrlMode,
0, wxALL | wxEXPAND , 5 );
sizerLeft->Add( CreateSizerWithTextAndButton( FileCtrlPage_SetDirectory , wxT( "Set &directory" ), wxID_ANY, &m_dir ),
sizerLeft->Add( CreateSizerWithTextAndButton( FileCtrlPage_SetDirectory , "Set &directory", wxID_ANY, &m_dir ),
0, wxALL | wxEXPAND , 5 );
sizerLeft->Add( CreateSizerWithTextAndButton( FileCtrlPage_SetPath , wxT( "Set &path" ), wxID_ANY, &m_path ),
sizerLeft->Add( CreateSizerWithTextAndButton( FileCtrlPage_SetPath , "Set &path", wxID_ANY, &m_path ),
0, wxALL | wxEXPAND , 5 );
sizerLeft->Add( CreateSizerWithTextAndButton( FileCtrlPage_SetFilename , wxT( "Set &filename" ), wxID_ANY, &m_filename ),
sizerLeft->Add( CreateSizerWithTextAndButton( FileCtrlPage_SetFilename , "Set &filename", wxID_ANY, &m_filename ),
0, wxALL | wxEXPAND , 5 );
wxSizer *sizerUseFlags =
new wxStaticBoxSizer( wxVERTICAL, this, wxT( "&Flags" ) );
new wxStaticBoxSizer( wxVERTICAL, this, "&Flags");
m_chkMultiple = CreateCheckBoxAndAddToSizer( sizerUseFlags, wxT( "wxFC_MULTIPLE" ) );
m_chkNoShowHidden = CreateCheckBoxAndAddToSizer( sizerUseFlags, wxT( "wxFC_NOSHOWHIDDEN" ) );
m_chkMultiple = CreateCheckBoxAndAddToSizer( sizerUseFlags, "wxFC_MULTIPLE");
m_chkNoShowHidden = CreateCheckBoxAndAddToSizer( sizerUseFlags, "wxFC_NOSHOWHIDDEN");
sizerLeft->Add( sizerUseFlags, wxSizerFlags().Expand().Border() );
wxSizer *sizerFilters =
new wxStaticBoxSizer( wxVERTICAL, this, wxT( "&Filters" ) );
m_fltr[0] = CreateCheckBoxAndAddToSizer( sizerFilters, wxString::Format( wxT( "all files (%s)|%s" ),
new wxStaticBoxSizer( wxVERTICAL, this, "&Filters");
m_fltr[0] = CreateCheckBoxAndAddToSizer( sizerFilters, wxString::Format("all files (%s)|%s",
wxFileSelectorDefaultWildcardStr, wxFileSelectorDefaultWildcardStr ) );
m_fltr[1] = CreateCheckBoxAndAddToSizer( sizerFilters, wxT( "C++ files (*.cpp; *.h)|*.cpp;*.h" ) );
m_fltr[2] = CreateCheckBoxAndAddToSizer( sizerFilters, wxT( "PNG images (*.png)|*.png" ) );
m_fltr[1] = CreateCheckBoxAndAddToSizer( sizerFilters, "C++ files (*.cpp; *.h)|*.cpp;*.h" );
m_fltr[2] = CreateCheckBoxAndAddToSizer( sizerFilters, "PNG images (*.png)|*.png");
sizerLeft->Add( sizerFilters, wxSizerFlags().Expand().Border() );
wxButton *btn = new wxButton( this, FileCtrlPage_Reset, wxT( "&Reset" ) );
wxButton *btn = new wxButton( this, FileCtrlPage_Reset, "&Reset" );
sizerLeft->Add( btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15 );
// right pane
@@ -253,7 +253,7 @@ void FileCtrlWidgetsPage::CreateFileCtrl()
if ( m_fltr[i]->IsChecked() )
{
if ( !wildcard.IsEmpty() )
wildcard += wxT( "|" );
wildcard += "|";
wildcard += m_fltr[i]->GetLabel();
}
}

View File

@@ -150,7 +150,7 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS GENERIC_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(FilePickerWidgetsPage, wxT("FilePicker"),
IMPLEMENT_WIDGETS_PAGE(FilePickerWidgetsPage, "FilePicker",
PICKER_CTRLS | FAMILY_CTRLS);
FilePickerWidgetsPage::FilePickerWidgetsPage(WidgetsBookCtrl *book,
@@ -164,17 +164,17 @@ void FilePickerWidgetsPage::CreateContent()
// left pane
wxSizer *boxleft = new wxBoxSizer(wxVERTICAL);
static const wxString mode[] = { wxT("open"), wxT("save") };
m_radioFilePickerMode = new wxRadioBox(this, wxID_ANY, wxT("wxFilePicker mode"),
static const wxString mode[] = { "open", "save" };
m_radioFilePickerMode = new wxRadioBox(this, wxID_ANY, "wxFilePicker mode",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(mode), mode);
boxleft->Add(m_radioFilePickerMode, 0, wxALL|wxGROW, 5);
wxStaticBoxSizer *filebox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&FilePicker style"));
m_chkFileTextCtrl = CreateCheckBoxAndAddToSizer(filebox, wxT("With textctrl"));
m_chkFileOverwritePrompt = CreateCheckBoxAndAddToSizer(filebox, wxT("Overwrite prompt"));
m_chkFileMustExist = CreateCheckBoxAndAddToSizer(filebox, wxT("File must exist"));
m_chkFileChangeDir = CreateCheckBoxAndAddToSizer(filebox, wxT("Change working dir"));
wxStaticBoxSizer *filebox = new wxStaticBoxSizer(wxVERTICAL, this, "&FilePicker style");
m_chkFileTextCtrl = CreateCheckBoxAndAddToSizer(filebox, "With textctrl");
m_chkFileOverwritePrompt = CreateCheckBoxAndAddToSizer(filebox, "Overwrite prompt");
m_chkFileMustExist = CreateCheckBoxAndAddToSizer(filebox, "File must exist");
m_chkFileChangeDir = CreateCheckBoxAndAddToSizer(filebox, "Change working dir");
m_chkSmall = CreateCheckBoxAndAddToSizer(filebox, "&Small version");
boxleft->Add(filebox, 0, wxALL|wxGROW, 5);
@@ -189,7 +189,7 @@ void FilePickerWidgetsPage::CreateContent()
boxleft->AddSpacer(10);
boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")),
boxleft->Add(new wxButton(this, PickerPage_Reset, "&Reset"),
0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
Reset(); // set checkboxes state
@@ -245,7 +245,7 @@ void FilePickerWidgetsPage::CreatePicker()
// pass an empty string as initial file
m_filePicker = new wxFilePickerCtrl(this, PickerPage_File,
wxEmptyString,
wxT("Hello!"), wxT("*"),
"Hello!", "*",
wxDefaultPosition, wxDefaultSize,
style);
}
@@ -310,7 +310,7 @@ void FilePickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event))
void FilePickerWidgetsPage::OnFileChange(wxFileDirPickerEvent& event)
{
wxLogMessage(wxT("The file changed to '%s' ! The current working directory is '%s'"),
wxLogMessage("The file changed to '%s' ! The current working directory is '%s'",
event.GetPath().c_str(), wxGetCwd().c_str());
}

View File

@@ -125,7 +125,7 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS GENERIC_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(FontPickerWidgetsPage, wxT("FontPicker"),
IMPLEMENT_WIDGETS_PAGE(FontPickerWidgetsPage, "FontPicker",
PICKER_CTRLS | FAMILY_CTRLS);
FontPickerWidgetsPage::FontPickerWidgetsPage(WidgetsBookCtrl *book,
@@ -139,13 +139,13 @@ void FontPickerWidgetsPage::CreateContent()
// left pane
wxSizer *boxleft = new wxBoxSizer(wxVERTICAL);
wxStaticBoxSizer *fontbox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&FontPicker style"));
m_chkFontTextCtrl = CreateCheckBoxAndAddToSizer(fontbox, wxT("With textctrl"));
m_chkFontDescAsLabel = CreateCheckBoxAndAddToSizer(fontbox, wxT("Font desc as btn label"));
m_chkFontUseFontForLabel = CreateCheckBoxAndAddToSizer(fontbox, wxT("Use font for label"));
wxStaticBoxSizer *fontbox = new wxStaticBoxSizer(wxVERTICAL, this, "&FontPicker style");
m_chkFontTextCtrl = CreateCheckBoxAndAddToSizer(fontbox, "With textctrl");
m_chkFontDescAsLabel = CreateCheckBoxAndAddToSizer(fontbox, "Font desc as btn label");
m_chkFontUseFontForLabel = CreateCheckBoxAndAddToSizer(fontbox, "Use font for label");
boxleft->Add(fontbox, 0, wxALL|wxGROW, 5);
boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")),
boxleft->Add(new wxButton(this, PickerPage_Reset, "&Reset"),
0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
Reset(); // set checkboxes state
@@ -218,7 +218,7 @@ void FontPickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event))
void FontPickerWidgetsPage::OnFontChange(wxFontPickerEvent& event)
{
wxLogMessage(wxT("The font changed to '%s' with size %d !"),
wxLogMessage("The font changed to '%s' with size %d !",
event.GetFont().GetFaceName().c_str(), event.GetFont().GetPointSize());
}

View File

@@ -175,7 +175,7 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(GaugeWidgetsPage, wxT("Gauge"), FAMILY_CTRLS );
IMPLEMENT_WIDGETS_PAGE(GaugeWidgetsPage, "Gauge", FAMILY_CTRLS );
GaugeWidgetsPage::GaugeWidgetsPage(WidgetsBookCtrl *book,
wxImageList *imaglist)
@@ -199,25 +199,25 @@ void GaugeWidgetsPage::CreateContent()
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style"));
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style");
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Vertical"));
m_chkSmooth = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Smooth"));
m_chkProgress = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Progress"));
m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, "&Vertical");
m_chkSmooth = CreateCheckBoxAndAddToSizer(sizerLeft, "&Smooth");
m_chkProgress = CreateCheckBoxAndAddToSizer(sizerLeft, "&Progress");
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
wxButton *btn = new wxButton(this, GaugePage_Reset, wxT("&Reset"));
wxButton *btn = new wxButton(this, GaugePage_Reset, "&Reset");
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change gauge value"));
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Change gauge value");
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxTextCtrl *text;
wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Current value"),
wxSizer *sizerRow = CreateSizerWithTextAndLabel("Current value",
GaugePage_CurValueText,
&text);
text->SetEditable(false);
@@ -225,26 +225,26 @@ void GaugeWidgetsPage::CreateContent()
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(GaugePage_SetValue,
wxT("Set &value"),
"Set &value",
GaugePage_ValueText,
&m_textValue);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(GaugePage_SetRange,
wxT("Set &range"),
"Set &range",
GaugePage_RangeText,
&m_textRange);
m_textRange->SetValue( wxString::Format(wxT("%lu"), m_range) );
m_textRange->SetValue( wxString::Format("%lu", m_range) );
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, GaugePage_Progress, wxT("Simulate &progress"));
btn = new wxButton(this, GaugePage_Progress, "Simulate &progress");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, GaugePage_IndeterminateProgress,
wxT("Simulate &indeterminate job"));
"Simulate &indeterminate job");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, GaugePage_Clear, wxT("&Clear"));
btn = new wxButton(this, GaugePage_Clear, "&Clear");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
// right pane
@@ -322,13 +322,13 @@ void GaugeWidgetsPage::StartTimer(wxButton *clicked)
{
static const int INTERVAL = 300;
wxLogMessage(wxT("Launched progress timer (interval = %d ms)"), INTERVAL);
wxLogMessage("Launched progress timer (interval = %d ms)", INTERVAL);
m_timer = new wxTimer(this,
clicked->GetId() == GaugePage_Progress ? GaugePage_Timer : GaugePage_IndeterminateTimer);
m_timer->Start(INTERVAL);
clicked->SetLabel(wxT("&Stop timer"));
clicked->SetLabel("&Stop timer");
if (clicked->GetId() == GaugePage_Progress)
FindWindow(GaugePage_IndeterminateProgress)->Disable();
@@ -338,23 +338,23 @@ void GaugeWidgetsPage::StartTimer(wxButton *clicked)
void GaugeWidgetsPage::StopTimer(wxButton *clicked)
{
wxCHECK_RET( m_timer, wxT("shouldn't be called") );
wxCHECK_RET( m_timer, "shouldn't be called" );
m_timer->Stop();
wxDELETE(m_timer);
if (clicked->GetId() == GaugePage_Progress)
{
clicked->SetLabel(wxT("Simulate &progress"));
clicked->SetLabel("Simulate &progress");
FindWindow(GaugePage_IndeterminateProgress)->Enable();
}
else
{
clicked->SetLabel(wxT("Simulate indeterminate job"));
clicked->SetLabel("Simulate indeterminate job");
FindWindow(GaugePage_Progress)->Enable();
}
wxLogMessage(wxT("Progress finished."));
wxLogMessage("Progress finished.");
}
// ----------------------------------------------------------------------------
@@ -379,7 +379,7 @@ void GaugeWidgetsPage::OnButtonProgress(wxCommandEvent& event)
{
StopTimer(b);
wxLogMessage(wxT("Stopped the timer."));
wxLogMessage("Stopped the timer.");
}
}
@@ -396,7 +396,7 @@ void GaugeWidgetsPage::OnButtonIndeterminateProgress(wxCommandEvent& event)
m_gauge->SetValue(0);
wxLogMessage(wxT("Stopped the timer."));
wxLogMessage("Stopped the timer.");
}
}
@@ -457,7 +457,7 @@ void GaugeWidgetsPage::OnProgressTimer(wxTimerEvent& WXUNUSED(event))
else // reached the end
{
wxButton *btn = (wxButton *)FindWindow(GaugePage_Progress);
wxCHECK_RET( btn, wxT("no progress button?") );
wxCHECK_RET( btn, "no progress button?" );
StopTimer(btn);
}
@@ -470,7 +470,7 @@ void GaugeWidgetsPage::OnIndeterminateProgressTimer(wxTimerEvent& WXUNUSED(event
void GaugeWidgetsPage::OnUpdateUICurValueText(wxUpdateUIEvent& event)
{
event.SetText( wxString::Format(wxT("%d"), m_gauge->GetValue()));
event.SetText( wxString::Format("%d", m_gauge->GetValue()));
}
#endif

View File

@@ -78,7 +78,7 @@ private:
#endif
IMPLEMENT_WIDGETS_PAGE(HeaderCtrlWidgetsPage,
wxT("Header"), HEADER_CTRL_FAMILY);
"Header", HEADER_CTRL_FAMILY);
void HeaderCtrlWidgetsPage::CreateContent()
{

View File

@@ -142,7 +142,7 @@ wxEND_EVENT_TABLE()
// implementation
// ============================================================================
IMPLEMENT_WIDGETS_PAGE(HyperlinkWidgetsPage, wxT("Hyperlink"),
IMPLEMENT_WIDGETS_PAGE(HyperlinkWidgetsPage, "Hyperlink",
GENERIC_CTRLS
);
@@ -157,33 +157,33 @@ void HyperlinkWidgetsPage::CreateContent()
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("Hyperlink details"));
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "Hyperlink details");
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
sizerLeft->Add( CreateSizerWithTextAndButton( HyperlinkPage_SetLabel , wxT("Set &Label"), wxID_ANY, &m_label ),
sizerLeft->Add( CreateSizerWithTextAndButton( HyperlinkPage_SetLabel , "Set &Label", wxID_ANY, &m_label ),
0, wxALL | wxALIGN_RIGHT , 5 );
sizerLeft->Add( CreateSizerWithTextAndButton( HyperlinkPage_SetURL , wxT("Set &URL"), wxID_ANY, &m_url ),
sizerLeft->Add( CreateSizerWithTextAndButton( HyperlinkPage_SetURL , "Set &URL", wxID_ANY, &m_url ),
0, wxALL | wxALIGN_RIGHT , 5 );
static const wxString alignments[] =
{
wxT("&left"),
wxT("&centre"),
wxT("&right")
"&left",
"&centre",
"&right"
};
wxCOMPILE_TIME_ASSERT( WXSIZEOF(alignments) == Align_Max,
AlignMismatch );
m_radioAlignMode = new wxRadioBox(this, wxID_ANY, wxT("alignment"),
m_radioAlignMode = new wxRadioBox(this, wxID_ANY, "alignment",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(alignments), alignments);
m_radioAlignMode->SetSelection(1); // start with "centre" selected since
// wxHL_DEFAULT_STYLE contains wxHL_ALIGN_CENTRE
sizerLeft->Add(m_radioAlignMode, 0, wxALL|wxGROW, 5);
m_checkGeneric = new wxCheckBox(this, wxID_ANY, wxT("Use generic version"),
m_checkGeneric = new wxCheckBox(this, wxID_ANY, "Use generic version",
wxDefaultPosition, wxDefaultSize);
sizerLeft->Add(m_checkGeneric, 0, wxALL|wxGROW, 5);
@@ -191,24 +191,24 @@ void HyperlinkWidgetsPage::CreateContent()
wxSizer *szHyperlinkLong = new wxBoxSizer(wxVERTICAL);
wxSizer *szHyperlink = new wxBoxSizer(wxHORIZONTAL);
m_visit = new wxStaticText(this, wxID_ANY, wxT("Visit "));
m_visit = new wxStaticText(this, wxID_ANY, "Visit ");
if (m_checkGeneric->IsChecked())
{
m_hyperlink = new wxGenericHyperlinkCtrl(this,
HyperlinkPage_Ctrl,
wxT("wxWidgets website"),
wxT("www.wxwidgets.org"));
"wxWidgets website",
"www.wxwidgets.org");
}
else
{
m_hyperlink = new wxHyperlinkCtrl(this,
HyperlinkPage_Ctrl,
wxT("wxWidgets website"),
wxT("www.wxwidgets.org"));
"wxWidgets website",
"www.wxwidgets.org");
}
m_fun = new wxStaticText(this, wxID_ANY, wxT(" for fun!"));
m_fun = new wxStaticText(this, wxID_ANY, " for fun!");
szHyperlink->Add(0, 0, 1, wxCENTRE);
szHyperlink->Add(m_visit, 0, wxCENTRE);
@@ -221,15 +221,15 @@ void HyperlinkWidgetsPage::CreateContent()
{
m_hyperlinkLong = new wxGenericHyperlinkCtrl(this,
wxID_ANY,
wxT("This is a long hyperlink"),
wxT("www.wxwidgets.org"));
"This is a long hyperlink",
"www.wxwidgets.org");
}
else
{
m_hyperlinkLong = new wxHyperlinkCtrl(this,
wxID_ANY,
wxT("This is a long hyperlink"),
wxT("www.wxwidgets.org"));
"This is a long hyperlink",
"www.wxwidgets.org");
}
szHyperlinkLong->Add(0, 0, 1, wxCENTRE);
@@ -307,8 +307,8 @@ void HyperlinkWidgetsPage::CreateHyperlinkLong(long align)
{
hyp = new wxGenericHyperlinkCtrl(this,
wxID_ANY,
wxT("This is a long hyperlink"),
wxT("www.wxwidgets.org"),
"This is a long hyperlink",
"www.wxwidgets.org",
wxDefaultPosition,
wxDefaultSize,
style);
@@ -317,8 +317,8 @@ void HyperlinkWidgetsPage::CreateHyperlinkLong(long align)
{
hyp = new wxHyperlinkCtrl(this,
wxID_ANY,
wxT("This is a long hyperlink"),
wxT("www.wxwidgets.org"),
"This is a long hyperlink",
"www.wxwidgets.org",
wxDefaultPosition,
wxDefaultSize,
style);
@@ -365,7 +365,7 @@ void HyperlinkWidgetsPage::OnAlignment(wxCommandEvent& WXUNUSED(event))
{
default:
case Align_Max:
wxFAIL_MSG( wxT("unknown alignment") );
wxFAIL_MSG( "unknown alignment" );
// fall through
case Align_Left:

View File

@@ -76,12 +76,12 @@ ItemContainerWidgetsPage::ItemContainerWidgetsPage(WidgetsBookCtrl *book,
#endif // __WXMSW__ || __WXGTK__
, m_trackedDataObjects(0)
{
m_items.Add(wxT("This"));
m_items.Add(wxT("is"));
m_items.Add(wxT("a"));
m_items.Add(wxT("List"));
m_items.Add(wxT("of"));
m_items.Add(wxT("strings"));
m_items.Add("This");
m_items.Add("is");
m_items.Add("a");
m_items.Add("List");
m_items.Add("of");
m_items.Add("strings");
m_itemsSorted = m_items;
}
@@ -108,11 +108,11 @@ bool ItemContainerWidgetsPage::VerifyAllClientDataDestroyed()
{
if ( m_trackedDataObjects )
{
wxString message = wxT("Bug in managing wxClientData: ");
wxString message = "Bug in managing wxClientData: ";
if ( m_trackedDataObjects > 0 )
message << m_trackedDataObjects << wxT(" lost objects");
message << m_trackedDataObjects << " lost objects";
else
message << (-m_trackedDataObjects) << wxT(" extra deletes");
message << (-m_trackedDataObjects) << " extra deletes";
wxFAIL_MSG(message);
return false;
}
@@ -123,7 +123,7 @@ bool ItemContainerWidgetsPage::VerifyAllClientDataDestroyed()
void ItemContainerWidgetsPage::StartTest(const wxString& label)
{
m_container->Clear();
wxLogMessage(wxT("Test - %s:"), label.c_str());
wxLogMessage("Test - %s:", label.c_str());
}
void ItemContainerWidgetsPage::EndTest(const wxArrayString& items)
@@ -133,7 +133,7 @@ void ItemContainerWidgetsPage::EndTest(const wxArrayString& items)
bool ok = count == items.GetCount();
if ( !ok )
{
wxFAIL_MSG(wxT("Item count does not match."));
wxFAIL_MSG("Item count does not match.");
}
else
{
@@ -143,7 +143,7 @@ void ItemContainerWidgetsPage::EndTest(const wxArrayString& items)
if ( str != items[i] )
{
wxFAIL_MSG(wxString::Format(
wxT("Wrong string \"%s\" at position %d (expected \"%s\")"),
"Wrong string \"%s\" at position %d (expected \"%s\")",
str.c_str(), i, items[i].c_str()));
ok = false;
break;
@@ -178,19 +178,19 @@ void ItemContainerWidgetsPage::EndTest(const wxArrayString& items)
m_container->Clear();
ok &= VerifyAllClientDataDestroyed();
wxLogMessage(wxT("...%s"), ok ? wxT("passed") : wxT("failed"));
wxLogMessage("...%s", ok ? "passed" : "failed");
}
wxString
ItemContainerWidgetsPage::DumpContainerData(const wxArrayString& expected) const
{
wxString str;
str << wxT("Current content:\n");
str << "Current content:\n";
unsigned i;
for ( i = 0; i < m_container->GetCount(); ++i )
{
str << wxT(" - ") << m_container->GetString(i) << wxT(" [");
str << " - " << m_container->GetString(i) << " [";
if ( m_container->HasClientObjectData() )
{
TrackedClientData *
@@ -204,20 +204,20 @@ ItemContainerWidgetsPage::DumpContainerData(const wxArrayString& expected) const
if ( data )
str << (wxUIntPtr)data;
}
str << wxT("]\n");
str << "]\n";
}
str << wxT("Expected content:\n");
str << "Expected content:\n";
for ( i = 0; i < expected.GetCount(); ++i )
{
const wxString& item = expected[i];
str << wxT(" - ") << item << wxT("[");
str << " - " << item << "[";
for( unsigned j = 0; j < m_items.GetCount(); ++j )
{
if ( m_items[j] == item )
str << j;
}
str << wxT("]\n");
str << "]\n";
}
return str;
@@ -227,7 +227,7 @@ bool ItemContainerWidgetsPage::VerifyClientData(wxUIntPtr i, const wxString& str
{
if ( i > m_items.GetCount() || m_items[i] != str )
{
wxLogMessage(wxT("Client data for '%s' does not match."), str.c_str());
wxLogMessage("Client data for '%s' does not match.", str.c_str());
return false;
}
@@ -251,9 +251,9 @@ ItemContainerWidgetsPage::MakeArray(const wxSortedArrayString& sorted)
void ItemContainerWidgetsPage::OnButtonTestItemContainer(wxCommandEvent&)
{
m_container = GetContainer();
wxASSERT_MSG(m_container, wxT("Widget must have a test widget"));
wxASSERT_MSG(m_container, "Widget must have a test widget");
wxLogMessage(wxT("wxItemContainer test for %s, %s:"),
wxLogMessage("wxItemContainer test for %s, %s:",
GetWidget()->GetClassInfo()->GetClassName(),
(m_container->IsSorted() ? "Sorted" : "Unsorted"));
@@ -261,16 +261,16 @@ void ItemContainerWidgetsPage::OnButtonTestItemContainer(wxCommandEvent&)
expected_result = m_container->IsSorted() ? MakeArray(m_itemsSorted)
: m_items;
StartTest(wxT("Append one item"));
StartTest("Append one item");
wxString item = m_items[0];
m_container->Append(item);
EndTest(wxArrayString(1, &item));
StartTest(wxT("Append some items"));
StartTest("Append some items");
m_container->Append(m_items);
EndTest(expected_result);
StartTest(wxT("Append some items with data objects"));
StartTest("Append some items with data objects");
wxClientData **objects = new wxClientData *[m_items.GetCount()];
for ( unsigned i = 0; i < m_items.GetCount(); ++i )
objects[i] = CreateClientData(i);
@@ -278,7 +278,7 @@ void ItemContainerWidgetsPage::OnButtonTestItemContainer(wxCommandEvent&)
EndTest(expected_result);
delete[] objects;
StartTest(wxT("Append some items with data"));
StartTest("Append some items with data");
void **data = new void *[m_items.GetCount()];
for ( unsigned i = 0; i < m_items.GetCount(); ++i )
data[i] = wxUIntToPtr(i);
@@ -286,19 +286,19 @@ void ItemContainerWidgetsPage::OnButtonTestItemContainer(wxCommandEvent&)
EndTest(expected_result);
delete[] data;
StartTest(wxT("Append some items with data, one by one"));
StartTest("Append some items with data, one by one");
for ( unsigned i = 0; i < m_items.GetCount(); ++i )
m_container->Append(m_items[i], wxUIntToPtr(i));
EndTest(expected_result);
StartTest(wxT("Append some items with data objects, one by one"));
StartTest("Append some items with data objects, one by one");
for ( unsigned i = 0; i < m_items.GetCount(); ++i )
m_container->Append(m_items[i], CreateClientData(i));
EndTest(expected_result);
if ( !m_container->IsSorted() )
{
StartTest(wxT("Insert in reverse order with data, one by one"));
StartTest("Insert in reverse order with data, one by one");
for ( unsigned i = m_items.GetCount(); i; --i )
m_container->Insert(m_items[i - 1], 0, wxUIntToPtr(i - 1));
EndTest(expected_result);

View File

@@ -244,7 +244,7 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(ListboxWidgetsPage, wxT("Listbox"),
IMPLEMENT_WIDGETS_PAGE(ListboxWidgetsPage, "Listbox",
FAMILY_CTRLS | WITH_ITEMS_CTRLS
);
@@ -278,17 +278,17 @@ void ListboxWidgetsPage::CreateContent()
// left pane
wxStaticBox *box = new wxStaticBox(this, wxID_ANY,
wxT("&Set listbox parameters"));
"&Set listbox parameters");
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
static const wxString modes[] =
{
wxT("single"),
wxT("extended"),
wxT("multiple"),
"single",
"extended",
"multiple",
};
m_radioSelMode = new wxRadioBox(this, wxID_ANY, wxT("Selection &mode:"),
m_radioSelMode = new wxRadioBox(this, wxID_ANY, "Selection &mode:",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(modes), modes,
1, wxRA_SPECIFY_COLS);
@@ -311,15 +311,15 @@ void ListboxWidgetsPage::CreateContent()
m_chkVScroll = CreateCheckBoxAndAddToSizer
(
sizerLeft,
wxT("Always show &vertical scrollbar")
"Always show &vertical scrollbar"
);
m_chkHScroll = CreateCheckBoxAndAddToSizer
(
sizerLeft,
wxT("Show &horizontal scrollbar")
"Show &horizontal scrollbar"
);
m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Sort items"));
m_chkOwnerDraw = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Owner drawn"));
m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, "&Sort items");
m_chkOwnerDraw = CreateCheckBoxAndAddToSizer(sizerLeft, "&Owner drawn");
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
sizerLeft->Add(m_radioSelMode, 0, wxGROW | wxALL, 5);
@@ -327,67 +327,67 @@ void ListboxWidgetsPage::CreateContent()
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
sizerLeft->Add(m_radioListType, 0, wxGROW | wxALL, 5);
wxButton *btn = new wxButton(this, ListboxPage_Reset, wxT("&Reset"));
wxButton *btn = new wxButton(this, ListboxPage_Reset, "&Reset");
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY,
wxT("&Change listbox contents"));
"&Change listbox contents");
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL);
btn = new wxButton(this, ListboxPage_Add, wxT("&Add this string"));
m_textAdd = new wxTextCtrl(this, ListboxPage_AddText, wxT("test item 0"));
btn = new wxButton(this, ListboxPage_Add, "&Add this string");
m_textAdd = new wxTextCtrl(this, ListboxPage_AddText, "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, ListboxPage_AddSeveral, wxT("&Insert a few strings"));
btn = new wxButton(this, ListboxPage_AddSeveral, "&Insert a few strings");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, ListboxPage_AddMany, wxT("Add &many strings"));
btn = new wxButton(this, ListboxPage_AddMany, "Add &many strings");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
sizerRow = new wxBoxSizer(wxHORIZONTAL);
btn = new wxButton(this, ListboxPage_Change, wxT("C&hange current"));
btn = new wxButton(this, ListboxPage_Change, "C&hange current");
m_textChange = new wxTextCtrl(this, ListboxPage_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, ListboxPage_EnsureVisible, wxT("Make item &visible"));
btn = new wxButton(this, ListboxPage_EnsureVisible, "Make item &visible");
m_textEnsureVisible = new wxTextCtrl(this, ListboxPage_EnsureVisibleText, wxEmptyString);
sizerRow->Add(btn, 0, wxRIGHT, 5);
sizerRow->Add(m_textEnsureVisible, 1, wxLEFT, 5);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = new wxBoxSizer(wxHORIZONTAL);
btn = new wxButton(this, ListboxPage_Delete, wxT("&Delete this item"));
btn = new wxButton(this, ListboxPage_Delete, "&Delete this item");
m_textDelete = new wxTextCtrl(this, ListboxPage_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, ListboxPage_DeleteSel, wxT("Delete &selection"));
btn = new wxButton(this, ListboxPage_DeleteSel, "Delete &selection");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, ListboxPage_Clear, wxT("&Clear"));
btn = new wxButton(this, ListboxPage_Clear, "&Clear");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, ListboxPage_MoveUp, wxT("Move item &up"));
btn = new wxButton(this, ListboxPage_MoveUp, "Move item &up");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, ListboxPage_MoveDown, wxT("Move item &down"));
btn = new wxButton(this, ListboxPage_MoveDown, "Move item &down");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, ListboxPage_GetTopItem, wxT("Get top item"));
btn = new wxButton(this, ListboxPage_GetTopItem, "Get top item");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, ListboxPage_GetCountPerPage, wxT("Get count per page"));
btn = new wxButton(this, ListboxPage_GetCountPerPage, "Get count per page");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, ListboxPage_ContainerTests, wxT("Run &tests"));
btn = new wxButton(this, ListboxPage_ContainerTests, "Run &tests");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
// right pane
@@ -431,7 +431,7 @@ void ListboxWidgetsPage::CreateLbox()
switch ( m_radioSelMode->GetSelection() )
{
default:
wxFAIL_MSG( wxT("unexpected radio box selection") );
wxFAIL_MSG( "unexpected radio box selection" );
wxFALLTHROUGH;
case LboxSel_Single: flags |= wxLB_SINGLE; break;
@@ -617,7 +617,7 @@ void ListboxWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event))
if ( !m_textAdd->IsModified() )
{
// update the default string
m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item));
m_textAdd->SetValue(wxString::Format("test item %u", ++s_item));
}
m_lbox->Append(s);
@@ -628,16 +628,16 @@ void ListboxWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event))
// "many" means 1000 here
for ( unsigned int n = 0; n < 1000; n++ )
{
m_lbox->Append(wxString::Format(wxT("item #%u"), n));
m_lbox->Append(wxString::Format("item #%u", n));
}
}
void ListboxWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event))
{
wxArrayString items;
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"));
items.Add("First");
items.Add("another one");
items.Add("and the last (very very very very very very very very very very long) one");
m_lbox->InsertItems(items, 0);
}
@@ -700,26 +700,26 @@ void ListboxWidgetsPage::OnUpdateUIMoveButtons(wxUpdateUIEvent& evt)
void ListboxWidgetsPage::OnListbox(wxCommandEvent& event)
{
long sel = event.GetSelection();
m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel));
m_textDelete->SetValue(wxString::Format("%ld", sel));
if (event.IsSelection())
{
wxLogMessage(wxT("Listbox item %ld selected"), sel);
wxLogMessage("Listbox item %ld selected", sel);
}
else
{
wxLogMessage(wxT("Listbox item %ld deselected"), sel);
wxLogMessage("Listbox item %ld deselected", sel);
}
}
void ListboxWidgetsPage::OnListboxDClick(wxCommandEvent& event)
{
wxLogMessage( wxT("Listbox item %d double clicked"), event.GetInt() );
wxLogMessage( "Listbox item %d double clicked", event.GetInt() );
}
void ListboxWidgetsPage::OnCheckListbox(wxCommandEvent& event)
{
wxLogMessage( wxT("Listbox item %d toggled"), event.GetInt() );
wxLogMessage( "Listbox item %d toggled", event.GetInt() );
}
void ListboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))

View File

@@ -272,7 +272,7 @@ private:
// implementation
// ============================================================================
IMPLEMENT_WIDGETS_PAGE(NativeWidgetsPage, wxT("Native"), NATIVE_CTRLS);
IMPLEMENT_WIDGETS_PAGE(NativeWidgetsPage, "Native", NATIVE_CTRLS);
NativeWidgetsPage::NativeWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist)
: WidgetsPage(book, imaglist, native_xpm)

View File

@@ -204,20 +204,20 @@ void BookWidgetsPage::CreateContent()
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style"));
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style");
// must be in sync with Orient enum
wxArrayString orientations;
orientations.Add(wxT("&top"));
orientations.Add(wxT("&bottom"));
orientations.Add(wxT("&left"));
orientations.Add(wxT("&right"));
orientations.Add("&top");
orientations.Add("&bottom");
orientations.Add("&left");
orientations.Add("&right");
wxASSERT_MSG( orientations.GetCount() == Orient_Max,
wxT("forgot to update something") );
"forgot to update something" );
m_chkImages = new wxCheckBox(this, wxID_ANY, wxT("Show &images"));
m_radioOrient = new wxRadioBox(this, wxID_ANY, wxT("&Tab orientation"),
m_chkImages = new wxCheckBox(this, wxID_ANY, "Show &images");
m_radioOrient = new wxRadioBox(this, wxID_ANY, "&Tab orientation",
wxDefaultPosition, wxDefaultSize,
orientations, 1, wxRA_SPECIFY_COLS);
@@ -227,48 +227,48 @@ void BookWidgetsPage::CreateContent()
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
sizerLeft->Add(m_radioOrient, 0, wxALL, 5);
wxButton *btn = new wxButton(this, BookPage_Reset, wxT("&Reset"));
wxButton *btn = new wxButton(this, BookPage_Reset, "&Reset");
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Contents"));
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Contents");
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxTextCtrl *text;
wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Number of pages: "),
wxSizer *sizerRow = CreateSizerWithTextAndLabel("Number of pages: ",
BookPage_NumPagesText,
&text);
text->SetEditable(false);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndLabel(wxT("Current selection: "),
sizerRow = CreateSizerWithTextAndLabel("Current selection: ",
BookPage_CurSelectText,
&text);
text->SetEditable(false);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(BookPage_SelectPage,
wxT("&Select page"),
"&Select page",
BookPage_SelectText,
&m_textSelect);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, BookPage_AddPage, wxT("&Add page"));
btn = new wxButton(this, BookPage_AddPage, "&Add page");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(BookPage_InsertPage,
wxT("&Insert page at"),
"&Insert page at",
BookPage_InsertText,
&m_textInsert);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(BookPage_RemovePage,
wxT("&Remove page"),
"&Remove page",
BookPage_RemoveText,
&m_textRemove);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, BookPage_DeleteAll, wxT("&Delete All"));
btn = new wxButton(this, BookPage_DeleteAll, "&Delete All");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
// right pane
@@ -342,7 +342,7 @@ void BookWidgetsPage::RecreateBook()
switch ( m_radioOrient->GetSelection() )
{
default:
wxFAIL_MSG( wxT("unknown orientation") );
wxFAIL_MSG( "unknown orientation" );
// fall through
case Orient_Top:
@@ -429,7 +429,7 @@ int BookWidgetsPage::GetIconIndex() const
wxWindow *BookWidgetsPage::CreateNewPage()
{
return new wxTextCtrl(m_book, wxID_ANY, wxT("I'm a book page"));
return new wxTextCtrl(m_book, wxID_ANY, "I'm a book page");
}
// ----------------------------------------------------------------------------
@@ -451,30 +451,30 @@ void BookWidgetsPage::OnButtonDeleteAll(wxCommandEvent& WXUNUSED(event))
void BookWidgetsPage::OnButtonSelectPage(wxCommandEvent& WXUNUSED(event))
{
int pos = GetTextValue(m_textSelect);
wxCHECK_RET( IsValidValue(pos), wxT("button should be disabled") );
wxCHECK_RET( IsValidValue(pos), "button should be disabled" );
m_book->SetSelection(pos);
}
void BookWidgetsPage::OnButtonAddPage(wxCommandEvent& WXUNUSED(event))
{
m_book->AddPage(CreateNewPage(), wxT("Added page"), false,
m_book->AddPage(CreateNewPage(), "Added page", false,
GetIconIndex());
}
void BookWidgetsPage::OnButtonInsertPage(wxCommandEvent& WXUNUSED(event))
{
int pos = GetTextValue(m_textInsert);
wxCHECK_RET( IsValidValue(pos), wxT("button should be disabled") );
wxCHECK_RET( IsValidValue(pos), "button should be disabled" );
m_book->InsertPage(pos, CreateNewPage(), wxT("Inserted page"), false,
m_book->InsertPage(pos, CreateNewPage(), "Inserted page", false,
GetIconIndex());
}
void BookWidgetsPage::OnButtonRemovePage(wxCommandEvent& WXUNUSED(event))
{
int pos = GetTextValue(m_textRemove);
wxCHECK_RET( IsValidValue(pos), wxT("button should be disabled") );
wxCHECK_RET( IsValidValue(pos), "button should be disabled" );
m_book->DeletePage(pos);
}
@@ -504,13 +504,13 @@ void BookWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event)
void BookWidgetsPage::OnUpdateUINumPagesText(wxUpdateUIEvent& event)
{
if(m_book)
event.SetText( wxString::Format(wxT("%u"), unsigned(m_book->GetPageCount())) );
event.SetText( wxString::Format("%u", unsigned(m_book->GetPageCount())) );
}
void BookWidgetsPage::OnUpdateUICurSelectText(wxUpdateUIEvent& event)
{
if(m_book)
event.SetText( wxString::Format(wxT("%d"), m_book->GetSelection()) );
event.SetText( wxString::Format("%d", m_book->GetSelection()) );
}
void BookWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
@@ -573,13 +573,13 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(NotebookWidgetsPage, wxT("Notebook"),
IMPLEMENT_WIDGETS_PAGE(NotebookWidgetsPage, "Notebook",
FAMILY_CTRLS | BOOK_CTRLS
);
void NotebookWidgetsPage::OnPageChanging(wxNotebookEvent& event)
{
wxLogMessage(wxT("Notebook page changing from %d to %d (currently %d)."),
wxLogMessage("Notebook page changing from %d to %d (currently %d).",
event.GetOldSelection(),
event.GetSelection(),
m_book->GetSelection());
@@ -589,7 +589,7 @@ void NotebookWidgetsPage::OnPageChanging(wxNotebookEvent& event)
void NotebookWidgetsPage::OnPageChanged(wxNotebookEvent& event)
{
wxLogMessage(wxT("Notebook page changed from %d to %d (currently %d)."),
wxLogMessage("Notebook page changed from %d to %d (currently %d).",
event.GetOldSelection(),
event.GetSelection(),
m_book->GetSelection());
@@ -646,13 +646,13 @@ wxBEGIN_EVENT_TABLE(ListbookWidgetsPage, BookWidgetsPage)
EVT_LISTBOOK_PAGE_CHANGED(wxID_ANY, ListbookWidgetsPage::OnPageChanged)
wxEND_EVENT_TABLE()
IMPLEMENT_WIDGETS_PAGE(ListbookWidgetsPage, wxT("Listbook"),
IMPLEMENT_WIDGETS_PAGE(ListbookWidgetsPage, "Listbook",
GENERIC_CTRLS | BOOK_CTRLS
);
void ListbookWidgetsPage::OnPageChanging(wxListbookEvent& event)
{
wxLogMessage(wxT("Listbook page changing from %d to %d (currently %d)."),
wxLogMessage("Listbook page changing from %d to %d (currently %d).",
event.GetOldSelection(),
event.GetSelection(),
m_book->GetSelection());
@@ -662,7 +662,7 @@ void ListbookWidgetsPage::OnPageChanging(wxListbookEvent& event)
void ListbookWidgetsPage::OnPageChanged(wxListbookEvent& event)
{
wxLogMessage(wxT("Listbook page changed from %d to %d (currently %d)."),
wxLogMessage("Listbook page changed from %d to %d (currently %d).",
event.GetOldSelection(),
event.GetSelection(),
m_book->GetSelection());
@@ -719,13 +719,13 @@ wxBEGIN_EVENT_TABLE(ChoicebookWidgetsPage, BookWidgetsPage)
EVT_CHOICEBOOK_PAGE_CHANGED(wxID_ANY, ChoicebookWidgetsPage::OnPageChanged)
wxEND_EVENT_TABLE()
IMPLEMENT_WIDGETS_PAGE(ChoicebookWidgetsPage, wxT("Choicebook"),
IMPLEMENT_WIDGETS_PAGE(ChoicebookWidgetsPage, "Choicebook",
GENERIC_CTRLS | BOOK_CTRLS
);
void ChoicebookWidgetsPage::OnPageChanging(wxChoicebookEvent& event)
{
wxLogMessage(wxT("Choicebook page changing from %d to %d (currently %d)."),
wxLogMessage("Choicebook page changing from %d to %d (currently %d).",
event.GetOldSelection(),
event.GetSelection(),
m_book->GetSelection());
@@ -735,7 +735,7 @@ void ChoicebookWidgetsPage::OnPageChanging(wxChoicebookEvent& event)
void ChoicebookWidgetsPage::OnPageChanged(wxChoicebookEvent& event)
{
wxLogMessage(wxT("Choicebook page changed from %d to %d (currently %d)."),
wxLogMessage("Choicebook page changed from %d to %d (currently %d).",
event.GetOldSelection(),
event.GetSelection(),
m_book->GetSelection());

View File

@@ -299,7 +299,7 @@ public:
};
IMPLEMENT_WIDGETS_PAGE(ODComboboxWidgetsPage, wxT("OwnerDrawnCombobox"),
IMPLEMENT_WIDGETS_PAGE(ODComboboxWidgetsPage, "OwnerDrawnCombobox",
GENERIC_CTRLS | WITH_ITEMS_CTRLS | COMBO_CTRLS
);
@@ -332,88 +332,88 @@ void ODComboboxWidgetsPage::CreateContent()
wxSizer *sizerLeft = new wxBoxSizer(wxVERTICAL);
// left pane - style box
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style"));
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style");
wxSizer *sizerStyle = new wxStaticBoxSizer(box, wxVERTICAL);
m_chkSort = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Sort items"));
m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Read only"));
m_chkDclickcycles = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Double-click Cycles"));
m_chkSort = CreateCheckBoxAndAddToSizer(sizerStyle, "&Sort items");
m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerStyle, "&Read only");
m_chkDclickcycles = CreateCheckBoxAndAddToSizer(sizerStyle, "&Double-click Cycles");
sizerStyle->AddSpacer(4);
m_chkBitmapbutton = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Bitmap button"));
m_chkStdbutton = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("B&lank button background"));
m_chkBitmapbutton = CreateCheckBoxAndAddToSizer(sizerStyle, "&Bitmap button");
m_chkStdbutton = CreateCheckBoxAndAddToSizer(sizerStyle, "B&lank button background");
wxButton *btn = new wxButton(this, ODComboPage_Reset, wxT("&Reset"));
wxButton *btn = new wxButton(this, ODComboPage_Reset, "&Reset");
sizerStyle->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 3);
sizerLeft->Add(sizerStyle, wxSizerFlags().Expand());
// left pane - popup adjustment box
box = new wxStaticBox(this, wxID_ANY, wxT("Adjust &popup"));
box = new wxStaticBox(this, wxID_ANY, "Adjust &popup");
wxSizer *sizerPopupPos = new wxStaticBoxSizer(box, wxVERTICAL);
sizerRow = CreateSizerWithTextAndLabel(wxT("Min. Width:"),
sizerRow = CreateSizerWithTextAndLabel("Min. Width:",
ODComboPage_PopupMinWidth,
&m_textPopupMinWidth);
m_textPopupMinWidth->SetValue(wxT("-1"));
m_textPopupMinWidth->SetValue("-1");
sizerPopupPos->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndLabel(wxT("Max. Height:"),
sizerRow = CreateSizerWithTextAndLabel("Max. Height:",
ODComboPage_PopupHeight,
&m_textPopupHeight);
m_textPopupHeight->SetValue(wxT("-1"));
m_textPopupHeight->SetValue("-1");
sizerPopupPos->Add(sizerRow, 0, wxALL | wxGROW, 5);
m_chkAlignpopupright = CreateCheckBoxAndAddToSizer(sizerPopupPos, wxT("Align Right"));
m_chkAlignpopupright = CreateCheckBoxAndAddToSizer(sizerPopupPos, "Align Right");
sizerLeft->Add(sizerPopupPos, wxSizerFlags().Expand().Border(wxTOP, 2));
// left pane - button adjustment box
box = new wxStaticBox(this, wxID_ANY, wxT("Adjust &button"));
box = new wxStaticBox(this, wxID_ANY, "Adjust &button");
wxSizer *sizerButtonPos = new wxStaticBoxSizer(box, wxVERTICAL);
sizerRow = CreateSizerWithTextAndLabel(wxT("Width:"),
sizerRow = CreateSizerWithTextAndLabel("Width:",
ODComboPage_ButtonWidth,
&m_textButtonWidth);
m_textButtonWidth->SetValue(wxT("-1"));
m_textButtonWidth->SetValue("-1");
sizerButtonPos->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndLabel(wxT("VSpacing:"),
sizerRow = CreateSizerWithTextAndLabel("VSpacing:",
ODComboPage_ButtonSpacing,
&m_textButtonSpacing);
m_textButtonSpacing->SetValue(wxT("0"));
m_textButtonSpacing->SetValue("0");
sizerButtonPos->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndLabel(wxT("Height:"),
sizerRow = CreateSizerWithTextAndLabel("Height:",
ODComboPage_ButtonHeight,
&m_textButtonHeight);
m_textButtonHeight->SetValue(wxT("-1"));
m_textButtonHeight->SetValue("-1");
sizerButtonPos->Add(sizerRow, 0, wxALL | wxGROW, 5);
m_chkAlignbutleft = CreateCheckBoxAndAddToSizer(sizerButtonPos, wxT("Align Left"));
m_chkAlignbutleft = CreateCheckBoxAndAddToSizer(sizerButtonPos, "Align Left");
sizerLeft->Add(sizerButtonPos, wxSizerFlags().Expand().Border(wxTOP, 2));
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY,
wxT("&Change combobox contents"));
"&Change combobox contents");
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
btn = new wxButton(this, ODComboPage_ContainerTests, wxT("Run &tests"));
btn = new wxButton(this, ODComboPage_ContainerTests, "Run &tests");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndLabel(wxT("Current selection"),
sizerRow = CreateSizerWithTextAndLabel("Current selection",
ODComboPage_CurText,
&text);
text->SetEditable(false);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndLabel(wxT("Insertion Point"),
sizerRow = CreateSizerWithTextAndLabel("Insertion Point",
ODComboPage_InsertionPointText,
&text);
text->SetEditable(false);
@@ -421,39 +421,39 @@ void ODComboboxWidgetsPage::CreateContent()
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(ODComboPage_Insert,
wxT("&Insert this string"),
"&Insert this string",
ODComboPage_InsertText,
&m_textInsert);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(ODComboPage_Add,
wxT("&Add this string"),
"&Add this string",
ODComboPage_AddText,
&m_textAdd);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, ODComboPage_AddSeveral, wxT("&Append a few strings"));
btn = new wxButton(this, ODComboPage_AddSeveral, "&Append a few strings");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, ODComboPage_AddMany, wxT("Append &many strings"));
btn = new wxButton(this, ODComboPage_AddMany, "Append &many strings");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(ODComboPage_Change,
wxT("C&hange current"),
"C&hange current",
ODComboPage_ChangeText,
&m_textChange);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(ODComboPage_Delete,
wxT("&Delete this item"),
"&Delete this item",
ODComboPage_DeleteText,
&m_textDelete);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, ODComboPage_DeleteSel, wxT("Delete &selection"));
btn = new wxButton(this, ODComboPage_DeleteSel, "Delete &selection");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, ODComboPage_Clear, wxT("&Clear"));
btn = new wxButton(this, ODComboPage_Clear, "&Clear");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
// right pane
@@ -569,7 +569,7 @@ void ODComboboxWidgetsPage::OnButtonChange(wxCommandEvent& WXUNUSED(event))
#ifndef __WXGTK__
m_combobox->SetString(sel, m_textChange->GetValue());
#else
wxLogMessage(wxT("Not implemented in wxGTK"));
wxLogMessage("Not implemented in wxGTK");
#endif
}
}
@@ -608,7 +608,7 @@ void ODComboboxWidgetsPage::OnButtonInsert(wxCommandEvent& WXUNUSED(event))
if ( !m_textInsert->IsModified() )
{
// update the default string
m_textInsert->SetValue(wxString::Format(wxT("test item %u"), ++s_item));
m_textInsert->SetValue(wxString::Format("test item %u", ++s_item));
}
if (m_combobox->GetSelection() >= 0)
@@ -623,7 +623,7 @@ void ODComboboxWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event))
if ( !m_textAdd->IsModified() )
{
// update the default string
m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item));
m_textAdd->SetValue(wxString::Format("test item %u", ++s_item));
}
m_combobox->Append(s);
@@ -634,15 +634,15 @@ void ODComboboxWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event))
// "many" means 1000 here
for ( unsigned int n = 0; n < 1000; n++ )
{
m_combobox->Append(wxString::Format(wxT("item #%u"), n));
m_combobox->Append(wxString::Format("item #%u", n));
}
}
void ODComboboxWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event))
{
m_combobox->Append(wxT("First"));
m_combobox->Append(wxT("another one"));
m_combobox->Append(wxT("and the last (very very very very very very very very very very long) one"));
m_combobox->Append("First");
m_combobox->Append("another one");
m_combobox->Append("and the last (very very very very very very very very very very long) one");
}
void ODComboboxWidgetsPage::OnTextPopupWidth(wxCommandEvent& WXUNUSED(event))
@@ -698,13 +698,13 @@ void ODComboboxWidgetsPage::OnTextButtonAll(wxCommandEvent& WXUNUSED(event))
void ODComboboxWidgetsPage::OnUpdateUICurText(wxUpdateUIEvent& event)
{
if (m_combobox)
event.SetText( wxString::Format(wxT("%d"), m_combobox->GetSelection()) );
event.SetText( wxString::Format("%d", m_combobox->GetSelection()) );
}
void ODComboboxWidgetsPage::OnUpdateUIInsertionPointText(wxUpdateUIEvent& event)
{
if (m_combobox)
event.SetText( wxString::Format(wxT("%ld"), m_combobox->GetInsertionPoint()) );
event.SetText( wxString::Format("%ld", m_combobox->GetInsertionPoint()) );
}
void ODComboboxWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event)
@@ -761,26 +761,26 @@ void ODComboboxWidgetsPage::OnComboText(wxCommandEvent& event)
wxString s = event.GetString();
wxASSERT_MSG( s == m_combobox->GetValue(),
wxT("event and combobox values should be the same") );
"event and combobox values should be the same" );
if (event.GetEventType() == wxEVT_TEXT_ENTER)
{
wxLogMessage(wxT("OwnerDrawnCombobox enter pressed (now '%s')"), s.c_str());
wxLogMessage("OwnerDrawnCombobox enter pressed (now '%s')", s.c_str());
}
else
{
wxLogMessage(wxT("OwnerDrawnCombobox text changed (now '%s')"), s.c_str());
wxLogMessage("OwnerDrawnCombobox text changed (now '%s')", s.c_str());
}
}
void ODComboboxWidgetsPage::OnComboBox(wxCommandEvent& event)
{
long sel = event.GetInt();
m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel));
m_textDelete->SetValue(wxString::Format("%ld", sel));
wxLogMessage(wxT("OwnerDrawnCombobox item %ld selected"), sel);
wxLogMessage("OwnerDrawnCombobox item %ld selected", sel);
wxLogMessage(wxT("OwnerDrawnCombobox GetValue(): %s"), m_combobox->GetValue().c_str() );
wxLogMessage("OwnerDrawnCombobox GetValue(): %s", m_combobox->GetValue().c_str() );
}
void ODComboboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& event)
@@ -849,12 +849,12 @@ wxBitmap ODComboboxWidgetsPage::CreateBitmap(const wxColour& colour)
void ODComboboxWidgetsPage::OnDropDown(wxCommandEvent& WXUNUSED(event))
{
wxLogMessage(wxT("Combobox dropped down"));
wxLogMessage("Combobox dropped down");
}
void ODComboboxWidgetsPage::OnCloseUp(wxCommandEvent& WXUNUSED(event))
{
wxLogMessage(wxT("Combobox closed up"));
wxLogMessage("Combobox closed up");
}
#endif //wxUSE_ODCOMBOBOX

View File

@@ -180,7 +180,7 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(RadioWidgetsPage, wxT("Radio"),
IMPLEMENT_WIDGETS_PAGE(RadioWidgetsPage, "Radio",
FAMILY_CTRLS | WITH_ITEMS_CTRLS
);
@@ -207,7 +207,7 @@ void RadioWidgetsPage::CreateContent()
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style"));
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style");
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
@@ -219,12 +219,12 @@ void RadioWidgetsPage::CreateContent()
static const wxString layoutDir[] =
{
wxT("default"),
wxT("left to right"),
wxT("top to bottom")
"default",
"left to right",
"top to bottom"
};
m_radioDir = new wxRadioBox(this, wxID_ANY, wxT("Numbering:"),
m_radioDir = new wxRadioBox(this, wxID_ANY, "Numbering:",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(layoutDir), layoutDir,
1, wxRA_SPECIFY_COLS);
@@ -236,57 +236,57 @@ void RadioWidgetsPage::CreateContent()
#endif // wxRA_LEFTTORIGHT
wxSizer *sizerRow;
sizerRow = CreateSizerWithTextAndLabel(wxT("&Major dimension:"),
sizerRow = CreateSizerWithTextAndLabel("&Major dimension:",
wxID_ANY,
&m_textMajorDim);
sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5);
sizerRow = CreateSizerWithTextAndLabel(wxT("&Number of buttons:"),
sizerRow = CreateSizerWithTextAndLabel("&Number of buttons:",
wxID_ANY,
&m_textNumBtns);
sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5);
wxButton *btn;
btn = new wxButton(this, RadioPage_Update, wxT("&Update"));
btn = new wxButton(this, RadioPage_Update, "&Update");
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 5);
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
btn = new wxButton(this, RadioPage_Reset, wxT("&Reset"));
btn = new wxButton(this, RadioPage_Reset, "&Reset");
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change parameters"));
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Change parameters");
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
sizerRow = CreateSizerWithTextAndLabel(wxT("Current selection:"),
sizerRow = CreateSizerWithTextAndLabel("Current selection:",
wxID_ANY,
&m_textCurSel);
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
sizerRow = CreateSizerWithTextAndButton(RadioPage_Selection,
wxT("&Change selection:"),
"&Change selection:",
wxID_ANY,
&m_textSel);
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
sizerRow = CreateSizerWithTextAndButton(RadioPage_Label,
wxT("&Label for box:"),
"&Label for box:",
wxID_ANY,
&m_textLabel);
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
sizerRow = CreateSizerWithTextAndButton(RadioPage_LabelBtn,
wxT("&Label for buttons:"),
"&Label for buttons:",
wxID_ANY,
&m_textLabelBtns);
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
m_chkEnableItem = CreateCheckBoxAndAddToSizer(sizerMiddle,
wxT("Disable &2nd item"),
"Disable &2nd item",
RadioPage_EnableItem);
m_chkShowItem = CreateCheckBoxAndAddToSizer(sizerMiddle,
wxT("Hide 2nd &item"),
"Hide 2nd &item",
RadioPage_ShowItem);
// right pane
@@ -312,10 +312,10 @@ void RadioWidgetsPage::CreateContent()
void RadioWidgetsPage::Reset()
{
m_textMajorDim->SetValue(wxString::Format(wxT("%u"), DEFAULT_MAJOR_DIM));
m_textNumBtns->SetValue(wxString::Format(wxT("%u"), DEFAULT_NUM_ENTRIES));
m_textLabel->SetValue(wxT("I'm a radiobox"));
m_textLabelBtns->SetValue(wxT("item"));
m_textMajorDim->SetValue(wxString::Format("%u", DEFAULT_MAJOR_DIM));
m_textNumBtns->SetValue(wxString::Format("%u", DEFAULT_NUM_ENTRIES));
m_textLabel->SetValue("I'm a radiobox");
m_textLabelBtns->SetValue("item");
m_chkSpecifyRows->SetValue(false);
m_chkEnableItem->SetValue(true);
@@ -342,7 +342,7 @@ void RadioWidgetsPage::CreateRadio()
unsigned long count;
if ( !m_textNumBtns->GetValue().ToULong(&count) )
{
wxLogWarning(wxT("Should have a valid number for number of items."));
wxLogWarning("Should have a valid number for number of items.");
// fall back to default
count = DEFAULT_NUM_ENTRIES;
@@ -351,7 +351,7 @@ void RadioWidgetsPage::CreateRadio()
unsigned long majorDim;
if ( !m_textMajorDim->GetValue().ToULong(&majorDim) )
{
wxLogWarning(wxT("Should have a valid major dimension number."));
wxLogWarning("Should have a valid major dimension number.");
// fall back to default
majorDim = DEFAULT_MAJOR_DIM;
@@ -362,7 +362,7 @@ void RadioWidgetsPage::CreateRadio()
wxString labelBtn = m_textLabelBtns->GetValue();
for ( size_t n = 0; n < count; n++ )
{
items[n] = wxString::Format(wxT("%s %lu"),
items[n] = wxString::Format("%s %lu",
labelBtn.c_str(), (unsigned long)n + 1);
}
@@ -375,7 +375,7 @@ void RadioWidgetsPage::CreateRadio()
switch ( m_radioDir->GetSelection() )
{
default:
wxFAIL_MSG( wxT("unexpected wxRadioBox layout direction") );
wxFAIL_MSG( "unexpected wxRadioBox layout direction" );
// fall through
case RadioDir_Default:
@@ -434,12 +434,12 @@ void RadioWidgetsPage::OnRadioBox(wxCommandEvent& event)
int event_sel = event.GetSelection();
wxUnusedVar(event_sel);
wxLogMessage(wxT("Radiobox selection changed, now %d"), sel);
wxLogMessage("Radiobox selection changed, now %d", sel);
wxASSERT_MSG( sel == event_sel,
wxT("selection should be the same in event and radiobox") );
"selection should be the same in event and radiobox" );
m_textCurSel->SetValue(wxString::Format(wxT("%d"), sel));
m_textCurSel->SetValue(wxString::Format("%d", sel));
}
void RadioWidgetsPage::OnButtonRecreate(wxCommandEvent& WXUNUSED(event))
@@ -458,7 +458,7 @@ void RadioWidgetsPage::OnButtonSelection(wxCommandEvent& WXUNUSED(event))
if ( !m_textSel->GetValue().ToULong(&sel) ||
(sel >= (size_t)m_radio->GetCount()) )
{
wxLogWarning(wxT("Invalid number specified as new selection."));
wxLogWarning("Invalid number specified as new selection.");
}
else
{
@@ -516,14 +516,14 @@ void RadioWidgetsPage::OnUpdateUIReset(wxUpdateUIEvent& event)
void RadioWidgetsPage::OnUpdateUIEnableItem(wxUpdateUIEvent& event)
{
event.SetText(m_radio->IsItemEnabled(TEST_BUTTON) ? wxT("Disable &2nd item")
: wxT("Enable &2nd item"));
event.SetText(m_radio->IsItemEnabled(TEST_BUTTON) ? "Disable &2nd item"
: "Enable &2nd item");
}
void RadioWidgetsPage::OnUpdateUIShowItem(wxUpdateUIEvent& event)
{
event.SetText(m_radio->IsItemShown(TEST_BUTTON) ? wxT("Hide 2nd &item")
: wxT("Show 2nd &item"));
event.SetText(m_radio->IsItemShown(TEST_BUTTON) ? "Hide 2nd &item"
: "Show 2nd &item");
}
#endif // wxUSE_RADIOBOX

View File

@@ -130,7 +130,7 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS GENERIC_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(SearchCtrlWidgetsPage, wxT("SearchCtrl"),
IMPLEMENT_WIDGETS_PAGE(SearchCtrlWidgetsPage, "SearchCtrl",
FAMILY_CTRLS | EDITABLE_CTRLS | ALL_CTRLS);
SearchCtrlWidgetsPage::SearchCtrlWidgetsPage(WidgetsBookCtrl *book,
@@ -147,12 +147,12 @@ void SearchCtrlWidgetsPage::CreateContent()
wxSizer* box = new wxStaticBoxSizer(
new wxStaticBox(this, -1, wxT("Options")),
new wxStaticBox(this, -1, "Options"),
wxVERTICAL);
m_searchBtnCheck = new wxCheckBox(this, ID_SEARCH_CB, wxT("Search button"));
m_cancelBtnCheck = new wxCheckBox(this, ID_CANCEL_CB, wxT("Cancel button"));
m_menuBtnCheck = new wxCheckBox(this, ID_MENU_CB, wxT("Search menu"));
m_searchBtnCheck = new wxCheckBox(this, ID_SEARCH_CB, "Search button");
m_cancelBtnCheck = new wxCheckBox(this, ID_CANCEL_CB, "Cancel button");
m_menuBtnCheck = new wxCheckBox(this, ID_MENU_CB, "Search menu");
m_searchBtnCheck->SetValue(true);
@@ -191,12 +191,12 @@ wxMenu* SearchCtrlWidgetsPage::CreateTestMenu()
{
wxMenu* menu = new wxMenu;
const int SEARCH_MENU_SIZE = 5;
wxMenuItem* menuItem = menu->Append(wxID_ANY, wxT("Recent Searches"), wxT(""), wxITEM_NORMAL);
wxMenuItem* menuItem = menu->Append(wxID_ANY, "Recent Searches", "", wxITEM_NORMAL);
menuItem->Enable(false);
for ( int i = 0; i < SEARCH_MENU_SIZE; i++ )
{
wxString itemText = wxString::Format(wxT("item %i"),i);
wxString tipText = wxString::Format(wxT("tip %i"),i);
wxString itemText = wxString::Format("item %i",i);
wxString tipText = wxString::Format("tip %i",i);
menu->Append(ID_SEARCHMENU+i, itemText, tipText, wxITEM_NORMAL);
}
return menu;

View File

@@ -226,7 +226,7 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(SliderWidgetsPage, wxT("Slider"), FAMILY_CTRLS );
IMPLEMENT_WIDGETS_PAGE(SliderWidgetsPage, "Slider", FAMILY_CTRLS );
SliderWidgetsPage::SliderWidgetsPage(WidgetsBookCtrl *book,
wxImageList *imaglist)
@@ -253,43 +253,43 @@ void SliderWidgetsPage::CreateContent()
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style"));
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style");
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
m_chkInverse = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Inverse"));
m_chkTicks = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Show &ticks"));
m_chkMinMaxLabels = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Show min/max &labels"));
m_chkValueLabel = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Show &value label"));
m_chkInverse = CreateCheckBoxAndAddToSizer(sizerLeft, "&Inverse");
m_chkTicks = CreateCheckBoxAndAddToSizer(sizerLeft, "Show &ticks");
m_chkMinMaxLabels = CreateCheckBoxAndAddToSizer(sizerLeft, "Show min/max &labels");
m_chkValueLabel = CreateCheckBoxAndAddToSizer(sizerLeft, "Show &value label");
static const wxString sides[] =
{
wxT("default"),
wxT("top"),
wxT("bottom"),
wxT("left"),
wxT("right"),
"default",
"top",
"bottom",
"left",
"right",
};
m_radioSides = new wxRadioBox(this, SliderPage_RadioSides, wxT("&Label position"),
m_radioSides = new wxRadioBox(this, SliderPage_RadioSides, "&Label position",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(sides), sides,
1, wxRA_SPECIFY_COLS);
sizerLeft->Add(m_radioSides, 0, wxGROW | wxALL, 5);
m_chkBothSides = CreateCheckBoxAndAddToSizer
(sizerLeft, wxT("&Both sides"), SliderPage_BothSides);
(sizerLeft, "&Both sides", SliderPage_BothSides);
#if wxUSE_TOOLTIPS
m_chkBothSides->SetToolTip( wxT("\"Both sides\" is only supported \nin Universal") );
m_chkBothSides->SetToolTip("\"Both sides\" is only supported \nin Universal");
#endif // wxUSE_TOOLTIPS
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
wxButton *btn = new wxButton(this, SliderPage_Reset, wxT("&Reset"));
wxButton *btn = new wxButton(this, SliderPage_Reset, "&Reset");
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change slider value"));
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Change slider value");
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxTextCtrl *text;
wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Current value"),
wxSizer *sizerRow = CreateSizerWithTextAndLabel("Current value",
SliderPage_CurValueText,
&text);
text->SetEditable(false);
@@ -297,49 +297,49 @@ void SliderWidgetsPage::CreateContent()
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(SliderPage_SetValue,
wxT("Set &value"),
"Set &value",
SliderPage_ValueText,
&m_textValue);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(SliderPage_SetMinAndMax,
wxT("&Min and max"),
"&Min and max",
SliderPage_MinText,
&m_textMin);
m_textMax = new wxTextCtrl(this, SliderPage_MaxText, wxEmptyString);
sizerRow->Add(m_textMax, 1, wxLEFT | wxALIGN_CENTRE_VERTICAL, 5);
m_textMin->SetValue( wxString::Format(wxT("%d"), m_min) );
m_textMax->SetValue( wxString::Format(wxT("%d"), m_max) );
m_textMin->SetValue( wxString::Format("%d", m_min) );
m_textMax->SetValue( wxString::Format("%d", m_max) );
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(SliderPage_SetLineSize,
wxT("Li&ne size"),
"Li&ne size",
SliderPage_LineSizeText,
&m_textLineSize);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(SliderPage_SetPageSize,
wxT("P&age size"),
"P&age size",
SliderPage_PageSizeText,
&m_textPageSize);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(SliderPage_SetTickFreq,
wxT("Tick &frequency"),
"Tick &frequency",
SliderPage_TickFreqText,
&m_textTickFreq);
m_textTickFreq->SetValue(wxT("10"));
m_textTickFreq->SetValue("10");
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(SliderPage_SetThumbLen,
wxT("Thumb &length"),
"Thumb &length",
SliderPage_ThumbLenText,
&m_textThumbLen);
@@ -353,8 +353,8 @@ void SliderWidgetsPage::CreateContent()
Reset();
CreateSlider();
m_textLineSize->SetValue(wxString::Format(wxT("%d"), m_slider->GetLineSize()));
m_textPageSize->SetValue(wxString::Format(wxT("%d"), m_slider->GetPageSize()));
m_textLineSize->SetValue(wxString::Format("%d", m_slider->GetLineSize()));
m_textPageSize->SetValue(wxString::Format("%d", m_slider->GetPageSize()));
// the 3 panes panes compose the window
sizerTop->Add(sizerLeft, 0, wxGROW | (wxALL & ~wxLEFT), 10);
@@ -429,7 +429,7 @@ void SliderWidgetsPage::CreateSlider()
break;
default:
wxFAIL_MSG(wxT("unexpected radiobox selection"));
wxFAIL_MSG("unexpected radiobox selection");
// fall through
}
@@ -488,7 +488,7 @@ void SliderWidgetsPage::DoSetLineSize()
long lineSize;
if ( !m_textLineSize->GetValue().ToLong(&lineSize) )
{
wxLogWarning(wxT("Invalid slider line size"));
wxLogWarning("Invalid slider line size");
return;
}
@@ -497,7 +497,7 @@ void SliderWidgetsPage::DoSetLineSize()
if ( m_slider->GetLineSize() != lineSize )
{
wxLogWarning(wxT("Invalid line size in slider."));
wxLogWarning("Invalid line size in slider.");
}
}
@@ -506,7 +506,7 @@ void SliderWidgetsPage::DoSetPageSize()
long pageSize;
if ( !m_textPageSize->GetValue().ToLong(&pageSize) )
{
wxLogWarning(wxT("Invalid slider page size"));
wxLogWarning("Invalid slider page size");
return;
}
@@ -515,7 +515,7 @@ void SliderWidgetsPage::DoSetPageSize()
if ( m_slider->GetPageSize() != pageSize )
{
wxLogWarning(wxT("Invalid page size in slider."));
wxLogWarning("Invalid page size in slider.");
}
}
@@ -524,7 +524,7 @@ void SliderWidgetsPage::DoSetTickFreq()
long freq;
if ( !m_textTickFreq->GetValue().ToLong(&freq) )
{
wxLogWarning(wxT("Invalid slider tick frequency"));
wxLogWarning("Invalid slider tick frequency");
return;
}
@@ -537,7 +537,7 @@ void SliderWidgetsPage::DoSetThumbLen()
long len;
if ( !m_textThumbLen->GetValue().ToLong(&len) )
{
wxLogWarning(wxT("Invalid slider thumb length"));
wxLogWarning("Invalid slider thumb length");
return;
}
@@ -584,7 +584,7 @@ void SliderWidgetsPage::OnButtonSetMinAndMax(wxCommandEvent& WXUNUSED(event))
!m_textMax->GetValue().ToLong(&maxNew) ||
minNew >= maxNew )
{
wxLogWarning(wxT("Invalid min/max values for the slider."));
wxLogWarning("Invalid min/max values for the slider.");
return;
}
@@ -597,7 +597,7 @@ void SliderWidgetsPage::OnButtonSetMinAndMax(wxCommandEvent& WXUNUSED(event))
if ( m_slider->GetMin() != m_min ||
m_slider->GetMax() != m_max )
{
wxLogWarning(wxT("Invalid range in slider."));
wxLogWarning("Invalid range in slider.");
}
}
@@ -606,7 +606,7 @@ void SliderWidgetsPage::OnButtonSetValue(wxCommandEvent& WXUNUSED(event))
long val;
if ( !m_textValue->GetValue().ToLong(&val) || !IsValidValue(val) )
{
wxLogWarning(wxT("Invalid slider value."));
wxLogWarning("Invalid slider value.");
return;
}
@@ -673,7 +673,7 @@ void SliderWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
void SliderWidgetsPage::OnUpdateUICurValueText(wxUpdateUIEvent& event)
{
event.SetText( wxString::Format(wxT("%d"), m_slider->GetValue()) );
event.SetText( wxString::Format("%d", m_slider->GetValue()) );
}
void SliderWidgetsPage::OnUpdateUIRadioSides(wxUpdateUIEvent& event)
@@ -693,7 +693,7 @@ void SliderWidgetsPage::OnUpdateUIBothSides(wxUpdateUIEvent& event)
void SliderWidgetsPage::OnSlider(wxScrollEvent& event)
{
wxASSERT_MSG( event.GetInt() == m_slider->GetValue(),
wxT("slider value should be the same") );
"slider value should be the same" );
wxEventType eventType = event.GetEventType();
@@ -702,17 +702,17 @@ void SliderWidgetsPage::OnSlider(wxScrollEvent& event)
include/wx/event.h
(section "wxScrollBar and wxSlider event identifiers")
*/
static const wxChar *eventNames[] =
static const wxString eventNames[] =
{
wxT("wxEVT_SCROLL_TOP"),
wxT("wxEVT_SCROLL_BOTTOM"),
wxT("wxEVT_SCROLL_LINEUP"),
wxT("wxEVT_SCROLL_LINEDOWN"),
wxT("wxEVT_SCROLL_PAGEUP"),
wxT("wxEVT_SCROLL_PAGEDOWN"),
wxT("wxEVT_SCROLL_THUMBTRACK"),
wxT("wxEVT_SCROLL_THUMBRELEASE"),
wxT("wxEVT_SCROLL_CHANGED")
"wxEVT_SCROLL_TOP",
"wxEVT_SCROLL_BOTTOM",
"wxEVT_SCROLL_LINEUP",
"wxEVT_SCROLL_LINEDOWN",
"wxEVT_SCROLL_PAGEUP",
"wxEVT_SCROLL_PAGEDOWN",
"wxEVT_SCROLL_THUMBTRACK",
"wxEVT_SCROLL_THUMBRELEASE",
"wxEVT_SCROLL_CHANGED"
};
int index = eventType - wxEVT_SCROLL_TOP;
@@ -722,12 +722,12 @@ void SliderWidgetsPage::OnSlider(wxScrollEvent& event)
should be added to the above eventNames array.
*/
wxASSERT_MSG(index >= 0 && (size_t)index < WXSIZEOF(eventNames),
wxT("Unknown slider event") );
"Unknown slider event" );
static int s_numSliderEvents = 0;
wxLogMessage(wxT("Slider event #%d: %s (pos = %d, int value = %d)"),
wxLogMessage("Slider event #%d: %s (pos = %d, int value = %d)",
s_numSliderEvents++,
eventNames[index],
event.GetPosition(),

View File

@@ -211,7 +211,7 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(SpinBtnWidgetsPage, wxT("Spin"),
IMPLEMENT_WIDGETS_PAGE(SpinBtnWidgetsPage, "Spin",
FAMILY_CTRLS | EDITABLE_CTRLS
);
@@ -245,25 +245,25 @@ void SpinBtnWidgetsPage::CreateContent()
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style"));
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style");
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Vertical"));
m_chkArrowKeys = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Arrow Keys"));
m_chkWrap = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Wrap"));
m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, "&Vertical");
m_chkArrowKeys = CreateCheckBoxAndAddToSizer(sizerLeft, "&Arrow Keys");
m_chkWrap = CreateCheckBoxAndAddToSizer(sizerLeft, "&Wrap");
m_chkProcessEnter = CreateCheckBoxAndAddToSizer(sizerLeft,
wxT("Process &Enter"));
"Process &Enter");
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
static const wxString halign[] =
{
wxT("left"),
wxT("centre"),
wxT("right"),
"left",
"centre",
"right",
};
m_radioAlign = new wxRadioBox(this, wxID_ANY, wxT("&Text alignment"),
m_radioAlign = new wxRadioBox(this, wxID_ANY, "&Text alignment",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(halign), halign, 1);
@@ -271,17 +271,17 @@ void SpinBtnWidgetsPage::CreateContent()
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
wxButton *btn = new wxButton(this, SpinBtnPage_Reset, wxT("&Reset"));
wxButton *btn = new wxButton(this, SpinBtnPage_Reset, "&Reset");
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY,
wxT("&Change spinbtn value"));
"&Change spinbtn value");
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxTextCtrl *text;
wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Current value"),
wxSizer *sizerRow = CreateSizerWithTextAndLabel("Current value",
SpinBtnPage_CurValueText,
&text);
text->SetEditable(false);
@@ -289,21 +289,21 @@ void SpinBtnWidgetsPage::CreateContent()
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(SpinBtnPage_SetValue,
wxT("Set &value"),
"Set &value",
SpinBtnPage_ValueText,
&m_textValue);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(SpinBtnPage_SetMinAndMax,
wxT("&Min and max"),
"&Min and max",
SpinBtnPage_MinText,
&m_textMin);
m_textMax = new wxTextCtrl(this, SpinBtnPage_MaxText, wxEmptyString);
sizerRow->Add(m_textMax, 1, wxLEFT | wxALIGN_CENTRE_VERTICAL, 5);
m_textMin->SetValue( wxString::Format(wxT("%d"), m_min) );
m_textMax->SetValue( wxString::Format(wxT("%d"), m_max) );
m_textMin->SetValue( wxString::Format("%d", m_min) );
m_textMax->SetValue( wxString::Format("%d", m_max) );
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
@@ -367,7 +367,7 @@ void SpinBtnWidgetsPage::CreateSpin()
switch ( m_radioAlign->GetSelection() )
{
default:
wxFAIL_MSG(wxT("unexpected radiobox selection"));
wxFAIL_MSG("unexpected radiobox selection");
// fall through
case Align_Left:
@@ -403,28 +403,28 @@ void SpinBtnWidgetsPage::CreateSpin()
m_spinbtn->SetRange(m_min, m_max);
m_spinctrl = new wxSpinCtrl(this, SpinBtnPage_SpinCtrl,
wxString::Format(wxT("%d"), val),
wxString::Format("%d", val),
wxDefaultPosition, wxDefaultSize,
flags | textFlags,
m_min, m_max, val);
m_spinctrldbl = new wxSpinCtrlDouble(this, SpinBtnPage_SpinCtrlDouble,
wxString::Format(wxT("%d"), val),
wxString::Format("%d", val),
wxDefaultPosition, wxDefaultSize,
flags | textFlags,
m_min, m_max, val, 0.1);
// Add spacers, labels and spin controls to the sizer.
m_sizerSpin->Add(0, 0, 1);
m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, wxT("wxSpinButton")),
m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, "wxSpinButton"),
0, wxALIGN_CENTRE | wxALL, 5);
m_sizerSpin->Add(m_spinbtn, 0, wxALIGN_CENTRE | wxALL, 5);
m_sizerSpin->Add(0, 0, 1);
m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, wxT("wxSpinCtrl")),
m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, "wxSpinCtrl"),
0, wxALIGN_CENTRE | wxALL, 5);
m_sizerSpin->Add(m_spinctrl, 0, wxALIGN_CENTRE | wxALL, 5);
m_sizerSpin->Add(0, 0, 1);
m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, wxT("wxSpinCtrlDouble")),
m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, "wxSpinCtrlDouble"),
0, wxALIGN_CENTRE | wxALL, 5);
m_sizerSpin->Add(m_spinctrldbl, 0, wxALIGN_CENTRE | wxALL, 5);
m_sizerSpin->Add(0, 0, 1);
@@ -451,7 +451,7 @@ void SpinBtnWidgetsPage::OnButtonSetMinAndMax(wxCommandEvent& WXUNUSED(event))
!m_textMax->GetValue().ToLong(&maxNew) ||
minNew > maxNew )
{
wxLogWarning(wxT("Invalid min/max values for the spinbtn."));
wxLogWarning("Invalid min/max values for the spinbtn.");
return;
}
@@ -498,7 +498,7 @@ void SpinBtnWidgetsPage::OnButtonSetValue(wxCommandEvent& WXUNUSED(event))
long val;
if ( !m_textValue->GetValue().ToLong(&val) || !IsValidValue(val) )
{
wxLogWarning(wxT("Invalid spinbtn value."));
wxLogWarning("Invalid spinbtn value.");
return;
}
@@ -542,7 +542,7 @@ void SpinBtnWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
void SpinBtnWidgetsPage::OnUpdateUICurValueText(wxUpdateUIEvent& event)
{
event.SetText( wxString::Format(wxT("%d"), m_spinbtn->GetValue()));
event.SetText( wxString::Format("%d", m_spinbtn->GetValue()));
}
void SpinBtnWidgetsPage::OnSpinBtn(wxSpinEvent& event)
@@ -550,20 +550,20 @@ void SpinBtnWidgetsPage::OnSpinBtn(wxSpinEvent& event)
int value = event.GetInt();
wxASSERT_MSG( value == m_spinbtn->GetValue(),
wxT("spinbtn value should be the same") );
"spinbtn value should be the same" );
wxLogMessage(wxT("Spin button value changed, now %d"), value);
wxLogMessage("Spin button value changed, now %d", value);
}
void SpinBtnWidgetsPage::OnSpinBtnUp(wxSpinEvent& event)
{
wxLogMessage( wxT("Spin button value incremented, will be %d (was %d)"),
wxLogMessage( "Spin button value incremented, will be %d (was %d)",
event.GetInt(), m_spinbtn->GetValue() );
}
void SpinBtnWidgetsPage::OnSpinBtnDown(wxSpinEvent& event)
{
wxLogMessage( wxT("Spin button value decremented, will be %d (was %d)"),
wxLogMessage( "Spin button value decremented, will be %d (was %d)",
event.GetInt(), m_spinbtn->GetValue() );
}
@@ -572,21 +572,21 @@ void SpinBtnWidgetsPage::OnSpinCtrl(wxSpinEvent& event)
int value = event.GetInt();
wxASSERT_MSG( value == m_spinctrl->GetValue(),
wxT("spinctrl value should be the same") );
"spinctrl value should be the same" );
wxLogMessage(wxT("Spin control value changed, now %d"), value);
wxLogMessage("Spin control value changed, now %d", value);
}
void SpinBtnWidgetsPage::OnSpinCtrlDouble(wxSpinDoubleEvent& event)
{
double value = event.GetValue();
wxLogMessage(wxT("Spin control value changed, now %g"), value);
wxLogMessage("Spin control value changed, now %g", value);
}
void SpinBtnWidgetsPage::OnSpinText(wxCommandEvent& event)
{
wxLogMessage(wxT("Text changed in spin control, now \"%s\""),
wxLogMessage("Text changed in spin control, now \"%s\"",
event.GetString().c_str());
}

View File

@@ -62,7 +62,7 @@ private:
void OnMouseEvent(wxMouseEvent& WXUNUSED(event))
{
wxLogMessage(wxT("wxStaticBitmap clicked."));
wxLogMessage("wxStaticBitmap clicked.");
}
wxStaticBitmapBase *m_statbmp;
@@ -74,7 +74,7 @@ private:
DECLARE_WIDGETS_PAGE(StatBmpWidgetsPage)
};
IMPLEMENT_WIDGETS_PAGE(StatBmpWidgetsPage, wxT("StaticBitmap"),
IMPLEMENT_WIDGETS_PAGE(StatBmpWidgetsPage, "StaticBitmap",
ALL_CTRLS);
void StatBmpWidgetsPage::CreateContent()
@@ -92,12 +92,12 @@ void StatBmpWidgetsPage::CreateContent()
wxString testImage;
#if wxUSE_LIBPNG
wxPathList pathlist;
pathlist.Add(wxT("."));
pathlist.Add(wxT(".."));
pathlist.Add(wxT("../image"));
pathlist.Add(wxT("../../../samples/image"));
pathlist.Add(".");
pathlist.Add("..");
pathlist.Add("../image");
pathlist.Add("../../../samples/image");
wxFileName fn(pathlist.FindValidPath(wxT("toucan.png")));
wxFileName fn(pathlist.FindValidPath("toucan.png"));
if ( fn.FileExists() )
testImage = fn.GetFullPath();
#endif // wxUSE_LIBPNG

View File

@@ -200,7 +200,7 @@ wxEND_EVENT_TABLE()
// implementation
// ============================================================================
IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, wxT("Static"),
IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, "Static",
(int)wxPlatform(GENERIC_CTRLS).If(wxOS_WINDOWS,NATIVE_CTRLS)
);
@@ -260,22 +260,22 @@ void StaticWidgetsPage::CreateContent()
static const wxString halign[] =
{
wxT("left"),
wxT("centre"),
wxT("right"),
"left",
"centre",
"right",
};
static const wxString valign[] =
{
wxT("top"),
wxT("centre"),
wxT("bottom"),
"top",
"centre",
"bottom",
};
m_radioHAlign = new wxRadioBox(this, wxID_ANY, wxT("&Horz alignment"),
m_radioHAlign = new wxRadioBox(this, wxID_ANY, "&Horz alignment",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(halign), halign, 3);
m_radioVAlign = new wxRadioBox(this, wxID_ANY, wxT("&Vert alignment"),
m_radioVAlign = new wxRadioBox(this, wxID_ANY, "&Vert alignment",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(valign), valign, 3);
@@ -285,23 +285,23 @@ void StaticWidgetsPage::CreateContent()
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
m_chkEllipsize = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Ellipsize"));
m_chkEllipsize = CreateCheckBoxAndAddToSizer(sizerLeft, "&Ellipsize");
static const wxString ellipsizeMode[] =
{
wxT("&start"),
wxT("&middle"),
wxT("&end"),
"&start",
"&middle",
"&end",
};
m_radioEllipsize = new wxRadioBox(this, wxID_ANY, wxT("&Ellipsize mode"),
m_radioEllipsize = new wxRadioBox(this, wxID_ANY, "&Ellipsize mode",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(ellipsizeMode), ellipsizeMode,
3);
sizerLeft->Add(m_radioEllipsize, 0, wxGROW | wxALL, 5);
wxButton *btn = new wxButton(this, StaticPage_Reset, wxT("&Reset"));
wxButton *btn = new wxButton(this, StaticPage_Reset, "&Reset");
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
@@ -340,14 +340,14 @@ void StaticWidgetsPage::CreateContent()
// NB: must be done _before_ calling CreateStatic()
Reset();
m_textBox->SetValue(wxT("This is a &box"));
m_textLabel->SetValue(wxT("And this is a\n\tlabel inside the box with a &mnemonic.\n")
wxT("Only this text is affected by the ellipsize settings."));
m_textBox->SetValue("This is a &box");
m_textLabel->SetValue("And this is a\n\tlabel inside the box with a &mnemonic.\n"
"Only this text is affected by the ellipsize settings.");
#if wxUSE_MARKUP
m_textLabelWithMarkup->SetValue(wxT("Another label, this time <b>decorated</b> ")
wxT("with <u>markup</u>; here you need entities ")
wxT("for the symbols: &lt; &gt; &amp; &apos; &quot; ")
wxT(" but you can still place &mnemonics..."));
m_textLabelWithMarkup->SetValue("Another label, this time <b>decorated</b> "
"with <u>markup</u>; here you need entities "
"for the symbols: &lt; &gt; &amp; &apos; &quot; "
" but you can still place &mnemonics...");
#endif // wxUSE_MARKUP
// right pane
@@ -416,7 +416,7 @@ void StaticWidgetsPage::CreateStatic()
switch ( m_radioHAlign->GetSelection() )
{
default:
wxFAIL_MSG(wxT("unexpected radiobox selection"));
wxFAIL_MSG("unexpected radiobox selection");
// fall through
case StaticHAlign_Left:
@@ -435,7 +435,7 @@ void StaticWidgetsPage::CreateStatic()
switch ( m_radioVAlign->GetSelection() )
{
default:
wxFAIL_MSG(wxT("unexpected radiobox selection"));
wxFAIL_MSG("unexpected radiobox selection");
// fall through
case StaticVAlign_Top:
@@ -456,7 +456,7 @@ void StaticWidgetsPage::CreateStatic()
switch ( m_radioEllipsize->GetSelection() )
{
default:
wxFAIL_MSG(wxT("unexpected radiobox selection"));
wxFAIL_MSG("unexpected radiobox selection");
// fall through
case StaticEllipsize_Start:
@@ -603,9 +603,9 @@ void StaticWidgetsPage::OnButtonLabelText(wxCommandEvent& WXUNUSED(event))
// test GetLabel() and GetLabelText(); the first should return the
// label as it is written in the relative text control; the second should
// return the label as it's shown in the wxStaticText
wxLogMessage(wxT("The original label should be '%s'"),
wxLogMessage("The original label should be '%s'",
m_statText->GetLabel());
wxLogMessage(wxT("The label text is '%s'"),
wxLogMessage("The label text is '%s'",
m_statText->GetLabelText());
}
@@ -617,9 +617,9 @@ void StaticWidgetsPage::OnButtonLabelWithMarkupText(wxCommandEvent& WXUNUSED(eve
// test GetLabel() and GetLabelText(); the first should return the
// label as it is written in the relative text control; the second should
// return the label as it's shown in the wxStaticText
wxLogMessage(wxT("The original label should be '%s'"),
wxLogMessage("The original label should be '%s'",
m_statMarkup->GetLabel());
wxLogMessage(wxT("The label text is '%s'"),
wxLogMessage("The label text is '%s'",
m_statMarkup->GetLabelText());
}
#endif // wxUSE_MARKUP

View File

@@ -292,32 +292,32 @@ private:
switch ( HitTest(event.GetPosition(), &x, &y) )
{
default:
wxFAIL_MSG( wxT("unexpected HitTest() result") );
wxFAIL_MSG( "unexpected HitTest() result" );
// fall through
case wxTE_HT_UNKNOWN:
x = y = -1;
where = wxT("nowhere near");
where = "nowhere near";
break;
case wxTE_HT_BEFORE:
where = wxT("before");
where = "before";
break;
case wxTE_HT_BELOW:
where = wxT("below");
where = "below";
break;
case wxTE_HT_BEYOND:
where = wxT("beyond");
where = "beyond";
break;
case wxTE_HT_ON_TEXT:
where = wxT("at");
where = "at";
break;
}
wxLogMessage(wxT("Mouse is %s (%ld, %ld)"), where.c_str(), x, y);
wxLogMessage("Mouse is %s (%ld, %ld)", where.c_str(), x, y);
}
};
@@ -366,7 +366,7 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(TextWidgetsPage, wxT("Text"),
IMPLEMENT_WIDGETS_PAGE(TextWidgetsPage, "Text",
FAMILY_CTRLS | EDITABLE_CTRLS
);
@@ -415,12 +415,12 @@ void TextWidgetsPage::CreateContent()
// left pane
static const wxString modes[] =
{
wxT("single line"),
wxT("multi line"),
"single line",
"multi line",
};
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set textctrl parameters"));
m_radioTextLines = new wxRadioBox(this, wxID_ANY, wxT("&Number of lines:"),
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set textctrl parameters");
m_radioTextLines = new wxRadioBox(this, wxID_ANY, "&Number of lines:",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(modes), modes,
1, wxRA_SPECIFY_COLS);
@@ -431,22 +431,22 @@ void TextWidgetsPage::CreateContent()
sizerLeft->AddSpacer(5);
m_chkPassword = CreateCheckBoxAndAddToSizer(
sizerLeft, wxT("&Password control"), TextPage_Password
sizerLeft, "&Password control", TextPage_Password
);
m_chkReadonly = CreateCheckBoxAndAddToSizer(
sizerLeft, wxT("&Read-only mode")
sizerLeft, "&Read-only mode"
);
m_chkProcessEnter = CreateCheckBoxAndAddToSizer(
sizerLeft, wxT("Process &Enter")
sizerLeft, "Process &Enter"
);
m_chkProcessTab = CreateCheckBoxAndAddToSizer(
sizerLeft, wxT("Process &Tab")
sizerLeft, "Process &Tab"
);
m_chkFilename = CreateCheckBoxAndAddToSizer(
sizerLeft, wxT("&Filename control")
sizerLeft, "&Filename control"
);
m_chkNoVertScrollbar = CreateCheckBoxAndAddToSizer(
sizerLeft, wxT("No &vertical scrollbar"),
sizerLeft, "No &vertical scrollbar",
TextPage_NoVertScrollbar
);
m_chkFilename->Disable(); // not implemented yet
@@ -454,13 +454,13 @@ void TextWidgetsPage::CreateContent()
static const wxString wrap[] =
{
wxT("no wrap"),
wxT("word wrap"),
wxT("char wrap"),
wxT("best wrap"),
"no wrap",
"word wrap",
"char wrap",
"best wrap",
};
m_radioWrap = new wxRadioBox(this, TextPage_WrapLines, wxT("&Wrap style:"),
m_radioWrap = new wxRadioBox(this, TextPage_WrapLines, "&Wrap style:",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(wrap), wrap,
1, wxRA_SPECIFY_COLS);
@@ -481,12 +481,12 @@ void TextWidgetsPage::CreateContent()
#ifdef __WXMSW__
static const wxString kinds[] =
{
wxT("plain edit"),
wxT("rich edit"),
wxT("rich edit 2.0"),
"plain edit",
"rich edit",
"rich edit 2.0",
};
m_radioKind = new wxRadioBox(this, wxID_ANY, wxT("Control &kind"),
m_radioKind = new wxRadioBox(this, wxID_ANY, "Control &kind",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(kinds), kinds,
1, wxRA_SPECIFY_COLS);
@@ -495,33 +495,33 @@ void TextWidgetsPage::CreateContent()
sizerLeft->Add(m_radioKind, 0, wxGROW | wxALL, 5);
#endif // __WXMSW__
wxButton *btn = new wxButton(this, TextPage_Reset, wxT("&Reset"));
wxButton *btn = new wxButton(this, TextPage_Reset, "&Reset");
sizerLeft->Add(2, 2, 0, wxGROW | wxALL, 1); // spacer
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change contents:"));
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Change contents:");
wxSizer *sizerMiddleUp = new wxStaticBoxSizer(box2, wxVERTICAL);
btn = new wxButton(this, TextPage_Set, wxT("&Set text value"));
btn = new wxButton(this, TextPage_Set, "&Set text value");
sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1);
btn = new wxButton(this, TextPage_Add, wxT("&Append text"));
btn = new wxButton(this, TextPage_Add, "&Append text");
sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1);
btn = new wxButton(this, TextPage_Insert, wxT("&Insert text"));
btn = new wxButton(this, TextPage_Insert, "&Insert text");
sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1);
btn = new wxButton(this, TextPage_Load, wxT("&Load file"));
btn = new wxButton(this, TextPage_Load, "&Load file");
sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1);
btn = new wxButton(this, TextPage_Clear, wxT("&Clear"));
btn = new wxButton(this, TextPage_Clear, "&Clear");
sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1);
btn = new wxButton(this, TextPage_StreamRedirector, wxT("St&ream redirection"));
btn = new wxButton(this, TextPage_StreamRedirector, "St&ream redirection");
sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1);
wxStaticBox *box4 = new wxStaticBox(this, wxID_ANY, wxT("&Info:"));
wxStaticBox *box4 = new wxStaticBox(this, wxID_ANY, "&Info:");
wxSizer *sizerMiddleDown = new wxStaticBoxSizer(box4, wxVERTICAL);
m_textPosCur = CreateInfoText();
@@ -531,19 +531,19 @@ void TextWidgetsPage::CreateContent()
wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL);
sizerRow->Add(CreateTextWithLabelSizer
(
wxT("Current pos:"),
"Current pos:",
m_textPosCur
),
0, wxRIGHT, 5);
sizerRow->Add(CreateTextWithLabelSizer
(
wxT("Col:"),
"Col:",
m_textColCur
),
0, wxLEFT | wxRIGHT, 5);
sizerRow->Add(CreateTextWithLabelSizer
(
wxT("Row:"),
"Row:",
m_textRowCur
),
0, wxLEFT, 5);
@@ -555,9 +555,9 @@ void TextWidgetsPage::CreateContent()
(
CreateTextWithLabelSizer
(
wxT("Number of lines:"),
"Number of lines:",
m_textLineLast,
wxT("Last position:"),
"Last position:",
m_textPosLast
),
0, wxALL, 5
@@ -569,9 +569,9 @@ void TextWidgetsPage::CreateContent()
(
CreateTextWithLabelSizer
(
wxT("Selection: from"),
"Selection: from",
m_textSelFrom,
wxT("to"),
"to",
m_textSelTo
),
0, wxALL, 5
@@ -584,7 +584,7 @@ void TextWidgetsPage::CreateContent()
(
CreateTextWithLabelSizer
(
wxT("Range 10..20:"),
"Range 10..20:",
m_textRange
),
0, wxALL, 5
@@ -606,7 +606,7 @@ void TextWidgetsPage::CreateContent()
sizerMiddle->Add(sizerMiddleDown, 1, wxGROW | wxTOP, 5);
// right pane
wxStaticBox *box3 = new wxStaticBox(this, wxID_ANY, wxT("&Text:"));
wxStaticBox *box3 = new wxStaticBox(this, wxID_ANY, "&Text:");
m_sizerText = new wxStaticBoxSizer(box3, wxHORIZONTAL);
Reset();
CreateText();
@@ -631,7 +631,7 @@ wxTextCtrl *TextWidgetsPage::CreateInfoText()
if ( !s_maxWidth )
{
// calc it once only
GetTextExtent(wxT("9999999"), &s_maxWidth, NULL);
GetTextExtent("9999999", &s_maxWidth, NULL);
}
wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, wxEmptyString,
@@ -689,7 +689,7 @@ void TextWidgetsPage::CreateText()
switch ( m_radioTextLines->GetSelection() )
{
default:
wxFAIL_MSG( wxT("unexpected lines radio box selection") );
wxFAIL_MSG( "unexpected lines radio box selection" );
case TextLines_Single:
break;
@@ -714,7 +714,7 @@ void TextWidgetsPage::CreateText()
switch ( m_radioWrap->GetSelection() )
{
default:
wxFAIL_MSG( wxT("unexpected wrap style radio box selection") );
wxFAIL_MSG( "unexpected wrap style radio box selection" );
wxFALLTHROUGH;
case WrapStyle_None:
@@ -754,7 +754,7 @@ void TextWidgetsPage::CreateText()
switch ( m_radioKind->GetSelection() )
{
default:
wxFAIL_MSG( wxT("unexpected kind radio box selection") );
wxFAIL_MSG( "unexpected kind radio box selection" );
case TextKind_Plain:
break;
@@ -779,7 +779,7 @@ void TextWidgetsPage::CreateText()
}
else
{
valueOld = wxT("Hello, Universe!");
valueOld = "Hello, Universe!";
}
m_text = new WidgetsTextCtrl(this, TextPage_Textctrl, valueOld, flags);
@@ -839,7 +839,7 @@ void TextWidgetsPage::OnIdle(wxIdleEvent& WXUNUSED(event))
if ( m_textLineLast )
{
m_textLineLast->SetValue(
wxString::Format(wxT("%d"), m_text->GetNumberOfLines()) );
wxString::Format("%d", m_text->GetNumberOfLines()) );
}
if ( m_textSelFrom && m_textSelTo )
@@ -884,8 +884,8 @@ void TextWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event))
void TextWidgetsPage::OnButtonSet(wxCommandEvent& WXUNUSED(event))
{
m_text->SetValue(m_text->GetWindowStyle() & wxTE_MULTILINE
? wxT("Here,\nthere and\neverywhere")
: wxT("Yellow submarine"));
? "Here,\nthere and\neverywhere"
: "Yellow submarine");
m_text->SetFocus();
}
@@ -894,18 +894,18 @@ void TextWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event))
{
if ( m_text->GetWindowStyle() & wxTE_MULTILINE )
{
m_text->AppendText(wxT("We all live in a\n"));
m_text->AppendText("We all live in a\n");
}
m_text->AppendText(wxT("Yellow submarine"));
m_text->AppendText("Yellow submarine");
}
void TextWidgetsPage::OnButtonInsert(wxCommandEvent& WXUNUSED(event))
{
m_text->WriteText(wxT("Is there anybody going to listen to my story"));
m_text->WriteText("Is there anybody going to listen to my story");
if ( m_text->GetWindowStyle() & wxTE_MULTILINE )
{
m_text->WriteText(wxT("\nall about the girl who came to stay"));
m_text->WriteText("\nall about the girl who came to stay");
}
}
@@ -919,15 +919,15 @@ void TextWidgetsPage::OnButtonLoad(wxCommandEvent& WXUNUSED(event))
{
// search for the file in several dirs where it's likely to be
wxPathList pathlist;
pathlist.Add(wxT("."));
pathlist.Add(wxT(".."));
pathlist.Add(wxT("../widgets"));
pathlist.Add(wxT("../../../samples/widgets"));
pathlist.Add(".");
pathlist.Add("..");
pathlist.Add("../widgets");
pathlist.Add("../../../samples/widgets");
wxString filename = pathlist.FindValidPath(wxT("textctrl.cpp"));
wxString filename = pathlist.FindValidPath("textctrl.cpp");
if ( !filename )
{
wxLogError(wxT("File textctrl.cpp not found."));
wxLogError("File textctrl.cpp not found.");
}
else // load it
{
@@ -935,12 +935,12 @@ void TextWidgetsPage::OnButtonLoad(wxCommandEvent& WXUNUSED(event))
if ( !m_text->LoadFile(filename) )
{
// this is not supposed to happen ...
wxLogError(wxT("Error loading file."));
wxLogError("Error loading file.");
}
else
{
long elapsed = sw.Time();
wxLogMessage(wxT("Loaded file '%s' in %lu.%us"),
wxLogMessage("Loaded file '%s' in %lu.%us",
filename.c_str(), elapsed / 1000,
(unsigned int) elapsed % 1000);
}
@@ -996,12 +996,12 @@ void TextWidgetsPage::OnText(wxCommandEvent& WXUNUSED(event))
return;
}
wxLogMessage(wxT("Text ctrl value changed"));
wxLogMessage("Text ctrl value changed");
}
void TextWidgetsPage::OnTextEnter(wxCommandEvent& event)
{
wxLogMessage(wxT("Text entered: '%s'"), event.GetString().c_str());
wxLogMessage("Text entered: '%s'", event.GetString().c_str());
event.Skip();
}
@@ -1058,9 +1058,9 @@ void TextWidgetsPage::OnStreamRedirector(wxCommandEvent& WXUNUSED(event))
{
#if wxHAS_TEXT_WINDOW_STREAM
wxStreamToTextRedirector redirect(m_text);
wxString str( wxT("Outputed to cout, appears in wxTextCtrl!") );
wxString str( "Outputed to cout, appears in wxTextCtrl!" );
wxSTD cout << str << wxSTD endl;
#else
wxMessageBox(wxT("This wxWidgets build does not support wxStreamToTextRedirector"));
wxMessageBox("This wxWidgets build does not support wxStreamToTextRedirector");
#endif
}

View File

@@ -119,7 +119,7 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS GENERIC_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(TimePickerWidgetsPage, wxT("TimePicker"),
IMPLEMENT_WIDGETS_PAGE(TimePickerWidgetsPage, "TimePicker",
FAMILY_CTRLS | PICKER_CTRLS
);

View File

@@ -175,7 +175,7 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(ToggleWidgetsPage, wxT("ToggleButton"),
IMPLEMENT_WIDGETS_PAGE(ToggleWidgetsPage, "ToggleButton",
FAMILY_CTRLS
);
@@ -213,14 +213,14 @@ void ToggleWidgetsPage::CreateContent()
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("Styles"));
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "Styles");
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
#ifdef wxHAS_BITMAPTOGGLEBUTTON
m_chkBitmapOnly = CreateCheckBoxAndAddToSizer(sizerLeft, "&Bitmap only");
m_chkTextAndBitmap = CreateCheckBoxAndAddToSizer(sizerLeft, "Text &and bitmap");
m_chkFit = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Fit exactly"));
m_chkFit = CreateCheckBoxAndAddToSizer(sizerLeft, "&Fit exactly");
#endif // wxHAS_BITMAPTOGGLEBUTTON
#if wxUSE_MARKUP
m_chkUseMarkup = CreateCheckBoxAndAddToSizer(sizerLeft, "Interpret &markup");
@@ -261,22 +261,22 @@ void ToggleWidgetsPage::CreateContent()
// should be in sync with enums Toggle[HV]Align!
static const wxString halign[] =
{
wxT("left"),
wxT("centre"),
wxT("right"),
"left",
"centre",
"right",
};
static const wxString valign[] =
{
wxT("top"),
wxT("centre"),
wxT("bottom"),
"top",
"centre",
"bottom",
};
m_radioHAlign = new wxRadioBox(this, wxID_ANY, wxT("&Horz alignment"),
m_radioHAlign = new wxRadioBox(this, wxID_ANY, "&Horz alignment",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(halign), halign);
m_radioVAlign = new wxRadioBox(this, wxID_ANY, wxT("&Vert alignment"),
m_radioVAlign = new wxRadioBox(this, wxID_ANY, "&Vert alignment",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(valign), valign);
@@ -286,18 +286,18 @@ void ToggleWidgetsPage::CreateContent()
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
wxButton *btn = new wxButton(this, TogglePage_Reset, wxT("&Reset"));
wxButton *btn = new wxButton(this, TogglePage_Reset, "&Reset");
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Operations"));
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Operations");
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxSizer *sizerRow = CreateSizerWithTextAndButton(TogglePage_ChangeLabel,
wxT("Change label"),
"Change label",
wxID_ANY,
&m_textLabel);
m_textLabel->SetValue(wxT("&Toggle me!"));
m_textLabel->SetValue("&Toggle me!");
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
@@ -378,7 +378,7 @@ void ToggleWidgetsPage::CreateToggle()
break;
default:
wxFAIL_MSG(wxT("unexpected radiobox selection"));
wxFAIL_MSG("unexpected radiobox selection");
// fall through
case ToggleHAlign_Centre:
@@ -396,7 +396,7 @@ void ToggleWidgetsPage::CreateToggle()
break;
default:
wxFAIL_MSG(wxT("unexpected radiobox selection"));
wxFAIL_MSG("unexpected radiobox selection");
// fall through
case ToggleVAlign_Centre:
@@ -419,22 +419,22 @@ void ToggleWidgetsPage::CreateToggle()
if ( m_chkUseBitmapClass->GetValue() )
{
btgl = new wxBitmapToggleButton(this, TogglePage_Picker,
CreateBitmap(wxT("normal")));
CreateBitmap("normal"));
}
else
{
btgl = new wxToggleButton(this, TogglePage_Picker, wxT(""));
btgl->SetBitmapLabel(CreateBitmap(wxT("normal")));
btgl = new wxToggleButton(this, TogglePage_Picker, "");
btgl->SetBitmapLabel(CreateBitmap("normal"));
}
#ifdef wxHAS_ANY_BUTTON
if ( m_chkUsePressed->GetValue() )
btgl->SetBitmapPressed(CreateBitmap(wxT("pushed")));
btgl->SetBitmapPressed(CreateBitmap("pushed"));
if ( m_chkUseFocused->GetValue() )
btgl->SetBitmapFocus(CreateBitmap(wxT("focused")));
btgl->SetBitmapFocus(CreateBitmap("focused"));
if ( m_chkUseCurrent->GetValue() )
btgl->SetBitmapCurrent(CreateBitmap(wxT("hover")));
btgl->SetBitmapCurrent(CreateBitmap("hover"));
if ( m_chkUseDisabled->GetValue() )
btgl->SetBitmapDisabled(CreateBitmap(wxT("disabled")));
btgl->SetBitmapDisabled(CreateBitmap("disabled"));
#endif // wxHAS_ANY_BUTTON
m_toggle = btgl;
}
@@ -527,8 +527,8 @@ wxBitmap ToggleWidgetsPage::CreateBitmap(const wxString& label)
dc.SetBackground(*wxCYAN_BRUSH);
dc.Clear();
dc.SetTextForeground(*wxBLACK);
dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + wxT("\n")
wxT("(") + label + wxT(" state)"),
dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + "\n"
"(" + label + " state)",
wxArtProvider::GetBitmap(wxART_INFORMATION),
wxRect(10, 10, bmp.GetWidth() - 20, bmp.GetHeight() - 20),
wxALIGN_CENTRE);

View File

@@ -357,22 +357,22 @@ bool WidgetsApp::OnInit()
// this sample side by side and it is useful to see which one is which
wxString title;
#if defined(__WXUNIVERSAL__)
title = wxT("wxUniv/");
title = "wxUniv/";
#endif
#if defined(__WXMSW__)
title += wxT("wxMSW");
title += "wxMSW";
#elif defined(__WXGTK__)
title += wxT("wxGTK");
title += "wxGTK";
#elif defined(__WXMAC__)
title += wxT("wxMAC");
title += "wxMAC";
#elif defined(__WXMOTIF__)
title += wxT("wxMOTIF");
title += "wxMOTIF";
#else
title += wxT("wxWidgets");
title += "wxWidgets";
#endif
wxFrame *frame = new WidgetsFrame(title + wxT(" widgets demo"));
wxFrame *frame = new WidgetsFrame(title + " widgets demo");
frame->Show();
return true;
@@ -400,25 +400,25 @@ WidgetsFrame::WidgetsFrame(const wxString& title)
wxMenuBar *mbar = new wxMenuBar;
wxMenu *menuWidget = new wxMenu;
#if wxUSE_TOOLTIPS
menuWidget->Append(Widgets_SetTooltip, wxT("Set &tooltip...\tCtrl-T"));
menuWidget->Append(Widgets_SetTooltip, "Set &tooltip...\tCtrl-T");
menuWidget->AppendSeparator();
#endif // wxUSE_TOOLTIPS
menuWidget->Append(Widgets_SetFgColour, wxT("Set &foreground...\tCtrl-F"));
menuWidget->Append(Widgets_SetBgColour, wxT("Set &background...\tCtrl-B"));
menuWidget->Append(Widgets_SetPageBg, wxT("Set &page background...\tShift-Ctrl-B"));
menuWidget->Append(Widgets_SetFont, wxT("Set f&ont...\tCtrl-O"));
menuWidget->AppendCheckItem(Widgets_Enable, wxT("&Enable/disable\tCtrl-E"));
menuWidget->AppendCheckItem(Widgets_Show, wxT("Show/Hide"));
menuWidget->Append(Widgets_SetFgColour, "Set &foreground...\tCtrl-F");
menuWidget->Append(Widgets_SetBgColour, "Set &background...\tCtrl-B");
menuWidget->Append(Widgets_SetPageBg, "Set &page background...\tShift-Ctrl-B");
menuWidget->Append(Widgets_SetFont, "Set f&ont...\tCtrl-O");
menuWidget->AppendCheckItem(Widgets_Enable, "&Enable/disable\tCtrl-E");
menuWidget->AppendCheckItem(Widgets_Show, "Show/Hide");
wxMenu *menuBorders = new wxMenu;
menuBorders->AppendRadioItem(Widgets_BorderDefault, wxT("De&fault\tCtrl-Shift-9"));
menuBorders->AppendRadioItem(Widgets_BorderNone, wxT("&None\tCtrl-Shift-0"));
menuBorders->AppendRadioItem(Widgets_BorderSimple, wxT("&Simple\tCtrl-Shift-1"));
menuBorders->AppendRadioItem(Widgets_BorderDouble, wxT("&Double\tCtrl-Shift-2"));
menuBorders->AppendRadioItem(Widgets_BorderStatic, wxT("Stati&c\tCtrl-Shift-3"));
menuBorders->AppendRadioItem(Widgets_BorderRaised, wxT("&Raised\tCtrl-Shift-4"));
menuBorders->AppendRadioItem(Widgets_BorderSunken, wxT("S&unken\tCtrl-Shift-5"));
menuWidget->AppendSubMenu(menuBorders, wxT("Set &border"));
menuBorders->AppendRadioItem(Widgets_BorderDefault, "De&fault\tCtrl-Shift-9");
menuBorders->AppendRadioItem(Widgets_BorderNone, "&None\tCtrl-Shift-0");
menuBorders->AppendRadioItem(Widgets_BorderSimple, "&Simple\tCtrl-Shift-1");
menuBorders->AppendRadioItem(Widgets_BorderDouble, "&Double\tCtrl-Shift-2");
menuBorders->AppendRadioItem(Widgets_BorderStatic, "Stati&c\tCtrl-Shift-3");
menuBorders->AppendRadioItem(Widgets_BorderRaised, "&Raised\tCtrl-Shift-4");
menuBorders->AppendRadioItem(Widgets_BorderSunken, "S&unken\tCtrl-Shift-5");
menuWidget->AppendSubMenu(menuBorders, "Set &border");
wxMenu* const menuVariants = new wxMenu;
menuVariants->AppendRadioItem(Widgets_VariantMini, "&Mini\tCtrl-Shift-6");
@@ -433,31 +433,31 @@ WidgetsFrame::WidgetsFrame(const wxString& title)
menuWidget->AppendSeparator();
menuWidget->AppendCheckItem(Widgets_GlobalBusyCursor,
wxT("Toggle &global busy cursor\tCtrl-Shift-U"));
"Toggle &global busy cursor\tCtrl-Shift-U");
menuWidget->AppendCheckItem(Widgets_BusyCursor,
wxT("Toggle b&usy cursor\tCtrl-U"));
"Toggle b&usy cursor\tCtrl-U");
menuWidget->AppendSeparator();
menuWidget->Append(wxID_EXIT, wxT("&Quit\tCtrl-Q"));
mbar->Append(menuWidget, wxT("&Widget"));
menuWidget->Append(wxID_EXIT, "&Quit\tCtrl-Q");
mbar->Append(menuWidget, "&Widget");
wxMenu *menuTextEntry = new wxMenu;
menuTextEntry->AppendRadioItem(TextEntry_DisableAutoComplete,
wxT("&Disable auto-completion"));
"&Disable auto-completion");
menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteFixed,
wxT("Fixed-&list auto-completion"));
"Fixed-&list auto-completion");
menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteFilenames,
wxT("&Files names auto-completion"));
"&Files names auto-completion");
menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteDirectories,
wxT("&Directories names auto-completion"));
"&Directories names auto-completion");
menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteCustom,
wxT("&Custom auto-completion"));
"&Custom auto-completion");
menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteKeyLength,
wxT("Custom with &min length"));
"Custom with &min length");
menuTextEntry->AppendSeparator();
menuTextEntry->Append(TextEntry_SetHint, "Set help &hint");
mbar->Append(menuTextEntry, wxT("&Text"));
mbar->Append(menuTextEntry, "&Text");
SetMenuBar(mbar);
@@ -488,7 +488,7 @@ WidgetsFrame::WidgetsFrame(const wxString& title)
// the lower one only has the log listbox and a button to clear it
#if USE_LOG
wxSizer *sizerDown = new wxStaticBoxSizer(
new wxStaticBox( m_panel, wxID_ANY, wxT("&Log window") ),
new wxStaticBox( m_panel, wxID_ANY, "&Log window" ),
wxVERTICAL);
m_lboxLog = new wxListBox(m_panel, wxID_ANY);
@@ -501,11 +501,11 @@ WidgetsFrame::WidgetsFrame(const wxString& title)
wxBoxSizer *sizerBtns = new wxBoxSizer(wxHORIZONTAL);
wxButton *btn;
#if USE_LOG
btn = new wxButton(m_panel, Widgets_ClearLog, wxT("Clear &log"));
btn = new wxButton(m_panel, Widgets_ClearLog, "Clear &log");
sizerBtns->Add(btn);
sizerBtns->Add(10, 0); // spacer
#endif // USE_LOG
btn = new wxButton(m_panel, Widgets_Quit, wxT("E&xit"));
btn = new wxButton(m_panel, Widgets_Quit, "E&xit");
sizerBtns->Add(btn);
sizerDown->Add(sizerBtns, 0, wxALL | wxALIGN_RIGHT, 5);
@@ -601,7 +601,7 @@ void WidgetsFrame::InitBook()
}
}
GetMenuBar()->Append(menuPages, wxT("&Page"));
GetMenuBar()->Append(menuPages, "&Page");
m_book->AssignImageList(imageList);
@@ -664,7 +664,7 @@ WidgetsPage *WidgetsFrame::CurrentPage()
#if !USE_TREEBOOK
WidgetsBookCtrl *subBook = wxStaticCast(page, WidgetsBookCtrl);
wxCHECK_MSG( subBook, NULL, wxT("no WidgetsBookCtrl?") );
wxCHECK_MSG( subBook, NULL, "no WidgetsBookCtrl?" );
page = subBook->GetCurrentPage();
#endif // !USE_TREEBOOK
@@ -771,8 +771,8 @@ void WidgetsFrame::OnSetTooltip(wxCommandEvent& WXUNUSED(event))
wxTextEntryDialog dialog
(
this,
wxT("Tooltip text (may use \\n, leave empty to remove): "),
wxT("Widgets sample"),
"Tooltip text (may use \\n, leave empty to remove): ",
"Widgets sample",
WidgetsPage::GetAttrs().m_tooltip
);
@@ -780,7 +780,7 @@ void WidgetsFrame::OnSetTooltip(wxCommandEvent& WXUNUSED(event))
return;
WidgetsPage::GetAttrs().m_tooltip = dialog.GetValue();
WidgetsPage::GetAttrs().m_tooltip.Replace(wxT("\\n"), wxT("\n"));
WidgetsPage::GetAttrs().m_tooltip.Replace("\\n", "\n");
CurrentPage()->SetUpWidget();
}
@@ -870,7 +870,7 @@ void WidgetsFrame::OnSetFont(wxCommandEvent& WXUNUSED(event))
// so re-layout to show it correctly.
page->Layout();
#else
wxLogMessage(wxT("Font selection dialog not available in current build."));
wxLogMessage("Font selection dialog not available in current build.");
#endif
}
@@ -901,7 +901,7 @@ void WidgetsFrame::OnSetBorder(wxCommandEvent& event)
case Widgets_BorderDouble: border = wxBORDER_DOUBLE; break;
default:
wxFAIL_MSG( wxT("unknown border style") );
wxFAIL_MSG( "unknown border style" );
// fall through
case Widgets_BorderDefault: border = wxBORDER_DEFAULT; break;
@@ -1210,7 +1210,7 @@ void WidgetsFrame::OnWidgetFocus(wxFocusEvent& event)
// WidgetsPageInfo
// ----------------------------------------------------------------------------
WidgetsPageInfo::WidgetsPageInfo(Constructor ctor, const wxChar *label, int categories)
WidgetsPageInfo::WidgetsPageInfo(Constructor ctor, const wxString& label, int categories)
: m_label(label)
, m_categories(categories)
{

View File

@@ -197,7 +197,7 @@ public:
wxImageList *imaglist);
// our ctor
WidgetsPageInfo(Constructor ctor, const wxChar *label, int categories);
WidgetsPageInfo(Constructor ctor, const wxString& label, int categories);
// accessors
const wxString& GetLabel() const { return m_label; }