]> git.saurik.com Git - wxWidgets.git/commitdiff
Added EVT_MOVE_START, EVT_MOVE_END (wxMSW only for now)
authorJulian Smart <julian@anthemion.co.uk>
Wed, 1 Aug 2007 15:34:48 +0000 (15:34 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 1 Aug 2007 15:34:48 +0000 (15:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47850 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/moveevt.tex
include/wx/event.h
include/wx/msw/window.h
src/common/event.cpp
src/msw/window.cpp

index 97dfbc45046e33cb3c1d2f28c0b0262bd3737a9c..f58c651a9707a43a6aba4f109cbf01c8e4aeef3f 100644 (file)
@@ -24,6 +24,10 @@ function that takes a wxMoveEvent argument.
 \begin{twocollist}\itemsep=0pt
 \twocolitem{{\bf EVT\_MOVE(func)}}{Process a wxEVT\_MOVE event, which is generated
 when a window is moved.}
+\twocolitem{{\bf EVT\_MOVE\_START(func)}}{Process a wxEVT\_MOVE\_START event, which is generated
+when the user starts to move or size a window. wxMSW only.}
+\twocolitem{{\bf EVT\_MOVE\_END(func)}}{Process a wxEVT\_MOVE\_END event, which is generated
+when the user stops moving or sizing a window. wxMSW only.}
 \end{twocollist}
 
 \wxheading{See also}
index 3635b757ecea0723bde721517aabf628c406dc20..4fc87804d0570de059a6dde21f021e58b83930bb 100644 (file)
@@ -275,13 +275,15 @@ BEGIN_DECLARE_EVENT_TYPES()
     DECLARE_EVENT_TYPE(wxEVT_UPDATE_UI, 440)
     DECLARE_EVENT_TYPE(wxEVT_SIZING, 441)
     DECLARE_EVENT_TYPE(wxEVT_MOVING, 442)
-    DECLARE_EVENT_TYPE(wxEVT_HIBERNATE, 443)
+    DECLARE_EVENT_TYPE(wxEVT_MOVE_START, 443)
+    DECLARE_EVENT_TYPE(wxEVT_MOVE_END, 444)
+    DECLARE_EVENT_TYPE(wxEVT_HIBERNATE, 445)
     // more power events follow -- see wx/power.h
 
         // Clipboard events
-    DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_COPY, 444)
-    DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_CUT, 445)
-    DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_PASTE, 446)
+    DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_COPY, 446)
+    DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_CUT, 447)
+    DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_PASTE, 448)
 
         // Generic command events
         // Note: a click is a higher-level event than button down/up
@@ -826,7 +828,7 @@ public:
     // Returns the configured number of lines (or whatever) to be scrolled per
     // wheel action.  Defaults to one.
     int GetLinesPerAction() const { return m_linesPerAction; }
-    
+
     // Is the system set to do page scrolling?
     bool IsPageScroll() const { return ((unsigned int)m_linesPerAction == UINT_MAX); }
 
@@ -847,7 +849,7 @@ public:
     bool          m_shiftDown;
     bool          m_altDown;
     bool          m_metaDown;
-    
+
     int           m_wheelAxis;
     int           m_wheelRotation;
     int           m_wheelDelta;
@@ -2304,7 +2306,7 @@ public:
     // Clear table
     void Clear();
 
-#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING 
+#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING
     // Clear all tables
     static void ClearAll();
 #endif // __WXDEBUG__ && wxUSE_MEMORY_TRACING
@@ -2846,6 +2848,8 @@ typedef void (wxEvtHandler::*wxClipboardTextEventFunction)(wxClipboardTextEvent&
 #define EVT_SIZING(func)  wx__DECLARE_EVT0(wxEVT_SIZING, wxSizeEventHandler(func))
 #define EVT_MOVE(func)  wx__DECLARE_EVT0(wxEVT_MOVE, wxMoveEventHandler(func))
 #define EVT_MOVING(func)  wx__DECLARE_EVT0(wxEVT_MOVING, wxMoveEventHandler(func))
+#define EVT_MOVE_START(func)  wx__DECLARE_EVT0(wxEVT_MOVE_START, wxMoveEventHandler(func))
+#define EVT_MOVE_END(func)  wx__DECLARE_EVT0(wxEVT_MOVE_END, wxMoveEventHandler(func))
 #define EVT_CLOSE(func)  wx__DECLARE_EVT0(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(func))
 #define EVT_END_SESSION(func)  wx__DECLARE_EVT0(wxEVT_END_SESSION, wxCloseEventHandler(func))
 #define EVT_QUERY_END_SESSION(func)  wx__DECLARE_EVT0(wxEVT_QUERY_END_SESSION, wxCloseEventHandler(func))
index e65781c7a4d9473f2e9d4c746e531b51c83b685b..0a3600676c9b4708fc3572bc370a11a558dc9e50 100644 (file)
@@ -317,6 +317,8 @@ public:
     bool HandleSize(int x, int y, WXUINT flag);
     bool HandleSizing(wxRect& rect);
     bool HandleGetMinMaxInfo(void *mmInfo);
+    bool HandleEnterSizeMove();
+    bool HandleExitSizeMove();
 
     bool HandleShow(bool show, int status);
     bool HandleActivate(int flag, bool minimized, WXHWND activate);
index 980f6ba96560fe5125284b496e17a1c657da7f32..93eaa2e2349f26b71f818a0b8e71de23c127f889 100644 (file)
@@ -113,7 +113,7 @@ const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] =
 // the memory leaks when using it, however this breaks re-initializing the
 // library (i.e. repeated calls to wxInitialize/wxUninitialize) because the
 // event tables won't be rebuilt the next time, so disable this by default
