X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e133b7d6438b9144b8f68cf6b514d03eaaf698b..a8cb1d29e7fe349142d8d6be9fc9afe986340611:/samples/splitter/test.cpp?ds=sidebyside diff --git a/samples/splitter/test.cpp b/samples/splitter/test.cpp index d01cb9f0fd..64a0228da3 100644 --- a/samples/splitter/test.cpp +++ b/samples/splitter/test.cpp @@ -35,7 +35,8 @@ public: class MySplitterWindow : public wxSplitterWindow { public: - MySplitterWindow(wxFrame *parent, wxWindowID id) : wxSplitterWindow(parent, id) + MySplitterWindow(wxFrame *parent, wxWindowID id) + : wxSplitterWindow(parent, id, wxDefaultPosition, wxDefaultSize, wxSP_3D | wxSP_LIVE_UPDATE) { m_frame = parent; } @@ -89,7 +90,7 @@ DECLARE_EVENT_TABLE() class MyCanvas: public wxScrolledWindow { public: - MyCanvas(wxWindow* parent, wxWindowID id, int x, int y, int w, int h); + MyCanvas(wxWindow* parent, wxWindowID id, int x, int y, int w, int h, const wxString &name); virtual ~MyCanvas(); virtual void OnDraw(wxDC& dc); @@ -166,12 +167,12 @@ MyFrame::MyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos, cons m_splitter = new MySplitterWindow(this, SPLITTER_WINDOW); - m_leftCanvas = new MyCanvas(m_splitter, CANVAS1, 0, 0, 400, 400); + m_leftCanvas = new MyCanvas(m_splitter, CANVAS1, 0, 0, 400, 400, "Test1" ); m_leftCanvas->SetBackgroundColour(*wxRED); m_leftCanvas->SetScrollbars(20, 20, 50, 50); m_leftCanvas->SetCursor(wxCursor(wxCURSOR_MAGNIFIER)); - m_rightCanvas = new MyCanvas(m_splitter, CANVAS2, 0, 0, 400, 400); + m_rightCanvas = new MyCanvas(m_splitter, CANVAS2, 0, 0, 400, 400, "Test2" ); m_rightCanvas->SetBackgroundColour(*wxCYAN); m_rightCanvas->SetScrollbars(20, 20, 50, 50); m_rightCanvas->Show(FALSE); @@ -224,14 +225,10 @@ void MyFrame::SetMinSize(wxCommandEvent& WXUNUSED(event) ) if ( str.IsEmpty() ) return; -/* - What is atoi in Unicode? - - int minsize = atoi(str); + int minsize = wxStrtol( str, (wxChar**)NULL, 10 ); m_splitter->SetMinimumPaneSize(minsize); str.Printf( _T("Min pane size = %d"), minsize); SetStatusText(str, 1); -*/ } void MyFrame::UpdateUIHorizontal(wxUpdateUIEvent& event) @@ -256,8 +253,8 @@ void MyFrame::UpdatePosition() SetStatusText(str); } -MyCanvas::MyCanvas(wxWindow* parent, wxWindowID id, int x, int y, int w, int h) : - wxScrolledWindow(parent, id, wxPoint(x, y), wxSize(w, h)) +MyCanvas::MyCanvas(wxWindow* parent, wxWindowID id, int x, int y, int w, int h, const wxString &name ) : + wxScrolledWindow(parent, id, wxPoint(x, y), wxSize(w, h), 0, name ) { }