From 5f4d35b8045442f97ed74ba2aa633e843adae7ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C5=82odzimierz=20Skiba?= Date: Tue, 23 Aug 2005 15:54:39 +0000 Subject: [PATCH] wxOS2/OW warning and build fixes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35281 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- demos/forty/card.cpp | 4 +-- demos/life/life.cpp | 14 ++++++++--- samples/artprov/arttest.cpp | 6 ++--- samples/dynamic/dynamic.cpp | 2 +- samples/listctrl/listtest.cpp | 9 ++++--- samples/minifram/minifram.cpp | 4 +-- samples/sashtest/sashtest.cpp | 46 ++++++++++++++++++++--------------- samples/toolbar/toolbar.cpp | 36 ++++++++++++++------------- 8 files changed, 66 insertions(+), 55 deletions(-) diff --git a/demos/forty/card.cpp b/demos/forty/card.cpp index c68a3b8d71..3e35c64c0d 100644 --- a/demos/forty/card.cpp +++ b/demos/forty/card.cpp @@ -41,7 +41,7 @@ #include "forty.h" #include "card.h" -#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXX11__) +#ifndef __WXMSW__ #include "pictures.xpm" #include "symbols.xbm" #endif @@ -565,5 +565,3 @@ void Card::DrawNullCard(wxDC& dc, int x, int y) dc.SetPen(*pen); dc.DrawRoundedRectangle(x, y, m_width, m_height, 4); } // Card::DrawNullCard() - - diff --git a/demos/life/life.cpp b/demos/life/life.cpp index 62a42a72e7..9a0051d4bf 100644 --- a/demos/life/life.cpp +++ b/demos/life/life.cpp @@ -103,7 +103,9 @@ enum // Event tables BEGIN_EVENT_TABLE(LifeFrame, wxFrame) EVT_MENU (wxID_NEW, LifeFrame::OnMenu) +#if wxUSE_FILEDLG EVT_MENU (wxID_OPEN, LifeFrame::OnOpen) +#endif EVT_MENU (ID_SAMPLES, LifeFrame::OnSamples) EVT_MENU (wxID_ABOUT, LifeFrame::OnMenu) EVT_MENU (wxID_EXIT, LifeFrame::OnMenu) @@ -183,7 +185,7 @@ bool LifeApp::OnInit() // -------------------------------------------------------------------------- // frame constructor -LifeFrame::LifeFrame() : +LifeFrame::LifeFrame() : wxFrame( (wxFrame *) NULL, wxID_ANY, _("Life!"), wxDefaultPosition ), m_navigator(NULL) { @@ -197,7 +199,9 @@ LifeFrame::LifeFrame() : wxMenu *menuHelp = new wxMenu(wxMENU_TEAROFF); menuFile->Append(wxID_NEW, wxGetStockLabel(wxID_NEW), _("Start a new game")); +#if wxUSE_FILEDLG menuFile->Append(wxID_OPEN, wxGetStockLabel(wxID_OPEN), _("Open an existing Life pattern")); +#endif menuFile->Append(ID_SAMPLES, _("&Sample game..."), _("Select a sample configuration")); #if ! (defined(__SMARTPHONE__) || defined(__POCKETPC__)) menuFile->AppendSeparator(); @@ -252,14 +256,16 @@ LifeFrame::LifeFrame() : ADD_TOOL(wxID_NEW, tbBitmaps[0], wxGetStockLabel(wxID_NEW, false), _("Start a new game")); #ifndef __POCKETPC__ +#if wxUSE_FILEDLG ADD_TOOL(wxID_OPEN, tbBitmaps[1], wxGetStockLabel(wxID_OPEN, false), _("Open an existing Life pattern")); +#endif // wxUSE_FILEDLG toolBar->AddSeparator(); ADD_TOOL(wxID_ZOOM_IN, tbBitmaps[2], wxGetStockLabel(wxID_ZOOM_IN, false), _("Zoom in")); ADD_TOOL(wxID_ZOOM_OUT, tbBitmaps[3], wxGetStockLabel(wxID_ZOOM_OUT, false), _("Zoom out")); ADD_TOOL(ID_INFO, tbBitmaps[4], _("Description"), _("Show description")); toolBar->AddSeparator(); -#endif +#endif // __POCKETPC__ ADD_TOOL(ID_START, tbBitmaps[5], _("Start"), _("Start")); ADD_TOOL(wxID_STOP, tbBitmaps[6], wxGetStockLabel(wxID_STOP, false), _("Stop")); @@ -446,6 +452,7 @@ void LifeFrame::OnMenu(wxCommandEvent& event) } } +#if wxUSE_FILEDLG void LifeFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) { wxFileDialog filedlg(this, @@ -475,6 +482,7 @@ void LifeFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) } } } +#endif void LifeFrame::OnSamples(wxCommandEvent& WXUNUSED(event)) { @@ -1132,5 +1140,3 @@ void LifeCanvas::OnEraseBackground(wxEraseEvent& WXUNUSED(event)) { // do nothing. I just don't want the background to be erased, you know. } - - diff --git a/samples/artprov/arttest.cpp b/samples/artprov/arttest.cpp index 186fd43003..6d787932dd 100644 --- a/samples/artprov/arttest.cpp +++ b/samples/artprov/arttest.cpp @@ -20,7 +20,7 @@ #include "wx/wx.h" #endif -#ifndef __WXMSW__ +#if !defined(__WXMSW__) && !defined(__WXPM__) #include "mondrian.xpm" #endif @@ -52,7 +52,7 @@ private: #endif // wxUSE_LOG void OnBrowser(wxCommandEvent& event); void OnPlugProvider(wxCommandEvent& event); - + DECLARE_EVENT_TABLE() }; @@ -156,7 +156,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, wxMenu *helpMenu = new wxMenu; helpMenu->Append(wxID_ABOUT, _T("&About...\tF1"), _T("Show about dialog")); - menuFile->AppendCheckItem(ID_PlugProvider, _T("&Plug-in art provider"), _T("Enable custom art provider")); + menuFile->AppendCheckItem(ID_PlugProvider, _T("&Plug-in art provider"), _T("Enable custom art provider")); menuFile->AppendSeparator(); #if wxUSE_LOG diff --git a/samples/dynamic/dynamic.cpp b/samples/dynamic/dynamic.cpp index 365c00eaa7..aea56b8fbe 100644 --- a/samples/dynamic/dynamic.cpp +++ b/samples/dynamic/dynamic.cpp @@ -27,7 +27,7 @@ #include "wx/clntdata.h" -#if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXCOCOA__) +#ifndef __WXMSW__ #include "mondrian.xpm" #endif diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index 28d151f6cc..adf5a082ec 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -25,9 +25,11 @@ #include "wx/wx.h" #endif -#ifndef __WXMSW__ +#if !defined(__WXMSW__) && !defined(__WXPM__) #include "mondrian.xpm" +#endif +#ifndef __WXMSW__ #include "bitmaps/toolbrai.xpm" #include "bitmaps/toolchar.xpm" #include "bitmaps/tooldata.xpm" @@ -95,7 +97,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(LIST_TOGGLE_LINES, MyFrame::OnToggleLines) EVT_UPDATE_UI(LIST_SHOW_COL_INFO, MyFrame::OnUpdateShowColInfo) - EVT_UPDATE_UI(LIST_TOGGLE_MULTI_SEL, MyFrame::OnUpdateToggleMultiSel) + EVT_UPDATE_UI(LIST_TOGGLE_MULTI_SEL, MyFrame::OnUpdateToggleMultiSel) END_EVENT_TABLE() BEGIN_EVENT_TABLE(MyListCtrl, wxListCtrl) @@ -736,7 +738,7 @@ void MyListCtrl::OnColRightClick(wxListEvent& event) // Show popupmenu at position wxMenu menu(wxT("Test")); menu.Append(LIST_ABOUT, _T("&About")); - PopupMenu(&menu, event.GetPoint()); + PopupMenu(&menu, event.GetPoint()); wxLogMessage( wxT("OnColumnRightClick at %d."), event.GetColumn() ); } @@ -1035,4 +1037,3 @@ void MyListCtrl::InsertItemInReportView(int i) buf.Printf(_T("Item %d in column 2"), i); SetItem(i, 2, buf); } - diff --git a/samples/minifram/minifram.cpp b/samples/minifram/minifram.cpp index f9d5f4e22c..96d41ad7e3 100644 --- a/samples/minifram/minifram.cpp +++ b/samples/minifram/minifram.cpp @@ -23,7 +23,7 @@ #include "wx/toolbar.h" #include "minifram.h" -#if !defined(__WXMSW__) +#if !defined(__WXMSW__) && !defined(__WXPM__) #include "mondrian.xpm" #endif #include "bitmaps/new.xpm" @@ -195,5 +195,3 @@ void MyMainFrame::OnReparent(wxCommandEvent& WXUNUSED(event)) mini_frame->SendSizeEvent(); } } - - diff --git a/samples/sashtest/sashtest.cpp b/samples/sashtest/sashtest.cpp index 7db36a819a..fb3accf647 100644 --- a/samples/sashtest/sashtest.cpp +++ b/samples/sashtest/sashtest.cpp @@ -135,7 +135,7 @@ MyFrame::MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, c win->SetSashVisible(wxSASH_RIGHT, true); win->SetExtraBorderSize(10); - wxTextCtrl* textWindow = new wxTextCtrl(win, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, + wxTextCtrl* textWindow = new wxTextCtrl(win, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxSUNKEN_BORDER); // wxTE_MULTILINE|wxNO_BORDER); textWindow->SetValue(_T("A help window")); @@ -175,8 +175,10 @@ void MyFrame::OnToggleWindow(wxCommandEvent& WXUNUSED(event)) { m_leftWindow1->Show(true); } +#if wxUSE_MDI_ARCHITECTURE wxLayoutAlgorithm layout; layout.LayoutMDIFrame(this); +#endif // wxUSE_MDI_ARCHITECTURE } void MyFrame::OnSashDrag(wxSashEvent& event) @@ -207,8 +209,11 @@ void MyFrame::OnSashDrag(wxSashEvent& event) break; } } + +#if wxUSE_MDI_ARCHITECTURE wxLayoutAlgorithm layout; layout.LayoutMDIFrame(this); +#endif // wxUSE_MDI_ARCHITECTURE // Leaves bits of itself behind sometimes GetClientWindow()->Refresh(); @@ -286,29 +291,29 @@ MyCanvas::MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size) // Define the repainting behaviour void MyCanvas::OnDraw(wxDC& dc) { - dc.SetFont(*wxSWISS_FONT); - dc.SetPen(*wxGREEN_PEN); - dc.DrawLine(0, 0, 200, 200); - dc.DrawLine(200, 0, 0, 200); + dc.SetFont(*wxSWISS_FONT); + dc.SetPen(*wxGREEN_PEN); + dc.DrawLine(0, 0, 200, 200); + dc.DrawLine(200, 0, 0, 200); - dc.SetBrush(*wxCYAN_BRUSH); - dc.SetPen(*wxRED_PEN); - dc.DrawRectangle(100, 100, 100, 50); - dc.DrawRoundedRectangle(150, 150, 100, 50, 20); + dc.SetBrush(*wxCYAN_BRUSH); + dc.SetPen(*wxRED_PEN); + dc.DrawRectangle(100, 100, 100, 50); + dc.DrawRoundedRectangle(150, 150, 100, 50, 20); - dc.DrawEllipse(250, 250, 100, 50); + dc.DrawEllipse(250, 250, 100, 50); #if wxUSE_SPLINES - dc.DrawSpline(50, 200, 50, 100, 200, 10); + dc.DrawSpline(50, 200, 50, 100, 200, 10); #endif // wxUSE_SPLINES - dc.DrawLine(50, 230, 200, 230); - dc.DrawText(_T("This is a test string"), 50, 230); + dc.DrawLine(50, 230, 200, 230); + dc.DrawText(_T("This is a test string"), 50, 230); - wxPoint points[3]; - points[0].x = 200; points[0].y = 300; - points[1].x = 100; points[1].y = 400; - points[2].x = 300; points[2].y = 400; - - dc.DrawPolygon(3, points); + wxPoint points[3]; + points[0].x = 200; points[0].y = 300; + points[1].x = 100; points[1].y = 400; + points[2].x = 300; points[2].y = 400; + + dc.DrawPolygon(3, points); } // This implements a tiny doodling program! Drag the mouse using @@ -331,8 +336,10 @@ void MyCanvas::OnEvent(wxMouseEvent& event) void MyFrame::OnSize(wxSizeEvent& WXUNUSED(event)) { +#if wxUSE_MDI_ARCHITECTURE wxLayoutAlgorithm layout; layout.LayoutMDIFrame(this); +#endif // wxUSE_MDI_ARCHITECTURE } // Note that SASHTEST_NEW_WINDOW and SASHTEST_ABOUT commands get passed @@ -366,4 +373,3 @@ void MyChild::OnActivate(wxActivateEvent& event) if (event.GetActive() && canvas) canvas->SetFocus(); } - diff --git a/samples/toolbar/toolbar.cpp b/samples/toolbar/toolbar.cpp index 5284572c39..7694cee94a 100644 --- a/samples/toolbar/toolbar.cpp +++ b/samples/toolbar/toolbar.cpp @@ -25,12 +25,12 @@ #endif #ifndef WX_PRECOMP - #include + #include "wx/wx.h" #endif -#include -#include -#include +#include "wx/toolbar.h" +#include "wx/log.h" +#include "wx/image.h" // define this to 1 to use wxToolBarSimple instead of the native one #define USE_GENERIC_TBAR 0 @@ -60,8 +60,11 @@ // resources // ---------------------------------------------------------------------------- -#if USE_XPM_BITMAPS +#if !defined(__WXMSW__) && !defined(__WXPM__) #include "mondrian.xpm" +#endif + +#if USE_XPM_BITMAPS #include "bitmaps/new.xpm" #include "bitmaps/open.xpm" #include "bitmaps/save.xpm" @@ -363,7 +366,7 @@ void MyFrame::RecreateToolbar() // adding a combo to a vertical toolbar is not very smart if ( m_horzToolbar ) { - wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO, _T(""), wxDefaultPosition, wxSize(200,wxDefaultCoord) ); + wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO, wxEmptyString, wxDefaultPosition, wxSize(200,wxDefaultCoord) ); combo->Append(_T("This")); combo->Append(_T("is a")); combo->Append(_T("combobox")); @@ -473,16 +476,16 @@ MyFrame::MyFrame(wxFrame* parent, tbarMenu->AppendSeparator(); - tbarMenu->Append(IDM_TOOLBAR_ENABLEPRINT, _T("&Enable print button\tCtrl-E"), _T("")); - tbarMenu->Append(IDM_TOOLBAR_DELETEPRINT, _T("&Delete print button\tCtrl-D"), _T("")); - tbarMenu->Append(IDM_TOOLBAR_INSERTPRINT, _T("&Insert print button\tCtrl-I"), _T("")); - tbarMenu->Append(IDM_TOOLBAR_TOGGLEHELP, _T("Toggle &help button\tCtrl-T"), _T("")); + tbarMenu->Append(IDM_TOOLBAR_ENABLEPRINT, _T("&Enable print button\tCtrl-E"), wxEmptyString); + tbarMenu->Append(IDM_TOOLBAR_DELETEPRINT, _T("&Delete print button\tCtrl-D"), wxEmptyString); + tbarMenu->Append(IDM_TOOLBAR_INSERTPRINT, _T("&Insert print button\tCtrl-I"), wxEmptyString); + tbarMenu->Append(IDM_TOOLBAR_TOGGLEHELP, _T("Toggle &help button\tCtrl-T"), wxEmptyString); tbarMenu->AppendSeparator(); - tbarMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN1, _T("Toggle &1st radio button\tCtrl-1"), _T("")); - tbarMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN2, _T("Toggle &2nd radio button\tCtrl-2"), _T("")); - tbarMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN3, _T("Toggle &3rd radio button\tCtrl-3"), _T("")); + tbarMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN1, _T("Toggle &1st radio button\tCtrl-1"), wxEmptyString); + tbarMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN2, _T("Toggle &2nd radio button\tCtrl-2"), wxEmptyString); + tbarMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN3, _T("Toggle &3rd radio button\tCtrl-3"), wxEmptyString); tbarMenu->AppendSeparator(); - tbarMenu->Append(IDM_TOOLBAR_CHANGE_TOOLTIP, _T("Change tool tip"), _T("")); + tbarMenu->Append(IDM_TOOLBAR_CHANGE_TOOLTIP, _T("Change tool tip"), wxEmptyString); tbarMenu->AppendSeparator(); tbarMenu->AppendRadioItem(IDM_TOOLBAR_SHOW_TEXT, _T("Show &text\tAlt-T")); tbarMenu->AppendRadioItem(IDM_TOOLBAR_SHOW_ICONS, _T("Show &icons\tAlt-I")); @@ -508,7 +511,7 @@ MyFrame::MyFrame(wxFrame* parent, // Create the toolbar RecreateToolbar(); - m_textWindow = new wxTextCtrl(this, wxID_ANY, _T(""), wxPoint(0, 0), wxDefaultSize, wxTE_MULTILINE); + m_textWindow = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxPoint(0, 0), wxDefaultSize, wxTE_MULTILINE); } #if USE_GENERIC_TBAR @@ -781,7 +784,7 @@ void MyFrame::OnToolEnter(wxCommandEvent& event) SetStatusText(str); } else - SetStatusText(_T("")); + SetStatusText(wxEmptyString); #else wxUnusedVar(event); #endif // wxUSE_STATUSBAR @@ -795,4 +798,3 @@ void MyFrame::OnToggleRadioBtn(wxCommandEvent& event) event.GetId() - IDM_TOOLBAR_TOGGLERADIOBTN1, true); } } -