[BUG_FIXED] (Author: Pekka Pöyry) Fix the bug that double clicking on tab with 2 views doesn't open new file.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@997 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2012-12-31 14:02:44 +00:00
parent c6afa7a3d1
commit d0395e1ffe
2 changed files with 25 additions and 1 deletions

View File

@ -50,7 +50,7 @@ void SplitterContainer::create(Window *pWin0, Window *pWin1, int splitterSize,
{ {
WNDCLASS splitterContainerClass; WNDCLASS splitterContainerClass;
splitterContainerClass.style = 0; splitterContainerClass.style = CS_DBLCLKS;
splitterContainerClass.lpfnWndProc = staticWinProc; splitterContainerClass.lpfnWndProc = staticWinProc;
splitterContainerClass.cbClsExtra = 0; splitterContainerClass.cbClsExtra = 0;
splitterContainerClass.cbWndExtra = 0; splitterContainerClass.cbWndExtra = 0;
@ -243,6 +243,26 @@ LRESULT SplitterContainer::runProc(UINT message, WPARAM wParam, LPARAM lParam)
return MAKELONG(0, DYNAMIC); 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 : default :
return ::DefWindowProc(_hSelf, message, wParam, lParam); return ::DefWindowProc(_hSelf, message, wParam, lParam);
} }

View File

@ -33,6 +33,10 @@
#include "Splitter.h" #include "Splitter.h"
#endif //SPLITTER_H #endif //SPLITTER_H
#ifndef MENUCMDID_H
#include "menuCmdID.h"
#endif //MENUCMDID_H
#define SPC_CLASS_NAME TEXT("splitterContainer") #define SPC_CLASS_NAME TEXT("splitterContainer")
#define ROTATION_A_GAUCHE 2000 #define ROTATION_A_GAUCHE 2000