From abcbaea73fa07b88ac681c78ea6933ba70a6fd72 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 23 May 2002 21:25:06 +0000 Subject: [PATCH] wxUniv compilation fixes (patch 559620) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15652 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/event.h | 29 ++++++++++++++++++----------- src/common/event.cpp | 19 +++++++++++++++++++ src/msw/window.cpp | 6 +++--- 3 files changed, 40 insertions(+), 14 deletions(-) diff --git a/include/wx/event.h b/include/wx/event.h index a8992f724f..17d965ceab 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -336,7 +336,7 @@ class WXDLLEXPORT wxEvent : public wxObject { private: wxEvent& operator=(const wxEvent&); - + protected: wxEvent(const wxEvent&); // for implementing Clone() @@ -406,7 +406,7 @@ class WXDLLEXPORT wxCommandEvent : public wxEvent { private: wxCommandEvent& operator=(const wxCommandEvent& event); - + public: wxCommandEvent(wxEventType commandType = wxEVT_NULL, int id = 0); @@ -593,6 +593,10 @@ class WXDLLEXPORT wxMouseEvent : public wxEvent { public: wxMouseEvent(wxEventType mouseType = wxEVT_NULL); + wxMouseEvent(const wxMouseEvent& event) { Assign(event); } + + wxMouseEvent& operator=(const wxMouseEvent& event) + { Assign(event); return *this; } // Was it a button event? (*doesn't* mean: is any button *down*?) bool IsButton() const { return Button(-1); } @@ -739,6 +743,9 @@ public: int m_wheelDelta; int m_linesPerAction; +protected: + void Assign(const wxMouseEvent& evt); + private: DECLARE_DYNAMIC_CLASS(wxMouseEvent) }; @@ -992,7 +999,7 @@ class WXDLLEXPORT wxEraseEvent : public wxEvent { private: wxEraseEvent& operator=(const wxEraseEvent& event); - + public: wxEraseEvent(int Id = 0, wxDC *dc = (wxDC *) NULL) : wxEvent(Id, wxEVT_ERASE_BACKGROUND) @@ -1024,7 +1031,7 @@ class WXDLLEXPORT wxFocusEvent : public wxEvent { private: wxFocusEvent& operator=(const wxFocusEvent& event); - + public: wxFocusEvent(wxEventType type = wxEVT_NULL, int id = 0) : wxEvent(id, type) @@ -1354,7 +1361,7 @@ class WXDLLEXPORT wxDropFilesEvent : public wxEvent { private: wxDropFilesEvent& operator=(const wxDropFilesEvent& event); - + public: int m_noFiles; wxPoint m_pos; @@ -1409,7 +1416,7 @@ public: wxUpdateUIEvent(wxWindowID commandId = 0) : wxCommandEvent(wxEVT_UPDATE_UI, commandId) , m_checked(FALSE) - , m_enabled(FALSE) + , m_enabled(FALSE) , m_setEnabled(FALSE) , m_setText(FALSE) , m_setChecked(FALSE) @@ -1469,7 +1476,7 @@ class WXDLLEXPORT wxMouseCaptureChangedEvent : public wxEvent { private: wxMouseCaptureChangedEvent operator=(const wxMouseCaptureChangedEvent& event); - + public: wxMouseCaptureChangedEvent(wxWindowID id = 0, wxWindow* gainedCapture = NULL) : wxEvent(id, wxEVT_MOUSE_CAPTURE_CHANGED) @@ -1514,7 +1521,7 @@ class WXDLLEXPORT wxPaletteChangedEvent : public wxEvent { private: wxPaletteChangedEvent& operator=(const wxPaletteChangedEvent& event); - + public: wxPaletteChangedEvent(wxWindowID id = 0) : wxEvent(id, wxEVT_PALETTE_CHANGED) @@ -1573,7 +1580,7 @@ class WXDLLEXPORT wxNavigationKeyEvent : public wxEvent { private: wxNavigationKeyEvent& operator=(const wxNavigationKeyEvent& event); - + public: wxNavigationKeyEvent() : wxEvent(0, wxEVT_NAVIGATION_KEY) @@ -1806,7 +1813,7 @@ struct WXDLLEXPORT wxEventTableEntryBase { private: wxEventTableEntryBase& operator=(const wxEventTableEntryBase& event); - + public: wxEventTableEntryBase(int id, int idLast, wxObjectEventFunction fn, wxObject *data) @@ -1821,7 +1828,7 @@ public: , m_lastId(event.m_lastId) , m_fn(event.m_fn) , m_callbackUserData(event.m_callbackUserData) - { } + { } // the range of ids for this entry: if m_lastId == -1, the range consists // only of m_id, otherwise it is m_id..m_lastId inclusive diff --git a/src/common/event.cpp b/src/common/event.cpp index 6265f0c7de..b9eeac40fb 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -386,6 +386,25 @@ wxMouseEvent::wxMouseEvent(wxEventType commandType) m_linesPerAction = 0; } +void wxMouseEvent::Assign(const wxMouseEvent& event) +{ + m_x = event.m_x; + m_y = event.m_y; + + m_leftDown = event.m_leftDown; + m_middleDown = event.m_middleDown; + m_rightDown = event.m_rightDown; + + m_controlDown = event.m_controlDown; + m_shiftDown = event.m_shiftDown; + m_altDown = event.m_altDown; + m_metaDown = event.m_metaDown; + + m_wheelRotation = event.m_wheelRotation; + m_wheelDelta = event.m_wheelDelta; + m_linesPerAction = event.m_linesPerAction; +} + // True if was a button dclick event (1 = left, 2 = middle, 3 = right) // or any button dclick event (but = -1) bool wxMouseEvent::ButtonDClick(int but) const diff --git a/src/msw/window.cpp b/src/msw/window.cpp index b280a33098..3f3fc4be5b 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -179,7 +179,7 @@ static void TranslateKbdEventToMouse(wxWindowMSW *win, static TEXTMETRIC wxGetTextMetrics(const wxWindowMSW *win); // find the window for the mouse event at the specified position -static wxWindowMSW *FindWindowForMouseEvent(wxWindow *win, int *x, int *y); +static wxWindowMSW *FindWindowForMouseEvent(wxWindowMSW *win, int *x, int *y); //TW:REQ:Univ // wrapper around BringWindowToTop() API static inline void wxBringWindowToTop(HWND hwnd) @@ -2427,7 +2427,7 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam } else { - wxWindow *win = FindWindowForMouseEvent(this, &x, &y); + wxWindowMSW *win = FindWindowForMouseEvent(this, &x, &y); //TW:REQ:Univ processed = win->HandleMouseEvent(message, x, y, wParam); } } @@ -3992,7 +3992,7 @@ void wxWindowMSW::InitMouseEvent(wxMouseEvent& event, // Notice that this is not done for the mouse move events because this could // (would?) be too slow, but only for clicks which means that the static texts // still don't get move, enter nor leave events. -static wxWindowMSW *FindWindowForMouseEvent(wxWindow *win, int *x, int *y) +static wxWindowMSW *FindWindowForMouseEvent(wxWindowMSW *win, int *x, int *y) //TW:REQ:Univ { wxCHECK_MSG( x && y, win, _T("NULL pointer in FindWindowForMouseEvent") );