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