Compile fixes for wxCanvas.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8323 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -89,6 +89,7 @@ class wxCanvasObjectGroup
|
||||
{
|
||||
public:
|
||||
wxCanvasObjectGroup();
|
||||
virtual ~wxCanvasObjectGroup();
|
||||
|
||||
void SetOwner(wxCanvas* canvas);
|
||||
wxCanvas *GetOwner() { return m_owner; }
|
||||
|
@@ -52,16 +52,17 @@ MywxCanvasImage::MywxCanvasImage( const wxImage &image, double x, double y, doub
|
||||
|
||||
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)
|
||||
{ if (!first)
|
||||
{
|
||||
first=true;
|
||||
if (!first)
|
||||
{
|
||||
first=TRUE;
|
||||
dx=x;
|
||||
dy=y;
|
||||
}
|
||||
@@ -71,8 +72,9 @@ void MywxCanvasImage::OnMouse(wxMouseEvent &event)
|
||||
else if (IsCapturedMouse())
|
||||
{
|
||||
ReleaseMouse();
|
||||
first=false;
|
||||
dx=0;dy=0;
|
||||
first=FALSE;
|
||||
dx=0;
|
||||
dy=0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,18 +99,19 @@ MywxCanvasObjectGroupRef::MywxCanvasObjectGroupRef(double x, double y,wxCanvasOb
|
||||
|
||||
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)
|
||||
{ if (!first)
|
||||
{
|
||||
first=true;
|
||||
if (!first)
|
||||
{
|
||||
first=FALSE;
|
||||
dx=x;
|
||||
dy=y;
|
||||
}
|
||||
@@ -118,8 +121,9 @@ void MywxCanvasObjectGroupRef::OnMouse(wxMouseEvent &event)
|
||||
else if (IsCapturedMouse())
|
||||
{
|
||||
ReleaseMouse();
|
||||
first=false;
|
||||
dx=0;dy=0;
|
||||
first=FALSE;
|
||||
dx=0;
|
||||
dy=0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -132,7 +132,11 @@ void wxCanvasObject::WriteSVG( wxTextOutputStream &stream )
|
||||
|
||||
wxCanvasObjectGroup::wxCanvasObjectGroup()
|
||||
{
|
||||
m_validbounds=false;
|
||||
m_validbounds = FALSE;
|
||||
}
|
||||
|
||||
wxCanvasObjectGroup::~wxCanvasObjectGroup()
|
||||
{
|
||||
}
|
||||
|
||||
void wxCanvasObjectGroup::SetOwner(wxCanvas* canvas)
|
||||
@@ -160,51 +164,48 @@ void wxCanvasObjectGroup::ExtendArea(int x, int y)
|
||||
}
|
||||
else
|
||||
{
|
||||
m_validbounds = true;
|
||||
m_validbounds = TRUE;
|
||||
|
||||
m_minx = x;
|
||||
m_miny = y;
|
||||
m_maxx = x;
|
||||
m_maxy = y;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void wxCanvasObjectGroup::DeleteContents( bool flag)
|
||||
{
|
||||
m_objects.DeleteContents( flag );
|
||||
m_validbounds=false;
|
||||
m_validbounds = FALSE;
|
||||
}
|
||||
|
||||
|
||||
void wxCanvasObjectGroup::Prepend( wxCanvasObject* obj )
|
||||
{
|
||||
m_objects.Insert( obj );
|
||||
m_validbounds=false;
|
||||
m_validbounds = FALSE;
|
||||
}
|
||||
|
||||
void wxCanvasObjectGroup::Append( wxCanvasObject* obj )
|
||||
{
|
||||
m_objects.Append( obj );
|
||||
m_validbounds=false;
|
||||
m_validbounds = FALSE;
|
||||
}
|
||||
|
||||
void wxCanvasObjectGroup::Insert( size_t before, wxCanvasObject* obj )
|
||||
{
|
||||
m_objects.Insert( before, obj );
|
||||
m_validbounds=false;
|
||||
m_validbounds = FALSE;
|
||||
}
|
||||
|
||||
void wxCanvasObjectGroup::Remove( wxCanvasObject* obj )
|
||||
{
|
||||
m_objects.DeleteObject( obj );
|
||||
m_validbounds=false;
|
||||
m_validbounds = FALSE;
|
||||
}
|
||||
|
||||
void wxCanvasObjectGroup::Recreate()
|
||||
{
|
||||
m_validbounds=false;
|
||||
m_validbounds = FALSE;
|
||||
wxNode *node = m_objects.First();
|
||||
while (node)
|
||||
{
|
||||
@@ -220,7 +221,6 @@ void wxCanvasObjectGroup::Recreate()
|
||||
|
||||
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)
|
||||
@@ -309,7 +309,8 @@ wxCanvasObject* wxCanvasObjectGroup::IsHitObject( int x, int y, int margin )
|
||||
}
|
||||
node = node->Previous();
|
||||
}
|
||||
return 0;
|
||||
|
||||
return (wxCanvasObject*) NULL;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -368,7 +369,6 @@ void wxCanvasObjectGroupRef::Recreate()
|
||||
|
||||
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());
|
||||
|
||||
@@ -421,9 +421,6 @@ wxCanvasObject* wxCanvasObjectGroupRef::IsHitObject( int x, int y, int margin )
|
||||
|
||||
void wxCanvasObjectGroupRef::Move( int x, int y )
|
||||
{
|
||||
int old_x = m_x;
|
||||
int old_y = m_y;
|
||||
|
||||
m_x = x;
|
||||
m_y = y;
|
||||
|
||||
|
Reference in New Issue
Block a user