[BUG_FIXED] Fix Document Map Docking dialog dropped/switching/close problems.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@861 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2012-02-02 00:49:22 +00:00
parent 76c1a650c5
commit 7c23050155
5 changed files with 40 additions and 2 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -91,6 +91,7 @@ public:
virtual void display(bool toShow = true) const {
DockingDlgInterface::display(toShow);
_vzDlg.display();
};
void setParent(HWND parent2set){