diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index 18fec8aac..456cbda51 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -272,7 +272,7 @@ bool Notepad_plus::doSave(BufferID id, const TCHAR * filename, bool isCopy) if (!res) _nativeLangSpeaker.messageBox("FileLockedWarning", _pPublicInterface->getHSelf(), - TEXT("Please check whether if this file is opened in another program"), + TEXT("Please check if this file is opened in another program."), TEXT("Save failed"), MB_OK); return res; diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp b/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp index df32c83db..2627bb1fa 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp @@ -1100,6 +1100,7 @@ void DockingCont::onSize() ::SetWindowPos(((tTbData*)tcItem.lParam)->hClient, NULL, 0, 0, rcTemp.right, rcTemp.bottom, SWP_NOZORDER); + ::SendMessage(((tTbData*)tcItem.lParam)->hClient, WM_SIZE, 0, MAKELONG(rcTemp.right, rcTemp.bottom)); } } } @@ -1291,6 +1292,13 @@ void DockingCont::SelectTab(int iTab) ::ShowWindow(((tTbData*)tcItem.lParam)->hClient, SW_SHOW); ::SetFocus(((tTbData*)tcItem.lParam)->hClient); + // Notify switch in + NMHDR nmhdr; + nmhdr.code = DMN_SWITCHIN; + nmhdr.hwndFrom = _hSelf; + nmhdr.idFrom = 0; + ::SendMessage(((tTbData*)tcItem.lParam)->hClient, WM_NOTIFY, nmhdr.idFrom, (LPARAM)&nmhdr); + if ((unsigned int)iTab != _prevItem) { // hide previous dialog @@ -1299,6 +1307,13 @@ void DockingCont::SelectTab(int iTab) if (!tcItem.lParam) return; ::ShowWindow(((tTbData*)tcItem.lParam)->hClient, SW_HIDE); + + // Notify switch off + NMHDR nmhdr; + nmhdr.code = DMN_SWITCHOFF; + nmhdr.hwndFrom = _hSelf; + nmhdr.idFrom = 0; + ::SendMessage(((tTbData*)tcItem.lParam)->hClient, WM_NOTIFY, nmhdr.idFrom, (LPARAM)&nmhdr); } // resize tab item diff --git a/PowerEditor/src/WinControls/DockingWnd/dockingResource.h b/PowerEditor/src/WinControls/DockingWnd/dockingResource.h index 0d80683c4..3fb36017a 100644 --- a/PowerEditor/src/WinControls/DockingWnd/dockingResource.h +++ b/PowerEditor/src/WinControls/DockingWnd/dockingResource.h @@ -57,7 +57,11 @@ //nmhdr.hwndFrom = hwndNpp; //nmhdr.idFrom = ctrlIdNpp; - + #define DMN_SWITCHIN (DMN_FIRST + 4) + #define DMN_SWITCHOFF (DMN_FIRST + 5) + //nmhdr.code = DWORD(DMN_XXX, 0); + //nmhdr.hwndFrom = DockingCont::_hself; + //nmhdr.idFrom = 0; #endif //DOCKING_RESOURCE_H diff --git a/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp b/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp index 1e9d74530..780521f14 100644 --- a/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp +++ b/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp @@ -161,6 +161,24 @@ BOOL CALLBACK DocumentMap::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara { switch (((LPNMHDR)lParam)->code) { + case DMN_CLOSE: + { + _vzDlg.display(false); + return TRUE; + } + + case DMN_SWITCHIN: + { + _vzDlg.display(); + return TRUE; + } + + case DMN_SWITCHOFF: + { + _vzDlg.display(false); + return TRUE; + } + case NM_DBLCLK: { return TRUE; diff --git a/PowerEditor/src/WinControls/DocumentMap/documentMap.h b/PowerEditor/src/WinControls/DocumentMap/documentMap.h index dc7a415fc..1d878f1a7 100644 --- a/PowerEditor/src/WinControls/DocumentMap/documentMap.h +++ b/PowerEditor/src/WinControls/DocumentMap/documentMap.h @@ -91,6 +91,7 @@ public: virtual void display(bool toShow = true) const { DockingDlgInterface::display(toShow); + _vzDlg.display(); }; void setParent(HWND parent2set){