From 5302aad1cc95b0b9585fdb3cdcead32e796a164b Mon Sep 17 00:00:00 2001 From: Jonathan Westhues Date: Fri, 8 Jan 2010 01:55:22 -0800 Subject: [PATCH] Hide the text or graphics edit control when the user left-clicks somewhere in the text or graphics window. Previously, those left-clicks just did nothing. [git-p4: depot-paths = "//depot/solvespace/": change = 2100] --- mouse.cpp | 7 ++++++- win32/w32main.cpp | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mouse.cpp b/mouse.cpp index 6c87ae73..dd5b54bf 100644 --- a/mouse.cpp +++ b/mouse.cpp @@ -762,7 +762,12 @@ bool GraphicsWindow::ConstrainPointByHovered(hEntity pt) { void GraphicsWindow::MouseLeftDown(double mx, double my) { orig.mouseDown = true; - if(GraphicsEditControlIsVisible()) return; + if(GraphicsEditControlIsVisible()) { + orig.mouse = Point2d::From(mx, my); + orig.mouseOnButtonDown = orig.mouse; + HideGraphicsEditControl(); + return; + } HideTextEditControl(); if(SS.showToolbar) { diff --git a/win32/w32main.cpp b/win32/w32main.cpp index 304ea089..e9e66055 100644 --- a/win32/w32main.cpp +++ b/win32/w32main.cpp @@ -432,7 +432,12 @@ LRESULT CALLBACK TextWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_LBUTTONDOWN: case WM_MOUSEMOVE: { if(TextEditControlIsVisible() || GraphicsEditControlIsVisible()) { - SetCursor(LoadCursor(NULL, IDC_ARROW)); + if(msg == WM_MOUSEMOVE) { + SetCursor(LoadCursor(NULL, IDC_ARROW)); + } else { + HideTextEditControl(); + HideGraphicsEditControl(); + } break; } GraphicsWindow::Selection ps = SS.GW.hover;