context menus for start menus

svn path=/trunk/; revision=10364
This commit is contained in:
Martin Fuchs
2004-08-02 20:00:56 +00:00
parent 62f1a2a671
commit 932a73bfc2
2 changed files with 24 additions and 2 deletions
@@ -234,7 +234,7 @@ LRESULT QuickLaunchBar::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
case WM_CONTEXTMENU: {
TBBUTTON btn;
QuickLaunchMap::iterator it;
Point pt(lparam), clnt_pt=pt;
Point screen_pt(lparam), clnt_pt=screen_pt;
ScreenToClient(_hwnd, &clnt_pt);
Entry* entry = NULL;
@@ -247,7 +247,7 @@ LRESULT QuickLaunchBar::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
}
if (entry) // entry is NULL for desktop switch buttons
CHECKERROR(entry->do_context_menu(_hwnd, pt));
CHECKERROR(entry->do_context_menu(_hwnd, screen_pt));
else
goto def;
break;}
@@ -428,6 +428,28 @@ LRESULT StartMenu::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
SelectButtonIndex(0, wparam?true:false);
break;
#ifdef _LIGHT_STARTMENU
case WM_CONTEXTMENU: {
Point screen_pt(lparam), clnt_pt=screen_pt;
ScreenToClient(_hwnd, &clnt_pt);
int id = ButtonHitTest(clnt_pt);
if (id) {
StartMenuEntry& sme = _entries[id];
for(ShellEntrySet::iterator it=sme._entries.begin(); it!=sme._entries.end(); ++it) {
Entry* entry = *it;
if (entry) {
CHECKERROR(entry->do_context_menu(_hwnd, screen_pt)); // may close start menu because of focus loss
break; ///@todo handle context menu for more than one entry
}
}
}
break;}
#endif
default: def:
return super::WndProc(nmsg, wparam, lparam);
}