From d0395e1ffeb929bf5d33e355a433f55e73f8ef26 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Mon, 31 Dec 2012 14:02:44 +0000 Subject: [PATCH] =?UTF-8?q?[BUG=5FFIXED]=20(Author:=20Pekka=20P=C3=B6yry)?= =?UTF-8?q?=20Fix=20the=20bug=20that=20double=20clicking=20on=20tab=20with?= =?UTF-8?q?=202=20views=20doesn't=20open=20new=20file.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@997 f5eea248-9336-0410-98b8-ebc06183d4e3 --- .../SplitterContainer/SplitterContainer.cpp | 22 ++++++++++++++++++- .../SplitterContainer/SplitterContainer.h | 4 ++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp b/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp index 041894d8..417691d4 100644 --- a/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp +++ b/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp @@ -50,7 +50,7 @@ void SplitterContainer::create(Window *pWin0, Window *pWin1, int splitterSize, { WNDCLASS splitterContainerClass; - splitterContainerClass.style = 0; + splitterContainerClass.style = CS_DBLCLKS; splitterContainerClass.lpfnWndProc = staticWinProc; splitterContainerClass.cbClsExtra = 0; splitterContainerClass.cbWndExtra = 0; @@ -243,6 +243,26 @@ LRESULT SplitterContainer::runProc(UINT message, WPARAM wParam, LPARAM lParam) return MAKELONG(0, DYNAMIC); } + case WM_LBUTTONDBLCLK: + { + POINT pt; + ::GetCursorPos(&pt); + ::ScreenToClient(_splitter.getHSelf(), &pt); + + Window* targetWindow; + + if(this->isVertical()) + targetWindow = pt.x < 0?_pWin0:_pWin1; + else + targetWindow = pt.y < 0?_pWin0:_pWin1; + + HWND parent = ::GetParent(getHSelf()); + + ::SendMessage(parent, NPPM_INTERNAL_SWITCHVIEWFROMHWND, 0, (LPARAM)targetWindow->getHSelf()); + ::SendMessage(parent, WM_COMMAND, IDM_FILE_NEW, 0); + return TRUE; + } + default : return ::DefWindowProc(_hSelf, message, wParam, lParam); } diff --git a/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.h b/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.h index e1a79bf6..9afb49f3 100644 --- a/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.h +++ b/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.h @@ -33,6 +33,10 @@ #include "Splitter.h" #endif //SPLITTER_H +#ifndef MENUCMDID_H +#include "menuCmdID.h" +#endif //MENUCMDID_H + #define SPC_CLASS_NAME TEXT("splitterContainer") #define ROTATION_A_GAUCHE 2000