From 7085e6972494253aa1d7c0a787ae8414c8f9387e Mon Sep 17 00:00:00 2001 From: donho Date: Wed, 21 May 2008 00:34:17 +0000 Subject: [PATCH] [NEW_FEATURE] Add tooltips in document tab to display the full file name path. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@204 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Notepad_plus.cpp | 27 +++++++++++++++---- PowerEditor/src/WinControls/TabBar/TabBar.cpp | 2 +- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index c2e5b7bb..fd7fb6d4 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -2210,11 +2210,29 @@ BOOL Notepad_plus::notify(SCNotification *notification) lpttt = (LPTOOLTIPTEXT)notification; lpttt->hinst = _hInst; - // Specify the resource identifier of the descriptive - // text for the given button. - int idButton = int(lpttt->hdr.idFrom); + POINT p; + ::GetCursorPos(&p); + ::ScreenToClient(_hSelf, &p); + HWND hWin = ::RealChildWindowFromPoint(_hSelf, p); + static string tip; - getNameStrFromCmd(idButton, tip); + int id = int(lpttt->hdr.idFrom); + + if (hWin == _rebarTop.getHSelf()) + { + getNameStrFromCmd(id, tip); + } + else if (hWin == _mainDocTab.getHSelf()) + { + tip = _mainEditView.getBufferAt(id).getFileName(); + } + else if (hWin == _subDocTab.getHSelf()) + { + tip = _subEditView.getBufferAt(id).getFileName(); + } + else + break; + lpttt->lpszText = (LPSTR)tip.c_str(); } break; @@ -4363,7 +4381,6 @@ void Notepad_plus::dropFiles(HDROP hdrop) // Determinate in which view the file(s) is (are) dropped POINT p; ::DragQueryPoint(hdrop, &p); - //HWND hWin = ::ChildWindowFromPoint(_hSelf, p); HWND hWin = ::RealChildWindowFromPoint(_hSelf, p); if (!hWin) return; diff --git a/PowerEditor/src/WinControls/TabBar/TabBar.cpp b/PowerEditor/src/WinControls/TabBar/TabBar.cpp index 2da0f290..61d82866 100644 --- a/PowerEditor/src/WinControls/TabBar/TabBar.cpp +++ b/PowerEditor/src/WinControls/TabBar/TabBar.cpp @@ -155,7 +155,7 @@ void TabBarPlus::init(HINSTANCE hInst, HWND parent, bool isVertical, bool isTrad int multiLine = isMultiLine?(_isTraditional?TCS_MULTILINE:0):0; int style = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE |\ - TCS_FOCUSNEVER | TCS_TABS | vertical | multiLine; + TCS_TOOLTIPS | TCS_FOCUSNEVER | TCS_TABS | vertical | multiLine; //if (isOwnerDrawTab() && (!_isTraditional)) {