dc.SetFont(wxNullFont);
wxMemoryDC dc2;
- dc2.SetFont(font);
// Sometimes GetTextExtent isn't accurate enough, so make it longer
wxBitmap bitmap((int) ((w+2) * 1.5), (int) h+2);
dc2.SelectObject(bitmap);
+ dc2.SetFont(font);
dc2.SetBackground(* wxWHITE_BRUSH);
dc2.Clear();
dc2.SetBackgroundMode(wxTRANSPARENT);
return Create(bitmap, cursor);
}
+#if wxUSE_TREECTRL
// Create a drag image for the given tree control item
bool wxGenericDragImage::Create(const wxTreeCtrl& treeCtrl, wxTreeItemId& id)
{
wxString str = treeCtrl.GetItemText(id);
return Create(str);
}
+#endif
+#if wxUSE_LISTCTRL
// Create a drag image for the given list control item
bool wxGenericDragImage::Create(const wxListCtrl& listCtrl, long id)
{
wxString str = listCtrl.GetItemText(id);
return Create(str);
}
+#endif
// Begin drag
bool wxGenericDragImage::BeginDrag(const wxPoint& hotspot,
{
if (m_window)
{
- m_window->ReleaseMouse();
+#ifdef __WXMSW__
+ // Under Windows we can be pretty sure this test will give
+ // the correct results
+ if (wxWindow::GetCapture() == m_window)
+#endif
+ m_window->ReleaseMouse();
+
if (m_cursor.Ok() && m_oldCursor.Ok())
{
m_window->SetCursor(m_oldCursor);