git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8323
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
{
public:
wxCanvasObjectGroup();
{
public:
wxCanvasObjectGroup();
+ virtual ~wxCanvasObjectGroup();
void SetOwner(wxCanvas* canvas);
wxCanvas *GetOwner() { return m_owner; }
void SetOwner(wxCanvas* canvas);
wxCanvas *GetOwner() { return m_owner; }
void MywxCanvasImage::OnMouse(wxMouseEvent &event)
{
void MywxCanvasImage::OnMouse(wxMouseEvent &event)
{
- static bool first=false;
+ static bool first=FALSE;
static int dx=0;
static int dy=0;
int x = event.GetX();
int y = event.GetY();
if (event.m_leftDown)
static int dx=0;
static int dy=0;
int x = event.GetX();
int y = event.GetY();
if (event.m_leftDown)
else if (IsCapturedMouse())
{
ReleaseMouse();
else if (IsCapturedMouse())
{
ReleaseMouse();
- first=false;
- dx=0;dy=0;
+ first=FALSE;
+ dx=0;
+ dy=0;
void MywxCanvasObjectGroupRef::OnMouse(wxMouseEvent &event)
{
void MywxCanvasObjectGroupRef::OnMouse(wxMouseEvent &event)
{
- static bool first=false;
- static dx=0;
- static dy=0;
+ static bool first=FALSE;
+ static int dx=0;
+ static int dy=0;
//new position of object
int x = m_owner->GetDeviceX( event.GetX());
int y = m_owner->GetDeviceY( event.GetY());
if (event.m_leftDown)
//new position of object
int x = m_owner->GetDeviceX( event.GetX());
int y = m_owner->GetDeviceY( event.GetY());
if (event.m_leftDown)
else if (IsCapturedMouse())
{
ReleaseMouse();
else if (IsCapturedMouse())
{
ReleaseMouse();
- first=false;
- dx=0;dy=0;
+ first=FALSE;
+ dx=0;
+ dy=0;
{
int old_x = m_area.x;
int old_y = m_area.y;
{
int old_x = m_area.x;
int old_y = m_area.y;
m_area.x = x;
m_area.y = y;
m_area.x = x;
m_area.y = y;
wxCanvasObjectGroup::wxCanvasObjectGroup()
{
wxCanvasObjectGroup::wxCanvasObjectGroup()
{
+ m_validbounds = FALSE;
+}
+
+wxCanvasObjectGroup::~wxCanvasObjectGroup()
+{
}
void wxCanvasObjectGroup::SetOwner(wxCanvas* canvas)
}
void wxCanvasObjectGroup::SetOwner(wxCanvas* canvas)
void wxCanvasObjectGroup::ExtendArea(int x, int y)
{
void wxCanvasObjectGroup::ExtendArea(int x, int y)
{
- if (m_validbounds)
- {
- if ( x < m_minx ) m_minx = x;
- if ( y < m_miny ) m_miny = y;
- if ( x > m_maxx ) m_maxx = x;
- if ( y > m_maxy ) m_maxy = y;
- }
- else
- {
- m_validbounds = true;
-
- m_minx = x;
- m_miny = y;
- m_maxx = x;
- m_maxy = y;
- }
+ if (m_validbounds)
+ {
+ if (x < m_minx) m_minx = x;
+ if (y < m_miny) m_miny = y;
+ if (x > m_maxx) m_maxx = x;
+ if (y > m_maxy) m_maxy = y;
+ }
+ else
+ {
+ m_validbounds = TRUE;
+ m_minx = x;
+ m_miny = y;
+ m_maxx = x;
+ m_maxy = y;
+ }
void wxCanvasObjectGroup::DeleteContents( bool flag)
{
m_objects.DeleteContents( flag );
void wxCanvasObjectGroup::DeleteContents( bool flag)
{
m_objects.DeleteContents( flag );
void wxCanvasObjectGroup::Prepend( wxCanvasObject* obj )
{
m_objects.Insert( obj );
void wxCanvasObjectGroup::Prepend( wxCanvasObject* obj )
{
m_objects.Insert( obj );
}
void wxCanvasObjectGroup::Append( wxCanvasObject* obj )
{
m_objects.Append( obj );
}
void wxCanvasObjectGroup::Append( wxCanvasObject* obj )
{
m_objects.Append( obj );
}
void wxCanvasObjectGroup::Insert( size_t before, wxCanvasObject* obj )
{
m_objects.Insert( before, obj );
}
void wxCanvasObjectGroup::Insert( size_t before, wxCanvasObject* obj )
{
m_objects.Insert( before, obj );
}
void wxCanvasObjectGroup::Remove( wxCanvasObject* obj )
{
m_objects.DeleteObject( obj );
}
void wxCanvasObjectGroup::Remove( wxCanvasObject* obj )
{
m_objects.DeleteObject( obj );
}
void wxCanvasObjectGroup::Recreate()
{
}
void wxCanvasObjectGroup::Recreate()
{
wxNode *node = m_objects.First();
while (node)
{
wxNode *node = m_objects.First();
while (node)
{
void wxCanvasObjectGroup::Render(int xabs, int yabs, int x, int y, int width, int height )
{
void wxCanvasObjectGroup::Render(int xabs, int yabs, int x, int y, int width, int height )
{
- wxImage *image = m_owner->GetBuffer();
// cycle through all objects
wxNode *node = m_objects.First();
while (node)
// cycle through all objects
wxNode *node = m_objects.First();
while (node)
}
node = node->Previous();
}
}
node = node->Previous();
}
+
+ return (wxCanvasObject*) NULL;
}
//----------------------------------------------------------------------------
}
//----------------------------------------------------------------------------
void wxCanvasObjectGroupRef::Render(int xabs, int yabs, int x, int y, int width, int height )
{
void wxCanvasObjectGroupRef::Render(int xabs, int yabs, int x, int y, int width, int height )
{
- wxImage *image = m_owner->GetBuffer();
- xabs+=m_owner->GetDeviceX(GetPosX());
- yabs+=m_owner->GetDeviceY(GetPosY());
+ xabs += m_owner->GetDeviceX(GetPosX());
+ yabs += m_owner->GetDeviceY(GetPosY());
int clip_x = xabs + m_group->GetXMin();
int clip_width = m_group->GetXMax()-m_group->GetXMin();
int clip_x = xabs + m_group->GetXMin();
int clip_width = m_group->GetXMax()-m_group->GetXMin();
void wxCanvasObjectGroupRef::Move( int x, int y )
{
void wxCanvasObjectGroupRef::Move( int x, int y )
{
- int old_x = m_x;
- int old_y = m_y;
-