[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
remotes/trunk
Don Ho 12 years ago
parent c6afa7a3d1
commit d0395e1ffe

@ -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);
}

@ -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

Loading…
Cancel
Save