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;
}
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);
SetMenuBar(menuBar);
m_splitter = new MySplitterWindow(this, SPLITTER_WINDOW);
+
+ wxSize sz( m_splitter->GetSize() );
+ wxLogMessage( "Initial splitter size: %d %d\n", (int)sz.x, (int)sz.y );
- 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);
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 )
{
}