mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-10-06 07:00:16 +08:00
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:
committed by
Vadim Zeitlin
parent
480047ee9a
commit
b70ed2d8c8
@@ -28,7 +28,7 @@
|
||||
#include "artbrows.h"
|
||||
|
||||
#define ART_CLIENT(id) \
|
||||
choice->Append(wxT(#id), (void*)id);
|
||||
choice->Append(#id, (void*)id);
|
||||
#define ART_ICON(id) \
|
||||
{ \
|
||||
int ind; \
|
||||
@@ -37,7 +37,7 @@
|
||||
ind = images->Add(icon); \
|
||||
else \
|
||||
ind = 0; \
|
||||
list->InsertItem(index, wxT(#id), ind); \
|
||||
list->InsertItem(index, #id, ind); \
|
||||
list->SetItemPtrData(index, wxPtrToUInt(id)); \
|
||||
index++; \
|
||||
}
|
||||
|
||||
@@ -944,7 +944,7 @@ void MyFrame::OnComboBoxUpdate( wxCommandEvent& event )
|
||||
}
|
||||
else if ( event.GetEventType() == wxEVT_TEXT )
|
||||
{
|
||||
wxLogDebug(wxT("EVT_TEXT(id=%i,string=\"%s\")"),event.GetId(),event.GetString().c_str());
|
||||
wxLogDebug("EVT_TEXT(id=%i,string=\"%s\")",event.GetId(),event.GetString().c_str());
|
||||
}
|
||||
else if ( event.GetEventType() == wxEVT_TEXT_ENTER )
|
||||
{
|
||||
|
||||
@@ -226,7 +226,7 @@ public:
|
||||
virtual wxString GetColumnType( unsigned int col ) const wxOVERRIDE
|
||||
{
|
||||
if (col == Col_Toggle)
|
||||
return wxT( "bool" );
|
||||
return "bool";
|
||||
|
||||
if (col == Col_IconText)
|
||||
return "wxDataViewIconText";
|
||||
|
||||
@@ -466,7 +466,7 @@ void MyApp::GenerateReport(wxDebugReport::Context ctx)
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogMessage(wxT("Report generated in \"%s\"."),
|
||||
wxLogMessage("Report generated in \"%s\".",
|
||||
report->GetCompressedFileName().c_str());
|
||||
report->Reset();
|
||||
}
|
||||
|
||||
+20
-20
@@ -631,7 +631,7 @@ public:
|
||||
size_t WXUNUSED(len), const void *buf) wxOVERRIDE
|
||||
{
|
||||
wxCHECK_MSG( format == m_formatShape, false,
|
||||
wxT( "unsupported format") );
|
||||
"unsupported format");
|
||||
|
||||
delete m_shape;
|
||||
m_shape = DnDShape::New(buf);
|
||||
@@ -1150,7 +1150,7 @@ void DnDFrame::OnDragMoveAllow(wxCommandEvent& event)
|
||||
void DnDFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxMessageBox("Drag-&-Drop Demo\n"
|
||||
wxT("Please see \"Help|Help...\" for details\n")
|
||||
"Please see \"Help|Help...\" for details\n"
|
||||
"Copyright (c) 1998 Vadim Zeitlin",
|
||||
"About wxDnD",
|
||||
wxICON_INFORMATION | wxOK,
|
||||
@@ -1175,11 +1175,11 @@ void DnDFrame::OnHelp(wxCommandEvent& /* event */)
|
||||
"it to wordpad or any other droptarget accepting text (and of course you can just drag it\n"
|
||||
"to the right pane). Due to a lot of trace messages, the cursor might take some time to \n"
|
||||
"change, don't release the mouse button until it does. You can change the string being\n"
|
||||
wxT("dragged in \"File|Test drag...\" dialog.\n")
|
||||
"dragged in \"File|Test drag...\" dialog.\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"Please send all questions/bug reports/suggestions &c to \n"
|
||||
wxT("Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>"),
|
||||
"Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>",
|
||||
"wxDnD Help");
|
||||
|
||||
dialog.ShowModal();
|
||||
@@ -1199,18 +1199,18 @@ void DnDFrame::OnLogClear(wxCommandEvent& /* event */ )
|
||||
void DnDFrame::LogDragResult(wxDragResult result)
|
||||
{
|
||||
#if wxUSE_STATUSBAR
|
||||
wxString pc;
|
||||
wxString msg;
|
||||
switch ( result )
|
||||
{
|
||||
case wxDragError: pc = "Error!"; break;
|
||||
case wxDragNone: pc = "Nothing"; break;
|
||||
case wxDragCopy: pc = "Copied"; break;
|
||||
case wxDragMove: pc = "Moved"; break;
|
||||
case wxDragCancel: pc = "Cancelled"; break;
|
||||
default: pc = "Huh?"; break;
|
||||
case wxDragError: msg = "Error!"; break;
|
||||
case wxDragNone: msg = "Nothing"; break;
|
||||
case wxDragCopy: msg = "Copied"; break;
|
||||
case wxDragMove: msg = "Moved"; break;
|
||||
case wxDragCancel: msg = "Cancelled"; break;
|
||||
default: msg = "Huh?"; break;
|
||||
}
|
||||
|
||||
SetStatusText(wxString("Drag result: ") + pc);
|
||||
SetStatusText(wxString("Drag result: ") + msg);
|
||||
#else
|
||||
wxUnusedVar(result);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
@@ -1294,9 +1294,9 @@ void DnDFrame::OnCopyBitmap(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
// PNG support is not always compiled in under Windows, so use BMP there
|
||||
#if wxUSE_LIBPNG
|
||||
wxFileDialog dialog(this, "Open a PNG file", wxEmptyString, wxEmptyString, wxT("PNG files (*.png)|*.png"), 0);
|
||||
wxFileDialog dialog(this, "Open a PNG file", wxEmptyString, wxEmptyString, "PNG files (*.png)|*.png", 0);
|
||||
#else
|
||||
wxFileDialog dialog(this, "Open a BMP file", wxEmptyString, wxEmptyString, wxT("BMP files (*.bmp)|*.bmp"), 0);
|
||||
wxFileDialog dialog(this, "Open a BMP file", wxEmptyString, wxEmptyString, "BMP files (*.bmp)|*.bmp", 0);
|
||||
#endif
|
||||
|
||||
if (dialog.ShowModal() != wxID_OK)
|
||||
@@ -1439,7 +1439,7 @@ void DnDFrame::OnCopyFiles(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
wxFileDialog dialog(this, "Select a file to copy", wxEmptyString, wxEmptyString,
|
||||
wxT("All files (*.*)|*.*"), 0);
|
||||
"All files (*.*)|*.*", 0);
|
||||
|
||||
wxArrayString filenames;
|
||||
while ( dialog.ShowModal() == wxID_OK )
|
||||
@@ -1802,7 +1802,7 @@ void DnDShapeFrame::OnDrag(wxMouseEvent& event)
|
||||
DnDShapeDataObject shapeData(m_shape);
|
||||
wxDropSource source(shapeData, this);
|
||||
|
||||
wxString pc;
|
||||
wxString msg;
|
||||
switch ( source.DoDragDrop(true) )
|
||||
{
|
||||
default:
|
||||
@@ -1817,11 +1817,11 @@ void DnDShapeFrame::OnDrag(wxMouseEvent& event)
|
||||
break;
|
||||
|
||||
case wxDragCopy:
|
||||
pc = "copied";
|
||||
msg = "copied";
|
||||
break;
|
||||
|
||||
case wxDragMove:
|
||||
pc = "moved";
|
||||
msg = "moved";
|
||||
if ( ms_lastDropTarget != this )
|
||||
{
|
||||
// don't delete the shape if we dropped it on ourselves!
|
||||
@@ -1836,10 +1836,10 @@ void DnDShapeFrame::OnDrag(wxMouseEvent& event)
|
||||
break;
|
||||
}
|
||||
|
||||
if ( pc.length() )
|
||||
if (msg.length() )
|
||||
{
|
||||
#if wxUSE_STATUSBAR
|
||||
SetStatusText(wxString("Shape successfully ") + pc);
|
||||
SetStatusText(wxString("Shape successfully ") + msg);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
}
|
||||
//else: status text already set
|
||||
|
||||
@@ -464,7 +464,7 @@ bool MyFrame::ProcessEvent(wxEvent& event)
|
||||
}
|
||||
catch ( const wxChar *msg )
|
||||
{
|
||||
wxLogMessage(wxT("Caught a string \"%s\" in MyFrame"), msg);
|
||||
wxLogMessage("Caught a string \"%s\" in MyFrame", msg);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+17
-18
@@ -343,7 +343,7 @@ enum
|
||||
Exec_Btn_Close
|
||||
};
|
||||
|
||||
static wxString DIALOG_TITLE()
|
||||
static wxString GetDialogTitle()
|
||||
{
|
||||
return "Exec sample";
|
||||
}
|
||||
@@ -675,12 +675,11 @@ void MyFrame::OnKill(wxCommandEvent& WXUNUSED(event))
|
||||
}
|
||||
else
|
||||
{
|
||||
wxArrayString errorText;
|
||||
errorText.push_back(""); // no error
|
||||
errorText.push_back("signal not supported");
|
||||
errorText.push_back("permission denied");
|
||||
errorText.push_back("no such process");
|
||||
errorText.push_back("unspecified error");
|
||||
const wxString errorText[] = { "", // no error
|
||||
"signal not supported",
|
||||
"permission denied",
|
||||
"no such process",
|
||||
"unspecified error" };
|
||||
|
||||
wxLogStatus("Failed to kill process %ld with signal %d: %s",
|
||||
pid, sig, errorText[rc]);
|
||||
@@ -742,7 +741,7 @@ wxBEGIN_EVENT_TABLE(ExecQueryDialog, wxDialog)
|
||||
wxEND_EVENT_TABLE()
|
||||
|
||||
ExecQueryDialog::ExecQueryDialog(const wxString& cmd)
|
||||
: wxDialog(NULL, wxID_ANY, DIALOG_TITLE(),
|
||||
: wxDialog(NULL, wxID_ANY, GetDialogTitle(),
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
||||
{
|
||||
@@ -891,7 +890,7 @@ void MyFrame::OnSyncExec(wxCommandEvent& WXUNUSED(event))
|
||||
void MyFrame::OnAsyncExec(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString cmd = wxGetTextFromUser("Enter the command: ",
|
||||
DIALOG_TITLE(),
|
||||
GetDialogTitle(),
|
||||
m_cmdLast);
|
||||
|
||||
if ( !cmd )
|
||||
@@ -903,7 +902,7 @@ void MyFrame::OnAsyncExec(wxCommandEvent& WXUNUSED(event))
|
||||
void MyFrame::OnShell(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString cmd = wxGetTextFromUser("Enter the command: ",
|
||||
DIALOG_TITLE(),
|
||||
GetDialogTitle(),
|
||||
m_cmdLast);
|
||||
|
||||
if ( !cmd )
|
||||
@@ -927,7 +926,7 @@ void MyFrame::OnExecWithRedirect(wxCommandEvent& WXUNUSED(event))
|
||||
}
|
||||
|
||||
wxString cmd = wxGetTextFromUser("Enter the command: ",
|
||||
DIALOG_TITLE(),
|
||||
GetDialogTitle(),
|
||||
m_cmdLast);
|
||||
|
||||
if ( !cmd )
|
||||
@@ -989,14 +988,14 @@ void MyFrame::OnExecWithPipe(wxCommandEvent& WXUNUSED(event))
|
||||
m_cmdLast = "tr [a-z] [A-Z]";
|
||||
|
||||
wxString cmd = wxGetTextFromUser("Enter the command: ",
|
||||
DIALOG_TITLE(),
|
||||
GetDialogTitle(),
|
||||
m_cmdLast);
|
||||
|
||||
if ( !cmd )
|
||||
return;
|
||||
|
||||
wxString input = wxGetTextFromUser("Enter the string to send to it: ",
|
||||
DIALOG_TITLE());
|
||||
GetDialogTitle());
|
||||
if ( !input )
|
||||
return;
|
||||
|
||||
@@ -1022,7 +1021,7 @@ void MyFrame::OnExecWithPipe(wxCommandEvent& WXUNUSED(event))
|
||||
void MyFrame::OnPOpen(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString cmd = wxGetTextFromUser("Enter the command to launch: ",
|
||||
DIALOG_TITLE(),
|
||||
GetDialogTitle(),
|
||||
m_cmdLast);
|
||||
if ( cmd.empty() )
|
||||
return;
|
||||
@@ -1174,7 +1173,7 @@ void MyFrame::OnOpenURL(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
if ( !wxLaunchDefaultBrowser(s_url) )
|
||||
{
|
||||
wxLogError(wxT("Failed to open URL \"%s\""), s_url.c_str());
|
||||
wxLogError("Failed to open URL \"%s\"", s_url.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1187,19 +1186,19 @@ void MyFrame::OnOpenURL(wxCommandEvent& WXUNUSED(event))
|
||||
bool MyFrame::GetDDEServer()
|
||||
{
|
||||
wxString server = wxGetTextFromUser("Server to connect to:",
|
||||
DIALOG_TITLE(), m_server);
|
||||
GetDialogTitle(), m_server);
|
||||
if ( !server )
|
||||
return false;
|
||||
|
||||
m_server = server;
|
||||
|
||||
wxString topic = wxGetTextFromUser("DDE topic:", DIALOG_TITLE(), m_topic);
|
||||
wxString topic = wxGetTextFromUser("DDE topic:", GetDialogTitle(), m_topic);
|
||||
if ( !topic )
|
||||
return false;
|
||||
|
||||
m_topic = topic;
|
||||
|
||||
wxString cmd = wxGetTextFromUser("DDE command:", DIALOG_TITLE(), m_cmdDde);
|
||||
wxString cmd = wxGetTextFromUser("DDE command:", GetDialogTitle(), m_cmdDde);
|
||||
if ( !cmd )
|
||||
return false;
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
#endif
|
||||
|
||||
// used as title for several dialog boxes
|
||||
static wxString SAMPLE_TITLE()
|
||||
static wxString GetSampleTitle()
|
||||
{
|
||||
return "wxWidgets Font Sample";
|
||||
}
|
||||
@@ -659,7 +659,7 @@ bool MyFrame::DoEnumerateFamilies(bool fixedWidthOnly,
|
||||
n = wxGetSingleChoiceIndex
|
||||
(
|
||||
"Choose a facename",
|
||||
SAMPLE_TITLE(),
|
||||
GetSampleTitle(),
|
||||
nFacenames,
|
||||
facenames,
|
||||
this
|
||||
@@ -713,7 +713,7 @@ void MyFrame::OnSetNativeDesc(wxCommandEvent& WXUNUSED(event))
|
||||
font.SetNativeFontInfo(fontInfo);
|
||||
if ( !font.IsOk() )
|
||||
{
|
||||
wxLogError(wxT("Font info string \"%s\" is invalid."),
|
||||
wxLogError("Font info string \"%s\" is invalid.",
|
||||
fontInfo.c_str());
|
||||
return;
|
||||
}
|
||||
@@ -807,7 +807,7 @@ wxFontEncoding MyFrame::GetEncodingFromUser()
|
||||
int i = wxGetSingleChoiceIndex
|
||||
(
|
||||
"Choose the encoding",
|
||||
SAMPLE_TITLE(),
|
||||
GetSampleTitle(),
|
||||
names,
|
||||
this
|
||||
);
|
||||
@@ -837,7 +837,7 @@ wxFontFamily MyFrame::GetFamilyFromUser()
|
||||
int i = wxGetSingleChoiceIndex
|
||||
(
|
||||
"Choose the family",
|
||||
SAMPLE_TITLE(),
|
||||
GetSampleTitle(),
|
||||
names,
|
||||
this
|
||||
);
|
||||
@@ -1088,10 +1088,10 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
// found!
|
||||
const wxChar *pc = line.c_str() + len;
|
||||
if ( *pc == wxT('"') )
|
||||
if ( *pc == '"')
|
||||
pc++;
|
||||
|
||||
while ( *pc && *pc != wxT('"') )
|
||||
while ( *pc && *pc != '"')
|
||||
{
|
||||
charset += *pc++;
|
||||
}
|
||||
@@ -1165,7 +1165,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxMessageBox("wxWidgets font sample\n"
|
||||
"(c) 1999-2006 Vadim Zeitlin",
|
||||
wxString("About ") + SAMPLE_TITLE(),
|
||||
wxString("About ") + GetSampleTitle(),
|
||||
wxOK | wxICON_INFORMATION, this);
|
||||
}
|
||||
|
||||
|
||||
@@ -1850,13 +1850,12 @@ void BugsGridTable::SetValueAsBool( int row, int col, bool value )
|
||||
|
||||
wxString BugsGridTable::GetColLabelValue( int col )
|
||||
{
|
||||
static wxArrayString headers;
|
||||
headers.push_back("Id");
|
||||
headers.push_back("Summary");
|
||||
headers.push_back("Severity");
|
||||
headers.push_back("Priority");
|
||||
headers.push_back("Platform");
|
||||
headers.push_back("Opened?");
|
||||
static const wxString headers[] = { "Id",
|
||||
"Summary",
|
||||
"Severity",
|
||||
"Priority",
|
||||
"Platform",
|
||||
"Opened?" };
|
||||
return headers[col];
|
||||
}
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
|
||||
#if wxUSE_GIF
|
||||
image.Destroy();
|
||||
|
||||
if ( !image.LoadFile( dir + wxT("horse.gif" )) )
|
||||
if ( !image.LoadFile( dir + "horse.gif" ) )
|
||||
{
|
||||
wxLogError("Can't load GIF image");
|
||||
}
|
||||
|
||||
@@ -397,8 +397,8 @@ void MyFrame::OnPlay(wxCommandEvent& WXUNUSED(event))
|
||||
}
|
||||
else if ( num == 9 )
|
||||
{
|
||||
// this message is not translated (not in catalog) because we used wxT()
|
||||
// and not _() around it
|
||||
// this message is not translated (not in catalog) because we
|
||||
// did not put _() around it
|
||||
str = "You've found a bug in this program!";
|
||||
}
|
||||
else if ( num == 17 )
|
||||
|
||||
@@ -251,7 +251,7 @@ void MyFrame::OnStart(wxCommandEvent& WXUNUSED(event))
|
||||
m_client = new MyClient;
|
||||
bool retval = m_client->Connect(hostname, servername, topic);
|
||||
|
||||
wxLogMessage(wxT("Client host=\"%s\" port=\"%s\" topic=\"%s\" %s"),
|
||||
wxLogMessage("Client host=\"%s\" port=\"%s\" topic=\"%s\" %s",
|
||||
hostname.c_str(), servername.c_str(), topic.c_str(),
|
||||
retval ? "connected" : "failed to connect");
|
||||
|
||||
|
||||
+14
-11
@@ -368,7 +368,7 @@ MyFlexSizerFrame::MyFlexSizerFrame(wxFrame* parent)
|
||||
sizerFlex->SetFlexibleDirection(wxHORIZONTAL);
|
||||
sizerCol2->Add(sizerFlex, 1, wxALL | wxEXPAND, 10);
|
||||
|
||||
sizerCol2->Add(new wxStaticText(p, wxID_ANY, wxT("Same with grow mode == \"none\"")), 0, wxCENTER | wxTOP, 20);
|
||||
sizerCol2->Add(new wxStaticText(p, wxID_ANY, "Same with grow mode == \"none\""), 0, wxCENTER | wxTOP, 20);
|
||||
sizerFlex = new wxFlexGridSizer(3, 3, wxSize(5, 5));
|
||||
InitFlexSizer(sizerFlex, p);
|
||||
sizerFlex->AddGrowableCol(1);
|
||||
@@ -377,7 +377,7 @@ MyFlexSizerFrame::MyFlexSizerFrame(wxFrame* parent)
|
||||
sizerFlex->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_NONE);
|
||||
sizerCol2->Add(sizerFlex, 1, wxALL | wxEXPAND, 10);
|
||||
|
||||
sizerCol2->Add(new wxStaticText(p, wxID_ANY, wxT("Same with grow mode == \"all\"")), 0, wxCENTER | wxTOP, 20);
|
||||
sizerCol2->Add(new wxStaticText(p, wxID_ANY, "Same with grow mode == \"all\""), 0, wxCENTER | wxTOP, 20);
|
||||
sizerFlex = new wxFlexGridSizer(3, 3, wxSize(5, 5));
|
||||
InitFlexSizer(sizerFlex, p);
|
||||
sizerFlex->AddGrowableCol(1);
|
||||
@@ -441,15 +441,18 @@ MySizerDialog::MySizerDialog(wxWindow *parent, const wxString &title)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// some simple macros to help make the sample code below more clear
|
||||
#define TEXTCTRL(text) new wxTextCtrl(p, wxID_ANY, wxT(text))
|
||||
#define MLTEXTCTRL(text) new wxTextCtrl(p, wxID_ANY, wxT(text), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE)
|
||||
#define TEXTCTRL(text) new wxTextCtrl(p, wxID_ANY, text)
|
||||
#define MLTEXTCTRL(text) new wxTextCtrl(p, wxID_ANY, text, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE)
|
||||
#define POS(r, c) wxGBPosition(r,c)
|
||||
#define SPAN(r, c) wxGBSpan(r,c)
|
||||
|
||||
const wxChar gbsDescription[] =wxT("\
|
||||
The wxGridBagSizer is similar to the wxFlexGridSizer except the items are explicitly positioned\n\
|
||||
in a virtual cell of the layout grid, and column or row spanning is allowed. For example, this\n\
|
||||
static text is positioned at (0,0) and it spans 7 columns.");
|
||||
wxString GetGbsDescription()
|
||||
{
|
||||
return "\
|
||||
The wxGridBagSizer is similar to the wxFlexGridSizer except the items are explicitly positioned\n\
|
||||
in a virtual cell of the layout grid, and column or row spanning is allowed. For example, this\n\
|
||||
static text is positioned at (0,0) and it spans 7 columns.";
|
||||
}
|
||||
|
||||
|
||||
// Some IDs
|
||||
@@ -479,7 +482,7 @@ MyGridBagSizerFrame::MyGridBagSizerFrame(wxFrame* parent)
|
||||
m_gbs = new wxGridBagSizer();
|
||||
|
||||
|
||||
m_gbs->Add( new wxStaticText(p, wxID_ANY, gbsDescription),
|
||||
m_gbs->Add( new wxStaticText(p, wxID_ANY, GetGbsDescription()),
|
||||
POS(0,0), SPAN(1, 7),
|
||||
wxALIGN_CENTER | wxALL, 5);
|
||||
|
||||
@@ -557,9 +560,9 @@ void MyGridBagSizerFrame::OnMoveBtn(wxCommandEvent& event)
|
||||
{
|
||||
if ( m_gbs->CheckForIntersection(wxGBPosition(3,6), wxGBSpan(1,1)) )
|
||||
wxMessageBox(
|
||||
wxT("wxGridBagSizer will not allow items to be in the same cell as\n\
|
||||
"wxGridBagSizer will not allow items to be in the same cell as\n\
|
||||
another item, so this operation will fail. You will also get an assert\n\
|
||||
when compiled in debug mode."), "Warning", wxOK | wxICON_INFORMATION);
|
||||
when compiled in debug mode.", "Warning", wxOK | wxICON_INFORMATION);
|
||||
|
||||
if ( m_gbs->SetItemPosition(btn, wxGBPosition(3,6)) )
|
||||
{
|
||||
|
||||
+135
-135
File diff suppressed because it is too large
Load Diff
@@ -79,8 +79,8 @@ private:
|
||||
wxLog *m_logOld;
|
||||
void SetColumnImage(int col, int image);
|
||||
|
||||
void LogEvent(const wxListEvent& event, const wxChar *eventName);
|
||||
void LogColEvent(const wxListEvent& event, const wxChar *eventName);
|
||||
void LogEvent(const wxListEvent& event, const wxString& eventName);
|
||||
void LogColEvent(const wxListEvent& event, const wxString& eventName);
|
||||
|
||||
virtual wxString OnGetItemText(long item, long column) const wxOVERRIDE;
|
||||
virtual int OnGetItemColumnImage(long item, long column) const wxOVERRIDE;
|
||||
@@ -97,7 +97,7 @@ private:
|
||||
class MyFrame: public wxFrame
|
||||
{
|
||||
public:
|
||||
MyFrame(const wxChar *title);
|
||||
MyFrame(const wxString& title);
|
||||
virtual ~MyFrame();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -674,9 +674,9 @@ MyFrame::MyFrame()
|
||||
wxLog::DisableTimestamp();
|
||||
m_logOld = wxLog::SetActiveTarget(new wxLogTextCtrl(m_textctrl));
|
||||
|
||||
wxLogMessage(wxT("Brief explanations: the commands in the \"Menu\" menu ")
|
||||
wxT("append/insert/delete items to/from the \"Test\" menu.\n")
|
||||
wxT("The commands in the \"Menubar\" menu work with the ")
|
||||
wxLogMessage("Brief explanations: the commands in the \"Menu\" menu "
|
||||
"append/insert/delete items to/from the \"Test\" menu.\n"
|
||||
"The commands in the \"Menubar\" menu work with the "
|
||||
"menubar itself.\n\n"
|
||||
"Right click the band below to test popup menus.\n");
|
||||
#endif
|
||||
|
||||
@@ -70,7 +70,7 @@ wxPanel *CreateUserCreatedPage(wxBookCtrlBase *parent)
|
||||
wxPanel *panel = new wxPanel(parent);
|
||||
|
||||
#if wxUSE_HELP
|
||||
panel->SetHelpText( wxT( "Panel with a Button" ) );
|
||||
panel->SetHelpText("Panel with a Button");
|
||||
#endif
|
||||
|
||||
(void) new wxButton( panel, wxID_ANY, "Button",
|
||||
@@ -84,7 +84,7 @@ wxPanel *CreateRadioButtonsPage(wxBookCtrlBase *parent)
|
||||
wxPanel *panel = new wxPanel(parent);
|
||||
|
||||
#if wxUSE_HELP
|
||||
panel->SetHelpText( wxT( "Panel with some Radio Buttons" ) );
|
||||
panel->SetHelpText("Panel with some Radio Buttons");
|
||||
#endif
|
||||
|
||||
wxString animals[] =
|
||||
@@ -115,7 +115,7 @@ wxPanel *CreateVetoPage(wxBookCtrlBase *parent)
|
||||
wxPanel *panel = new wxPanel(parent);
|
||||
|
||||
#if wxUSE_HELP
|
||||
panel->SetHelpText( wxT( "An empty panel" ) );
|
||||
panel->SetHelpText("An empty panel");
|
||||
#endif
|
||||
|
||||
(void) new wxStaticText( panel, wxID_ANY,
|
||||
@@ -130,7 +130,7 @@ wxPanel *CreateBigButtonPage(wxBookCtrlBase *parent)
|
||||
wxPanel *panel = new wxPanel(parent);
|
||||
|
||||
#if wxUSE_HELP
|
||||
panel->SetHelpText( wxT( "Panel with a maximized button" ) );
|
||||
panel->SetHelpText("Panel with a maximized button");
|
||||
#endif
|
||||
|
||||
wxButton *buttonBig = new wxButton(panel, wxID_ANY, "Maximized button");
|
||||
@@ -147,7 +147,7 @@ wxPanel *CreateInsertPage(wxBookCtrlBase *parent)
|
||||
wxPanel *panel = new wxPanel(parent);
|
||||
|
||||
#if wxUSE_HELP
|
||||
panel->SetHelpText( wxT( "Maroon panel" ) );
|
||||
panel->SetHelpText("Maroon panel");
|
||||
#endif
|
||||
|
||||
panel->SetBackgroundColour( wxColour( "MAROON" ) );
|
||||
@@ -642,7 +642,7 @@ wxPanel *MyFrame::CreateNewPage() const
|
||||
wxPanel *panel = new wxPanel(m_bookCtrl, wxID_ANY );
|
||||
|
||||
#if wxUSE_HELP
|
||||
panel->SetHelpText( wxT( "Panel with \"First\" and \"Second\" buttons" ) );
|
||||
panel->SetHelpText("Panel with \"First\" and \"Second\" buttons");
|
||||
#endif
|
||||
|
||||
(void) new wxButton(panel, wxID_ANY, "First button", wxPoint(10, 30));
|
||||
|
||||
+538
-545
File diff suppressed because it is too large
Load Diff
@@ -38,12 +38,12 @@ wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
wxEND_EVENT_TABLE()
|
||||
|
||||
MyFrame::MyFrame(wxWindow* parent)
|
||||
: wxFrame(parent, wxID_ANY, wxT("PropertyGrid Test"))
|
||||
: wxFrame(parent, wxID_ANY, "PropertyGrid Test")
|
||||
{
|
||||
wxMenu *Menu = new wxMenu;
|
||||
Menu->Append(ID_ACTION, wxT("Action"));
|
||||
Menu->Append(ID_ACTION, "Action");
|
||||
wxMenuBar *MenuBar = new wxMenuBar();
|
||||
MenuBar->Append(Menu, wxT("Action"));
|
||||
MenuBar->Append(Menu, "Action");
|
||||
SetMenuBar(MenuBar);
|
||||
|
||||
wxPropertyGrid *pg = new wxPropertyGrid(this,wxID_ANY,wxDefaultPosition,wxSize(400,400),
|
||||
@@ -51,9 +51,9 @@ MyFrame::MyFrame(wxWindow* parent)
|
||||
wxPG_BOLD_MODIFIED );
|
||||
m_pg = pg;
|
||||
|
||||
pg->Append( new wxStringProperty(wxT("String Property"), wxPG_LABEL) );
|
||||
pg->Append( new wxIntProperty(wxT("Int Property"), wxPG_LABEL) );
|
||||
pg->Append( new wxBoolProperty(wxT("Bool Property"), wxPG_LABEL) );
|
||||
pg->Append( new wxStringProperty("String Property", wxPG_LABEL) );
|
||||
pg->Append( new wxIntProperty("Int Property", wxPG_LABEL) );
|
||||
pg->Append( new wxBoolProperty("Bool Property", wxPG_LABEL) );
|
||||
|
||||
SetSize(400, 600);
|
||||
}
|
||||
@@ -64,12 +64,12 @@ void MyFrame::OnPropertyGridChange(wxPropertyGridEvent &event)
|
||||
|
||||
if ( p )
|
||||
{
|
||||
wxLogVerbose(wxT("OnPropertyGridChange(%s, value=%s)"),
|
||||
wxLogVerbose("OnPropertyGridChange(%s, value=%s)",
|
||||
p->GetName().c_str(), p->GetValueAsString().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogVerbose(wxT("OnPropertyGridChange(NULL)"));
|
||||
wxLogVerbose("OnPropertyGridChange(NULL)");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ void MyFrame::OnPropertyGridChanging(wxPropertyGridEvent &event)
|
||||
{
|
||||
wxPGProperty* p = event.GetProperty();
|
||||
|
||||
wxLogVerbose(wxT("OnPropertyGridChanging(%s)"), p->GetName().c_str());
|
||||
wxLogVerbose("OnPropertyGridChanging(%s)", p->GetName().c_str());
|
||||
}
|
||||
|
||||
void MyFrame::OnAction(wxCommandEvent &)
|
||||
|
||||
@@ -69,7 +69,7 @@ wxFontDataProperty::wxFontDataProperty( const wxString& label, const wxString& n
|
||||
m_value_wxFontData << fontData;
|
||||
|
||||
// Add extra children.
|
||||
AddPrivateChild( new wxColourProperty(wxT("Colour"), wxPG_LABEL,
|
||||
AddPrivateChild( new wxColourProperty("Colour", wxPG_LABEL,
|
||||
fontData.GetColour() ) );
|
||||
}
|
||||
|
||||
@@ -77,9 +77,9 @@ wxFontDataProperty::~wxFontDataProperty () { }
|
||||
|
||||
void wxFontDataProperty::OnSetValue()
|
||||
{
|
||||
if ( !m_value.IsType(wxT("wxFontData")) )
|
||||
if ( !m_value.IsType("wxFontData") )
|
||||
{
|
||||
if ( m_value.IsType(wxT("wxFont")) )
|
||||
if ( m_value.IsType("wxFont") )
|
||||
{
|
||||
wxFont font;
|
||||
font << m_value;
|
||||
@@ -101,7 +101,7 @@ void wxFontDataProperty::OnSetValue()
|
||||
}
|
||||
else
|
||||
{
|
||||
wxFAIL_MSG(wxT("Value to wxFontDataProperty must be either wxFontData or wxFont"));
|
||||
wxFAIL_MSG("Value to wxFontDataProperty must be either wxFontData or wxFont");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -201,8 +201,8 @@ wxSizeProperty::wxSizeProperty( const wxString& label, const wxString& name,
|
||||
const wxSize& value) : wxPGProperty(label,name)
|
||||
{
|
||||
SetValueI(value);
|
||||
AddPrivateChild( new wxIntProperty(wxT("Width"),wxPG_LABEL,value.x) );
|
||||
AddPrivateChild( new wxIntProperty(wxT("Height"),wxPG_LABEL,value.y) );
|
||||
AddPrivateChild( new wxIntProperty("Width",wxPG_LABEL,value.x) );
|
||||
AddPrivateChild( new wxIntProperty("Height",wxPG_LABEL,value.y) );
|
||||
}
|
||||
|
||||
wxSizeProperty::~wxSizeProperty() { }
|
||||
@@ -241,8 +241,8 @@ wxPointProperty::wxPointProperty( const wxString& label, const wxString& name,
|
||||
const wxPoint& value) : wxPGProperty(label,name)
|
||||
{
|
||||
SetValueI(value);
|
||||
AddPrivateChild( new wxIntProperty(wxT("X"),wxPG_LABEL,value.x) );
|
||||
AddPrivateChild( new wxIntProperty(wxT("Y"),wxPG_LABEL,value.y) );
|
||||
AddPrivateChild( new wxIntProperty("X",wxPG_LABEL,value.x) );
|
||||
AddPrivateChild( new wxIntProperty("Y",wxPG_LABEL,value.y) );
|
||||
}
|
||||
|
||||
wxPointProperty::~wxPointProperty() { }
|
||||
@@ -277,7 +277,7 @@ wxVariant wxPointProperty::ChildChanged( wxVariant& thisValue,
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY_WITH_VALIDATOR(wxDirsProperty, ',',
|
||||
wxT("Browse"))
|
||||
"Browse")
|
||||
|
||||
#if wxUSE_VALIDATORS
|
||||
|
||||
@@ -292,7 +292,7 @@ wxValidator* wxDirsProperty::DoGetValidator() const
|
||||
bool wxDirsProperty::OnCustomStringEdit( wxWindow* parent, wxString& value )
|
||||
{
|
||||
wxDirDialog dlg(parent,
|
||||
wxT("Select a directory to be added to the list:"),
|
||||
"Select a directory to be added to the list:",
|
||||
value,
|
||||
0);
|
||||
|
||||
@@ -474,7 +474,7 @@ bool operator == (const wxArrayDouble& a, const wxArrayDouble& b)
|
||||
// Can't do direct equality comparison with floating point numbers.
|
||||
if ( fabs(a[i] - b[i]) > 0.0000000001 )
|
||||
{
|
||||
//wxLogDebug(wxT("%f != %f"),a[i],b[i]);
|
||||
//wxLogDebug("%f != %f",a[i],b[i]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -498,10 +498,10 @@ wxArrayDoubleProperty::wxArrayDoubleProperty (const wxString& label,
|
||||
//
|
||||
// Need to figure out delimiter needed for this locale
|
||||
// (i.e. can't use comma when comma acts as decimal point in float).
|
||||
wxChar use_delimiter = wxT(',');
|
||||
wxChar use_delimiter = ',';
|
||||
|
||||
if (wxString::Format(wxT("%.2f"),12.34).Find(use_delimiter) >= 0)
|
||||
use_delimiter = wxT(';');
|
||||
if (wxString::Format("%.2f",12.34).Find(use_delimiter) >= 0)
|
||||
use_delimiter = ';';
|
||||
|
||||
m_delimiter = use_delimiter;
|
||||
|
||||
@@ -540,7 +540,7 @@ wxString wxArrayDoubleProperty::ValueToString( wxVariant& value,
|
||||
|
||||
void wxArrayDoubleProperty::GenerateValueAsString( wxString& target, int prec, bool removeZeroes ) const
|
||||
{
|
||||
wxChar between[3] = wxT(", ");
|
||||
wxString between = ", ";
|
||||
size_t i;
|
||||
|
||||
between[0] = m_delimiter;
|
||||
@@ -657,7 +657,7 @@ wxValidator* wxArrayDoubleProperty::DoGetValidator() const
|
||||
wxArrayString incChars(numValidator.GetIncludes());
|
||||
// Accept also a delimiter and space character
|
||||
incChars.Add(m_delimiter);
|
||||
incChars.Add(wxT(" "));
|
||||
incChars.Add(" ");
|
||||
|
||||
validator->SetIncludes(incChars);
|
||||
|
||||
@@ -670,9 +670,9 @@ wxValidator* wxArrayDoubleProperty::DoGetValidator() const
|
||||
bool wxArrayDoubleProperty::ValidateValue(wxVariant& value,
|
||||
wxPGValidationInfo& validationInfo) const
|
||||
{
|
||||
if (!value.IsType(wxT("wxArrayDouble")))
|
||||
if (!value.IsType("wxArrayDouble"))
|
||||
{
|
||||
validationInfo.SetFailureMessage(wxT("At least one element is not a valid floating-point number."));
|
||||
validationInfo.SetFailureMessage("At least one element is not a valid floating-point number.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+191
-191
File diff suppressed because it is too large
Load Diff
@@ -571,7 +571,7 @@ void MyFrame::OnLoad(wxCommandEvent& WXUNUSED(event))
|
||||
wxRendererNative *renderer = wxRendererNative::Load(name);
|
||||
if ( !renderer )
|
||||
{
|
||||
wxLogError(wxT("Failed to load renderer \"%s\"."), name.c_str());
|
||||
wxLogError("Failed to load renderer \"%s\".", name.c_str());
|
||||
}
|
||||
else // loaded ok
|
||||
{
|
||||
@@ -579,7 +579,7 @@ void MyFrame::OnLoad(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
m_panel->Refresh();
|
||||
|
||||
wxLogStatus(this, wxT("Successfully loaded the renderer \"%s\"."),
|
||||
wxLogStatus(this, "Successfully loaded the renderer \"%s\".",
|
||||
name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -651,7 +651,7 @@ void MyFrame::OnPrimaryColourSelect(wxRibbonGalleryEvent& evt)
|
||||
{
|
||||
wxString name;
|
||||
wxColour colour = GetGalleryColour(evt.GetGallery(), evt.GetGalleryItem(), &name);
|
||||
AddText(wxT("Colour \"") + name + wxT("\" selected as primary."));
|
||||
AddText("Colour \"" + name + "\" selected as primary.");
|
||||
wxColour secondary, tertiary;
|
||||
m_ribbon->GetArtProvider()->GetColourScheme(NULL, &secondary, &tertiary);
|
||||
m_ribbon->GetArtProvider()->SetColourScheme(colour, secondary, tertiary);
|
||||
@@ -663,7 +663,7 @@ void MyFrame::OnSecondaryColourSelect(wxRibbonGalleryEvent& evt)
|
||||
{
|
||||
wxString name;
|
||||
wxColour colour = GetGalleryColour(evt.GetGallery(), evt.GetGalleryItem(), &name);
|
||||
AddText(wxT("Colour \"") + name + wxT("\" selected as secondary."));
|
||||
AddText("Colour \"" + name + "\" selected as secondary.");
|
||||
wxColour primary, tertiary;
|
||||
m_ribbon->GetArtProvider()->GetColourScheme(&primary, NULL, &tertiary);
|
||||
m_ribbon->GetArtProvider()->SetColourScheme(primary, colour, tertiary);
|
||||
|
||||
+45
-45
@@ -149,9 +149,9 @@ Edit::Edit (wxWindow *parent, wxWindowID id,
|
||||
StyleSetFont (wxSTC_STYLE_DEFAULT, font);
|
||||
StyleSetForeground (wxSTC_STYLE_DEFAULT, *wxBLACK);
|
||||
StyleSetBackground (wxSTC_STYLE_DEFAULT, *wxWHITE);
|
||||
StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour (wxT("DARK GREY")));
|
||||
StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour ("DARK GREY"));
|
||||
StyleSetBackground (wxSTC_STYLE_LINENUMBER, *wxWHITE);
|
||||
StyleSetForeground(wxSTC_STYLE_INDENTGUIDE, wxColour (wxT("DARK GREY")));
|
||||
StyleSetForeground(wxSTC_STYLE_INDENTGUIDE, wxColour ("DARK GREY"));
|
||||
InitializePrefs (DEFAULT_LANGUAGE);
|
||||
|
||||
// set visibility
|
||||
@@ -160,19 +160,19 @@ Edit::Edit (wxWindow *parent, wxWindowID id,
|
||||
SetYCaretPolicy (wxSTC_CARET_EVEN|wxSTC_VISIBLE_STRICT|wxSTC_CARET_SLOP, 1);
|
||||
|
||||
// markers
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDER, wxSTC_MARK_DOTDOTDOT, wxT("BLACK"), wxT("BLACK"));
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_ARROWDOWN, wxT("BLACK"), wxT("BLACK"));
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY, wxT("BLACK"), wxT("BLACK"));
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_DOTDOTDOT, wxT("BLACK"), wxT("WHITE"));
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_ARROWDOWN, wxT("BLACK"), wxT("WHITE"));
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY, wxT("BLACK"), wxT("BLACK"));
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY, wxT("BLACK"), wxT("BLACK"));
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDER, wxSTC_MARK_DOTDOTDOT, "BLACK", "BLACK");
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_ARROWDOWN, "BLACK", "BLACK");
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY, "BLACK", "BLACK");
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_DOTDOTDOT, "BLACK", "WHITE");
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_ARROWDOWN, "BLACK", "WHITE");
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY, "BLACK", "BLACK");
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY, "BLACK", "BLACK");
|
||||
|
||||
// annotations
|
||||
AnnotationSetVisible(wxSTC_ANNOTATION_BOXED);
|
||||
|
||||
// miscellaneous
|
||||
m_LineNrMargin = TextWidth (wxSTC_STYLE_LINENUMBER, wxT("_999999"));
|
||||
m_LineNrMargin = TextWidth (wxSTC_STYLE_LINENUMBER, "_999999");
|
||||
m_FoldingMargin = 16;
|
||||
CmdKeyClear (wxSTC_KEY_TAB, 0); // this is done by the menu accelerator key
|
||||
SetLayoutCache (wxSTC_CACHE_PAGE);
|
||||
@@ -501,8 +501,8 @@ wxString Edit::DeterminePrefs (const wxString &filename) {
|
||||
while (!filepattern.empty()) {
|
||||
wxString cur = filepattern.BeforeFirst (';');
|
||||
if ((cur == filename) ||
|
||||
(cur == (filename.BeforeLast ('.') + wxT(".*"))) ||
|
||||
(cur == (wxT("*.") + filename.AfterLast ('.')))) {
|
||||
(cur == (filename.BeforeLast ('.') + ".*")) ||
|
||||
(cur == ("*." + filename.AfterLast ('.')))) {
|
||||
return curInfo->name;
|
||||
}
|
||||
filepattern = filepattern.AfterFirst (';');
|
||||
@@ -536,7 +536,7 @@ bool Edit::InitializePrefs (const wxString &name) {
|
||||
|
||||
// set margin for line numbers
|
||||
SetMarginType (m_LineNrID, wxSTC_MARGIN_NUMBER);
|
||||
StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour (wxT("DARK GREY")));
|
||||
StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour ("DARK GREY"));
|
||||
StyleSetBackground (wxSTC_STYLE_LINENUMBER, *wxWHITE);
|
||||
SetMarginWidth (m_LineNrID, 0); // start out not visible
|
||||
|
||||
@@ -554,8 +554,8 @@ bool Edit::InitializePrefs (const wxString &name) {
|
||||
}
|
||||
|
||||
// set common styles
|
||||
StyleSetForeground (wxSTC_STYLE_DEFAULT, wxColour (wxT("DARK GREY")));
|
||||
StyleSetForeground (wxSTC_STYLE_INDENTGUIDE, wxColour (wxT("DARK GREY")));
|
||||
StyleSetForeground (wxSTC_STYLE_DEFAULT, wxColour ("DARK GREY"));
|
||||
StyleSetForeground (wxSTC_STYLE_INDENTGUIDE, wxColour ("DARK GREY"));
|
||||
|
||||
// initialize settings
|
||||
if (g_CommonPrefs.syntaxEnable) {
|
||||
@@ -567,10 +567,10 @@ bool Edit::InitializePrefs (const wxString &name) {
|
||||
.Family(wxFONTFAMILY_MODERN)
|
||||
.FaceName(curType.fontname));
|
||||
StyleSetFont (Nr, font);
|
||||
if (curType.foreground) {
|
||||
if (curType.foreground.length()) {
|
||||
StyleSetForeground (Nr, wxColour (curType.foreground));
|
||||
}
|
||||
if (curType.background) {
|
||||
if (curType.background.length()) {
|
||||
StyleSetBackground (Nr, wxColour (curType.background));
|
||||
}
|
||||
StyleSetBold (Nr, (curType.fontstyle & mySTC_STYLE_BOLD) > 0);
|
||||
@@ -600,21 +600,21 @@ bool Edit::InitializePrefs (const wxString &name) {
|
||||
if (g_CommonPrefs.foldEnable) {
|
||||
SetMarginWidth (m_FoldingID, curInfo->folds != 0? m_FoldingMargin: 0);
|
||||
SetMarginSensitive (m_FoldingID, curInfo->folds != 0);
|
||||
SetProperty (wxT("fold"), curInfo->folds != 0? wxT("1"): wxT("0"));
|
||||
SetProperty (wxT("fold.comment"),
|
||||
(curInfo->folds & mySTC_FOLD_COMMENT) > 0? wxT("1"): wxT("0"));
|
||||
SetProperty (wxT("fold.compact"),
|
||||
(curInfo->folds & mySTC_FOLD_COMPACT) > 0? wxT("1"): wxT("0"));
|
||||
SetProperty (wxT("fold.preprocessor"),
|
||||
(curInfo->folds & mySTC_FOLD_PREPROC) > 0? wxT("1"): wxT("0"));
|
||||
SetProperty (wxT("fold.html"),
|
||||
(curInfo->folds & mySTC_FOLD_HTML) > 0? wxT("1"): wxT("0"));
|
||||
SetProperty (wxT("fold.html.preprocessor"),
|
||||
(curInfo->folds & mySTC_FOLD_HTMLPREP) > 0? wxT("1"): wxT("0"));
|
||||
SetProperty (wxT("fold.comment.python"),
|
||||
(curInfo->folds & mySTC_FOLD_COMMENTPY) > 0? wxT("1"): wxT("0"));
|
||||
SetProperty (wxT("fold.quotes.python"),
|
||||
(curInfo->folds & mySTC_FOLD_QUOTESPY) > 0? wxT("1"): wxT("0"));
|
||||
SetProperty ("fold", curInfo->folds != 0? "1": "0");
|
||||
SetProperty ("fold.comment",
|
||||
(curInfo->folds & mySTC_FOLD_COMMENT) > 0? "1": "0");
|
||||
SetProperty ("fold.compact",
|
||||
(curInfo->folds & mySTC_FOLD_COMPACT) > 0? "1": "0");
|
||||
SetProperty ("fold.preprocessor",
|
||||
(curInfo->folds & mySTC_FOLD_PREPROC) > 0? "1": "0");
|
||||
SetProperty ("fold.html",
|
||||
(curInfo->folds & mySTC_FOLD_HTML) > 0? "1": "0");
|
||||
SetProperty ("fold.html.preprocessor",
|
||||
(curInfo->folds & mySTC_FOLD_HTMLPREP) > 0? "1": "0");
|
||||
SetProperty ("fold.comment.python",
|
||||
(curInfo->folds & mySTC_FOLD_COMMENTPY) > 0? "1": "0");
|
||||
SetProperty ("fold.quotes.python",
|
||||
(curInfo->folds & mySTC_FOLD_QUOTESPY) > 0? "1": "0");
|
||||
}
|
||||
SetFoldFlags (wxSTC_FOLDFLAG_LINEBEFORE_CONTRACTED |
|
||||
wxSTC_FOLDFLAG_LINEAFTER_CONTRACTED);
|
||||
@@ -646,8 +646,8 @@ bool Edit::LoadFile ()
|
||||
#if wxUSE_FILEDLG
|
||||
// get filename
|
||||
if (!m_filename) {
|
||||
wxFileDialog dlg (this, wxT("Open file"), wxEmptyString, wxEmptyString,
|
||||
wxT("Any file (*)|*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR);
|
||||
wxFileDialog dlg (this, "Open file", wxEmptyString, wxEmptyString,
|
||||
"Any file (*)|*", wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR);
|
||||
if (dlg.ShowModal() != wxID_OK) return false;
|
||||
m_filename = dlg.GetPath();
|
||||
}
|
||||
@@ -683,7 +683,7 @@ bool Edit::SaveFile ()
|
||||
|
||||
// get filename
|
||||
if (!m_filename) {
|
||||
wxFileDialog dlg (this, wxT("Save file"), wxEmptyString, wxEmptyString, wxT("Any file (*)|*"),
|
||||
wxFileDialog dlg (this, "Save file", wxEmptyString, wxEmptyString, "Any file (*)|*",
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
|
||||
if (dlg.ShowModal() != wxID_OK) return false;
|
||||
m_filename = dlg.GetPath();
|
||||
@@ -757,14 +757,14 @@ EditProperties::EditProperties (Edit *edit,
|
||||
textinfo->Add (new wxStaticText (this, wxID_ANY, _("Lexer-ID: "),
|
||||
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||
text = wxString::Format (wxT("%d"), edit->GetLexer());
|
||||
text = wxString::Format ("%d", edit->GetLexer());
|
||||
textinfo->Add (new wxStaticText (this, wxID_ANY, text),
|
||||
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||
wxString EOLtype = wxEmptyString;
|
||||
switch (edit->GetEOLMode()) {
|
||||
case wxSTC_EOL_CR: {EOLtype = wxT("CR (Unix)"); break; }
|
||||
case wxSTC_EOL_CRLF: {EOLtype = wxT("CRLF (Windows)"); break; }
|
||||
case wxSTC_EOL_LF: {EOLtype = wxT("CR (Macintosh)"); break; }
|
||||
case wxSTC_EOL_CR: {EOLtype = "CR (Unix)"; break; }
|
||||
case wxSTC_EOL_CRLF: {EOLtype = "CRLF (Windows)"; break; }
|
||||
case wxSTC_EOL_LF: {EOLtype = "CR (Macintosh)"; break; }
|
||||
}
|
||||
textinfo->Add (new wxStaticText (this, wxID_ANY, _("Line endings"),
|
||||
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||
@@ -774,7 +774,7 @@ EditProperties::EditProperties (Edit *edit,
|
||||
|
||||
// text info box
|
||||
wxStaticBoxSizer *textinfos = new wxStaticBoxSizer (
|
||||
new wxStaticBox (this, wxID_ANY, _("Informations")),
|
||||
new wxStaticBox (this, wxID_ANY, _("Information")),
|
||||
wxVERTICAL);
|
||||
textinfos->Add (textinfo, 0, wxEXPAND);
|
||||
textinfos->Add (0, 6);
|
||||
@@ -784,25 +784,25 @@ EditProperties::EditProperties (Edit *edit,
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, _("Total lines"),
|
||||
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||
text = wxString::Format (wxT("%d"), edit->GetLineCount());
|
||||
text = wxString::Format ("%d", edit->GetLineCount());
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, text),
|
||||
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, _("Total chars"),
|
||||
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||
text = wxString::Format (wxT("%d"), edit->GetTextLength());
|
||||
text = wxString::Format ("%d", edit->GetTextLength());
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, text),
|
||||
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, _("Current line"),
|
||||
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||
text = wxString::Format (wxT("%d"), edit->GetCurrentLine());
|
||||
text = wxString::Format ("%d", edit->GetCurrentLine());
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, text),
|
||||
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, _("Current pos"),
|
||||
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||
text = wxString::Format (wxT("%d"), edit->GetCurrentPos());
|
||||
text = wxString::Format ("%d", edit->GetCurrentPos());
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, text),
|
||||
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||
|
||||
@@ -836,7 +836,7 @@ EditProperties::EditProperties (Edit *edit,
|
||||
// EditPrint
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
EditPrint::EditPrint (Edit *edit, const wxChar *title)
|
||||
EditPrint::EditPrint (Edit *edit, const wxString& title)
|
||||
: wxPrintout(title)
|
||||
, m_edit(edit)
|
||||
{
|
||||
|
||||
+1
-1
@@ -162,7 +162,7 @@ class EditPrint: public wxPrintout {
|
||||
public:
|
||||
|
||||
//! constructor
|
||||
EditPrint (Edit *edit, const wxChar *title = wxT(""));
|
||||
EditPrint (Edit *edit, const wxString& title = "");
|
||||
|
||||
//! event handlers
|
||||
bool OnPrintPage (int page) wxOVERRIDE;
|
||||
|
||||
+93
-93
File diff suppressed because it is too large
Load Diff
+4
-4
@@ -136,10 +136,10 @@ extern const int g_LanguagePrefsSize;
|
||||
//----------------------------------------------------------------------------
|
||||
// StyleInfo
|
||||
struct StyleInfo {
|
||||
const wxChar *name;
|
||||
const wxChar *foreground;
|
||||
const wxChar *background;
|
||||
const wxChar *fontname;
|
||||
const wxString name;
|
||||
const wxString foreground;
|
||||
const wxString background;
|
||||
const wxString fontname;
|
||||
int fontsize;
|
||||
int fontstyle;
|
||||
int lettercase;
|
||||
|
||||
+31
-31
@@ -54,19 +54,19 @@
|
||||
// declarations
|
||||
//============================================================================
|
||||
|
||||
#define APP_NAME wxT("STC-Test")
|
||||
#define APP_DESCR _("See http://wxguide.sourceforge.net/")
|
||||
#define APP_NAME "STC-Test"
|
||||
#define APP_DESCR "See http://wxguide.sourceforge.net/"
|
||||
|
||||
#define APP_MAINT wxT("Otto Wyss")
|
||||
#define APP_VENDOR wxT("wxWidgets")
|
||||
#define APP_COPYRIGTH wxT("(C) 2003 Otto Wyss")
|
||||
#define APP_LICENCE wxT("wxWidgets")
|
||||
#define APP_MAINT "Otto Wyss"
|
||||
#define APP_VENDOR "wxWidgets"
|
||||
#define APP_COPYRIGTH "(C) 2003 Otto Wyss"
|
||||
#define APP_LICENCE "wxWidgets"
|
||||
|
||||
#define APP_VERSION wxT("0.1.alpha")
|
||||
#define APP_VERSION "0.1.alpha"
|
||||
#define APP_BUILD __DATE__
|
||||
|
||||
#define APP_WEBSITE wxT("http://www.wxWidgets.org")
|
||||
#define APP_MAIL wxT("mailto://???")
|
||||
#define APP_WEBSITE "http://www.wxWidgets.org"
|
||||
#define APP_MAIL "mailto://???"
|
||||
|
||||
#define NONAME _("<untitled>")
|
||||
|
||||
@@ -214,7 +214,7 @@ bool App::OnInit () {
|
||||
SetVendorName (APP_VENDOR);
|
||||
g_appname = new wxString ();
|
||||
g_appname->Append (APP_VENDOR);
|
||||
g_appname->Append (wxT("-"));
|
||||
g_appname->Append ("-");
|
||||
g_appname->Append (APP_NAME);
|
||||
|
||||
#if wxUSE_PRINTING_ARCHITECTURE
|
||||
@@ -301,7 +301,7 @@ AppFrame::AppFrame (const wxString &title)
|
||||
|
||||
// set icon and background
|
||||
SetTitle (*g_appname);
|
||||
SetBackgroundColour (wxT("WHITE"));
|
||||
SetBackgroundColour ("WHITE");
|
||||
|
||||
// create menu
|
||||
m_menuBar = new wxMenuBar;
|
||||
@@ -311,7 +311,7 @@ AppFrame::AppFrame (const wxString &title)
|
||||
m_edit = new Edit (this, wxID_ANY);
|
||||
m_edit->SetFocus();
|
||||
|
||||
FileOpen (wxT("stctest.cpp"));
|
||||
FileOpen ("stctest.cpp");
|
||||
}
|
||||
|
||||
AppFrame::~AppFrame () {
|
||||
@@ -341,7 +341,7 @@ void AppFrame::OnFileOpen (wxCommandEvent &WXUNUSED(event)) {
|
||||
if (!m_edit) return;
|
||||
#if wxUSE_FILEDLG
|
||||
wxString fname;
|
||||
wxFileDialog dlg (this, wxT("Open file"), wxEmptyString, wxEmptyString, wxT("Any file (*)|*"),
|
||||
wxFileDialog dlg (this, "Open file", wxEmptyString, wxEmptyString, "Any file (*)|*",
|
||||
wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR);
|
||||
if (dlg.ShowModal() != wxID_OK) return;
|
||||
fname = dlg.GetPath ();
|
||||
@@ -363,7 +363,7 @@ void AppFrame::OnFileSaveAs (wxCommandEvent &WXUNUSED(event)) {
|
||||
if (!m_edit) return;
|
||||
#if wxUSE_FILEDLG
|
||||
wxString filename = wxEmptyString;
|
||||
wxFileDialog dlg (this, wxT("Save file"), wxEmptyString, wxEmptyString, wxT("Any file (*)|*"), wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
|
||||
wxFileDialog dlg (this, "Save file", wxEmptyString, wxEmptyString, "Any file (*)|*", wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
|
||||
if (dlg.ShowModal() != wxID_OK) return;
|
||||
filename = dlg.GetPath();
|
||||
m_edit->SaveFile (filename);
|
||||
@@ -466,8 +466,8 @@ void AppFrame::OnContextMenu(wxContextMenuEvent& evt)
|
||||
}
|
||||
|
||||
wxMenu menu;
|
||||
menu.Append(wxID_ABOUT, wxT("&About"));
|
||||
menu.Append(wxID_EXIT, wxT("E&xit"));
|
||||
menu.Append(wxID_ABOUT, "&About");
|
||||
menu.Append(wxID_EXIT, "E&xit");
|
||||
PopupMenu(&menu, point);
|
||||
}
|
||||
|
||||
@@ -733,23 +733,23 @@ public:
|
||||
{
|
||||
SetLexerXml();
|
||||
|
||||
SetProperty(wxT("fold"), wxT("1"));
|
||||
SetProperty(wxT("fold.comment"), wxT("1"));
|
||||
SetProperty(wxT("fold.compact"), wxT("1"));
|
||||
SetProperty(wxT("fold.preprocessor"), wxT("1"));
|
||||
SetProperty(wxT("fold.html"), wxT("1"));
|
||||
SetProperty(wxT("fold.html.preprocessor"), wxT("1"));
|
||||
SetProperty("fold", "1");
|
||||
SetProperty("fold.comment", "1");
|
||||
SetProperty("fold.compact", "1");
|
||||
SetProperty("fold.preprocessor", "1");
|
||||
SetProperty("fold.html", "1");
|
||||
SetProperty("fold.html.preprocessor", "1");
|
||||
|
||||
SetMarginType(margin_id_lineno, wxSTC_MARGIN_NUMBER);
|
||||
SetMarginWidth(margin_id_lineno, 32);
|
||||
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS, wxT("WHITE"), wxT("BLACK"));
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS, wxT("WHITE"), wxT("BLACK"));
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_VLINE, wxT("WHITE"), wxT("BLACK"));
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUSCONNECTED, wxT("WHITE"), wxT("BLACK"));
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUSCONNECTED, wxT("WHITE"), wxT("BLACK"));
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_TCORNER, wxT("WHITE"), wxT("BLACK"));
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_LCORNER, wxT("WHITE"), wxT("BLACK"));
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS, "WHITE", "BLACK");
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS, "WHITE", "BLACK");
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_VLINE, "WHITE", "BLACK");
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUSCONNECTED, "WHITE", "BLACK");
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUSCONNECTED, "WHITE", "BLACK");
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_TCORNER, "WHITE", "BLACK");
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_LCORNER, "WHITE", "BLACK");
|
||||
|
||||
SetMarginMask(margin_id_fold, wxSTC_MASK_FOLDERS);
|
||||
SetMarginWidth(margin_id_fold, 32);
|
||||
@@ -780,7 +780,7 @@ public:
|
||||
StyleSetForeground(wxSTC_H_DOUBLESTRING, *wxBLACK);
|
||||
StyleSetForeground(wxSTC_H_SINGLESTRING, *wxBLACK);
|
||||
StyleSetForeground(wxSTC_H_OTHER, *wxBLUE);
|
||||
StyleSetForeground(wxSTC_H_COMMENT, wxTheColourDatabase->Find(wxT("GREY")));
|
||||
StyleSetForeground(wxSTC_H_COMMENT, wxTheColourDatabase->Find("GREY"));
|
||||
StyleSetForeground(wxSTC_H_ENTITY, *wxRED);
|
||||
StyleSetBold(wxSTC_H_ENTITY, true);
|
||||
StyleSetForeground(wxSTC_H_TAGEND, *wxBLUE);
|
||||
@@ -814,7 +814,7 @@ void MinimalEditor::OnMarginClick(wxStyledTextEvent &event)
|
||||
|
||||
void MinimalEditor::OnText(wxStyledTextEvent& event)
|
||||
{
|
||||
wxLogDebug(wxT("Modified"));
|
||||
wxLogDebug("Modified");
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
@@ -898,7 +898,7 @@ void MyTextCtrl::OnText(wxCommandEvent& event)
|
||||
const wxChar *data = (const wxChar *)(win->GetClientData());
|
||||
if ( data )
|
||||
{
|
||||
wxLogMessage(wxT("Text %s in control \"%s\""), changeVerb, data);
|
||||
wxLogMessage("Text %s in control \"%s\"", changeVerb, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1022,7 +1022,7 @@ void MyTextCtrl::OnKeyDown(wxKeyEvent& event)
|
||||
(unsigned int) sel.length());
|
||||
|
||||
const wxString text = GetLineText(line);
|
||||
wxLogMessage(wxT("Current line: \"%s\"; length = %lu"),
|
||||
wxLogMessage("Current line: \"%s\"; length = %lu",
|
||||
text.c_str(), text.length());
|
||||
}
|
||||
break;
|
||||
@@ -1212,7 +1212,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
|
||||
"very very very long line to test "
|
||||
"wxHSCROLL style\n"
|
||||
"\nAnd here is a link in quotation marks to "
|
||||
wxT("test wxTE_AUTO_URL: \"http://www.wxwidgets.org\""),
|
||||
"test wxTE_AUTO_URL: \"http://www.wxwidgets.org\"",
|
||||
wxPoint(450, 10), wxSize(200, 230),
|
||||
wxTE_RICH | wxTE_MULTILINE | wxTE_AUTO_URL);
|
||||
m_textrich->SetStyle(0, 10, *wxRED);
|
||||
|
||||
@@ -605,7 +605,7 @@ MyFrame::MyFrame(wxFrame* parent,
|
||||
toolMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN2, "Toggle &2nd radio button\tCtrl-2");
|
||||
toolMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN3, "Toggle &3rd radio button\tCtrl-3");
|
||||
toolMenu->AppendSeparator();
|
||||
toolMenu->Append(IDM_TOOLBAR_CHANGE_TOOLTIP, wxT("Change tooltip of \"New\""));
|
||||
toolMenu->Append(IDM_TOOLBAR_CHANGE_TOOLTIP, "Change tooltip of \"New\"");
|
||||
toolMenu->AppendSeparator();
|
||||
toolMenu->Append(IDM_TOOLBAR_INC_TOOL_SPACING, "Increase spacing\tCtrl-+");
|
||||
toolMenu->Append(IDM_TOOLBAR_DEC_TOOL_SPACING, "Decrease spacing\tCtrl--");
|
||||
|
||||
@@ -1298,12 +1298,12 @@ void MyTreeCtrl::DoResetBrokenStateImages(const wxTreeItemId& idParent,
|
||||
DoResetBrokenStateImages(idParent, cookie, state);
|
||||
}
|
||||
|
||||
void MyTreeCtrl::LogEvent(const wxChar *name, const wxTreeEvent& event)
|
||||
void MyTreeCtrl::LogEvent(const wxString& name, const wxTreeEvent& event)
|
||||
{
|
||||
wxTreeItemId item = event.GetItem();
|
||||
wxString text;
|
||||
if ( item.IsOk() )
|
||||
text << wxT('"') << GetItemText(item).c_str() << wxT('"');
|
||||
text << '"' << GetItemText(item).c_str() << '"';
|
||||
else
|
||||
text = "invalid item";
|
||||
wxLogMessage("%s(%s)", name, text.c_str());
|
||||
@@ -1313,7 +1313,7 @@ void MyTreeCtrl::LogEvent(const wxChar *name, const wxTreeEvent& event)
|
||||
#define TREE_EVENT_HANDLER(name) \
|
||||
void MyTreeCtrl::name(wxTreeEvent& event) \
|
||||
{ \
|
||||
LogEvent(wxT(#name), event); \
|
||||
LogEvent(#name, event); \
|
||||
event.Skip(); \
|
||||
}
|
||||
|
||||
@@ -1606,7 +1606,7 @@ void MyTreeCtrl::OnItemStateClick(wxTreeEvent& event)
|
||||
wxTreeItemId itemId = event.GetItem();
|
||||
DoToggleState(itemId);
|
||||
|
||||
wxLogMessage(wxT("Item \"%s\" state changed to %d"),
|
||||
wxLogMessage("Item \"%s\" state changed to %d",
|
||||
GetItemText(itemId), GetItemState(itemId));
|
||||
}
|
||||
|
||||
@@ -1619,8 +1619,8 @@ void MyTreeCtrl::OnItemMenu(wxTreeEvent& event)
|
||||
wxPoint clientpt = event.GetPoint();
|
||||
wxPoint screenpt = ClientToScreen(clientpt);
|
||||
|
||||
wxLogMessage(wxT("OnItemMenu for item \"%s\" at screen coords (%i, %i)"),
|
||||
item ? item->GetDesc() : wxString(wxS("unknown")), screenpt.x, screenpt.y);
|
||||
wxLogMessage("OnItemMenu for item \"%s\" at screen coords (%i, %i)",
|
||||
item ? item->GetDesc() : wxString("unknown"), screenpt.x, screenpt.y);
|
||||
|
||||
ShowMenu(itemId, clientpt);
|
||||
event.Skip();
|
||||
@@ -1665,7 +1665,7 @@ void MyTreeCtrl::OnItemRClick(wxTreeEvent& event)
|
||||
|
||||
MyTreeItemData *item = (MyTreeItemData *)GetItemData(itemId);
|
||||
|
||||
wxLogMessage(wxT("Item \"%s\" right clicked"), item ? item->GetDesc() : wxString(wxS("unknown")));
|
||||
wxLogMessage("Item \"%s\" right clicked", item ? item->GetDesc() : wxString("unknown"));
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ private:
|
||||
void DoResetBrokenStateImages(const wxTreeItemId& idParent,
|
||||
wxTreeItemIdValue cookie, int state);
|
||||
|
||||
void LogEvent(const wxChar *name, const wxTreeEvent& event);
|
||||
void LogEvent(const wxString& name, const wxTreeEvent& event);
|
||||
|
||||
int m_imageSize; // current size of images
|
||||
bool m_reverseSort; // flag for OnCompareItems
|
||||
|
||||
@@ -1051,15 +1051,15 @@ void MyApp::DoVariantDemo(wxCommandEvent& WXUNUSED(event) )
|
||||
|
||||
wxFont* sysFont = new wxFont(wxSystemSettings::GetFont(wxSYS_OEM_FIXED_FONT));
|
||||
var1 = wxVariant(sysFont);
|
||||
textCtrl << wxT("var1 = (wxfont)\"");
|
||||
textCtrl << "var1 = (wxfont)\"";
|
||||
wxFont* font = wxGetVariantCast(var1,wxFont);
|
||||
if (font)
|
||||
{
|
||||
textCtrl << font->GetNativeFontInfoDesc() << wxT("\"\n");
|
||||
textCtrl << font->GetNativeFontInfoDesc() << "\"\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
textCtrl << wxT("(null)\"\n");
|
||||
textCtrl << "(null)\"\n";
|
||||
}
|
||||
|
||||
delete sysFont;
|
||||
|
||||
@@ -109,7 +109,7 @@ wxEND_EVENT_TABLE()
|
||||
// ============================================================================
|
||||
|
||||
IMPLEMENT_WIDGETS_PAGE(ActivityIndicatorWidgetsPage,
|
||||
wxT("ActivityIndicator"), NATIVE_CTRLS);
|
||||
"ActivityIndicator", NATIVE_CTRLS);
|
||||
|
||||
void ActivityIndicatorWidgetsPage::CreateContent()
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+31
-31
@@ -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);
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
+21
-21
@@ -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))
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
);
|
||||
|
||||
|
||||
+28
-28
@@ -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() )
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
+24
-24
@@ -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
|
||||
|
||||
@@ -78,7 +78,7 @@ private:
|
||||
#endif
|
||||
|
||||
IMPLEMENT_WIDGETS_PAGE(HeaderCtrlWidgetsPage,
|
||||
wxT("Header"), HEADER_CTRL_FAMILY);
|
||||
"Header", HEADER_CTRL_FAMILY);
|
||||
|
||||
void HeaderCtrlWidgetsPage::CreateContent()
|
||||
{
|
||||
|
||||
@@ -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("¢re"),
|
||||
wxT("&right")
|
||||
"&left",
|
||||
"¢re",
|
||||
"&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:
|
||||
|
||||
@@ -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);
|
||||
|
||||
+37
-37
@@ -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))
|
||||
|
||||
@@ -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)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
+52
-52
File diff suppressed because it is too large
Load Diff
+34
-34
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
||||
+29
-29
@@ -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: < > & ' " ")
|
||||
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: < > & ' " "
|
||||
" 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
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
);
|
||||
|
||||
|
||||
+26
-26
@@ -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);
|
||||
|
||||
+44
-44
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -90,7 +90,7 @@ void wxObjectCodeReaderCallback::AllocateObject(int objectID, wxClassInfo *class
|
||||
{
|
||||
// add corresponding header if not already included
|
||||
wxString include;
|
||||
include.Printf(wxT("#include \"%s\"\n"),classInfo->GetIncludeName());
|
||||
include.Printf("#include \"%s\"\n",classInfo->GetIncludeName());
|
||||
if ( m_headerincludes.Find(include) == wxNOT_FOUND)
|
||||
m_headerincludes += include;
|
||||
}
|
||||
@@ -155,12 +155,12 @@ wxString wxObjectCodeReaderCallback::ValueAsCode( const wxAny ¶m )
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogError ( _("Internal error, illegal wxCustomTypeInfo") );
|
||||
wxLogError ( "Internal error, illegal wxCustomTypeInfo" );
|
||||
}
|
||||
}
|
||||
else if ( type->GetKind() == wxT_STRING )
|
||||
{
|
||||
value.Printf( wxT("\"%s\""), wxAnyGetAsString(param).c_str() );
|
||||
value.Printf( "\"%s\"", wxAnyGetAsString(param).c_str() );
|
||||
}
|
||||
else if ( type->GetKind() == wxT_OBJECT )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user