]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/collpane/collpane.cpp
Remove the unused code instead of commenting it out.
[wxWidgets.git] / samples / collpane / collpane.cpp
index 2cd10c25c91fa95995218a348fdecaf950792a52..27cccb9f7714f0a4f21def127259eb886e9cbdc8 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     14/10/06
 // RCS-ID:      $Id$
 // Copyright:   (c) Francesco Montorsi
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
@@ -44,7 +44,7 @@
 #include "wx/fontpicker.h"
 #include "wx/aboutdlg.h"
 
-#ifndef __WXMSW__
+#ifndef wxHAS_IMAGES_IN_RESOURCES
     #include "../sample.xpm"
 #endif
 
@@ -166,7 +166,7 @@ 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)
 {
@@ -178,12 +178,12 @@ MyFrame::MyFrame()
 
     // 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);
 
@@ -191,18 +191,23 @@ 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 );
-    m_paneSizer->Add( new wxTextCtrl(win, PANE_TEXTCTRL, wxT("Text control"), wxDefaultPosition, wxSize(80,-1) ), 0, wxALIGN_LEFT );
-    m_paneSizer->Add( new wxButton(win, PANE_BUTTON, wxT("Press to align right") ), 0, wxALIGN_LEFT );
+    m_paneSizer = new wxBoxSizer( wxHORIZONTAL );
+    wxBoxSizer* paneSubSizer = new wxBoxSizer( wxVERTICAL );
+    m_paneSizer->AddSpacer( 20 );
+    m_paneSizer->Add( paneSubSizer, 1 );
+
+    paneSubSizer->Add( new wxStaticText(win, -1, wxT("Static text") ), 0, wxALIGN_LEFT | wxALL, 3 );
+    paneSubSizer->Add( new wxStaticText(win, -1, wxT("Yet another one!") ), 0, wxALIGN_LEFT | wxALL, 3 );
+    paneSubSizer->Add( new wxTextCtrl(win, PANE_TEXTCTRL, wxT("Text control"), wxDefaultPosition, wxSize(80,-1) ), 0, wxALIGN_LEFT | wxALL, 3 );
+    paneSubSizer->Add( new wxButton(win, PANE_BUTTON, wxT("Press to align right") ), 0, wxALIGN_LEFT | wxALL, 3 );
+
     win->SetSizer( m_paneSizer );
 }
 
@@ -249,7 +254,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);
 }