Implemented tool tips for quicklaunch bar.

svn path=/trunk/; revision=5800
This commit is contained in:
Martin Fuchs 2003-08-23 18:05:34 +00:00
parent 05831e8a00
commit 4d265e45f4
2 changed files with 22 additions and 2 deletions

View file

@ -68,7 +68,7 @@ HWND QuickLaunchBar::Create(HWND hwndParent)
HWND hwnd = CreateToolbarEx(hwndParent,
WS_CHILD|WS_VISIBLE|CCS_NODIVIDER|CCS_NORESIZE|
TBSTYLE_FLAT|TBSTYLE_TOOLTIPS|TBSTYLE_WRAPABLE,
TBSTYLE_TOOLTIPS|TBSTYLE_WRAPABLE|TBSTYLE_FLAT,
IDW_QUICKLAUNCHBAR, 0, 0, 0, NULL, 0, 0, 0, 16, 16, sizeof(TBBUTTON));
if (hwnd)
@ -98,7 +98,7 @@ void QuickLaunchBar::AddShortcuts()
ShellFolder desktop_folder;
WindowCanvas canvas(_hwnd);
TBBUTTON btn = {-2/*I_IMAGENONE*/, 0, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0};
TBBUTTON btn = {0, 0, TBSTATE_ENABLED, BTNS_BUTTON|BTNS_NOPREFIX, {0, 0}, 0, 0};
for(Entry*entry=_dir->_down; entry; entry=entry->_next) {
// hide files like "desktop.ini"
@ -154,3 +154,22 @@ int QuickLaunchBar::Command(int id, int code)
return 0;
}
int QuickLaunchBar::Notify(int id, NMHDR* pnmh)
{
switch(pnmh->code) {
case TTN_GETDISPINFO: {
NMTTDISPINFO* ttdi = (NMTTDISPINFO*) pnmh;
int id = ttdi->hdr.idFrom;
ttdi->lpszText = (LPTSTR)_entries[id]._title.c_str();
#ifdef TTF_DI_SETITEM
ttdi->uFlags |= TTF_DI_SETITEM;
#endif
break;}
return super::Notify(id, pnmh);
}
return 0;
}

View file

@ -68,6 +68,7 @@ struct QuickLaunchBar : public SubclassedWindow
protected:
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
int Command(int id, int code);
int Notify(int id, NMHDR* pnmh);
ShellDirectory* _dir;