don't change selection if not capturing the console window

svn path=/trunk/; revision=10310
This commit is contained in:
Thomas Bluemel 2004-07-29 13:54:45 +00:00
parent 310098e324
commit a8c60b138d

View file

@ -1,4 +1,4 @@
/* $Id: guiconsole.c,v 1.17 2004/07/29 13:43:38 weiden Exp $ /* $Id: guiconsole.c,v 1.18 2004/07/29 13:54:45 weiden Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -34,6 +34,7 @@ typedef struct GUI_CONSOLE_DATA_TAG
HBITMAP MemoryBitmap; HBITMAP MemoryBitmap;
RECT Selection; RECT Selection;
POINT SelectionStart; POINT SelectionStart;
BOOL MouseDown;
} GUI_CONSOLE_DATA, *PGUI_CONSOLE_DATA; } GUI_CONSOLE_DATA, *PGUI_CONSOLE_DATA;
#ifndef WM_APP #ifndef WM_APP
@ -639,6 +640,8 @@ GuiConsoleLeftMouseDown(HWND hWnd, LPARAM lParam)
SetCapture(hWnd); SetCapture(hWnd);
GuiData->MouseDown = TRUE;
GuiConsoleUpdateSelection(hWnd, &rc, GuiData); GuiConsoleUpdateSelection(hWnd, &rc, GuiData);
} }
@ -652,7 +655,7 @@ GuiConsoleLeftMouseUp(HWND hWnd, LPARAM lParam)
GuiConsoleGetDataPointers(hWnd, &Console, &GuiData); GuiConsoleGetDataPointers(hWnd, &Console, &GuiData);
if (Console == NULL || GuiData == NULL) return; if (Console == NULL || GuiData == NULL) return;
if (GuiData->Selection.left == -1) return; if (GuiData->Selection.left == -1 || !GuiData->MouseDown) return;
pt = MAKEPOINTS(lParam); pt = MAKEPOINTS(lParam);
@ -677,6 +680,8 @@ GuiConsoleLeftMouseUp(HWND hWnd, LPARAM lParam)
rc.bottom = tmp + 1; rc.bottom = tmp + 1;
} }
GuiData->MouseDown = FALSE;
GuiConsoleUpdateSelection(hWnd, &rc, GuiData); GuiConsoleUpdateSelection(hWnd, &rc, GuiData);
ReleaseCapture(); ReleaseCapture();
@ -693,7 +698,7 @@ GuiConsoleMouseMove(HWND hWnd, WPARAM wParam, LPARAM lParam)
if (!(wParam & MK_LBUTTON)) return; if (!(wParam & MK_LBUTTON)) return;
GuiConsoleGetDataPointers(hWnd, &Console, &GuiData); GuiConsoleGetDataPointers(hWnd, &Console, &GuiData);
if (Console == NULL || GuiData == NULL) return; if (Console == NULL || GuiData == NULL || !GuiData->MouseDown) return;
pt = MAKEPOINTS(lParam); pt = MAKEPOINTS(lParam);