Split wxCanvas into two (wxVectorCanvas).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8833 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -55,8 +55,7 @@ MyFrame::MyFrame( wxWindow *parent, wxWindowID id, const wxString &title,
|
||||
m_admin = new wxCanvasAdmin;
|
||||
wxCanvas *canvas = new wxCanvas( m_admin, this, -1 );
|
||||
|
||||
canvas->SetScroll( 0, 0, 400, 600 );
|
||||
canvas->SetMappingScroll( 0, 0, 400, 600, FALSE );
|
||||
canvas->SetScrollbars( 10, 10, 40, 40 );
|
||||
|
||||
// The wxCanvasAdmin need to know about all Admin wxCanvas objects.
|
||||
m_admin->Append( canvas );
|
||||
@@ -76,6 +75,11 @@ MyFrame::MyFrame( wxWindow *parent, wxWindowID id, const wxString &title,
|
||||
m_smile1 = new wxCanvasImage( image, 0,70,32,32 );
|
||||
root->Append( m_smile1 );
|
||||
|
||||
wxCanvasRect *rect = new wxCanvasRect( 20,20,100,100 );
|
||||
rect->SetBrush( *wxRED_BRUSH );
|
||||
root->Append( rect );
|
||||
|
||||
/*
|
||||
int i;
|
||||
for (i = 10; i < 300; i+=10)
|
||||
{
|
||||
@@ -83,16 +87,19 @@ MyFrame::MyFrame( wxWindow *parent, wxWindowID id, const wxString &title,
|
||||
r->SetBrush( *wxRED_BRUSH );
|
||||
root->Append( r );
|
||||
}
|
||||
*/
|
||||
|
||||
m_smile2 = new wxCanvasImage( image, 0,110,32,32 );
|
||||
root->Append( m_smile2 );
|
||||
|
||||
/*
|
||||
for (i = 15; i < 300; i+=10)
|
||||
{
|
||||
wxCanvasRect *r = new wxCanvasRect( i,50,3,140 );
|
||||
r->SetBrush( *wxRED_BRUSH );
|
||||
root->Append( r );
|
||||
}
|
||||
*/
|
||||
|
||||
// This will call all object and children recursivly so
|
||||
// all know what their wxCanvasAdmin is. Call at the end.
|
||||
|
@@ -647,13 +647,13 @@ void MyFrame::OnAbout( wxCommandEvent &WXUNUSED(event) )
|
||||
|
||||
// the event tables connect the wxWindows events with the functions (event
|
||||
// handlers) which process them.
|
||||
BEGIN_EVENT_TABLE(MyCanvas,wxCanvas)
|
||||
BEGIN_EVENT_TABLE(MyCanvas,wxVectorCanvas)
|
||||
EVT_MOUSE_EVENTS (MyCanvas::OnMouseEvent)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
MyCanvas::MyCanvas(wxCanvasAdmin* admin, MySplitterWindow *parent, wxWindowID id,
|
||||
const wxPoint &position, const wxSize& size, long style ) :
|
||||
wxCanvas( admin, parent, id, position, size, style )
|
||||
wxVectorCanvas( admin, parent, id, position, size, style )
|
||||
{
|
||||
m_parent=parent;
|
||||
}
|
||||
@@ -708,7 +708,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
|
||||
}
|
||||
else
|
||||
{
|
||||
wxCanvas::OnMouse(event);
|
||||
wxVectorCanvas::OnMouse(event);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -64,7 +64,7 @@ class MySplitterWindow : public wxSplitterWindow
|
||||
{
|
||||
public:
|
||||
MySplitterWindow(wxFrame *parent, wxWindowID id)
|
||||
: wxSplitterWindow(parent, id, wxDefaultPosition, wxDefaultSize, wxSP_3D | wxSP_LIVE_UPDATE)
|
||||
: wxSplitterWindow(parent, id, wxDefaultPosition, wxDefaultSize, wxSP_3D )
|
||||
{
|
||||
m_frame = parent;
|
||||
}
|
||||
@@ -163,7 +163,7 @@ enum
|
||||
#define CANVAS1 102
|
||||
#define CANVAS2 103
|
||||
|
||||
class MyCanvas: public wxCanvas
|
||||
class MyCanvas: public wxVectorCanvas
|
||||
{
|
||||
public:
|
||||
MyCanvas( wxCanvasAdmin* admin, MySplitterWindow *parent, wxWindowID id = -1,
|
||||
|
Reference in New Issue
Block a user