فهرست منبع

Window non-client area now properly reports mouse clicks

Marko Pintera 10 سال پیش
والد
کامیت
5082dcd7bc
2فایلهای تغییر یافته به همراه51 افزوده شده و 4 حذف شده
  1. 51 3
      BansheeCore/Source/Win32/BsWin32Platform.cpp
  2. 0 1
      TODO.txt

+ 51 - 3
BansheeCore/Source/Win32/BsWin32Platform.cpp

@@ -874,6 +874,7 @@ namespace BansheeEngine
 					onMouseLeftWindow(win);
 			}
 			return 0;
+		case WM_NCLBUTTONUP:
 		case WM_LBUTTONUP:
 			{
 				ReleaseCapture();
@@ -885,8 +886,13 @@ namespace BansheeEngine
 
 				if(!onCursorButtonReleased.empty())
 					onCursorButtonReleased(intMousePos, OSMouseButton::Left, btnStates);
+
+				if (uMsg == WM_LBUTTONUP)
+					return 0;
+				else
+					break;
 			}
-			return 0;
+		case WM_NCMBUTTONUP:
 		case WM_MBUTTONUP:
 			{
 				ReleaseCapture();
@@ -898,8 +904,13 @@ namespace BansheeEngine
 
 				if(!onCursorButtonReleased.empty())
 					onCursorButtonReleased(intMousePos, OSMouseButton::Middle, btnStates);
+
+				if (uMsg == WM_MBUTTONUP)
+					return 0;
+				else
+					break;
 			}
-			return 0;
+		case WM_NCRBUTTONUP:
 		case WM_RBUTTONUP:
 			{
 				ReleaseCapture();
@@ -911,8 +922,23 @@ namespace BansheeEngine
 
 				if(!onCursorButtonReleased.empty())
 					onCursorButtonReleased(intMousePos, OSMouseButton::Right, btnStates);
+
+				if (uMsg == WM_RBUTTONUP)
+					return 0;
+				else
+					break;
 			}
-			return 0;
+		case WM_NCLBUTTONDOWN:
+			{
+				Vector2I intMousePos;
+				OSPointerButtonStates btnStates;
+
+				getMouseData(hWnd, wParam, lParam, intMousePos, btnStates);
+
+				if (!onCursorButtonPressed.empty())
+					onCursorButtonPressed(intMousePos, OSMouseButton::Left, btnStates);
+			}
+			break;
 		case WM_LBUTTONDOWN:
 			{
 				SetCapture(hWnd);
@@ -926,6 +952,17 @@ namespace BansheeEngine
 					onCursorButtonPressed(intMousePos, OSMouseButton::Left, btnStates);
 			}
 			return 0;
+		case WM_NCMBUTTONDOWN:
+			{
+				Vector2I intMousePos;
+				OSPointerButtonStates btnStates;
+
+				getMouseData(hWnd, wParam, lParam, intMousePos, btnStates);
+
+				if (!onCursorButtonPressed.empty())
+					onCursorButtonPressed(intMousePos, OSMouseButton::Middle, btnStates);
+			}
+			break;
 		case WM_MBUTTONDOWN:
 			{
 				SetCapture(hWnd);
@@ -939,6 +976,17 @@ namespace BansheeEngine
 					onCursorButtonPressed(intMousePos, OSMouseButton::Middle, btnStates);
 			}
 			return 0;
+		case WM_NCRBUTTONDOWN:
+			{
+				Vector2I intMousePos;
+				OSPointerButtonStates btnStates;
+
+				getMouseData(hWnd, wParam, lParam, intMousePos, btnStates);
+
+				if (!onCursorButtonPressed.empty())
+					onCursorButtonPressed(intMousePos, OSMouseButton::Right, btnStates);
+			}
+			break;
 		case WM_RBUTTONDOWN:
 			{
 				SetCapture(hWnd);

+ 0 - 1
TODO.txt

@@ -64,7 +64,6 @@ Polish stage 1
 
 Click on empty part of the menu bar doesn't close the menu bar (ignoring NC area clicks?)
 Clicking on a parent of a menu item just reopens that item but I would expect it to close it
-Clicking on menu items doesn't seem to work
 Docking a window to another windows title bar doesn't seem to work
 Decent looking default layout
 Fix DX11 (and possibly DX9) rendering