Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/ghost/intern/GHOST_WindowWin32.cpp')
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index f1a4110995e..9d957da61cd 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -785,21 +785,20 @@ bool GHOST_WindowWin32::isDialog() const
return (parent != 0) && (style & WS_POPUPWINDOW);
}
-void GHOST_WindowWin32::registerMouseClickEvent(int press)
+void GHOST_WindowWin32::updateMouseCapture(GHOST_MouseCaptureEventWin32 event)
{
-
- switch (press) {
- case 0:
+ switch (event) {
+ case MousePressed:
m_nPressedButtons++;
break;
- case 1:
+ case MouseReleased:
if (m_nPressedButtons)
m_nPressedButtons--;
break;
- case 2:
+ case OperatorGrab:
m_hasGrabMouse = true;
break;
- case 3:
+ case OperatorUngrab:
m_hasGrabMouse = false;
break;
}
@@ -814,6 +813,11 @@ void GHOST_WindowWin32::registerMouseClickEvent(int press)
}
}
+bool GHOST_WindowWin32::getMousePressed() const
+{
+ return m_nPressedButtons;
+}
+
HCURSOR GHOST_WindowWin32::getStandardCursor(GHOST_TStandardCursor shape) const
{
// Convert GHOST cursor to Windows OEM cursor
@@ -977,7 +981,7 @@ GHOST_TSuccess GHOST_WindowWin32::setWindowCursorGrab(GHOST_TGrabCursorMode mode
if (mode == GHOST_kGrabHide)
setWindowCursorVisibility(false);
}
- registerMouseClickEvent(2);
+ updateMouseCapture(OperatorGrab);
}
else {
if (m_cursorGrab == GHOST_kGrabHide) {
@@ -997,7 +1001,7 @@ GHOST_TSuccess GHOST_WindowWin32::setWindowCursorGrab(GHOST_TGrabCursorMode mode
* can be incorrect on exit. */
setCursorGrabAccum(0, 0);
m_cursorGrabBounds.m_l = m_cursorGrabBounds.m_r = -1; /* disable */
- registerMouseClickEvent(3);
+ updateMouseCapture(OperatorUngrab);
}
return GHOST_kSuccess;