// globals
//----------------------------------------------------------------------------
-const double pi = 3.1415926535;
+static const double pi = 3.1415926535;
#if wxUSE_FREETYPE
FT_Library g_freetypeLibrary;
// wxCanvasObject
//----------------------------------------------------------------------------
+IMPLEMENT_CLASS(wxCanvasObject, wxEvtHandler)
+
wxCanvasObject::wxCanvasObject()
{
// the default event handler is just this object
m_isVector = FALSE;
m_isImage = FALSE;
m_visible = TRUE;
- m_dragmode = DRAG_ONTOP;
+ m_dragmode = wxDRAG_ONTOP;
// handy when debugging
-// m_dragmode = DRAG_RECTANGLE;
+// m_dragmode = wxDRAG_RECTANGLE;
m_dragable = TRUE;
}
void wxCanvasObject::DragStart()
{
- if (m_dragmode == DRAG_RECTANGLE)
+ if (m_dragmode == wxDRAG_RECTANGLE)
{
this->SetVisible(FALSE);
wxTransformMatrix help;
dc.SetBrush(wxNullBrush);
dc.SetPen(wxNullPen);
}
- else
+ else if (m_dragmode != wxDRAG_REDRAW)
{
this->SetVisible(FALSE);
wxTransformMatrix help;
void wxCanvasObject::DragRelative( double x, double y)
{
- if (m_dragmode == DRAG_RECTANGLE)
+ if (m_dragmode == wxDRAG_RECTANGLE)
{
wxTransformMatrix help;
dc.SetBrush(wxNullBrush);
dc.SetPen(wxNullPen);
}
- else
+ else if (m_dragmode != wxDRAG_REDRAW)
{
wxClientDC dc(m_admin->GetActive());
wxMemoryDC tmp;
dcm.SelectObject(wxNullBitmap);
this->SetVisible(FALSE);
}
+ else
+ MoveRelative(x,y);
}
// wxCanvasObjectGroup
//----------------------------------------------------------------------------
+IMPLEMENT_CLASS(wxCanvasObjectGroup, wxCanvasObject)
+
wxCanvasObjectGroup::wxCanvasObjectGroup(double x, double y)
{
lworld.Translate(x,y);
// wxCanvasObjectRef
//----------------------------------------------------------------------------
+IMPLEMENT_CLASS(wxCanvasObjectRef, wxCanvasObject)
+
wxCanvasObjectRef::wxCanvasObjectRef(double x, double y, wxCanvasObject* obj)
: wxCanvasObject()
{
// wxCanvasRect
//----------------------------------------------------------------------------
+IMPLEMENT_CLASS(wxCanvasRect, wxCanvasObject)
+
wxCanvasRect::wxCanvasRect( double x, double y, double w, double h , double radius )
: wxCanvasObject()
{
if (cworld->GetRotation())
tmp = tmp.Rotate(-cworld->GetRotation()/180.0 * pi, centr, TRUE, NULL );
- bmp = tmp.ConvertToBitmap();
+ bmp = wxBitmap(tmp);
// create cached bitmap
m_cBitmap = bmp;
wxRect sub_rect( clip_x, clip_y, clip_width, clip_height );
wxBitmap sub_bitmap( bitmap->GetSubBitmap( sub_rect ) );
- wxImage image( sub_bitmap );
+ wxImage image( sub_bitmap.ConvertToImage() );
// local coordinates
int start_x = clip_x - tmparea.x;
}
}
- sub_bitmap = image.ConvertToBitmap();
+ sub_bitmap = wxBitmap(image);
wxDC *dc = m_admin->GetActive()->GetDC();
dc->DrawBitmap( sub_bitmap, clip_x, clip_y );