class MyApp : public wxApp
{
public:
- virtual bool OnInit() { (new MyFrame())->Show(); return TRUE; }
+ virtual bool OnInit() { (new MyFrame())->Show(); return true; }
};
// ----------------------------------------------------------------------------
// frame constructor
MyFrame::MyFrame()
- : wxFrame(NULL, -1, _T("HtmlLbox wxWidgets Sample"),
+ : wxFrame(NULL, wxID_ANY, _T("HtmlLbox wxWidgets Sample"),
wxDefaultPosition, wxSize(400, 500))
{
// set the frame icon
// create the child controls
m_hlbox = new MyHtmlListBox(this);
- wxTextCtrl *text = new wxTextCtrl(this, -1, _T(""),
+ wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, _T(""),
wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE);
delete wxLog::SetActiveTarget(new wxLogTextCtrl(text));
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
- // TRUE is to force the frame to close
- Close(TRUE);
+ // true is to force the frame to close
+ Close(true);
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxMessageBox(_T("This sample shows wxHtmlListBox class.\n")
_T("\n")
- _T("© 2003 Vadim Zeitlin"),
+ _T("(c) 2003 Vadim Zeitlin"),
_T("About HtmlLbox"),
wxOK | wxICON_INFORMATION,
this);
m_hlbox->SetBackgroundColour(col);
m_hlbox->Refresh();
+#if wxUSE_STATUSBAR
SetStatusText(_T("Background colour changed."));
+#endif // wxUSE_STATUSBAR
}
}
m_hlbox->SetSelectionBackground(col);
m_hlbox->Refresh();
+#if wxUSE_STATUSBAR
SetStatusText(_T("Selection background colour changed."));
+#endif // wxUSE_STATUSBAR
}
}
wxLogMessage(_T("Selected items: %s"), s.c_str());
}
+#if wxUSE_STATUSBAR
SetStatusText(wxString::Format(
_T("# items selected = %lu"),
(unsigned long)m_hlbox->GetSelectedCount()
));
+#endif // wxUSE_STATUSBAR
}
// ============================================================================
// ============================================================================
MyHtmlListBox::MyHtmlListBox(wxWindow *parent, bool multi)
- : wxHtmlListBox(parent, -1, wxDefaultPosition, wxDefaultSize,
+ : wxHtmlListBox(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
multi ? wxLB_MULTIPLE : 0)
{
m_change = true;