Fixed missing hotspot code; fixed misspelling in setup0.h; added missing

consts to wxPoint operators


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7628 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2000-06-21 14:09:18 +00:00
parent d1016f9826
commit 1008a84515
5 changed files with 14 additions and 11 deletions

View File

@@ -234,7 +234,7 @@ Compiling using the makefiles:
'make -f makefile.b32 DLL=1' 'make -f makefile.b32 DLL=1'
and then for each sample, and then for each sample,
'make -f makefile.b32 WXUSINGDLL=1' 'make -f makefile.b32 WXUSINGDLL=1'
Unfortunately there are still undiagnosed run-time problems Please note that the samples have not been exhaustively tested
with this configuration. with this configuration.
Note (1): the wxWindows library and (some) samples compile in 16-bit mode Note (1): the wxWindows library and (some) samples compile in 16-bit mode

View File

@@ -226,8 +226,8 @@ public:
wxRealPoint() { x = y = 0.0; }; wxRealPoint() { x = y = 0.0; };
wxRealPoint(double xx, double yy) { x = xx; y = yy; }; wxRealPoint(double xx, double yy) { x = xx; y = yy; };
wxRealPoint operator+(const wxRealPoint& pt) { return wxRealPoint(x + pt.x, y + pt.y); } wxRealPoint operator+(const wxRealPoint& pt) const { return wxRealPoint(x + pt.x, y + pt.y); }
wxRealPoint operator-(const wxRealPoint& pt) { return wxRealPoint(x - pt.x, y - pt.y); } wxRealPoint operator-(const wxRealPoint& pt) const { return wxRealPoint(x - pt.x, y - pt.y); }
bool operator==(const wxRealPoint& pt) const { return x == pt.x && y == pt.y; } bool operator==(const wxRealPoint& pt) const { return x == pt.x && y == pt.y; }
}; };
@@ -247,8 +247,8 @@ public:
bool operator!=(const wxPoint& p) const { return !(*this == p); } bool operator!=(const wxPoint& p) const { return !(*this == p); }
// arithmetic operations (component wise) // arithmetic operations (component wise)
wxPoint operator+(const wxPoint& p) { return wxPoint(x + p.x, y + p.y); } wxPoint operator+(const wxPoint& p) const { return wxPoint(x + p.x, y + p.y); }
wxPoint operator-(const wxPoint& p) { return wxPoint(x - p.x, y - p.y); } wxPoint operator-(const wxPoint& p) const { return wxPoint(x - p.x, y - p.y); }
wxPoint& operator+=(const wxPoint& p) { x += p.x; y += p.y; return *this; } wxPoint& operator+=(const wxPoint& p) { x += p.x; y += p.y; return *this; }
wxPoint& operator-=(const wxPoint& p) { x -= p.x; y -= p.y; return *this; } wxPoint& operator-=(const wxPoint& p) { x -= p.x; y -= p.y; return *this; }

View File

@@ -200,6 +200,7 @@ protected:
wxCursor m_cursor; wxCursor m_cursor;
wxCursor m_oldCursor; wxCursor m_oldCursor;
wxPoint m_hotspot; wxPoint m_hotspot;
wxPoint m_offset; // The hostpot value passed to BeginDrag
wxPoint m_position; wxPoint m_position;
bool m_isDirty; bool m_isDirty;
bool m_isShown; bool m_isShown;

View File

@@ -735,8 +735,8 @@
// wxUSE_DBEUG_NEW_ALWAYS = 1 not compatible with BC++ in DLL mode // wxUSE_DBEUG_NEW_ALWAYS = 1 not compatible with BC++ in DLL mode
#if defined(__BORLANDC__) && (defined(WXMAKINGDLL) || defined(WXUSINGDLL)) #if defined(__BORLANDC__) && (defined(WXMAKINGDLL) || defined(WXUSINGDLL))
#undef wxUSE_DBEUG_NEW_ALWAYS #undef wxUSE_DEBUG_NEW_ALWAYS
#define wxUSE_DBEUG_NEW_ALWAYS 0 #define wxUSE_DEBUG_NEW_ALWAYS 0
#endif #endif
#if defined(__WXMSW__) && defined(__WATCOMC__) #if defined(__WXMSW__) && defined(__WATCOMC__)

View File

@@ -187,13 +187,15 @@ bool wxGenericDragImage::Create(const wxListCtrl& listCtrl, long id)
} }
// Begin drag // Begin drag
bool wxGenericDragImage::BeginDrag(const wxPoint& WXUNUSED(hotspot), bool wxGenericDragImage::BeginDrag(const wxPoint& hotspot,
wxWindow* window, wxWindow* window,
bool fullScreen, bool fullScreen,
wxRect* rect) wxRect* rect)
{ {
wxASSERT_MSG( (window != 0), wxT("Window must not be null in BeginDrag.")); wxASSERT_MSG( (window != 0), wxT("Window must not be null in BeginDrag."));
// The image should be offset by this amount
m_offset = hotspot;
m_window = window; m_window = window;
m_fullScreen = fullScreen; m_fullScreen = fullScreen;
@@ -320,7 +322,7 @@ bool wxGenericDragImage::Move(const wxPoint& pt)
bool eraseOldImage = (m_isDirty && m_isShown); bool eraseOldImage = (m_isDirty && m_isShown);
if (m_isShown) if (m_isShown)
RedrawImage(oldPos, pt, eraseOldImage, TRUE); RedrawImage(oldPos - m_offset, pt - m_offset, eraseOldImage, TRUE);
m_position = pt; m_position = pt;
@@ -346,7 +348,7 @@ bool wxGenericDragImage::Show()
memDC.Blit(0, 0, m_boundingRect.width, m_boundingRect.height, m_windowDC, m_boundingRect.x, m_boundingRect.y); memDC.Blit(0, 0, m_boundingRect.width, m_boundingRect.height, m_windowDC, m_boundingRect.x, m_boundingRect.y);
memDC.SelectObject(wxNullBitmap); memDC.SelectObject(wxNullBitmap);
RedrawImage(m_position, m_position, FALSE, TRUE); RedrawImage(m_position - m_offset, m_position - m_offset, FALSE, TRUE);
} }
m_isShown = TRUE; m_isShown = TRUE;
@@ -363,7 +365,7 @@ bool wxGenericDragImage::Hide()
if (m_isShown && m_isDirty) if (m_isShown && m_isDirty)
{ {
RedrawImage(m_position, m_position, TRUE, FALSE); RedrawImage(m_position - m_offset, m_position - m_offset, TRUE, FALSE);
} }
m_isShown = FALSE; m_isShown = FALSE;