{
wxSize sz = GetClientSize();
wxRect rect(0, 0, sz.x, sz.y);
-
+
if (event.GetDC())
{
wxGetApp().TileBitmap(rect, *(event.GetDC()), wxGetApp().GetBackgroundBitmap());
}
case SHAPE_DRAG_ICON:
{
- // Can anyone explain why this test is necessary,
- // to prevent a gcc error?
-#if defined(__WXMOTIF__) || defined(__WXX11__)
- wxIcon icon(dragicon_xpm);
-#else
- wxIcon icon(wxICON(dragicon));
-#endif
-
- m_dragImage = new wxDragImage(icon, wxCursor(wxCURSOR_HAND));
+ m_dragImage = new wxDragImage(wxICON(dragicon), wxCursor(wxCURSOR_HAND));
break;
}
}
// The offset between the top-left of the shape image and the current shape position
wxPoint beginDragHotSpot = m_dragStartPos - m_draggedShape->GetPosition();
-
+
// Now we do this inside the implementation: always assume
// coordinates relative to the capture window (client coordinates)
//if (fullScreen)
// beginDragHotSpot -= ClientToScreen(wxPoint(0, 0));
-
+
if (!m_dragImage->BeginDrag(beginDragHotSpot, this, fullScreen))
{
delete m_dragImage;
m_dragImage = (wxDragImage*) NULL;
m_dragMode = TEST_DRAG_NONE;
-
+
} else
{
m_dragImage->Move(event.GetPosition());
wxRect rect2(shape->GetRect());
dc.SetClippingRegion(rect2.x, rect2.y, rect2.width, rect2.height);
-
+
wxGetApp().TileBitmap(rect, dc, wxGetApp().GetBackgroundBitmap());
dc.DestroyClippingRegion();
file_menu->Append( wxID_ABOUT, _T("&About..."));
file_menu->AppendCheckItem( TEST_USE_SCREEN, _T("&Use whole screen for dragging"), _T("Use whole screen"));
file_menu->Append( wxID_EXIT, _T("E&xit"));
-
+
wxMenuBar *menu_bar = new wxMenuBar();
menu_bar->Append(file_menu, _T("&File"));
SetIcon(wxICON(mondrian));
SetMenuBar( menu_bar );
-
+
+#if wxUSE_STATUSBAR
CreateStatusBar(2);
int widths[] = { -1, 100 };
SetStatusWidths( 2, widths );
-
+#endif // wxUSE_STATUSBAR
+
m_canvas = new MyCanvas( this, wxID_ANY, wxPoint(0,0), wxSize(10,10) );
}
{
(void)wxMessageBox( _T("wxDragImage demo\n")
_T("Julian Smart (c) 2000"),
- _T("About wxDragImage Demo"),
+ _T("About wxDragImage Demo"),
wxICON_INFORMATION | wxOK );
}
{
int w = bitmap.GetWidth();
int h = bitmap.GetHeight();
-
+
int i, j;
for (i = rect.x; i < rect.x + rect.width; i += w)
{
m_show = true;
}
-DragShape::~DragShape()
-{
-}
-
bool DragShape::HitTest(const wxPoint& pt) const
{
wxRect rect(GetRect());
{
wxMemoryDC memDC;
memDC.SelectObject(m_bitmap);
-
+
dc.Blit(m_pos.x, m_pos.y, m_bitmap.GetWidth(), m_bitmap.GetHeight(),
& memDC, 0, 0, op, true);