]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/collpane/collpane.cpp
Use X64 machine type for MSVC linker instead of old AMD64.
[wxWidgets.git] / samples / collpane / collpane.cpp
index a48444f4fe3ed5f2e96d43d46e230faf2e65ca76..fccfa6a56fc28a4d37d4251f55a1b7daf78ed0c7 100644 (file)
 #include "wx/fontpicker.h"
 #include "wx/aboutdlg.h"
 
+#ifndef __WXMSW__
+    #include "../sample.xpm"
+#endif
+
 // ----------------------------------------------------------------------------
 // constants
 // ----------------------------------------------------------------------------
 // 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);
 };
 
 
@@ -162,22 +166,24 @@ END_EVENT_TABLE()
 
 // My frame constructor
 MyFrame::MyFrame()
-       : wxFrame(NULL, wxID_ANY, _T("wxCollapsiblePane sample"),
+       : wxFrame(NULL, wxID_ANY, wxT("wxCollapsiblePane sample"),
                  wxDefaultPosition, wxSize(420, 300),
                  wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE)
 {
+    SetIcon(wxICON(sample));
+
 #if wxUSE_STATUSBAR
     CreateStatusBar(2);
 #endif // wxUSE_STATUSBAR
 
     // Make a menubar
     wxMenu *paneMenu = new wxMenu;
-    paneMenu->Append(PANE_COLLAPSE, _T("Collapse\tCtrl-C"));
-    paneMenu->Append(PANE_EXPAND, _T("Expand\tCtrl-E"));
+    paneMenu->Append(PANE_COLLAPSE, wxT("Collapse\tCtrl-C"));
+    paneMenu->Append(PANE_EXPAND, wxT("Expand\tCtrl-E"));
     paneMenu->AppendSeparator();
-    paneMenu->Append(PANE_SETLABEL, _T("Set label...\tCtrl-L"));
+    paneMenu->Append(PANE_SETLABEL, wxT("Set label...\tCtrl-L"));
     paneMenu->AppendSeparator();
-    paneMenu->Append(PANE_SHOWDLG, _T("Show dialog...\tCtrl-S"));
+    paneMenu->Append(PANE_SHOWDLG, wxT("Show dialog...\tCtrl-S"));
     paneMenu->AppendSeparator();
     paneMenu->Append(PANE_QUIT);
 
@@ -185,13 +191,13 @@ MyFrame::MyFrame()
     helpMenu->Append(PANE_ABOUT);
 
     wxMenuBar *menuBar = new wxMenuBar;
-    menuBar->Append(paneMenu, _T("&Pane"));
-    menuBar->Append(helpMenu, _T("&Help"));
+    menuBar->Append(paneMenu, wxT("&Pane"));
+    menuBar->Append(helpMenu, wxT("&Help"));
     SetMenuBar(menuBar);
 
     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 );
@@ -243,7 +249,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
     wxAboutDialogInfo info;
     info.SetName(_("wxCollapsiblePane sample"));
     info.SetDescription(_("This sample program demonstrates usage of wxCollapsiblePane"));
-    info.SetCopyright(_T("(C) 2006 Francesco Montorsi <frm@users.sourceforge.net>"));
+    info.SetCopyright(wxT("(C) 2006 Francesco Montorsi <frm@users.sourceforge.net>"));
 
     wxAboutBox(info);
 }
@@ -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(wxCollapsiblePaneEventevent)
 {
-    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"));
 }