From: John L. <jr...@us...> - 2009-11-17 06:11:12
|
Update of /cvsroot/wxlua/wxLua/apps/wxluacan/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv2334/wxLua/apps/wxluacan/src Modified Files: canlua.cpp canlua.h Log Message: Make collapsing in the wxLuaStackDialog MUCH faster by not recursively calling Collapse(). Tabs to spaces in wxluacan. Index: canlua.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/canlua.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** canlua.h 14 Aug 2007 13:42:13 -0000 1.9 --- canlua.h 17 Nov 2009 06:11:03 -0000 1.10 *************** *** 30,35 **** //! base canvas object /*! ! this and derived objects or placed on the canvas in the m_rootobject or as a child of another canvasobject. ! This way nested structures can be made. */ class wxlCanObj: public wxEvtHandler --- 30,35 ---- //! base canvas object /*! ! this and derived objects or placed on the canvas in the m_rootobject or as a child of another canvasobject. ! This way nested structures can be made. */ class wxlCanObj: public wxEvtHandler *************** *** 38,99 **** public: ! //! constructor ! /*! ! This object can have child objects added, and acts as a grouping object. ! All derived object can have childs too. ! */ ! wxlCanObj( double x = 0, double y = 0 ); virtual ~wxlCanObj(); ! //! sets the position of the object relative to its parent object. ! void SetPos( double x, double y ) { m_x = x; m_y = y; SetPending( true ); } ! //! get x positions double GetX() { return m_x; } ! //! get y positions double GetY() { return m_y; } ! //! set default pen to use for drawing ! void SetPen( const wxPen& pen ) { m_pen = pen; } ! //! set default brush to use for drawing ! void SetBrush( const wxBrush& brush ) { m_brush = brush; } ! //! called when there is a pending objects in the canvas ! /*! ! when this specific object was set pending, it can update its state. ! */ ! void Update( double absx, double absy ); ! //! draw the object at an absolute position. ! void Draw( wxDC& dc, double absx, double absy ); ! //! hit test all child objects in this object at an absolute position. ! wxlCanObj* WhichIsHit( double x, double y ); ! //! hit test the object at an absolute position. ! bool IsHit( double x, double y, double absx = 0, double absy = 0); ! //! the object is part of this canvas ! void SetCanvas( wxlCan* canvas ) { m_canvas = canvas; } ! //! add a child object ! void AddObject( wxlCanObj *canobj ); ! //! get child object at index wxlCanObj* GetItem( size_t index ); ! //! something changed in this object, it needs an update and re-draw void SetPending( bool pending = true ); ! //! child objects ! wxlCanObjList m_objects; protected: virtual void DoUpdate( double WXUNUSED(absx), double WXUNUSED(absy) ) ! { ! m_pending = false; ! } virtual void DoDraw( wxDC& WXUNUSED(dc), double WXUNUSED(absx), double WXUNUSED(absy) ) {} --- 38,99 ---- public: ! //! constructor ! /*! ! This object can have child objects added, and acts as a grouping object. ! All derived object can have childs too. ! */ ! wxlCanObj( double x = 0, double y = 0 ); virtual ~wxlCanObj(); ! //! sets the position of the object relative to its parent object. ! void SetPos( double x, double y ) { m_x = x; m_y = y; SetPending( true ); } ! //! get x positions double GetX() { return m_x; } ! //! get y positions double GetY() { return m_y; } ! //! set default pen to use for drawing ! void SetPen( const wxPen& pen ) { m_pen = pen; } ! //! set default brush to use for drawing ! void SetBrush( const wxBrush& brush ) { m_brush = brush; } ! //! called when there is a pending objects in the canvas ! /*! ! when this specific object was set pending, it can update its state. ! */ ! void Update( double absx, double absy ); ! //! draw the object at an absolute position. ! void Draw( wxDC& dc, double absx, double absy ); ! //! hit test all child objects in this object at an absolute position. ! wxlCanObj* WhichIsHit( double x, double y ); ! //! hit test the object at an absolute position. ! bool IsHit( double x, double y, double absx = 0, double absy = 0); ! //! the object is part of this canvas ! void SetCanvas( wxlCan* canvas ) { m_canvas = canvas; } ! //! add a child object ! void AddObject( wxlCanObj *canobj ); ! //! get child object at index wxlCanObj* GetItem( size_t index ); ! //! something changed in this object, it needs an update and re-draw void SetPending( bool pending = true ); ! //! child objects ! wxlCanObjList m_objects; protected: virtual void DoUpdate( double WXUNUSED(absx), double WXUNUSED(absy) ) ! { ! m_pending = false; ! } virtual void DoDraw( wxDC& WXUNUSED(dc), double WXUNUSED(absx), double WXUNUSED(absy) ) {} *************** *** 101,112 **** virtual bool DoIsHit( double WXUNUSED(x), double WXUNUSED(y), double WXUNUSED(absx), double WXUNUSED(absy) ) { return false; } ! wxBrush m_brush; ! wxPen m_pen; ! wxlCan* m_canvas; ! double m_x, m_y; ! bool m_pending; }; --- 101,112 ---- virtual bool DoIsHit( double WXUNUSED(x), double WXUNUSED(y), double WXUNUSED(absx), double WXUNUSED(absy) ) { return false; } ! wxBrush m_brush; ! wxPen m_pen; ! wxlCan* m_canvas; ! double m_x, m_y; ! bool m_pending; }; *************** *** 114,118 **** //! rectangle canvas object /*! ! to be placed on the canvas in the m_rootobject or as a child of another canvasobject */ class wxlCanObjRect: public wxlCanObj --- 114,118 ---- //! rectangle canvas object /*! ! to be placed on the canvas in the m_rootobject or as a child of another canvasobject */ class wxlCanObjRect: public wxlCanObj *************** *** 121,127 **** public: ! wxlCanObjRect( double x, double y, double w, double h ); ! void DoDraw( wxDC& dc, double absx, double absy ); bool DoIsHit( double x, double y, double absx, double absy ); --- 121,127 ---- public: ! wxlCanObjRect( double x, double y, double w, double h ); ! void DoDraw( wxDC& dc, double absx, double absy ); bool DoIsHit( double x, double y, double absx, double absy ); *************** *** 129,138 **** protected: ! double m_w, m_h; }; //! circle canvas object /*! ! to be placed on the canvas in the m_rootobject or as a child of another canvasobject */ class wxlCanObjCircle: public wxlCanObj --- 129,138 ---- protected: ! double m_w, m_h; }; //! circle canvas object /*! ! to be placed on the canvas in the m_rootobject or as a child of another canvasobject */ class wxlCanObjCircle: public wxlCanObj *************** *** 141,147 **** public: ! wxlCanObjCircle( double x, double y, double r ); ! void DoDraw( wxDC& dc, double absx, double absy ); bool DoIsHit( double x, double y, double absx, double absy ); --- 141,147 ---- public: ! wxlCanObjCircle( double x, double y, double r ); ! void DoDraw( wxDC& dc, double absx, double absy ); bool DoIsHit( double x, double y, double absx, double absy ); *************** *** 149,165 **** protected: ! double m_r; }; //! lua script canvas object /*! ! to be placed on the canvas in the m_rootobject or as a child of another canvasobject. ! The object name, is used to call a lua function fron DoDraw() called ! NameDraw( wxDC& dc, double absx, double absy ) to draw the object ! And in DoIsHit() ! NameHit( double x, double y ) to hit test the object */ --- 149,165 ---- protected: ! double m_r; }; //! lua script canvas object /*! ! to be placed on the canvas in the m_rootobject or as a child of another canvasobject. ! The object name, is used to call a lua function fron DoDraw() called ! NameDraw( wxDC& dc, double absx, double absy ) to draw the object ! And in DoIsHit() ! NameHit( double x, double y ) to hit test the object */ *************** *** 169,175 **** public: ! wxlCanObjScript( double x, double y, const wxString& name ); ! void DoDraw( wxDC& dc, double absx, double absy ); bool DoIsHit( double x, double y, double absx, double absy ); --- 169,175 ---- public: ! wxlCanObjScript( double x, double y, const wxString& name ); ! void DoDraw( wxDC& dc, double absx, double absy ); bool DoIsHit( double x, double y, double absx, double absy ); *************** *** 177,189 **** protected: ! wxString m_objectname; }; //! lua script canvas object /*! ! to be placed on the canvas in the m_rootobject or as a child of another canvasobject. ! The lua script in m_script will contain a function to generate the drawing for the object. ! It should do that by adding child objects to this object itself. ! The hit is no more then a hit on those childs, which is default functionality. */ class wxlCanObjAddScript: public wxlCanObj --- 177,189 ---- protected: ! wxString m_objectname; }; //! lua script canvas object /*! ! to be placed on the canvas in the m_rootobject or as a child of another canvasobject. ! The lua script in m_script will contain a function to generate the drawing for the object. ! It should do that by adding child objects to this object itself. ! The hit is no more then a hit on those childs, which is default functionality. */ class wxlCanObjAddScript: public wxlCanObj *************** *** 192,198 **** public: ! wxlCanObjAddScript( double x, double y, const wxString& script ); ! void SetScript( const wxString& script ); protected: --- 192,198 ---- public: ! wxlCanObjAddScript( double x, double y, const wxString& script ); ! void SetScript( const wxString& script ); protected: *************** *** 200,204 **** virtual void DoUpdate( double absx, double absy ); ! wxString m_script; }; --- 200,204 ---- virtual void DoUpdate( double absx, double absy ); ! wxString m_script; }; *************** *** 239,250 **** virtual void SetYaxis(bool up); ! void SetBackgroundBrush( const wxBrush& brush ); void SetPending( bool pending = true ); ! void Render( wxDC& dc ); //! Give the virtual size to be displayed. ! /*! To display all of a drawing, set this here to the boundingbox of the root object of the canvas. --- 239,250 ---- virtual void SetYaxis(bool up); ! void SetBackgroundBrush( const wxBrush& brush ); void SetPending( bool pending = true ); ! void Render( wxDC& dc ); //! Give the virtual size to be displayed. ! /*! To display all of a drawing, set this here to the boundingbox of the root object of the canvas. *************** *** 291,295 **** inline int WorldToDeviceY(double y) const { return (int) floor(m_scaley * y + m_transy + 0.5); } ! void AddObject( wxlCanObj *canobj ); wxlLuaCanCmd* GetCmdh() { return m_cmdh; } --- 291,295 ---- inline int WorldToDeviceY(double y) const { return (int) floor(m_scaley * y + m_transy + 0.5); } ! void AddObject( wxlCanObj *canobj ); wxlLuaCanCmd* GetCmdh() { return m_cmdh; } *************** *** 303,307 **** protected: ! void OnMouseEvent(wxMouseEvent& event); //! redraw pending objects to the buffer --- 303,307 ---- protected: ! void OnMouseEvent(wxMouseEvent& event); //! redraw pending objects to the buffer *************** *** 314,320 **** void OnPaint( wxPaintEvent &event ); ! void OnScroll(wxScrollWinEvent& event); ! void OnEraseBackground(wxEraseEvent& WXUNUSED(event) ); private: --- 314,320 ---- void OnPaint( wxPaintEvent &event ); ! void OnScroll(wxScrollWinEvent& event); ! void OnEraseBackground(wxEraseEvent& WXUNUSED(event) ); private: *************** *** 324,330 **** wxLuaState* m_luastate; ! wxBitmap m_buffer; ! bool m_pendingObjects; //! virtual coordinates box its miminum X --- 324,330 ---- wxLuaState* m_luastate; ! wxBitmap m_buffer; ! bool m_pendingObjects; //! virtual coordinates box its miminum X *************** *** 355,359 **** bool m_yaxis; ! wxBrush m_backbrush; wxlCanObj m_rootobject; --- 355,359 ---- bool m_yaxis; ! wxBrush m_backbrush; wxlCanObj m_rootobject; Index: canlua.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/canlua.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** canlua.cpp 26 Jan 2008 22:28:01 -0000 1.16 --- canlua.cpp 17 Nov 2009 06:11:02 -0000 1.17 *************** *** 32,40 **** wxlCanObj::wxlCanObj( double x, double y ) { ! m_x = x; ! m_y = y; m_brush = wxNullBrush; ! m_pen = wxNullPen; m_canvas = NULL; --- 32,40 ---- wxlCanObj::wxlCanObj( double x, double y ) { ! m_x = x; ! m_y = y; m_brush = wxNullBrush; ! m_pen = wxNullPen; m_canvas = NULL; *************** *** 43,55 **** wxlCanObj::~wxlCanObj() { ! m_objects.DeleteContents( true ); ! m_objects.Clear(); } void wxlCanObj::AddObject( wxlCanObj *canobj ) { ! canobj->SetCanvas( m_canvas ); ! m_objects.Append( canobj ); ! SetPending( true ); } --- 43,55 ---- wxlCanObj::~wxlCanObj() { ! m_objects.DeleteContents( true ); ! m_objects.Clear(); } void wxlCanObj::AddObject( wxlCanObj *canobj ) { ! canobj->SetCanvas( m_canvas ); ! m_objects.Append( canobj ); ! SetPending( true ); } *************** *** 61,65 **** void wxlCanObj::SetPending( bool pending ) { ! m_pending = pending; m_canvas->SetPending( pending ); } --- 61,65 ---- void wxlCanObj::SetPending( bool pending ) { ! m_pending = pending; m_canvas->SetPending( pending ); } *************** *** 70,74 **** absy += m_y; ! DoUpdate( absx, absy ); // iterate over the child list --- 70,74 ---- absy += m_y; ! DoUpdate( absx, absy ); // iterate over the child list *************** *** 76,80 **** { wxlCanObj *obj = node->GetData(); ! obj->Update( absx, absy ); } } --- 76,80 ---- { wxlCanObj *obj = node->GetData(); ! obj->Update( absx, absy ); } } *************** *** 82,97 **** void wxlCanObj::Draw( wxDC& dc, double absx, double absy ) { ! if ( m_brush.Ok() ) ! dc.SetBrush( m_brush ); ! if ( m_pen.Ok() ) ! dc.SetPen( m_pen ); ! wxBrush currentBrush = dc.GetBrush(); ! wxPen currentPen = dc.GetPen(); absx += m_x; absy += m_y; ! DoDraw( dc, absx, absy ); // iterate over the child list --- 82,97 ---- void wxlCanObj::Draw( wxDC& dc, double absx, double absy ) { ! if ( m_brush.Ok() ) ! dc.SetBrush( m_brush ); ! if ( m_pen.Ok() ) ! dc.SetPen( m_pen ); ! wxBrush currentBrush = dc.GetBrush(); ! wxPen currentPen = dc.GetPen(); absx += m_x; absy += m_y; ! DoDraw( dc, absx, absy ); // iterate over the child list *************** *** 99,106 **** { wxlCanObj *drawobj = node->GetData(); ! // restore brush and pen ! dc.SetBrush( currentBrush ); ! dc.SetPen( currentPen ); ! drawobj->Draw( dc , absx, absy ); } } --- 99,106 ---- { wxlCanObj *drawobj = node->GetData(); ! // restore brush and pen ! dc.SetBrush( currentBrush ); ! dc.SetPen( currentPen ); ! drawobj->Draw( dc , absx, absy ); } } *************** *** 112,116 **** { wxlCanObj *drawobj = node->GetData(); ! if ( drawobj->IsHit( x, y ) ) return drawobj; } --- 112,116 ---- { wxlCanObj *drawobj = node->GetData(); ! if ( drawobj->IsHit( x, y ) ) return drawobj; } *************** *** 123,127 **** absy += m_y; ! if ( DoIsHit( x, y, absx, absy ) ) return true; --- 123,127 ---- absy += m_y; ! if ( DoIsHit( x, y, absx, absy ) ) return true; *************** *** 143,154 **** :wxlCanObj( x, y ) { ! m_w = w; ! m_h = h; } void wxlCanObjRect::DoDraw( wxDC& dc, double absx, double absy ) { ! dc.DrawRectangle( m_canvas->WorldToDeviceX( absx ), m_canvas->WorldToDeviceX( absy ), ! m_canvas->WorldToDeviceXRel( m_w ), m_canvas->WorldToDeviceYRel( m_h ) ); } --- 143,154 ---- :wxlCanObj( x, y ) { ! m_w = w; ! m_h = h; } void wxlCanObjRect::DoDraw( wxDC& dc, double absx, double absy ) { ! dc.DrawRectangle( m_canvas->WorldToDeviceX( absx ), m_canvas->WorldToDeviceX( absy ), ! m_canvas->WorldToDeviceXRel( m_w ), m_canvas->WorldToDeviceYRel( m_h ) ); } *************** *** 184,193 **** :wxlCanObj( x, y ) { ! m_r = r; } void wxlCanObjCircle::DoDraw( wxDC& dc, double absx, double absy ) { ! dc.DrawCircle( m_canvas->WorldToDeviceX( absx ), m_canvas->WorldToDeviceX( absy ), m_canvas->WorldToDeviceXRel( m_r ) ); } --- 184,193 ---- :wxlCanObj( x, y ) { ! m_r = r; } void wxlCanObjCircle::DoDraw( wxDC& dc, double absx, double absy ) { ! dc.DrawCircle( m_canvas->WorldToDeviceX( absx ), m_canvas->WorldToDeviceX( absy ), m_canvas->WorldToDeviceXRel( m_r ) ); } *************** *** 219,223 **** void wxlCanObjScript::DoDraw( wxDC& dc, double absx, double absy ) { ! // run all statements in the script which should be drawing statements on a wxDC wxLuaState lst = *(m_canvas->GetLuastate()); lua_State* L = lst.GetLuaState(); --- 219,223 ---- void wxlCanObjScript::DoDraw( wxDC& dc, double absx, double absy ) { ! // run all statements in the script which should be drawing statements on a wxDC wxLuaState lst = *(m_canvas->GetLuastate()); lua_State* L = lst.GetLuaState(); *************** *** 243,247 **** yh = y - absy; ! // run all statements in the script which should be returning a hit on the object or not wxLuaState lst = *(m_canvas->GetLuastate()); --- 243,247 ---- yh = y - absy; ! // run all statements in the script which should be returning a hit on the object or not wxLuaState lst = *(m_canvas->GetLuastate()); *************** *** 277,308 **** :wxlCanObj( x, y ) { ! m_script = script; } void wxlCanObjAddScript::SetScript( const wxString& script ) { ! m_script = script; ! SetPending( true ); } void wxlCanObjAddScript::DoUpdate( double absx, double absy ) { ! if ( m_pending ) ! { ! wxLuaState lst = *(m_canvas->GetLuastate()); ! lua_State* L = lst.GetLuaState(); ! if ( 0 != lst.RunString( m_script ) ) ! { ! wxLogWarning( _("Error in Lua Script") ); ! } ! else ! { ! lua_getglobal( L, wx2lua( wxT("AddChilds") ) ); ! lst.wxluaT_PushUserDataType(this, wxluatype_wxlCanObj, true); ! lst.lua_PushNumber( m_canvas->WorldToDeviceX( absx ) ); ! lst.lua_PushNumber( m_canvas->WorldToDeviceX( absy ) ); ! if ( lst.lua_PCall( 3, 0, 0 ) != 0 ) { wxLuaEvent event(wxEVT_LUA_ERROR, lst.GetId(), lst); --- 277,308 ---- :wxlCanObj( x, y ) { ! m_script = script; } void wxlCanObjAddScript::SetScript( const wxString& script ) { ! m_script = script; ! SetPending( true ); } void wxlCanObjAddScript::DoUpdate( double absx, double absy ) { ! if ( m_pending ) ! { ! wxLuaState lst = *(m_canvas->GetLuastate()); ! lua_State* L = lst.GetLuaState(); ! if ( 0 != lst.RunString( m_script ) ) ! { ! wxLogWarning( _("Error in Lua Script") ); ! } ! else ! { ! lua_getglobal( L, wx2lua( wxT("AddChilds") ) ); ! lst.wxluaT_PushUserDataType(this, wxluatype_wxlCanObj, true); ! lst.lua_PushNumber( m_canvas->WorldToDeviceX( absx ) ); ! lst.lua_PushNumber( m_canvas->WorldToDeviceX( absy ) ); ! if ( lst.lua_PCall( 3, 0, 0 ) != 0 ) { wxLuaEvent event(wxEVT_LUA_ERROR, lst.GetId(), lst); *************** *** 310,316 **** lst.SendEvent(event); } ! } ! m_pending = false; ! } } --- 310,316 ---- lst.SendEvent(event); } ! } ! m_pending = false; ! } } *************** *** 341,345 **** m_buffer = wxBitmap( size.GetWidth(), size.GetHeight() ); ! m_pendingObjects = false; //set one to one mapping as default --- 341,345 ---- m_buffer = wxBitmap( size.GetWidth(), size.GetHeight() ); ! m_pendingObjects = false; //set one to one mapping as default *************** *** 356,360 **** m_scaley = 1; ! m_rootobject.SetCanvas( this ); m_hit = NULL; --- 356,360 ---- m_scaley = 1; ! m_rootobject.SetCanvas( this ); m_hit = NULL; *************** *** 371,381 **** void wxlCan::OnEraseBackground(wxEraseEvent& WXUNUSED(event) ) { ! //event.Skip(); } void wxlCan::SetBackgroundBrush( const wxBrush& brush ) { ! m_backbrush = brush; ! m_pendingObjects = true; } --- 371,381 ---- void wxlCan::OnEraseBackground(wxEraseEvent& WXUNUSED(event) ) { ! //event.Skip(); } void wxlCan::SetBackgroundBrush( const wxBrush& brush ) { ! m_backbrush = brush; ! m_pendingObjects = true; } *************** *** 390,395 **** void wxlCan::SetMappingUpp( double vx1, double vy1, double xpp, double ypp ) { ! //double wx = m_buffer.GetWidth(); ! double wy = m_buffer.GetHeight(); m_xpp = xpp; --- 390,395 ---- void wxlCan::SetMappingUpp( double vx1, double vy1, double xpp, double ypp ) { ! //double wx = m_buffer.GetWidth(); ! double wy = m_buffer.GetHeight(); m_xpp = xpp; *************** *** 430,435 **** } ! m_pendingObjects = true; ! Refresh(); } --- 430,435 ---- } ! m_pendingObjects = true; ! Refresh(); } *************** *** 487,505 **** if ( m_pendingObjects ) { ! m_rootobject.Update( 0, 0 ); ! // we will now render all objects stored in the canvas to a bitmap ! wxMemoryDC mdc; ! mdc.SelectObject( m_buffer ); ! //draw object into buffer ! Render( mdc ); ! mdc.SelectObject( wxNullBitmap ); ! // force a repaint in OnPaint() ! Refresh(); ! m_pendingObjects = false; } event.Skip(); //always skip idle events --- 487,505 ---- if ( m_pendingObjects ) { ! m_rootobject.Update( 0, 0 ); ! // we will now render all objects stored in the canvas to a bitmap ! wxMemoryDC mdc; ! mdc.SelectObject( m_buffer ); ! //draw object into buffer ! Render( mdc ); ! mdc.SelectObject( wxNullBitmap ); ! // force a repaint in OnPaint() ! Refresh(); ! m_pendingObjects = false; } event.Skip(); //always skip idle events *************** *** 508,533 **** void wxlCan::AddObject( wxlCanObj *canobj ) { ! canobj->SetCanvas( this ); ! m_rootobject.AddObject( canobj ); } void wxlCan::SetPending( bool pending ) { ! m_pendingObjects = pending; } void wxlCan::Render( wxDC& dc ) { ! int w,h; ! GetVirtualSize( &w, &h ); ! dc.SetBackground( GetBackgroundColour() ); ! dc.Clear(); ! dc.SetBrush(m_backbrush); ! dc.SetPen( *wxTRANSPARENT_PEN ); ! dc.DrawRectangle( 0, 0, w, h ); ! //draw objects m_rootobject.Draw( dc, 0, 0 ); } --- 508,533 ---- void wxlCan::AddObject( wxlCanObj *canobj ) { ! canobj->SetCanvas( this ); ! m_rootobject.AddObject( canobj ); } void wxlCan::SetPending( bool pending ) { ! m_pendingObjects = pending; } void wxlCan::Render( wxDC& dc ) { ! int w,h; ! GetVirtualSize( &w, &h ); ! dc.SetBackground( GetBackgroundColour() ); ! dc.Clear(); ! dc.SetBrush(m_backbrush); ! dc.SetPen( *wxTRANSPARENT_PEN ); ! dc.DrawRectangle( 0, 0, w, h ); ! //draw objects m_rootobject.Draw( dc, 0, 0 ); } *************** *** 550,559 **** CalcUnscrolledPosition( x, y, &xx, &yy); ! wxMemoryDC mdc; ! mdc.SelectObject( m_buffer ); ! dc.Blit( x, y, w, h, &mdc, xx, yy, wxCOPY, false ); ! mdc.SelectObject( wxNullBitmap ); it++; --- 550,559 ---- CalcUnscrolledPosition( x, y, &xx, &yy); ! wxMemoryDC mdc; ! mdc.SelectObject( m_buffer ); ! dc.Blit( x, y, w, h, &mdc, xx, yy, wxCOPY, false ); ! mdc.SelectObject( wxNullBitmap ); it++; *************** *** 567,573 **** GetClientSize(&dx,&dy); ! wxScrolledWindow::OnScroll( event ); ! m_pendingObjects = true; } --- 567,573 ---- GetClientSize(&dx,&dy); ! wxScrolledWindow::OnScroll( event ); ! m_pendingObjects = true; } *************** *** 580,590 **** GetVirtualSize( &w, &h ); ! if ( w < dx ) ! w = dx; ! if ( h < dy ) ! h = dy; m_buffer = wxBitmap( w, h ); ! m_pendingObjects = true; } --- 580,590 ---- GetVirtualSize( &w, &h ); ! if ( w < dx ) ! w = dx; ! if ( h < dy ) ! h = dy; m_buffer = wxBitmap( w, h ); ! m_pendingObjects = true; } |