mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +00:00
context menu for notification area
svn path=/trunk/; revision=8808
This commit is contained in:
parent
f06e49faea
commit
18e827f845
7 changed files with 198 additions and 141 deletions
|
@ -167,8 +167,10 @@ IDM_DESKTOPBAR MENU DISCARDABLE
|
|||
BEGIN
|
||||
POPUP ""
|
||||
BEGIN
|
||||
MENUITEM "&About Explorer...", ID_ABOUT_EXPLORER //FIXME?
|
||||
MENUITEM "&Settings...", ID_DESKTOPBAR_SETTINGS //FIXME?
|
||||
MENUITEM "&Settings...", ID_DESKTOPBAR_SETTINGS //FIXME?
|
||||
MENUITEM "&Task Manager...", ID_TASKMGR
|
||||
MENUITEM SEPARATOR,
|
||||
MENUITEM "&About Explorer...", ID_ABOUT_EXPLORER //FIXME?
|
||||
END
|
||||
END
|
||||
|
||||
|
|
|
@ -77,6 +77,7 @@
|
|||
#define IDI_COMPUTER 149
|
||||
#define IDM_DESKTOPBAR 150
|
||||
#define IDM_VOLUME 151
|
||||
#define IDM_NOTIFYAREA 152
|
||||
#define IDD_DESKBAR_TASKBAR 153
|
||||
#define IDB_ICON_ALIGN_0 153
|
||||
#define IDD_DESKBAR_STARTMENU 154
|
||||
|
@ -144,6 +145,9 @@
|
|||
#define ID_BROWSE_UP 40013
|
||||
#define ID_TRAY_VOLUME 40014
|
||||
#define ID_VOLUME_PROPERTIES 40015
|
||||
#define ID_SHOW_HIDDEN_ICONS 40016
|
||||
#define ID_CONFIG_NOTIFYAREA 40017
|
||||
#define ID_CONFIG_TIME 40018
|
||||
#define ID_SWITCH_DESKTOP_1 50000
|
||||
#define ID_WINDOW_NEW 0xE130
|
||||
#define ID_WINDOW_ARRANGE 0xE131
|
||||
|
@ -162,7 +166,7 @@
|
|||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 163
|
||||
#define _APS_NEXT_COMMAND_VALUE 40016
|
||||
#define _APS_NEXT_COMMAND_VALUE 40019
|
||||
#define _APS_NEXT_CONTROL_VALUE 1003
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
|
|
|
@ -523,11 +523,138 @@ END
|
|||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
// French (France) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDM_MAINFRAME MENU PRELOAD DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "&Fichier"
|
||||
BEGIN
|
||||
MENUITEM "&Fermer", ID_FILE_EXIT
|
||||
END
|
||||
POPUP "&Affichage"
|
||||
BEGIN
|
||||
MENUITEM "Barre d'&outils", ID_VIEW_TOOL_BAR
|
||||
MENUITEM "&Extra Bar", ID_VIEW_EXTRA_BAR
|
||||
MENUITEM "&Drivebar", ID_VIEW_DRIVE_BAR, CHECKED
|
||||
MENUITEM "Barre d'&état", ID_VIEW_STATUSBAR
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "F&ull Screen\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
|
||||
END
|
||||
POPUP "&Window"
|
||||
BEGIN
|
||||
MENUITEM "New &Window", ID_WINDOW_NEW
|
||||
MENUITEM "Cascading\tShift+F5", ID_WINDOW_CASCADE
|
||||
MENUITEM "Tile &Horizontally", ID_WINDOW_TILE_HORZ
|
||||
MENUITEM "Tile &Vertically\tShift+F4", ID_WINDOW_TILE_VERT
|
||||
MENUITEM "Arrange Automatically", ID_WINDOW_AUTOSORT
|
||||
MENUITEM "Arrange &Symbols", ID_WINDOW_ARRANGE
|
||||
MENUITEM "&Refresh\tF5", ID_REFRESH
|
||||
END
|
||||
POPUP "A&ide"
|
||||
BEGIN
|
||||
MENUITEM "&FAQ Explorateur...", ID_EXPLORER_FAQ
|
||||
MENUITEM "A propos de l'&explorateur...", ID_ABOUT_WINDOWS
|
||||
MENUITEM "A propos de l'&OS...", ID_ABOUT_EXPLORER
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Execute"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
CONTROL "",101,"Static",SS_SIMPLE | SS_NOPREFIX,3,6,162,10
|
||||
CONTROL "&Command:",-1,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,3,
|
||||
18,60,10
|
||||
EDITTEXT 201,3,29,134,12,ES_AUTOHSCROLL
|
||||
CONTROL "As &Symbol",214,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,
|
||||
45,71,12
|
||||
DEFPUSHBUTTON "&OK",1,158,6,47,14
|
||||
PUSHBUTTON "&Cancel",2,158,23,47,14
|
||||
PUSHBUTTON "&Help",254,158,43,47,14
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_TITLE "Explorateur Reactos"
|
||||
IDS_START "Démarrer"
|
||||
IDS_LOGOFF "Déconnexion ..."
|
||||
IDS_SHUTDOWN "Arrêter..."
|
||||
IDS_LAUNCH "Exécuter..."
|
||||
IDS_START_HELP "Aide"
|
||||
IDS_SEARCH_FILES "Rechercher Fichiers..."
|
||||
IDS_DOCUMENTS "Documents"
|
||||
IDS_FAVORITES "Favoris"
|
||||
IDS_PROGRAMS "Programmes"
|
||||
IDS_SETTINGS "Paramètres"
|
||||
IDS_EXPLORE "Explorer"
|
||||
IDS_EMPTY "(Vide)"
|
||||
IDS_RECENT "Documents récents"
|
||||
IDS_ADMIN "Administration"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_NETWORK "Réseaux"
|
||||
IDS_CONNECTIONS "Connexions réseaux"
|
||||
IDS_DRIVES "Disques"
|
||||
IDS_SEARCH_COMPUTER "Recherche Ordinateurs..."
|
||||
IDS_SETTINGS_MENU "Barre des tâches et menu démarrer"
|
||||
IDS_CONTROL_PANEL "Panneau de configuration"
|
||||
IDS_PRINTERS "Imprimantes"
|
||||
IDS_BROWSE "Parcourir"
|
||||
IDS_SEARCH_PRG "Recherche Programme..."
|
||||
IDS_ALL_USERS "Tous les utilisateurs\\"
|
||||
IDS_SEARCH "Rechercher"
|
||||
IDS_ABOUT_EXPLORER "A propos de l'explorateur..."
|
||||
IDS_LAUNCH_MANY_PROGRAMS
|
||||
"You have selected more than one program.\nAre you sure you want to launch all of them?"
|
||||
IDS_DESKTOPBAR_SETTINGS "Bureau"
|
||||
IDS_DESKTOP "Bureau"
|
||||
IDS_TASKBAR "Taskbar"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_STARTMENU "Startmenu"
|
||||
IDS_MINIMIZE_ALL "mimimize all windows"
|
||||
IDS_DESKTOP_NUM "Bureau %d"
|
||||
IDS_VOLUME "Volume"
|
||||
END
|
||||
|
||||
#endif // French (France) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.K.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
|
@ -682,9 +809,10 @@ IDM_DESKTOPBAR MENU DISCARDABLE
|
|||
BEGIN
|
||||
POPUP ""
|
||||
BEGIN
|
||||
MENUITEM "&About Explorer...", ID_ABOUT_EXPLORER
|
||||
MENUITEM "&Settings...", ID_DESKTOPBAR_SETTINGS
|
||||
MENUITEM "&Task Manager...", ID_TASKMGR
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&About Explorer...", ID_ABOUT_EXPLORER
|
||||
END
|
||||
END
|
||||
|
||||
|
@ -697,6 +825,18 @@ BEGIN
|
|||
END
|
||||
END
|
||||
|
||||
IDM_NOTIFYAREA MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP ""
|
||||
BEGIN
|
||||
MENUITEM "&Show hidden icons", ID_SHOW_HIDDEN_ICONS
|
||||
MENUITEM "&Configure Notifications...", ID_CONFIG_NOTIFYAREA
|
||||
MENUITEM "Adjust Date/&Time...", ID_CONFIG_TIME
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&About Explorer...", ID_ABOUT_EXPLORER
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
@ -877,134 +1017,7 @@ BEGIN
|
|||
IDS_VOLUME "Volume"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// French (France) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDM_MAINFRAME MENU PRELOAD DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "&Fichier"
|
||||
BEGIN
|
||||
MENUITEM "&Fermer", ID_FILE_EXIT
|
||||
END
|
||||
POPUP "&Affichage"
|
||||
BEGIN
|
||||
MENUITEM "Barre d'&outils", ID_VIEW_TOOL_BAR
|
||||
MENUITEM "&Extra Bar", ID_VIEW_EXTRA_BAR
|
||||
MENUITEM "&Drivebar", ID_VIEW_DRIVE_BAR, CHECKED
|
||||
MENUITEM "Barre d'&état", ID_VIEW_STATUSBAR
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "F&ull Screen\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
|
||||
END
|
||||
POPUP "&Window"
|
||||
BEGIN
|
||||
MENUITEM "New &Window", ID_WINDOW_NEW
|
||||
MENUITEM "Cascading\tShift+F5", ID_WINDOW_CASCADE
|
||||
MENUITEM "Tile &Horizontally", ID_WINDOW_TILE_HORZ
|
||||
MENUITEM "Tile &Vertically\tShift+F4", ID_WINDOW_TILE_VERT
|
||||
MENUITEM "Arrange Automatically", ID_WINDOW_AUTOSORT
|
||||
MENUITEM "Arrange &Symbols", ID_WINDOW_ARRANGE
|
||||
MENUITEM "&Refresh\tF5", ID_REFRESH
|
||||
END
|
||||
POPUP "A&ide"
|
||||
BEGIN
|
||||
MENUITEM "&FAQ Explorateur...", ID_EXPLORER_FAQ
|
||||
MENUITEM "A propos de l'&explorateur...", ID_ABOUT_WINDOWS
|
||||
MENUITEM "A propos de l'&OS...", ID_ABOUT_EXPLORER
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Execute"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
CONTROL "",101,"Static",SS_SIMPLE | SS_NOPREFIX,3,6,162,10
|
||||
CONTROL "&Command:",-1,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,3,
|
||||
18,60,10
|
||||
EDITTEXT 201,3,29,134,12,ES_AUTOHSCROLL
|
||||
CONTROL "As &Symbol",214,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,
|
||||
45,71,12
|
||||
DEFPUSHBUTTON "&OK",1,158,6,47,14
|
||||
PUSHBUTTON "&Cancel",2,158,23,47,14
|
||||
PUSHBUTTON "&Help",254,158,43,47,14
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_TITLE "Explorateur Reactos"
|
||||
IDS_START "Démarrer"
|
||||
IDS_LOGOFF "Déconnexion ..."
|
||||
IDS_SHUTDOWN "Arrêter..."
|
||||
IDS_LAUNCH "Exécuter..."
|
||||
IDS_START_HELP "Aide"
|
||||
IDS_SEARCH_FILES "Rechercher Fichiers..."
|
||||
IDS_DOCUMENTS "Documents"
|
||||
IDS_FAVORITES "Favoris"
|
||||
IDS_PROGRAMS "Programmes"
|
||||
IDS_SETTINGS "Paramètres"
|
||||
IDS_EXPLORE "Explorer"
|
||||
IDS_EMPTY "(Vide)"
|
||||
IDS_RECENT "Documents récents"
|
||||
IDS_ADMIN "Administration"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_NETWORK "Réseaux"
|
||||
IDS_CONNECTIONS "Connexions réseaux"
|
||||
IDS_DRIVES "Disques"
|
||||
IDS_SEARCH_COMPUTER "Recherche Ordinateurs..."
|
||||
IDS_SETTINGS_MENU "Barre des tâches et menu démarrer"
|
||||
IDS_CONTROL_PANEL "Panneau de configuration"
|
||||
IDS_PRINTERS "Imprimantes"
|
||||
IDS_BROWSE "Parcourir"
|
||||
IDS_SEARCH_PRG "Recherche Programme..."
|
||||
IDS_ALL_USERS "Tous les utilisateurs\\"
|
||||
IDS_SEARCH "Rechercher"
|
||||
IDS_ABOUT_EXPLORER "A propos de l'explorateur..."
|
||||
IDS_LAUNCH_MANY_PROGRAMS
|
||||
"You have selected more than one program.\nAre you sure you want to launch all of them?"
|
||||
IDS_DESKTOPBAR_SETTINGS "Bureau"
|
||||
IDS_DESKTOP "Bureau"
|
||||
IDS_TASKBAR "Taskbar"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_STARTMENU "Startmenu"
|
||||
IDS_MINIMIZE_ALL "mimimize all windows"
|
||||
IDS_DESKTOP_NUM "Bureau %d"
|
||||
IDS_VOLUME "Volume"
|
||||
END
|
||||
|
||||
#endif // French (France) resources
|
||||
#endif // English (U.K.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
|
|
@ -229,9 +229,11 @@ LRESULT DesktopBar::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
|
|||
case WM_COPYDATA:
|
||||
return ProcessCopyData((COPYDATASTRUCT*)lparam);
|
||||
|
||||
case WM_CONTEXTMENU:
|
||||
PopupMenu(IDM_DESKTOPBAR).TrackPopupMenu(_hwnd, MAKEPOINTS(lparam));
|
||||
break;
|
||||
case WM_CONTEXTMENU: {
|
||||
PopupMenu menu(IDM_DESKTOPBAR);
|
||||
SetMenuDefaultItem(menu, 0, MF_BYPOSITION);
|
||||
menu.TrackPopupMenu(_hwnd, MAKEPOINTS(lparam));
|
||||
break;}
|
||||
|
||||
case PM_GET_LAST_ACTIVE:
|
||||
if (_hwndTaskBar)
|
||||
|
|
|
@ -122,8 +122,10 @@ LRESULT TaskBar::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
|
|||
case WM_CONTEXTMENU: {
|
||||
Point pt(lparam);
|
||||
ScreenToClient(_htoolbar, &pt);
|
||||
|
||||
if ((HWND)wparam==_htoolbar && SendMessage(_htoolbar, TB_HITTEST, 0, (LPARAM)&pt)>0)
|
||||
break; // avoid displaying context menu for application button _and_ desktop bar at the same time
|
||||
|
||||
goto def;}
|
||||
/*
|
||||
//#define PM_SHELLHOOK_NOTIFY (WM_APP+0x10)
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
#include "../explorer.h"
|
||||
#include "../globals.h"
|
||||
|
||||
#include "../explorer_intres.h"
|
||||
|
||||
#include "traynotify.h"
|
||||
|
||||
|
||||
|
@ -296,8 +298,17 @@ LRESULT NotifyArea::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
|
|||
case PM_GET_WIDTH:
|
||||
return _sorted_icons.size()*NOTIFYICON_DIST + NOTIFYAREA_SPACE + _clock_width;
|
||||
|
||||
case WM_CONTEXTMENU:
|
||||
break; // don't let WM_CONTEXTMENU go through to the desktop bar
|
||||
case WM_CONTEXTMENU: {
|
||||
Point pt(lparam);
|
||||
ScreenToClient(_hwnd, &pt);
|
||||
|
||||
if (IconHitTest(pt) == _sorted_icons.end()) { // display menu only when no icon clicked
|
||||
PopupMenu menu(IDM_NOTIFYAREA);
|
||||
SetMenuDefaultItem(menu, 0, MF_BYPOSITION);
|
||||
CheckMenuItem(menu, ID_SHOW_HIDDEN_ICONS, MF_BYCOMMAND|(_show_hidden?MF_CHECKED:MF_UNCHECKED));
|
||||
menu.TrackPopupMenu(_hwnd, MAKEPOINTS(lparam));
|
||||
}
|
||||
break;}
|
||||
|
||||
case WM_COPYDATA: { // receive NotifyHook answers
|
||||
String path;
|
||||
|
@ -305,7 +316,6 @@ LRESULT NotifyArea::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
|
|||
|
||||
if (_hook.ModulePathCopyData(lparam, &hwnd, path))
|
||||
_window_modules[hwnd] = path;
|
||||
|
||||
break;}
|
||||
|
||||
default:
|
||||
|
@ -360,6 +370,29 @@ LRESULT NotifyArea::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int NotifyArea::Command(int id, int code)
|
||||
{
|
||||
switch(id) {
|
||||
case ID_SHOW_HIDDEN_ICONS:
|
||||
_show_hidden = !_show_hidden;
|
||||
Refresh();
|
||||
break;
|
||||
|
||||
case ID_CONFIG_NOTIFYAREA:
|
||||
///@todo
|
||||
break;
|
||||
|
||||
case ID_CONFIG_TIME:
|
||||
RunDLL(_hwnd, TEXT("shell32"), "Control_RunDLL", TEXT("timedate.cpl"), SW_SHOWNORMAL);
|
||||
break;
|
||||
|
||||
default:
|
||||
SendParent(WM_COMMAND, MAKELONG(id,code), 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int NotifyArea::Notify(int id, NMHDR* pnmh)
|
||||
{
|
||||
if (pnmh->code == TTN_GETDISPINFO) {
|
||||
|
|
|
@ -149,6 +149,7 @@ protected:
|
|||
|
||||
LRESULT Init(LPCREATESTRUCT pcs);
|
||||
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
|
||||
int Command(int id, int code);
|
||||
int Notify(int id, NMHDR* pnmh);
|
||||
|
||||
void Refresh();
|
||||
|
|
Loading…
Reference in a new issue