X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/491bb4ba78c499cce7e845323b4a549ad266853d..858102d740aa2d0644f040b64c7078de8d19a240:/samples/collpane/collpane.cpp diff --git a/samples/collpane/collpane.cpp b/samples/collpane/collpane.cpp index a48444f4fe..2cd10c25c9 100644 --- a/samples/collpane/collpane.cpp +++ b/samples/collpane/collpane.cpp @@ -44,6 +44,10 @@ #include "wx/fontpicker.h" #include "wx/aboutdlg.h" +#ifndef __WXMSW__ + #include "../sample.xpm" +#endif + // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- @@ -51,13 +55,13 @@ // ID for the menu commands enum { - PANE_COLLAPSE, + PANE_COLLAPSE = 100, PANE_EXPAND, PANE_SETLABEL, PANE_SHOWDLG, PANE_ABOUT = wxID_ABOUT, PANE_QUIT = wxID_EXIT, - + PANE_BUTTON, PANE_TEXTCTRL }; @@ -74,7 +78,7 @@ public: virtual bool OnInit(); - DECLARE_NO_COPY_CLASS(MyApp) + wxDECLARE_NO_COPY_CLASS(MyApp); }; class MyFrame: public wxFrame @@ -100,7 +104,7 @@ private: wxBoxSizer *m_paneSizer; DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(MyFrame) + wxDECLARE_NO_COPY_CLASS(MyFrame); }; class MyDialog : public wxDialog @@ -116,7 +120,7 @@ private: wxGridSizer *m_paneSizer; DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(MyDialog) + wxDECLARE_NO_COPY_CLASS(MyDialog); }; @@ -166,6 +170,8 @@ MyFrame::MyFrame() wxDefaultPosition, wxSize(420, 300), wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE) { + SetIcon(wxICON(sample)); + #if wxUSE_STATUSBAR CreateStatusBar(2); #endif // wxUSE_STATUSBAR @@ -191,7 +197,7 @@ MyFrame::MyFrame() m_collPane = new wxCollapsiblePane(this, -1, wxT("test!")); wxWindow *win = m_collPane->GetPane(); - + m_paneSizer = new wxBoxSizer( wxVERTICAL ); m_paneSizer->Add( new wxStaticText(win, -1, wxT("Static text") ), 0, wxALIGN_LEFT ); m_paneSizer->Add( new wxStaticText(win, -1, wxT("Yet another one!") ), 0, wxALIGN_LEFT ); @@ -318,13 +324,13 @@ void MyDialog::OnAlignButton(wxCommandEvent& WXUNUSED(ev)) { wxSizerItem *item = m_paneSizer->GetItem( FindWindow(PANE_TEXTCTRL), true ); item->SetFlag( wxALIGN_RIGHT ); - + Layout(); } -void MyDialog::OnPaneChanged(wxCollapsiblePaneEvent &event) +void MyDialog::OnPaneChanged(wxCollapsiblePaneEvent& event) { - wxLogDebug(wxT("The pane has just been %s by the user"), + wxLogMessage(wxT("The pane has just been %s by the user"), event.GetCollapsed() ? wxT("collapsed") : wxT("expanded")); }