Applied patch [ 829144 ] Compilation error fixes for samples
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24755 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -108,14 +108,15 @@ bool MyApp::OnInit()
|
|||||||
menu_bar->Append(test_menu, _T("&Tests"));
|
menu_bar->Append(test_menu, _T("&Tests"));
|
||||||
frame->SetMenuBar(menu_bar);
|
frame->SetMenuBar(menu_bar);
|
||||||
|
|
||||||
m_textCtrl = new wxTextCtrl(frame, -1, _T(""), wxPoint(0, 0), wxDefaultSize, wxTE_MULTILINE);
|
m_textCtrl = new wxTextCtrl(frame, wxID_ANY, wxEmptyString,
|
||||||
|
wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
|
||||||
|
|
||||||
// Show the frame
|
// Show the frame
|
||||||
frame->Show(TRUE);
|
frame->Show(true);
|
||||||
|
|
||||||
SetTopWindow(frame);
|
SetTopWindow(frame);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event))
|
void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event))
|
||||||
@@ -958,7 +959,7 @@ void MyApp::DoMIMEDemo(wxCommandEvent& WXUNUSED(event))
|
|||||||
textCtrl << _T("MIME information about extension '") << ext << _T("'\n")
|
textCtrl << _T("MIME information about extension '") << ext << _T("'\n")
|
||||||
<< _T("\tMIME type: ") << ( !type ? wxT("unknown")
|
<< _T("\tMIME type: ") << ( !type ? wxT("unknown")
|
||||||
: type.c_str() ) << '\n'
|
: type.c_str() ) << '\n'
|
||||||
<< _T("\tDescription: ") << ( !desc ? wxT("") : desc.c_str() )
|
<< _T("\tDescription: ") << ( !desc ? wxEmptyString : desc.c_str() )
|
||||||
<< '\n'
|
<< '\n'
|
||||||
<< _T("\tCommand to open: ") << ( !open ? wxT("no") : open.c_str() )
|
<< _T("\tCommand to open: ") << ( !open ? wxT("no") : open.c_str() )
|
||||||
<< '\n';
|
<< '\n';
|
||||||
@@ -984,19 +985,19 @@ void MyApp::DoByteOrderDemo(wxCommandEvent& WXUNUSED(event))
|
|||||||
wxString text;
|
wxString text;
|
||||||
|
|
||||||
wxInt32 var = 0xF1F2F3F4;
|
wxInt32 var = 0xF1F2F3F4;
|
||||||
text = _T("");
|
text = wxEmptyString;
|
||||||
text.Printf( _T("Value of wxInt32 is now: %#x.\n\n"), var );
|
text.Printf( _T("Value of wxInt32 is now: %#x.\n\n"), var );
|
||||||
textCtrl.WriteText( text );
|
textCtrl.WriteText( text );
|
||||||
|
|
||||||
text = _T("");
|
text = wxEmptyString;
|
||||||
text.Printf( _T("Value of swapped wxInt32 is: %#x.\n\n"), wxINT32_SWAP_ALWAYS( var ) );
|
text.Printf( _T("Value of swapped wxInt32 is: %#x.\n\n"), wxINT32_SWAP_ALWAYS( var ) );
|
||||||
textCtrl.WriteText( text );
|
textCtrl.WriteText( text );
|
||||||
|
|
||||||
text = _T("");
|
text = wxEmptyString;
|
||||||
text.Printf( _T("Value of wxInt32 swapped on little endian is: %#x.\n\n"), wxINT32_SWAP_ON_LE( var ) );
|
text.Printf( _T("Value of wxInt32 swapped on little endian is: %#x.\n\n"), wxINT32_SWAP_ON_LE( var ) );
|
||||||
textCtrl.WriteText( text );
|
textCtrl.WriteText( text );
|
||||||
|
|
||||||
text = _T("");
|
text = wxEmptyString;
|
||||||
text.Printf( _T("Value of wxInt32 swapped on big endian is: %#x.\n\n"), wxINT32_SWAP_ON_BE( var ) );
|
text.Printf( _T("Value of wxInt32 swapped on big endian is: %#x.\n\n"), wxINT32_SWAP_ON_BE( var ) );
|
||||||
textCtrl.WriteText( text );
|
textCtrl.WriteText( text );
|
||||||
}
|
}
|
||||||
@@ -1024,10 +1025,8 @@ void MyApp::DoVariantDemo(wxCommandEvent& WXUNUSED(event) )
|
|||||||
long l = var1;
|
long l = var1;
|
||||||
|
|
||||||
// suppress compile warnings about unused variables
|
// suppress compile warnings about unused variables
|
||||||
if ( l < v )
|
wxUnusedVar(l);
|
||||||
{
|
wxUnusedVar(v);
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxStringList stringList;
|
wxStringList stringList;
|
||||||
stringList.Add(_T("one")); stringList.Add(_T("two")); stringList.Add(_T("three"));
|
stringList.Add(_T("one")); stringList.Add(_T("two")); stringList.Add(_T("three"));
|
||||||
@@ -1051,9 +1050,12 @@ void MyApp::DoVariantDemo(wxCommandEvent& WXUNUSED(event) )
|
|||||||
var1 = wxVariant(new wxFont(wxSystemSettings::GetFont(wxSYS_OEM_FIXED_FONT)));
|
var1 = wxVariant(new wxFont(wxSystemSettings::GetFont(wxSYS_OEM_FIXED_FONT)));
|
||||||
textCtrl << _T("var1 = (wxfont)\"");
|
textCtrl << _T("var1 = (wxfont)\"");
|
||||||
wxFont* font = wxGetVariantCast(var1,wxFont);
|
wxFont* font = wxGetVariantCast(var1,wxFont);
|
||||||
if (font) {
|
if (font)
|
||||||
|
{
|
||||||
textCtrl << font->GetNativeFontInfoDesc() << _T("\"\n");
|
textCtrl << font->GetNativeFontInfoDesc() << _T("\"\n");
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
textCtrl << _T("(null)\"\n");
|
textCtrl << _T("(null)\"\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1065,13 +1067,13 @@ END_EVENT_TABLE()
|
|||||||
|
|
||||||
// My frame constructor
|
// My frame constructor
|
||||||
MyFrame::MyFrame(wxFrame *parent, const wxString& title,
|
MyFrame::MyFrame(wxFrame *parent, const wxString& title,
|
||||||
const wxPoint& pos, const wxSize& size):
|
const wxPoint& pos, const wxSize& size)
|
||||||
wxFrame(parent, -1, title, pos, size)
|
: wxFrame(parent, wxID_ANY, title, pos, size)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )
|
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
Close(TRUE);
|
Close(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
|
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
|
||||||
|
@@ -127,8 +127,8 @@ BEGIN_EVENT_TABLE(ButtonWidgetsPage, WidgetsPage)
|
|||||||
EVT_BUTTON(ButtonPage_Reset, ButtonWidgetsPage::OnButtonReset)
|
EVT_BUTTON(ButtonPage_Reset, ButtonWidgetsPage::OnButtonReset)
|
||||||
EVT_BUTTON(ButtonPage_ChangeLabel, ButtonWidgetsPage::OnButtonChangeLabel)
|
EVT_BUTTON(ButtonPage_ChangeLabel, ButtonWidgetsPage::OnButtonChangeLabel)
|
||||||
|
|
||||||
EVT_CHECKBOX(-1, ButtonWidgetsPage::OnCheckOrRadioBox)
|
EVT_CHECKBOX(wxID_ANY, ButtonWidgetsPage::OnCheckOrRadioBox)
|
||||||
EVT_RADIOBOX(-1, ButtonWidgetsPage::OnCheckOrRadioBox)
|
EVT_RADIOBOX(wxID_ANY, ButtonWidgetsPage::OnCheckOrRadioBox)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@@ -159,7 +159,7 @@ ButtonWidgetsPage::ButtonWidgetsPage(wxNotebook *notebook,
|
|||||||
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
|
||||||
// left pane
|
// left pane
|
||||||
wxStaticBox *box = new wxStaticBox(this, -1, _T("&Set style"));
|
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style"));
|
||||||
|
|
||||||
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
|
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
|
||||||
|
|
||||||
@@ -189,10 +189,10 @@ ButtonWidgetsPage::ButtonWidgetsPage(wxNotebook *notebook,
|
|||||||
_T("bottom"),
|
_T("bottom"),
|
||||||
};
|
};
|
||||||
|
|
||||||
m_radioHAlign = new wxRadioBox(this, -1, _T("&Horz alignment"),
|
m_radioHAlign = new wxRadioBox(this, wxID_ANY, _T("&Horz alignment"),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
WXSIZEOF(halign), halign);
|
WXSIZEOF(halign), halign);
|
||||||
m_radioVAlign = new wxRadioBox(this, -1, _T("&Vert alignment"),
|
m_radioVAlign = new wxRadioBox(this, wxID_ANY, _T("&Vert alignment"),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
WXSIZEOF(valign), valign);
|
WXSIZEOF(valign), valign);
|
||||||
|
|
||||||
@@ -205,12 +205,12 @@ ButtonWidgetsPage::ButtonWidgetsPage(wxNotebook *notebook,
|
|||||||
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
||||||
|
|
||||||
// middle pane
|
// middle pane
|
||||||
wxStaticBox *box2 = new wxStaticBox(this, -1, _T("&Operations"));
|
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Operations"));
|
||||||
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
|
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
|
||||||
|
|
||||||
wxSizer *sizerRow = CreateSizerWithTextAndButton(ButtonPage_ChangeLabel,
|
wxSizer *sizerRow = CreateSizerWithTextAndButton(ButtonPage_ChangeLabel,
|
||||||
_T("Change label"),
|
_T("Change label"),
|
||||||
-1,
|
wxID_ANY,
|
||||||
&m_textLabel);
|
&m_textLabel);
|
||||||
|
|
||||||
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
||||||
@@ -232,7 +232,6 @@ ButtonWidgetsPage::ButtonWidgetsPage(wxNotebook *notebook,
|
|||||||
// final initializations
|
// final initializations
|
||||||
Reset();
|
Reset();
|
||||||
|
|
||||||
SetAutoLayout(TRUE);
|
|
||||||
SetSizer(sizerTop);
|
SetSizer(sizerTop);
|
||||||
|
|
||||||
sizerTop->Fit(this);
|
sizerTop->Fit(this);
|
||||||
@@ -248,9 +247,9 @@ ButtonWidgetsPage::~ButtonWidgetsPage()
|
|||||||
|
|
||||||
void ButtonWidgetsPage::Reset()
|
void ButtonWidgetsPage::Reset()
|
||||||
{
|
{
|
||||||
m_chkFit->SetValue(TRUE);
|
m_chkFit->SetValue(true);
|
||||||
m_chkImage->SetValue(FALSE);
|
m_chkImage->SetValue(false);
|
||||||
m_chkDefault->SetValue(FALSE);
|
m_chkDefault->SetValue(false);
|
||||||
|
|
||||||
m_radioHAlign->SetSelection(ButtonHAlign_Centre);
|
m_radioHAlign->SetSelection(ButtonHAlign_Centre);
|
||||||
m_radioVAlign->SetSelection(ButtonVAlign_Centre);
|
m_radioVAlign->SetSelection(ButtonVAlign_Centre);
|
||||||
|
@@ -178,8 +178,8 @@ BEGIN_EVENT_TABLE(ComboboxWidgetsPage, WidgetsPage)
|
|||||||
EVT_TEXT(ComboPage_Combo, ComboboxWidgetsPage::OnComboText)
|
EVT_TEXT(ComboPage_Combo, ComboboxWidgetsPage::OnComboText)
|
||||||
EVT_TEXT_ENTER(ComboPage_Combo, ComboboxWidgetsPage::OnComboText)
|
EVT_TEXT_ENTER(ComboPage_Combo, ComboboxWidgetsPage::OnComboText)
|
||||||
|
|
||||||
EVT_CHECKBOX(-1, ComboboxWidgetsPage::OnCheckOrRadioBox)
|
EVT_CHECKBOX(wxID_ANY, ComboboxWidgetsPage::OnCheckOrRadioBox)
|
||||||
EVT_RADIOBOX(-1, ComboboxWidgetsPage::OnCheckOrRadioBox)
|
EVT_RADIOBOX(wxID_ANY, ComboboxWidgetsPage::OnCheckOrRadioBox)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@@ -210,7 +210,7 @@ ComboboxWidgetsPage::ComboboxWidgetsPage(wxNotebook *notebook,
|
|||||||
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
|
||||||
// left pane
|
// left pane
|
||||||
wxStaticBox *box = new wxStaticBox(this, -1, _T("&Set style"));
|
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style"));
|
||||||
|
|
||||||
// should be in sync with ComboKind_XXX values
|
// should be in sync with ComboKind_XXX values
|
||||||
static const wxString kinds[] =
|
static const wxString kinds[] =
|
||||||
@@ -220,7 +220,7 @@ ComboboxWidgetsPage::ComboboxWidgetsPage(wxNotebook *notebook,
|
|||||||
_T("drop down"),
|
_T("drop down"),
|
||||||
};
|
};
|
||||||
|
|
||||||
m_radioKind = new wxRadioBox(this, -1, _T("Combobox &kind:"),
|
m_radioKind = new wxRadioBox(this, wxID_ANY, _T("Combobox &kind:"),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
WXSIZEOF(kinds), kinds,
|
WXSIZEOF(kinds), kinds,
|
||||||
1, wxRA_SPECIFY_COLS);
|
1, wxRA_SPECIFY_COLS);
|
||||||
@@ -237,7 +237,8 @@ ComboboxWidgetsPage::ComboboxWidgetsPage(wxNotebook *notebook,
|
|||||||
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
||||||
|
|
||||||
// middle pane
|
// middle pane
|
||||||
wxStaticBox *box2 = new wxStaticBox(this, -1, _T("&Change combobox contents"));
|
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY,
|
||||||
|
_T("&Change combobox contents"));
|
||||||
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
|
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
|
||||||
|
|
||||||
wxSizer *sizerRow;
|
wxSizer *sizerRow;
|
||||||
@@ -246,7 +247,7 @@ ComboboxWidgetsPage::ComboboxWidgetsPage(wxNotebook *notebook,
|
|||||||
sizerRow = CreateSizerWithTextAndLabel(_T("Current selection"),
|
sizerRow = CreateSizerWithTextAndLabel(_T("Current selection"),
|
||||||
ComboPage_CurText,
|
ComboPage_CurText,
|
||||||
&text);
|
&text);
|
||||||
text->SetEditable(FALSE);
|
text->SetEditable(false);
|
||||||
|
|
||||||
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
||||||
|
|
||||||
@@ -288,7 +289,7 @@ ComboboxWidgetsPage::ComboboxWidgetsPage(wxNotebook *notebook,
|
|||||||
|
|
||||||
// right pane
|
// right pane
|
||||||
wxSizer *sizerRight = new wxBoxSizer(wxVERTICAL);
|
wxSizer *sizerRight = new wxBoxSizer(wxVERTICAL);
|
||||||
m_combobox = new wxComboBox(this, ComboPage_Combo, _T(""),
|
m_combobox = new wxComboBox(this, ComboPage_Combo, wxEmptyString,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
0, NULL,
|
0, NULL,
|
||||||
0);
|
0);
|
||||||
@@ -304,7 +305,6 @@ ComboboxWidgetsPage::ComboboxWidgetsPage(wxNotebook *notebook,
|
|||||||
// final initializations
|
// final initializations
|
||||||
Reset();
|
Reset();
|
||||||
|
|
||||||
SetAutoLayout(TRUE);
|
|
||||||
SetSizer(sizerTop);
|
SetSizer(sizerTop);
|
||||||
|
|
||||||
sizerTop->Fit(this);
|
sizerTop->Fit(this);
|
||||||
@@ -316,8 +316,8 @@ ComboboxWidgetsPage::ComboboxWidgetsPage(wxNotebook *notebook,
|
|||||||
|
|
||||||
void ComboboxWidgetsPage::Reset()
|
void ComboboxWidgetsPage::Reset()
|
||||||
{
|
{
|
||||||
m_chkSort->SetValue(FALSE);
|
m_chkSort->SetValue(false);
|
||||||
m_chkReadonly->SetValue(FALSE);
|
m_chkReadonly->SetValue(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComboboxWidgetsPage::CreateCombo()
|
void ComboboxWidgetsPage::CreateCombo()
|
||||||
@@ -360,7 +360,7 @@ void ComboboxWidgetsPage::CreateCombo()
|
|||||||
delete m_combobox;
|
delete m_combobox;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_combobox = new wxComboBox(this, ComboPage_Combo, _T(""),
|
m_combobox = new wxComboBox(this, ComboPage_Combo, wxEmptyString,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
0, NULL,
|
0, NULL,
|
||||||
flags);
|
flags);
|
||||||
|
@@ -144,8 +144,8 @@ BEGIN_EVENT_TABLE(GaugeWidgetsPage, WidgetsPage)
|
|||||||
|
|
||||||
EVT_UPDATE_UI(GaugePage_CurValueText, GaugeWidgetsPage::OnUpdateUICurValueText)
|
EVT_UPDATE_UI(GaugePage_CurValueText, GaugeWidgetsPage::OnUpdateUICurValueText)
|
||||||
|
|
||||||
EVT_CHECKBOX(-1, GaugeWidgetsPage::OnCheckOrRadioBox)
|
EVT_CHECKBOX(wxID_ANY, GaugeWidgetsPage::OnCheckOrRadioBox)
|
||||||
EVT_RADIOBOX(-1, GaugeWidgetsPage::OnCheckOrRadioBox)
|
EVT_RADIOBOX(wxID_ANY, GaugeWidgetsPage::OnCheckOrRadioBox)
|
||||||
|
|
||||||
EVT_TIMER(GaugePage_Timer, GaugeWidgetsPage::OnProgressTimer)
|
EVT_TIMER(GaugePage_Timer, GaugeWidgetsPage::OnProgressTimer)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
@@ -176,7 +176,7 @@ GaugeWidgetsPage::GaugeWidgetsPage(wxNotebook *notebook,
|
|||||||
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
|
||||||
// left pane
|
// left pane
|
||||||
wxStaticBox *box = new wxStaticBox(this, -1, _T("&Set style"));
|
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style"));
|
||||||
|
|
||||||
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
|
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
|
||||||
|
|
||||||
@@ -189,14 +189,15 @@ GaugeWidgetsPage::GaugeWidgetsPage(wxNotebook *notebook,
|
|||||||
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
||||||
|
|
||||||
// middle pane
|
// middle pane
|
||||||
wxStaticBox *box2 = new wxStaticBox(this, -1, _T("&Change gauge value"));
|
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY,
|
||||||
|
_T("&Change gauge value"));
|
||||||
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
|
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
|
||||||
|
|
||||||
wxTextCtrl *text;
|
wxTextCtrl *text;
|
||||||
wxSizer *sizerRow = CreateSizerWithTextAndLabel(_T("Current value"),
|
wxSizer *sizerRow = CreateSizerWithTextAndLabel(_T("Current value"),
|
||||||
GaugePage_CurValueText,
|
GaugePage_CurValueText,
|
||||||
&text);
|
&text);
|
||||||
text->SetEditable(FALSE);
|
text->SetEditable(false);
|
||||||
|
|
||||||
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
||||||
|
|
||||||
@@ -234,7 +235,6 @@ GaugeWidgetsPage::GaugeWidgetsPage(wxNotebook *notebook,
|
|||||||
// final initializations
|
// final initializations
|
||||||
Reset();
|
Reset();
|
||||||
|
|
||||||
SetAutoLayout(TRUE);
|
|
||||||
SetSizer(sizerTop);
|
SetSizer(sizerTop);
|
||||||
|
|
||||||
sizerTop->Fit(this);
|
sizerTop->Fit(this);
|
||||||
@@ -251,8 +251,8 @@ GaugeWidgetsPage::~GaugeWidgetsPage()
|
|||||||
|
|
||||||
void GaugeWidgetsPage::Reset()
|
void GaugeWidgetsPage::Reset()
|
||||||
{
|
{
|
||||||
m_chkVert->SetValue(FALSE);
|
m_chkVert->SetValue(false);
|
||||||
m_chkSmooth->SetValue(FALSE);
|
m_chkSmooth->SetValue(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GaugeWidgetsPage::CreateGauge()
|
void GaugeWidgetsPage::CreateGauge()
|
||||||
|
@@ -179,8 +179,8 @@ BEGIN_EVENT_TABLE(ListboxWidgetsPage, WidgetsPage)
|
|||||||
EVT_LISTBOX_DCLICK(ListboxPage_Listbox, ListboxWidgetsPage::OnListboxDClick)
|
EVT_LISTBOX_DCLICK(ListboxPage_Listbox, ListboxWidgetsPage::OnListboxDClick)
|
||||||
EVT_CHECKLISTBOX(ListboxPage_Listbox, ListboxWidgetsPage::OnCheckListbox)
|
EVT_CHECKLISTBOX(ListboxPage_Listbox, ListboxWidgetsPage::OnCheckListbox)
|
||||||
|
|
||||||
EVT_CHECKBOX(-1, ListboxWidgetsPage::OnCheckOrRadioBox)
|
EVT_CHECKBOX(wxID_ANY, ListboxWidgetsPage::OnCheckOrRadioBox)
|
||||||
EVT_RADIOBOX(-1, ListboxWidgetsPage::OnCheckOrRadioBox)
|
EVT_RADIOBOX(wxID_ANY, ListboxWidgetsPage::OnCheckOrRadioBox)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@@ -215,7 +215,8 @@ ListboxWidgetsPage::ListboxWidgetsPage(wxNotebook *notebook,
|
|||||||
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
|
||||||
// left pane
|
// left pane
|
||||||
wxStaticBox *box = new wxStaticBox(this, -1, _T("&Set listbox parameters"));
|
wxStaticBox *box = new wxStaticBox(this, wxID_ANY,
|
||||||
|
_T("&Set listbox parameters"));
|
||||||
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
|
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
|
||||||
|
|
||||||
static const wxString modes[] =
|
static const wxString modes[] =
|
||||||
@@ -225,7 +226,7 @@ ListboxWidgetsPage::ListboxWidgetsPage(wxNotebook *notebook,
|
|||||||
_T("multiple"),
|
_T("multiple"),
|
||||||
};
|
};
|
||||||
|
|
||||||
m_radioSelMode = new wxRadioBox(this, -1, _T("Selection &mode:"),
|
m_radioSelMode = new wxRadioBox(this, wxID_ANY, _T("Selection &mode:"),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
WXSIZEOF(modes), modes,
|
WXSIZEOF(modes), modes,
|
||||||
1, wxRA_SPECIFY_COLS);
|
1, wxRA_SPECIFY_COLS);
|
||||||
@@ -250,7 +251,8 @@ ListboxWidgetsPage::ListboxWidgetsPage(wxNotebook *notebook,
|
|||||||
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
||||||
|
|
||||||
// middle pane
|
// middle pane
|
||||||
wxStaticBox *box2 = new wxStaticBox(this, -1, _T("&Change listbox contents"));
|
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY,
|
||||||
|
_T("&Change listbox contents"));
|
||||||
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
|
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
|
||||||
|
|
||||||
wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL);
|
||||||
@@ -268,14 +270,14 @@ ListboxWidgetsPage::ListboxWidgetsPage(wxNotebook *notebook,
|
|||||||
|
|
||||||
sizerRow = new wxBoxSizer(wxHORIZONTAL);
|
sizerRow = new wxBoxSizer(wxHORIZONTAL);
|
||||||
btn = new wxButton(this, ListboxPage_Change, _T("C&hange current"));
|
btn = new wxButton(this, ListboxPage_Change, _T("C&hange current"));
|
||||||
m_textChange = new wxTextCtrl(this, ListboxPage_ChangeText, _T(""));
|
m_textChange = new wxTextCtrl(this, ListboxPage_ChangeText, wxEmptyString);
|
||||||
sizerRow->Add(btn, 0, wxRIGHT, 5);
|
sizerRow->Add(btn, 0, wxRIGHT, 5);
|
||||||
sizerRow->Add(m_textChange, 1, wxLEFT, 5);
|
sizerRow->Add(m_textChange, 1, wxLEFT, 5);
|
||||||
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
||||||
|
|
||||||
sizerRow = new wxBoxSizer(wxHORIZONTAL);
|
sizerRow = new wxBoxSizer(wxHORIZONTAL);
|
||||||
btn = new wxButton(this, ListboxPage_Delete, _T("&Delete this item"));
|
btn = new wxButton(this, ListboxPage_Delete, _T("&Delete this item"));
|
||||||
m_textDelete = new wxTextCtrl(this, ListboxPage_DeleteText, _T(""));
|
m_textDelete = new wxTextCtrl(this, ListboxPage_DeleteText, wxEmptyString);
|
||||||
sizerRow->Add(btn, 0, wxRIGHT, 5);
|
sizerRow->Add(btn, 0, wxRIGHT, 5);
|
||||||
sizerRow->Add(m_textDelete, 1, wxLEFT, 5);
|
sizerRow->Add(m_textDelete, 1, wxLEFT, 5);
|
||||||
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
||||||
@@ -304,7 +306,6 @@ ListboxWidgetsPage::ListboxWidgetsPage(wxNotebook *notebook,
|
|||||||
// final initializations
|
// final initializations
|
||||||
Reset();
|
Reset();
|
||||||
|
|
||||||
SetAutoLayout(TRUE);
|
|
||||||
SetSizer(sizerTop);
|
SetSizer(sizerTop);
|
||||||
|
|
||||||
sizerTop->Fit(this);
|
sizerTop->Fit(this);
|
||||||
@@ -317,10 +318,10 @@ ListboxWidgetsPage::ListboxWidgetsPage(wxNotebook *notebook,
|
|||||||
void ListboxWidgetsPage::Reset()
|
void ListboxWidgetsPage::Reset()
|
||||||
{
|
{
|
||||||
m_radioSelMode->SetSelection(LboxSel_Single);
|
m_radioSelMode->SetSelection(LboxSel_Single);
|
||||||
m_chkSort->SetValue(FALSE);
|
m_chkSort->SetValue(false);
|
||||||
m_chkCheck->SetValue(FALSE);
|
m_chkCheck->SetValue(false);
|
||||||
m_chkHScroll->SetValue(TRUE);
|
m_chkHScroll->SetValue(true);
|
||||||
m_chkVScroll->SetValue(FALSE);
|
m_chkVScroll->SetValue(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ListboxWidgetsPage::CreateLbox()
|
void ListboxWidgetsPage::CreateLbox()
|
||||||
|
@@ -181,11 +181,11 @@ BEGIN_EVENT_TABLE(NotebookWidgetsPage, WidgetsPage)
|
|||||||
EVT_UPDATE_UI(NotebookPage_InsertPage, NotebookWidgetsPage::OnUpdateUIInsertButton)
|
EVT_UPDATE_UI(NotebookPage_InsertPage, NotebookWidgetsPage::OnUpdateUIInsertButton)
|
||||||
EVT_UPDATE_UI(NotebookPage_RemovePage, NotebookWidgetsPage::OnUpdateUIRemoveButton)
|
EVT_UPDATE_UI(NotebookPage_RemovePage, NotebookWidgetsPage::OnUpdateUIRemoveButton)
|
||||||
|
|
||||||
EVT_NOTEBOOK_PAGE_CHANGING(-1, NotebookWidgetsPage::OnPageChanging)
|
EVT_NOTEBOOK_PAGE_CHANGING(wxID_ANY, NotebookWidgetsPage::OnPageChanging)
|
||||||
EVT_NOTEBOOK_PAGE_CHANGED(-1, NotebookWidgetsPage::OnPageChanged)
|
EVT_NOTEBOOK_PAGE_CHANGED(wxID_ANY, NotebookWidgetsPage::OnPageChanged)
|
||||||
|
|
||||||
EVT_CHECKBOX(-1, NotebookWidgetsPage::OnCheckOrRadioBox)
|
EVT_CHECKBOX(wxID_ANY, NotebookWidgetsPage::OnCheckOrRadioBox)
|
||||||
EVT_RADIOBOX(-1, NotebookWidgetsPage::OnCheckOrRadioBox)
|
EVT_RADIOBOX(wxID_ANY, NotebookWidgetsPage::OnCheckOrRadioBox)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@@ -210,7 +210,7 @@ NotebookWidgetsPage::NotebookWidgetsPage(wxNotebook *notebook,
|
|||||||
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
|
||||||
// left pane
|
// left pane
|
||||||
wxStaticBox *box = new wxStaticBox(this, -1, _T("&Set style"));
|
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style"));
|
||||||
|
|
||||||
// must be in sync with Orient enum
|
// must be in sync with Orient enum
|
||||||
wxString orientations[] =
|
wxString orientations[] =
|
||||||
@@ -224,8 +224,8 @@ NotebookWidgetsPage::NotebookWidgetsPage(wxNotebook *notebook,
|
|||||||
wxASSERT_MSG( WXSIZEOF(orientations) == Orient_Max,
|
wxASSERT_MSG( WXSIZEOF(orientations) == Orient_Max,
|
||||||
_T("forgot to update something") );
|
_T("forgot to update something") );
|
||||||
|
|
||||||
m_chkImages = new wxCheckBox(this, -1, _T("Show &images"));
|
m_chkImages = new wxCheckBox(this, wxID_ANY, _T("Show &images"));
|
||||||
m_radioOrient = new wxRadioBox(this, -1, _T("&Tab orientation"),
|
m_radioOrient = new wxRadioBox(this, wxID_ANY, _T("&Tab orientation"),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
WXSIZEOF(orientations), orientations,
|
WXSIZEOF(orientations), orientations,
|
||||||
1, wxRA_SPECIFY_COLS);
|
1, wxRA_SPECIFY_COLS);
|
||||||
@@ -240,20 +240,20 @@ NotebookWidgetsPage::NotebookWidgetsPage(wxNotebook *notebook,
|
|||||||
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
||||||
|
|
||||||
// middle pane
|
// middle pane
|
||||||
wxStaticBox *box2 = new wxStaticBox(this, -1, _T("&Contents"));
|
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Contents"));
|
||||||
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
|
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
|
||||||
|
|
||||||
wxTextCtrl *text;
|
wxTextCtrl *text;
|
||||||
wxSizer *sizerRow = CreateSizerWithTextAndLabel(_T("Number of pages: "),
|
wxSizer *sizerRow = CreateSizerWithTextAndLabel(_T("Number of pages: "),
|
||||||
NotebookPage_NumPagesText,
|
NotebookPage_NumPagesText,
|
||||||
&text);
|
&text);
|
||||||
text->SetEditable(FALSE);
|
text->SetEditable(false);
|
||||||
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
||||||
|
|
||||||
sizerRow = CreateSizerWithTextAndLabel(_T("Current selection: "),
|
sizerRow = CreateSizerWithTextAndLabel(_T("Current selection: "),
|
||||||
NotebookPage_CurSelectText,
|
NotebookPage_CurSelectText,
|
||||||
&text);
|
&text);
|
||||||
text->SetEditable(FALSE);
|
text->SetEditable(false);
|
||||||
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
||||||
|
|
||||||
sizerRow = CreateSizerWithTextAndButton(NotebookPage_SelectPage,
|
sizerRow = CreateSizerWithTextAndButton(NotebookPage_SelectPage,
|
||||||
@@ -296,7 +296,6 @@ NotebookWidgetsPage::NotebookWidgetsPage(wxNotebook *notebook,
|
|||||||
Reset();
|
Reset();
|
||||||
CreateImageList();
|
CreateImageList();
|
||||||
|
|
||||||
SetAutoLayout(TRUE);
|
|
||||||
SetSizer(sizerTop);
|
SetSizer(sizerTop);
|
||||||
|
|
||||||
sizerTop->Fit(this);
|
sizerTop->Fit(this);
|
||||||
@@ -313,7 +312,7 @@ NotebookWidgetsPage::~NotebookWidgetsPage()
|
|||||||
|
|
||||||
void NotebookWidgetsPage::Reset()
|
void NotebookWidgetsPage::Reset()
|
||||||
{
|
{
|
||||||
m_chkImages->SetValue(TRUE);
|
m_chkImages->SetValue(true);
|
||||||
m_radioOrient->SetSelection(Orient_Top);
|
m_radioOrient->SetSelection(Orient_Top);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -393,7 +392,7 @@ void NotebookWidgetsPage::CreateNotebook()
|
|||||||
{
|
{
|
||||||
m_notebook->AddPage(CreateNewPage(),
|
m_notebook->AddPage(CreateNewPage(),
|
||||||
notebook->GetPageText(n),
|
notebook->GetPageText(n),
|
||||||
FALSE,
|
false,
|
||||||
notebook->GetPageImage(n));
|
notebook->GetPageImage(n));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -440,7 +439,7 @@ int NotebookWidgetsPage::GetIconIndex() const
|
|||||||
|
|
||||||
wxWindow *NotebookWidgetsPage::CreateNewPage()
|
wxWindow *NotebookWidgetsPage::CreateNewPage()
|
||||||
{
|
{
|
||||||
return new wxTextCtrl(m_notebook, -1, _T("I'm a notebook page"));
|
return new wxTextCtrl(m_notebook, wxID_ANY, _T("I'm a notebook page"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -469,7 +468,7 @@ void NotebookWidgetsPage::OnButtonSelectPage(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
void NotebookWidgetsPage::OnButtonAddPage(wxCommandEvent& WXUNUSED(event))
|
void NotebookWidgetsPage::OnButtonAddPage(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
m_notebook->AddPage(CreateNewPage(), _T("Added page"), FALSE,
|
m_notebook->AddPage(CreateNewPage(), _T("Added page"), false,
|
||||||
GetIconIndex());
|
GetIconIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -478,7 +477,7 @@ void NotebookWidgetsPage::OnButtonInsertPage(wxCommandEvent& WXUNUSED(event))
|
|||||||
int pos = GetTextValue(m_textInsert);
|
int pos = GetTextValue(m_textInsert);
|
||||||
wxCHECK_RET( IsValidValue(pos), _T("button should be disabled") );
|
wxCHECK_RET( IsValidValue(pos), _T("button should be disabled") );
|
||||||
|
|
||||||
m_notebook->InsertPage(pos, CreateNewPage(), _T("Inserted page"), FALSE,
|
m_notebook->InsertPage(pos, CreateNewPage(), _T("Inserted page"), false,
|
||||||
GetIconIndex());
|
GetIconIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -142,8 +142,8 @@ BEGIN_EVENT_TABLE(RadioWidgetsPage, WidgetsPage)
|
|||||||
|
|
||||||
EVT_RADIOBOX(RadioPage_Radio, RadioWidgetsPage::OnRadioBox)
|
EVT_RADIOBOX(RadioPage_Radio, RadioWidgetsPage::OnRadioBox)
|
||||||
|
|
||||||
EVT_CHECKBOX(-1, RadioWidgetsPage::OnCheckOrRadioBox)
|
EVT_CHECKBOX(wxID_ANY, RadioWidgetsPage::OnCheckOrRadioBox)
|
||||||
EVT_RADIOBOX(-1, RadioWidgetsPage::OnCheckOrRadioBox)
|
EVT_RADIOBOX(wxID_ANY, RadioWidgetsPage::OnCheckOrRadioBox)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@@ -172,7 +172,7 @@ RadioWidgetsPage::RadioWidgetsPage(wxNotebook *notebook,
|
|||||||
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
|
||||||
// left pane
|
// left pane
|
||||||
wxStaticBox *box = new wxStaticBox(this, -1, _T("&Set style"));
|
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style"));
|
||||||
|
|
||||||
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
|
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ RadioWidgetsPage::RadioWidgetsPage(wxNotebook *notebook,
|
|||||||
_T("top to bottom")
|
_T("top to bottom")
|
||||||
};
|
};
|
||||||
|
|
||||||
m_radioDir = new wxRadioBox(this, -1, _T("Numbering:"),
|
m_radioDir = new wxRadioBox(this, wxID_ANY, _T("Numbering:"),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
WXSIZEOF(layoutDir), layoutDir,
|
WXSIZEOF(layoutDir), layoutDir,
|
||||||
1, wxRA_SPECIFY_COLS);
|
1, wxRA_SPECIFY_COLS);
|
||||||
@@ -198,12 +198,12 @@ RadioWidgetsPage::RadioWidgetsPage(wxNotebook *notebook,
|
|||||||
|
|
||||||
wxSizer *sizerRow;
|
wxSizer *sizerRow;
|
||||||
sizerRow = CreateSizerWithTextAndLabel(_T("&Major dimension:"),
|
sizerRow = CreateSizerWithTextAndLabel(_T("&Major dimension:"),
|
||||||
-1,
|
wxID_ANY,
|
||||||
&m_textMajorDim);
|
&m_textMajorDim);
|
||||||
sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5);
|
sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5);
|
||||||
|
|
||||||
sizerRow = CreateSizerWithTextAndLabel(_T("&Number of buttons:"),
|
sizerRow = CreateSizerWithTextAndLabel(_T("&Number of buttons:"),
|
||||||
-1,
|
wxID_ANY,
|
||||||
&m_textNumBtns);
|
&m_textNumBtns);
|
||||||
sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5);
|
sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5);
|
||||||
|
|
||||||
@@ -217,29 +217,29 @@ RadioWidgetsPage::RadioWidgetsPage(wxNotebook *notebook,
|
|||||||
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
||||||
|
|
||||||
// middle pane
|
// middle pane
|
||||||
wxStaticBox *box2 = new wxStaticBox(this, -1, _T("&Change parameters"));
|
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Change parameters"));
|
||||||
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
|
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
|
||||||
|
|
||||||
sizerRow = CreateSizerWithTextAndLabel(_T("Current selection:"),
|
sizerRow = CreateSizerWithTextAndLabel(_T("Current selection:"),
|
||||||
-1,
|
wxID_ANY,
|
||||||
&m_textCurSel);
|
&m_textCurSel);
|
||||||
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
|
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
|
||||||
|
|
||||||
sizerRow = CreateSizerWithTextAndButton(RadioPage_Selection,
|
sizerRow = CreateSizerWithTextAndButton(RadioPage_Selection,
|
||||||
_T("&Change selection:"),
|
_T("&Change selection:"),
|
||||||
-1,
|
wxID_ANY,
|
||||||
&m_textSel);
|
&m_textSel);
|
||||||
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
|
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
|
||||||
|
|
||||||
sizerRow = CreateSizerWithTextAndButton(RadioPage_Label,
|
sizerRow = CreateSizerWithTextAndButton(RadioPage_Label,
|
||||||
_T("&Label for box:"),
|
_T("&Label for box:"),
|
||||||
-1,
|
wxID_ANY,
|
||||||
&m_textLabel);
|
&m_textLabel);
|
||||||
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
|
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
|
||||||
|
|
||||||
sizerRow = CreateSizerWithTextAndButton(RadioPage_LabelBtn,
|
sizerRow = CreateSizerWithTextAndButton(RadioPage_LabelBtn,
|
||||||
_T("&Label for buttons:"),
|
_T("&Label for buttons:"),
|
||||||
-1,
|
wxID_ANY,
|
||||||
&m_textLabelBtns);
|
&m_textLabelBtns);
|
||||||
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
|
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
|
||||||
|
|
||||||
@@ -257,7 +257,6 @@ RadioWidgetsPage::RadioWidgetsPage(wxNotebook *notebook,
|
|||||||
sizerTop->Add(sizerRight, 0, wxGROW | (wxALL & ~wxRIGHT), 10);
|
sizerTop->Add(sizerRight, 0, wxGROW | (wxALL & ~wxRIGHT), 10);
|
||||||
|
|
||||||
// final initializations
|
// final initializations
|
||||||
SetAutoLayout(TRUE);
|
|
||||||
SetSizer(sizerTop);
|
SetSizer(sizerTop);
|
||||||
|
|
||||||
sizerTop->Fit(this);
|
sizerTop->Fit(this);
|
||||||
@@ -278,7 +277,7 @@ void RadioWidgetsPage::Reset()
|
|||||||
m_textLabel->SetValue(_T("I'm a radiobox"));
|
m_textLabel->SetValue(_T("I'm a radiobox"));
|
||||||
m_textLabelBtns->SetValue(_T("item"));
|
m_textLabelBtns->SetValue(_T("item"));
|
||||||
|
|
||||||
m_chkVert->SetValue(FALSE);
|
m_chkVert->SetValue(false);
|
||||||
m_radioDir->SetSelection(RadioDir_Default);
|
m_radioDir->SetSelection(RadioDir_Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -185,8 +185,8 @@ BEGIN_EVENT_TABLE(SliderWidgetsPage, WidgetsPage)
|
|||||||
|
|
||||||
EVT_COMMAND_SCROLL(SliderPage_Slider, SliderWidgetsPage::OnSlider)
|
EVT_COMMAND_SCROLL(SliderPage_Slider, SliderWidgetsPage::OnSlider)
|
||||||
|
|
||||||
EVT_CHECKBOX(-1, SliderWidgetsPage::OnCheckOrRadioBox)
|
EVT_CHECKBOX(wxID_ANY, SliderWidgetsPage::OnCheckOrRadioBox)
|
||||||
EVT_RADIOBOX(-1, SliderWidgetsPage::OnCheckOrRadioBox)
|
EVT_RADIOBOX(wxID_ANY, SliderWidgetsPage::OnCheckOrRadioBox)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@@ -218,7 +218,7 @@ SliderWidgetsPage::SliderWidgetsPage(wxNotebook *notebook,
|
|||||||
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
|
||||||
// left pane
|
// left pane
|
||||||
wxStaticBox *box = new wxStaticBox(this, -1, _T("&Set style"));
|
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style"));
|
||||||
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
|
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
|
||||||
|
|
||||||
m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Vertical"));
|
m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Vertical"));
|
||||||
@@ -248,14 +248,14 @@ SliderWidgetsPage::SliderWidgetsPage(wxNotebook *notebook,
|
|||||||
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
||||||
|
|
||||||
// middle pane
|
// middle pane
|
||||||
wxStaticBox *box2 = new wxStaticBox(this, -1, _T("&Change slider value"));
|
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Change slider value"));
|
||||||
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
|
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
|
||||||
|
|
||||||
wxTextCtrl *text;
|
wxTextCtrl *text;
|
||||||
wxSizer *sizerRow = CreateSizerWithTextAndLabel(_T("Current value"),
|
wxSizer *sizerRow = CreateSizerWithTextAndLabel(_T("Current value"),
|
||||||
SliderPage_CurValueText,
|
SliderPage_CurValueText,
|
||||||
&text);
|
&text);
|
||||||
text->SetEditable(FALSE);
|
text->SetEditable(false);
|
||||||
|
|
||||||
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@ SliderWidgetsPage::SliderWidgetsPage(wxNotebook *notebook,
|
|||||||
SliderPage_MinText,
|
SliderPage_MinText,
|
||||||
&m_textMin);
|
&m_textMin);
|
||||||
|
|
||||||
m_textMax = new wxTextCtrl(this, SliderPage_MaxText, _T(""));
|
m_textMax = new wxTextCtrl(this, SliderPage_MaxText, wxEmptyString);
|
||||||
sizerRow->Add(m_textMax, 1, wxLEFT | wxALIGN_CENTRE_VERTICAL, 5);
|
sizerRow->Add(m_textMax, 1, wxLEFT | wxALIGN_CENTRE_VERTICAL, 5);
|
||||||
|
|
||||||
m_textMin->SetValue( wxString::Format(_T("%d"), m_min) );
|
m_textMin->SetValue( wxString::Format(_T("%d"), m_min) );
|
||||||
@@ -308,7 +308,6 @@ SliderWidgetsPage::SliderWidgetsPage(wxNotebook *notebook,
|
|||||||
sizerTop->Add(sizerRight, 1, wxGROW | (wxALL & ~wxRIGHT), 10);
|
sizerTop->Add(sizerRight, 1, wxGROW | (wxALL & ~wxRIGHT), 10);
|
||||||
|
|
||||||
// final initializations
|
// final initializations
|
||||||
SetAutoLayout(TRUE);
|
|
||||||
SetSizer(sizerTop);
|
SetSizer(sizerTop);
|
||||||
|
|
||||||
sizerTop->Fit(this);
|
sizerTop->Fit(this);
|
||||||
@@ -324,10 +323,10 @@ SliderWidgetsPage::~SliderWidgetsPage()
|
|||||||
|
|
||||||
void SliderWidgetsPage::Reset()
|
void SliderWidgetsPage::Reset()
|
||||||
{
|
{
|
||||||
m_chkVert->SetValue(FALSE);
|
m_chkVert->SetValue(false);
|
||||||
m_chkTicks->SetValue(TRUE);
|
m_chkTicks->SetValue(true);
|
||||||
m_chkLabels->SetValue(TRUE);
|
m_chkLabels->SetValue(true);
|
||||||
m_chkBothSides->SetValue(FALSE);
|
m_chkBothSides->SetValue(false);
|
||||||
|
|
||||||
m_radioSides->SetSelection(StaticSides_Top);
|
m_radioSides->SetSelection(StaticSides_Top);
|
||||||
}
|
}
|
||||||
@@ -556,7 +555,7 @@ void SliderWidgetsPage::OnUpdateUIBothSides(wxUpdateUIEvent& event)
|
|||||||
#if defined(__WIN95__) || defined(__WXUNIVERSAL__)
|
#if defined(__WIN95__) || defined(__WXUNIVERSAL__)
|
||||||
event.Enable( m_chkTicks->GetValue() );
|
event.Enable( m_chkTicks->GetValue() );
|
||||||
#else
|
#else
|
||||||
event.Enable( FALSE );
|
event.Enable( false );
|
||||||
#endif // defined(__WIN95__) || defined(__WXUNIVERSAL__)
|
#endif // defined(__WIN95__) || defined(__WXUNIVERSAL__)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -152,8 +152,8 @@ BEGIN_EVENT_TABLE(SpinBtnWidgetsPage, WidgetsPage)
|
|||||||
EVT_SPIN_DOWN(SpinBtnPage_SpinBtn, SpinBtnWidgetsPage::OnSpinBtnDown)
|
EVT_SPIN_DOWN(SpinBtnPage_SpinBtn, SpinBtnWidgetsPage::OnSpinBtnDown)
|
||||||
EVT_SPINCTRL(SpinBtnPage_SpinCtrl, SpinBtnWidgetsPage::OnSpinCtrl)
|
EVT_SPINCTRL(SpinBtnPage_SpinCtrl, SpinBtnWidgetsPage::OnSpinCtrl)
|
||||||
|
|
||||||
EVT_CHECKBOX(-1, SpinBtnWidgetsPage::OnCheckOrRadioBox)
|
EVT_CHECKBOX(wxID_ANY, SpinBtnWidgetsPage::OnCheckOrRadioBox)
|
||||||
EVT_RADIOBOX(-1, SpinBtnWidgetsPage::OnCheckOrRadioBox)
|
EVT_RADIOBOX(wxID_ANY, SpinBtnWidgetsPage::OnCheckOrRadioBox)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@@ -188,7 +188,7 @@ SpinBtnWidgetsPage::SpinBtnWidgetsPage(wxNotebook *notebook,
|
|||||||
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
|
||||||
// left pane
|
// left pane
|
||||||
wxStaticBox *box = new wxStaticBox(this, -1, _T("&Set style"));
|
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style"));
|
||||||
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
|
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
|
||||||
|
|
||||||
m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Vertical"));
|
m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Vertical"));
|
||||||
@@ -200,14 +200,16 @@ SpinBtnWidgetsPage::SpinBtnWidgetsPage(wxNotebook *notebook,
|
|||||||
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
||||||
|
|
||||||
// middle pane
|
// middle pane
|
||||||
wxStaticBox *box2 = new wxStaticBox(this, -1, _T("&Change spinbtn value"));
|
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY,
|
||||||
|
_T("&Change spinbtn value"));
|
||||||
|
|
||||||
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
|
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
|
||||||
|
|
||||||
wxTextCtrl *text;
|
wxTextCtrl *text;
|
||||||
wxSizer *sizerRow = CreateSizerWithTextAndLabel(_T("Current value"),
|
wxSizer *sizerRow = CreateSizerWithTextAndLabel(_T("Current value"),
|
||||||
SpinBtnPage_CurValueText,
|
SpinBtnPage_CurValueText,
|
||||||
&text);
|
&text);
|
||||||
text->SetEditable(FALSE);
|
text->SetEditable(false);
|
||||||
|
|
||||||
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
||||||
|
|
||||||
@@ -222,7 +224,7 @@ SpinBtnWidgetsPage::SpinBtnWidgetsPage(wxNotebook *notebook,
|
|||||||
SpinBtnPage_MinText,
|
SpinBtnPage_MinText,
|
||||||
&m_textMin);
|
&m_textMin);
|
||||||
|
|
||||||
m_textMax = new wxTextCtrl(this, SpinBtnPage_MaxText, _T(""));
|
m_textMax = new wxTextCtrl(this, SpinBtnPage_MaxText, wxEmptyString);
|
||||||
sizerRow->Add(m_textMax, 1, wxLEFT | wxALIGN_CENTRE_VERTICAL, 5);
|
sizerRow->Add(m_textMax, 1, wxLEFT | wxALIGN_CENTRE_VERTICAL, 5);
|
||||||
|
|
||||||
m_textMin->SetValue( wxString::Format(_T("%d"), m_min) );
|
m_textMin->SetValue( wxString::Format(_T("%d"), m_min) );
|
||||||
@@ -244,7 +246,6 @@ SpinBtnWidgetsPage::SpinBtnWidgetsPage(wxNotebook *notebook,
|
|||||||
sizerTop->Add(sizerRight, 1, wxGROW | (wxALL & ~wxRIGHT), 10);
|
sizerTop->Add(sizerRight, 1, wxGROW | (wxALL & ~wxRIGHT), 10);
|
||||||
|
|
||||||
// final initializations
|
// final initializations
|
||||||
SetAutoLayout(TRUE);
|
|
||||||
SetSizer(sizerTop);
|
SetSizer(sizerTop);
|
||||||
|
|
||||||
sizerTop->Fit(this);
|
sizerTop->Fit(this);
|
||||||
@@ -260,8 +261,8 @@ SpinBtnWidgetsPage::~SpinBtnWidgetsPage()
|
|||||||
|
|
||||||
void SpinBtnWidgetsPage::Reset()
|
void SpinBtnWidgetsPage::Reset()
|
||||||
{
|
{
|
||||||
m_chkVert->SetValue(TRUE);
|
m_chkVert->SetValue(true);
|
||||||
m_chkWrap->SetValue(FALSE);
|
m_chkWrap->SetValue(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpinBtnWidgetsPage::CreateSpin()
|
void SpinBtnWidgetsPage::CreateSpin()
|
||||||
|
@@ -191,8 +191,8 @@ BEGIN_EVENT_TABLE(StaticWidgetsPage, WidgetsPage)
|
|||||||
EVT_BUTTON(StaticPage_LabelText, StaticWidgetsPage::OnButtonLabelText)
|
EVT_BUTTON(StaticPage_LabelText, StaticWidgetsPage::OnButtonLabelText)
|
||||||
EVT_BUTTON(StaticPage_BoxText, StaticWidgetsPage::OnButtonBoxText)
|
EVT_BUTTON(StaticPage_BoxText, StaticWidgetsPage::OnButtonBoxText)
|
||||||
|
|
||||||
EVT_CHECKBOX(-1, StaticWidgetsPage::OnCheckOrRadioBox)
|
EVT_CHECKBOX(wxID_ANY, StaticWidgetsPage::OnCheckOrRadioBox)
|
||||||
EVT_RADIOBOX(-1, StaticWidgetsPage::OnCheckOrRadioBox)
|
EVT_RADIOBOX(wxID_ANY, StaticWidgetsPage::OnCheckOrRadioBox)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@@ -224,7 +224,7 @@ StaticWidgetsPage::StaticWidgetsPage(wxNotebook *notebook,
|
|||||||
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
|
||||||
// left pane
|
// left pane
|
||||||
wxStaticBox *box = new wxStaticBox(this, -1, _T("&Set style"));
|
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style"));
|
||||||
|
|
||||||
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
|
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
|
||||||
|
|
||||||
@@ -246,10 +246,10 @@ StaticWidgetsPage::StaticWidgetsPage(wxNotebook *notebook,
|
|||||||
_T("bottom"),
|
_T("bottom"),
|
||||||
};
|
};
|
||||||
|
|
||||||
m_radioHAlign = new wxRadioBox(this, -1, _T("&Horz alignment"),
|
m_radioHAlign = new wxRadioBox(this, wxID_ANY, _T("&Horz alignment"),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
WXSIZEOF(halign), halign);
|
WXSIZEOF(halign), halign);
|
||||||
m_radioVAlign = new wxRadioBox(this, -1, _T("&Vert alignment"),
|
m_radioVAlign = new wxRadioBox(this, wxID_ANY, _T("&Vert alignment"),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
WXSIZEOF(valign), valign);
|
WXSIZEOF(valign), valign);
|
||||||
|
|
||||||
@@ -260,19 +260,19 @@ StaticWidgetsPage::StaticWidgetsPage(wxNotebook *notebook,
|
|||||||
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
||||||
|
|
||||||
// middle pane
|
// middle pane
|
||||||
wxStaticBox *box2 = new wxStaticBox(this, -1, _T("&Change labels"));
|
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Change labels"));
|
||||||
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
|
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
|
||||||
|
|
||||||
wxSizer *sizerRow;
|
wxSizer *sizerRow;
|
||||||
|
|
||||||
sizerRow = CreateSizerWithTextAndButton(StaticPage_BoxText,
|
sizerRow = CreateSizerWithTextAndButton(StaticPage_BoxText,
|
||||||
_T("Change &box label"),
|
_T("Change &box label"),
|
||||||
-1, &m_textBox);
|
wxID_ANY, &m_textBox);
|
||||||
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
|
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
|
||||||
|
|
||||||
sizerRow = CreateSizerWithTextAndButton(StaticPage_LabelText,
|
sizerRow = CreateSizerWithTextAndButton(StaticPage_LabelText,
|
||||||
_T("Change &text label"),
|
_T("Change &text label"),
|
||||||
-1, &m_textLabel);
|
wxID_ANY, &m_textLabel);
|
||||||
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
|
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
|
||||||
|
|
||||||
m_textBox->SetValue(_T("This is a box"));
|
m_textBox->SetValue(_T("This is a box"));
|
||||||
@@ -293,7 +293,6 @@ StaticWidgetsPage::StaticWidgetsPage(wxNotebook *notebook,
|
|||||||
// final initializations
|
// final initializations
|
||||||
Reset();
|
Reset();
|
||||||
|
|
||||||
SetAutoLayout(TRUE);
|
|
||||||
SetSizer(sizerTop);
|
SetSizer(sizerTop);
|
||||||
|
|
||||||
sizerTop->Fit(this);
|
sizerTop->Fit(this);
|
||||||
@@ -309,8 +308,8 @@ StaticWidgetsPage::~StaticWidgetsPage()
|
|||||||
|
|
||||||
void StaticWidgetsPage::Reset()
|
void StaticWidgetsPage::Reset()
|
||||||
{
|
{
|
||||||
m_chkVert->SetValue(FALSE);
|
m_chkVert->SetValue(false);
|
||||||
m_chkAutoResize->SetValue(TRUE);
|
m_chkAutoResize->SetValue(true);
|
||||||
|
|
||||||
m_radioHAlign->SetSelection(StaticHAlign_Left);
|
m_radioHAlign->SetSelection(StaticHAlign_Left);
|
||||||
m_radioVAlign->SetSelection(StaticVAlign_Top);
|
m_radioVAlign->SetSelection(StaticVAlign_Top);
|
||||||
@@ -379,17 +378,17 @@ void StaticWidgetsPage::CreateStatic()
|
|||||||
flagsText |= align;
|
flagsText |= align;
|
||||||
flagsBox |= align;
|
flagsBox |= align;
|
||||||
|
|
||||||
m_staticBox = new MyStaticBox(this, -1, m_textBox->GetValue(),
|
m_staticBox = new MyStaticBox(this, wxID_ANY, m_textBox->GetValue(),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
flagsBox);
|
flagsBox);
|
||||||
m_sizerStatBox = new wxStaticBoxSizer(m_staticBox, isVert ? wxHORIZONTAL
|
m_sizerStatBox = new wxStaticBoxSizer(m_staticBox, isVert ? wxHORIZONTAL
|
||||||
: wxVERTICAL);
|
: wxVERTICAL);
|
||||||
|
|
||||||
m_statText = new MyStaticText(this, -1, m_textLabel->GetValue(),
|
m_statText = new MyStaticText(this, wxID_ANY, m_textLabel->GetValue(),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
flagsText);
|
flagsText);
|
||||||
|
|
||||||
m_statLine = new wxStaticLine(this, -1,
|
m_statLine = new wxStaticLine(this, wxID_ANY,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
isVert ? wxLI_VERTICAL : wxLI_HORIZONTAL);
|
isVert ? wxLI_VERTICAL : wxLI_HORIZONTAL);
|
||||||
|
|
||||||
|
@@ -96,9 +96,9 @@ static const struct ControlValues
|
|||||||
} DEFAULTS =
|
} DEFAULTS =
|
||||||
{
|
{
|
||||||
TextLines_Multi, // multiline
|
TextLines_Multi, // multiline
|
||||||
FALSE, // not password
|
false, // not password
|
||||||
TRUE, // do wrap lines
|
true, // do wrap lines
|
||||||
FALSE, // not readonly
|
false, // not readonly
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
TextKind_Plain // plain EDIT control
|
TextKind_Plain // plain EDIT control
|
||||||
#endif // __WXMSW__
|
#endif // __WXMSW__
|
||||||
@@ -233,8 +233,8 @@ BEGIN_EVENT_TABLE(TextWidgetsPage, WidgetsPage)
|
|||||||
EVT_TEXT(TextPage_Textctrl, TextWidgetsPage::OnText)
|
EVT_TEXT(TextPage_Textctrl, TextWidgetsPage::OnText)
|
||||||
EVT_TEXT_ENTER(TextPage_Textctrl, TextWidgetsPage::OnTextEnter)
|
EVT_TEXT_ENTER(TextPage_Textctrl, TextWidgetsPage::OnTextEnter)
|
||||||
|
|
||||||
EVT_CHECKBOX(-1, TextWidgetsPage::OnCheckOrRadioBox)
|
EVT_CHECKBOX(wxID_ANY, TextWidgetsPage::OnCheckOrRadioBox)
|
||||||
EVT_RADIOBOX(-1, TextWidgetsPage::OnCheckOrRadioBox)
|
EVT_RADIOBOX(wxID_ANY, TextWidgetsPage::OnCheckOrRadioBox)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@@ -286,8 +286,8 @@ TextWidgetsPage::TextWidgetsPage(wxNotebook *notebook, wxImageList *imaglist)
|
|||||||
_T("multi line"),
|
_T("multi line"),
|
||||||
};
|
};
|
||||||
|
|
||||||
wxStaticBox *box = new wxStaticBox(this, -1, _T("&Set textctrl parameters"));
|
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set textctrl parameters"));
|
||||||
m_radioTextLines = new wxRadioBox(this, -1, _T("&Number of lines:"),
|
m_radioTextLines = new wxRadioBox(this, wxID_ANY, _T("&Number of lines:"),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
WXSIZEOF(modes), modes,
|
WXSIZEOF(modes), modes,
|
||||||
1, wxRA_SPECIFY_COLS);
|
1, wxRA_SPECIFY_COLS);
|
||||||
@@ -315,7 +315,7 @@ TextWidgetsPage::TextWidgetsPage(wxNotebook *notebook, wxImageList *imaglist)
|
|||||||
_T("rich edit 2.0"),
|
_T("rich edit 2.0"),
|
||||||
};
|
};
|
||||||
|
|
||||||
m_radioKind = new wxRadioBox(this, -1, _T("Control &kind"),
|
m_radioKind = new wxRadioBox(this, wxID_ANY, _T("Control &kind"),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
WXSIZEOF(kinds), kinds,
|
WXSIZEOF(kinds), kinds,
|
||||||
1, wxRA_SPECIFY_COLS);
|
1, wxRA_SPECIFY_COLS);
|
||||||
@@ -329,7 +329,7 @@ TextWidgetsPage::TextWidgetsPage(wxNotebook *notebook, wxImageList *imaglist)
|
|||||||
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
||||||
|
|
||||||
// middle pane
|
// middle pane
|
||||||
wxStaticBox *box2 = new wxStaticBox(this, -1, _T("&Change contents:"));
|
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Change contents:"));
|
||||||
wxSizer *sizerMiddleUp = new wxStaticBoxSizer(box2, wxVERTICAL);
|
wxSizer *sizerMiddleUp = new wxStaticBoxSizer(box2, wxVERTICAL);
|
||||||
|
|
||||||
btn = new wxButton(this, TextPage_Set, _T("&Set text value"));
|
btn = new wxButton(this, TextPage_Set, _T("&Set text value"));
|
||||||
@@ -347,7 +347,7 @@ TextWidgetsPage::TextWidgetsPage(wxNotebook *notebook, wxImageList *imaglist)
|
|||||||
btn = new wxButton(this, TextPage_Clear, _T("&Clear"));
|
btn = new wxButton(this, TextPage_Clear, _T("&Clear"));
|
||||||
sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1);
|
sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1);
|
||||||
|
|
||||||
wxStaticBox *box4 = new wxStaticBox(this, -1, _T("&Info:"));
|
wxStaticBox *box4 = new wxStaticBox(this, wxID_ANY, _T("&Info:"));
|
||||||
wxSizer *sizerMiddleDown = new wxStaticBoxSizer(box4, wxVERTICAL);
|
wxSizer *sizerMiddleDown = new wxStaticBoxSizer(box4, wxVERTICAL);
|
||||||
|
|
||||||
m_textPosCur = CreateInfoText();
|
m_textPosCur = CreateInfoText();
|
||||||
@@ -403,7 +403,7 @@ TextWidgetsPage::TextWidgetsPage(wxNotebook *notebook, wxImageList *imaglist)
|
|||||||
0, wxALL, 5
|
0, wxALL, 5
|
||||||
);
|
);
|
||||||
|
|
||||||
m_textRange = new wxTextCtrl(this, -1, _T(""),
|
m_textRange = new wxTextCtrl(this, wxID_ANY, wxEmptyString,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
wxTE_READONLY);
|
wxTE_READONLY);
|
||||||
sizerMiddleDown->Add
|
sizerMiddleDown->Add
|
||||||
@@ -421,7 +421,7 @@ TextWidgetsPage::TextWidgetsPage(wxNotebook *notebook, wxImageList *imaglist)
|
|||||||
sizerMiddle->Add(sizerMiddleDown, 1, wxGROW | wxTOP, 5);
|
sizerMiddle->Add(sizerMiddleDown, 1, wxGROW | wxTOP, 5);
|
||||||
|
|
||||||
// right pane
|
// right pane
|
||||||
wxStaticBox *box3 = new wxStaticBox(this, -1, _T("&Text:"));
|
wxStaticBox *box3 = new wxStaticBox(this, wxID_ANY, _T("&Text:"));
|
||||||
m_sizerText = new wxStaticBoxSizer(box3, wxHORIZONTAL);
|
m_sizerText = new wxStaticBoxSizer(box3, wxHORIZONTAL);
|
||||||
Reset();
|
Reset();
|
||||||
CreateText();
|
CreateText();
|
||||||
@@ -433,7 +433,6 @@ TextWidgetsPage::TextWidgetsPage(wxNotebook *notebook, wxImageList *imaglist)
|
|||||||
sizerTop->Add(sizerMiddle, 0, wxGROW | wxALL, 10);
|
sizerTop->Add(sizerMiddle, 0, wxGROW | wxALL, 10);
|
||||||
sizerTop->Add(m_sizerText, 1, wxGROW | (wxALL & ~wxRIGHT), 10);
|
sizerTop->Add(m_sizerText, 1, wxGROW | (wxALL & ~wxRIGHT), 10);
|
||||||
|
|
||||||
SetAutoLayout(TRUE);
|
|
||||||
SetSizer(sizerTop);
|
SetSizer(sizerTop);
|
||||||
|
|
||||||
sizerTop->Fit(this);
|
sizerTop->Fit(this);
|
||||||
@@ -456,7 +455,7 @@ wxTextCtrl *TextWidgetsPage::CreateInfoText()
|
|||||||
GetTextExtent(_T("9999999"), &s_maxWidth, NULL);
|
GetTextExtent(_T("9999999"), &s_maxWidth, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxTextCtrl *text = new wxTextCtrl(this, -1, _T(""),
|
wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, wxEmptyString,
|
||||||
wxDefaultPosition,
|
wxDefaultPosition,
|
||||||
wxSize(s_maxWidth, -1),
|
wxSize(s_maxWidth, -1),
|
||||||
wxTE_READONLY);
|
wxTE_READONLY);
|
||||||
@@ -469,12 +468,12 @@ wxSizer *TextWidgetsPage::CreateTextWithLabelSizer(const wxString& label,
|
|||||||
wxTextCtrl *text2)
|
wxTextCtrl *text2)
|
||||||
{
|
{
|
||||||
wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL);
|
||||||
sizerRow->Add(new wxStaticText(this, -1, label), 0,
|
sizerRow->Add(new wxStaticText(this, wxID_ANY, label), 0,
|
||||||
wxALIGN_CENTRE_VERTICAL | wxRIGHT, 5);
|
wxALIGN_CENTRE_VERTICAL | wxRIGHT, 5);
|
||||||
sizerRow->Add(text, 0, wxALIGN_CENTRE_VERTICAL);
|
sizerRow->Add(text, 0, wxALIGN_CENTRE_VERTICAL);
|
||||||
if ( text2 )
|
if ( text2 )
|
||||||
{
|
{
|
||||||
sizerRow->Add(new wxStaticText(this, -1, label2), 0,
|
sizerRow->Add(new wxStaticText(this, wxID_ANY, label2), 0,
|
||||||
wxALIGN_CENTRE_VERTICAL | wxLEFT | wxRIGHT, 5);
|
wxALIGN_CENTRE_VERTICAL | wxLEFT | wxRIGHT, 5);
|
||||||
sizerRow->Add(text2, 0, wxALIGN_CENTRE_VERTICAL);
|
sizerRow->Add(text2, 0, wxALIGN_CENTRE_VERTICAL);
|
||||||
}
|
}
|
||||||
@@ -510,7 +509,7 @@ void TextWidgetsPage::CreateText()
|
|||||||
|
|
||||||
case TextLines_Multi:
|
case TextLines_Multi:
|
||||||
flags |= wxTE_MULTILINE;
|
flags |= wxTE_MULTILINE;
|
||||||
m_chkPassword->SetValue(FALSE);
|
m_chkPassword->SetValue(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -747,10 +746,10 @@ void TextWidgetsPage::OnText(wxCommandEvent& WXUNUSED(event))
|
|||||||
// small hack to suppress the very first message: by then the logging is
|
// small hack to suppress the very first message: by then the logging is
|
||||||
// not yet redirected and so initial setting of the text value results in
|
// not yet redirected and so initial setting of the text value results in
|
||||||
// an annoying message box
|
// an annoying message box
|
||||||
static bool s_firstTime = TRUE;
|
static bool s_firstTime = true;
|
||||||
if ( s_firstTime )
|
if ( s_firstTime )
|
||||||
{
|
{
|
||||||
s_firstTime = FALSE;
|
s_firstTime = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -192,7 +192,7 @@ END_EVENT_TABLE()
|
|||||||
bool WidgetsApp::OnInit()
|
bool WidgetsApp::OnInit()
|
||||||
{
|
{
|
||||||
if ( !wxApp::OnInit() )
|
if ( !wxApp::OnInit() )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
// the reason for having these ifdef's is that I often run two copies of
|
// the reason for having these ifdef's is that I often run two copies of
|
||||||
// this sample side by side and it is useful to see which one is which
|
// this sample side by side and it is useful to see which one is which
|
||||||
@@ -220,7 +220,7 @@ bool WidgetsApp::OnInit()
|
|||||||
//wxLog::AddTraceMask(_T("scrollbar"));
|
//wxLog::AddTraceMask(_T("scrollbar"));
|
||||||
//wxLog::AddTraceMask(_T("focus"));
|
//wxLog::AddTraceMask(_T("focus"));
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -228,7 +228,7 @@ bool WidgetsApp::OnInit()
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WidgetsFrame::WidgetsFrame(const wxString& title)
|
WidgetsFrame::WidgetsFrame(const wxString& title)
|
||||||
: wxFrame(NULL, -1, title,
|
: wxFrame(NULL, wxID_ANY, title,
|
||||||
wxPoint(0, 50), wxDefaultSize,
|
wxPoint(0, 50), wxDefaultSize,
|
||||||
wxDEFAULT_FRAME_STYLE |
|
wxDEFAULT_FRAME_STYLE |
|
||||||
wxNO_FULL_REPAINT_ON_RESIZE |
|
wxNO_FULL_REPAINT_ON_RESIZE |
|
||||||
@@ -242,24 +242,25 @@ WidgetsFrame::WidgetsFrame(const wxString& title)
|
|||||||
m_imaglist = (wxImageList *)NULL;
|
m_imaglist = (wxImageList *)NULL;
|
||||||
|
|
||||||
// create controls
|
// create controls
|
||||||
m_panel = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxCLIP_CHILDREN);
|
m_panel = new wxPanel(this, wxID_ANY,
|
||||||
|
wxDefaultPosition, wxDefaultSize, wxCLIP_CHILDREN);
|
||||||
|
|
||||||
wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
|
wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
||||||
// we have 2 panes: notebook which pages demonstrating the controls in the
|
// we have 2 panes: notebook which pages demonstrating the controls in the
|
||||||
// upper one and the log window with some buttons in the lower
|
// upper one and the log window with some buttons in the lower
|
||||||
|
|
||||||
m_notebook = new wxNotebook(m_panel, -1, wxDefaultPosition, wxDefaultSize, wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN);
|
m_notebook = new wxNotebook(m_panel, wxID_ANY, wxDefaultPosition,
|
||||||
|
wxDefaultSize, wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN);
|
||||||
InitNotebook();
|
InitNotebook();
|
||||||
wxSizer *sizerUp = new wxNotebookSizer(m_notebook);
|
wxSizer *sizerUp = new wxNotebookSizer(m_notebook);
|
||||||
|
|
||||||
// the lower one only has the log listbox and a button to clear it
|
// the lower one only has the log listbox and a button to clear it
|
||||||
wxSizer *sizerDown = new wxStaticBoxSizer
|
wxSizer *sizerDown = new wxStaticBoxSizer(
|
||||||
(
|
new wxStaticBox( m_panel, wxID_ANY, _T("&Log window") ),
|
||||||
new wxStaticBox(m_panel, -1, _T("&Log window")),
|
wxVERTICAL);
|
||||||
wxVERTICAL
|
|
||||||
);
|
m_lboxLog = new wxListBox(m_panel, wxID_ANY);
|
||||||
m_lboxLog = new wxListBox(m_panel, -1);
|
|
||||||
sizerDown->Add(m_lboxLog, 1, wxGROW | wxALL, 5);
|
sizerDown->Add(m_lboxLog, 1, wxGROW | wxALL, 5);
|
||||||
sizerDown->SetMinSize(100, 150);
|
sizerDown->SetMinSize(100, 150);
|
||||||
|
|
||||||
@@ -276,7 +277,6 @@ WidgetsFrame::WidgetsFrame(const wxString& title)
|
|||||||
sizerTop->Add(0, 5, 0, wxGROW); // spacer in between
|
sizerTop->Add(0, 5, 0, wxGROW); // spacer in between
|
||||||
sizerTop->Add(sizerDown, 0, wxGROW | (wxALL & ~wxTOP), 10);
|
sizerTop->Add(sizerDown, 0, wxGROW | (wxALL & ~wxTOP), 10);
|
||||||
|
|
||||||
m_panel->SetAutoLayout(TRUE);
|
|
||||||
m_panel->SetSizer(sizerTop);
|
m_panel->SetSizer(sizerTop);
|
||||||
|
|
||||||
sizerTop->Fit(this);
|
sizerTop->Fit(this);
|
||||||
@@ -317,7 +317,7 @@ void WidgetsFrame::InitNotebook()
|
|||||||
m_notebook->AddPage(
|
m_notebook->AddPage(
|
||||||
pages[n],
|
pages[n],
|
||||||
labels[n],
|
labels[n],
|
||||||
FALSE, // don't select
|
false, // don't select
|
||||||
n // image id
|
n // image id
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -363,7 +363,7 @@ WidgetsPageInfo::WidgetsPageInfo(Constructor ctor, const wxChar *label)
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WidgetsPage::WidgetsPage(wxNotebook *notebook)
|
WidgetsPage::WidgetsPage(wxNotebook *notebook)
|
||||||
: wxPanel(notebook, -1,
|
: wxPanel(notebook, wxID_ANY,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
wxNO_FULL_REPAINT_ON_RESIZE |
|
wxNO_FULL_REPAINT_ON_RESIZE |
|
||||||
wxCLIP_CHILDREN |
|
wxCLIP_CHILDREN |
|
||||||
@@ -376,7 +376,8 @@ wxSizer *WidgetsPage::CreateSizerWithText(wxControl *control,
|
|||||||
wxTextCtrl **ppText)
|
wxTextCtrl **ppText)
|
||||||
{
|
{
|
||||||
wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL);
|
||||||
wxTextCtrl *text = new wxTextCtrl(this, id, _T(""), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
|
wxTextCtrl *text = new wxTextCtrl(this, id, wxEmptyString,
|
||||||
|
wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
|
||||||
|
|
||||||
sizerRow->Add(control, 0, wxRIGHT | wxALIGN_CENTRE_VERTICAL, 5);
|
sizerRow->Add(control, 0, wxRIGHT | wxALIGN_CENTRE_VERTICAL, 5);
|
||||||
sizerRow->Add(text, 1, wxLEFT | wxALIGN_CENTRE_VERTICAL, 5);
|
sizerRow->Add(text, 1, wxLEFT | wxALIGN_CENTRE_VERTICAL, 5);
|
||||||
@@ -392,7 +393,8 @@ wxSizer *WidgetsPage::CreateSizerWithTextAndLabel(const wxString& label,
|
|||||||
wxWindowID id,
|
wxWindowID id,
|
||||||
wxTextCtrl **ppText)
|
wxTextCtrl **ppText)
|
||||||
{
|
{
|
||||||
return CreateSizerWithText(new wxStaticText(this, -1, label), id, ppText);
|
return CreateSizerWithText(new wxStaticText(this, wxID_ANY, label),
|
||||||
|
id, ppText);
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a sizer containing a button and a text ctrl
|
// create a sizer containing a button and a text ctrl
|
||||||
|
@@ -40,24 +40,24 @@ protected:
|
|||||||
// (pointer to which will be saved in the provided variable if not NULL)
|
// (pointer to which will be saved in the provided variable if not NULL)
|
||||||
// with the specified id
|
// with the specified id
|
||||||
wxSizer *CreateSizerWithText(wxControl *control,
|
wxSizer *CreateSizerWithText(wxControl *control,
|
||||||
wxWindowID id = -1,
|
wxWindowID id = wxID_ANY,
|
||||||
wxTextCtrl **ppText = NULL);
|
wxTextCtrl **ppText = NULL);
|
||||||
|
|
||||||
// create a sizer containing a label and a text ctrl
|
// create a sizer containing a label and a text ctrl
|
||||||
wxSizer *CreateSizerWithTextAndLabel(const wxString& label,
|
wxSizer *CreateSizerWithTextAndLabel(const wxString& label,
|
||||||
wxWindowID id = -1,
|
wxWindowID id = wxID_ANY,
|
||||||
wxTextCtrl **ppText = NULL);
|
wxTextCtrl **ppText = NULL);
|
||||||
|
|
||||||
// create a sizer containing a button and a text ctrl
|
// create a sizer containing a button and a text ctrl
|
||||||
wxSizer *CreateSizerWithTextAndButton(wxWindowID idBtn,
|
wxSizer *CreateSizerWithTextAndButton(wxWindowID idBtn,
|
||||||
const wxString& labelBtn,
|
const wxString& labelBtn,
|
||||||
wxWindowID id = -1,
|
wxWindowID id = wxID_ANY,
|
||||||
wxTextCtrl **ppText = NULL);
|
wxTextCtrl **ppText = NULL);
|
||||||
|
|
||||||
// create a checkbox and add it to the sizer
|
// create a checkbox and add it to the sizer
|
||||||
wxCheckBox *CreateCheckBoxAndAddToSizer(wxSizer *sizer,
|
wxCheckBox *CreateCheckBoxAndAddToSizer(wxSizer *sizer,
|
||||||
const wxString& label,
|
const wxString& label,
|
||||||
wxWindowID id = -1);
|
wxWindowID id = wxID_ANY);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// the head of the linked list containinginfo about all pages
|
// the head of the linked list containinginfo about all pages
|
||||||
|
Reference in New Issue
Block a user