-#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING 
+#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING
 
 class wxEventTableEntryModule: public wxModule
 {
@@ -257,6 +257,8 @@ DEFINE_EVENT_TYPE(wxEVT_SIZE)
 DEFINE_EVENT_TYPE(wxEVT_SIZING)
 DEFINE_EVENT_TYPE(wxEVT_MOVE)
 DEFINE_EVENT_TYPE(wxEVT_MOVING)
+DEFINE_EVENT_TYPE(wxEVT_MOVE_START)
+DEFINE_EVENT_TYPE(wxEVT_MOVE_END)
 DEFINE_EVENT_TYPE(wxEVT_CLOSE_WINDOW)
 DEFINE_EVENT_TYPE(wxEVT_END_SESSION)
 DEFINE_EVENT_TYPE(wxEVT_QUERY_END_SESSION)
@@ -861,7 +863,7 @@ void wxEventHashTable::Clear()
     m_size = 0;
 }
 
-#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING 
+#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING
 
 // Clear all tables
 void wxEventHashTable::ClearAll()
@@ -1037,7 +1039,7 @@ wxEvtHandler::wxEvtHandler()
     m_eventsLocker = new wxCriticalSection;
 #  endif
 #endif
-    
+
     // no client data (yet)
     m_clientData = NULL;
     m_clientDataType = wxClientData_None;
@@ -1163,7 +1165,7 @@ void wxEvtHandler::ProcessPendingEvents()
     // pending events
     wxCHECK_RET( m_pendingEvents,
                  wxT("Please call wxApp::ProcessPendingEvents() instead") );
-    
+
     wxENTER_CRIT_SECT( Lock() );
 
     // we leave the loop once we have processed all events that were present at
@@ -1506,7 +1508,7 @@ wxEventBlocker::wxEventBlocker(wxWindow *win, wxEventType type)
 wxEventBlocker::~wxEventBlocker()
 {
     wxEvtHandler *popped = m_window->PopEventHandler(false);
-    wxCHECK_RET(popped == this, 
+    wxCHECK_RET(popped == this,
         wxT("Don't push other event handlers into a window managed by wxEventBlocker!"));
 }
 
index 67992184f173386c6adf1e1d0566fc46c6cff6fc..e3531202d3efeb41adaad7a29c6726cb7a3866e4 100644 (file)
@@ -2543,6 +2543,18 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l
             }
             break;
 
+        case WM_ENTERSIZEMOVE:
+            {
+                processed = HandleEnterSizeMove();
+            }
+            break;
+
+        case WM_EXITSIZEMOVE:
+            {
+                processed = HandleExitSizeMove();
+            }
+            break;
+
         case WM_SIZING:
             {
                 LPRECT pRect = (LPRECT)lParam;
@@ -4563,6 +4575,24 @@ bool wxWindowMSW::HandleMoving(wxRect& rect)
     return rc;
 }
 
+bool wxWindowMSW::HandleEnterSizeMove()
+{
+    wxMoveEvent event(wxPoint(), m_windowId);
+    event.SetEventType(wxEVT_MOVE_START);
+    event.SetEventObject(this);
+
+    return GetEventHandler()->ProcessEvent(event);
+}
+
+bool wxWindowMSW::HandleExitSizeMove()
+{
+    wxMoveEvent event(wxPoint(), m_windowId);
+    event.SetEventType(wxEVT_MOVE_END);
+    event.SetEventObject(this);
+
+    return GetEventHandler()->ProcessEvent(event);
+}
+
 bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam)
 {
 #if USE_DEFERRED_SIZING