move search start menu entries into 'Search' submenu

svn path=/trunk/; revision=7317
This commit is contained in:
Martin Fuchs
2003-12-29 23:46:33 +00:00
parent 5e2692a21b
commit b824b25697
5 changed files with 93 additions and 46 deletions
@@ -8,7 +8,7 @@
#define IDS_SHUTDOWN 4
#define IDS_LAUNCH 5
#define IDS_START_HELP 6
#define IDS_SEARCH 7
#define IDS_SEARCH_FILES 7
#define IDS_DOCUMENTS 8
#define IDS_FAVORITES 9
#define IDS_PROGRAMS 10
@@ -27,6 +27,7 @@
#define IDS_BROWSE 23
#define IDS_SEARCH_PRG 24
#define IDS_ALL_USERS 25
#define IDS_SEARCH 26
#define IDI_REACTOS 100
#define IDI_EXPLORER 101
#define IDI_STARTMENU 102
@@ -90,7 +90,7 @@ BEGIN
IDS_SHUTDOWN "Oprire calculator ..."
IDS_LAUNCH "Pornire ..."
IDS_START_HELP "Ajutor"
IDS_SEARCH "Cãutare..."
IDS_SEARCH_FILES "Cãutare Files..."
IDS_DOCUMENTS "Documente"
IDS_FAVORITES "Preferinþe"
IDS_PROGRAMS "Programe"
@@ -99,6 +99,7 @@ BEGIN
IDS_EMPTY "(Empty)"
IDS_RECENT "Documente Recente"
IDS_ADMIN "Administrare"
IDS_SEARCH "Cãutare..."
END
STRINGTABLE DISCARDABLE
@@ -110,7 +111,7 @@ BEGIN
IDS_SETTINGS_MENU "Settings Menu"
IDS_CONTROL_PANEL "Control Panel"
IDS_PRINTERS "Printers"
IDS_BROWSE "Browse Files..."
IDS_BROWSE "Browse Files"
IDS_SEARCH_PRG "Search Programm..."
IDS_ALL_USERS "All Users\\"
END
@@ -361,7 +362,7 @@ BEGIN
IDS_SHUTDOWN "Herunterfahren..."
IDS_LAUNCH "Starten..."
IDS_START_HELP "Hilfe"
IDS_SEARCH "Suche..."
IDS_SEARCH_FILES "Suche Dateien..."
IDS_DOCUMENTS "Dokumente"
IDS_FAVORITES "Bookmarks"
IDS_PROGRAMS "Programme"
@@ -370,6 +371,7 @@ BEGIN
IDS_EMPTY "(Empty)"
IDS_RECENT "Aktuelle Dokumente"
IDS_ADMIN "Verwaltung"
IDS_SEARCH "Suche"
END
STRINGTABLE DISCARDABLE
@@ -381,7 +383,7 @@ BEGIN
IDS_SETTINGS_MENU "Einstellungen-Menu"
IDS_CONTROL_PANEL "Systemsteuerung"
IDS_PRINTERS "Drucker"
IDS_BROWSE "Dateien..."
IDS_BROWSE "Dateien"
IDS_SEARCH_PRG "Suche Programm..."
IDS_ALL_USERS "Alle Benutzer\\"
END
@@ -610,7 +612,7 @@ BEGIN
IDS_SHUTDOWN "Turn Off..."
IDS_LAUNCH "Run..."
IDS_START_HELP "Help"
IDS_SEARCH "Search..."
IDS_SEARCH_FILES "Search..."
IDS_DOCUMENTS "Documents"
IDS_FAVORITES "Favorites"
IDS_PROGRAMS "Programs"
@@ -619,6 +621,7 @@ BEGIN
IDS_EMPTY "(Empty)"
IDS_RECENT "Recent Documents"
IDS_ADMIN "Administration"
IDS_SEARCH "Search"
END
STRINGTABLE DISCARDABLE
@@ -630,7 +633,7 @@ BEGIN
IDS_SETTINGS_MENU "Settings Menu"
IDS_CONTROL_PANEL "Control Panel"
IDS_PRINTERS "Printers"
IDS_BROWSE "Browse Files..."
IDS_BROWSE "Browse Files"
IDS_SEARCH_PRG "Search Programm..."
IDS_ALL_USERS "All Users\\"
END
@@ -717,7 +720,7 @@ BEGIN
IDS_SHUTDOWN "Arrêter..."
IDS_LAUNCH "Exécuter..."
IDS_START_HELP "Aide"
IDS_SEARCH "Rechercher..."
IDS_SEARCH_FILES "Rechercher Files..."
IDS_DOCUMENTS "Documents"
IDS_FAVORITES "Favoris"
IDS_PROGRAMS "Programmes"
@@ -726,6 +729,7 @@ BEGIN
IDS_EMPTY "(Vide)"
IDS_RECENT "Documents récents"
IDS_ADMIN "Administration"
IDS_SEARCH "Rechercher"
END
STRINGTABLE DISCARDABLE
@@ -737,7 +741,7 @@ BEGIN
IDS_SETTINGS_MENU "Barre des tâches et menu démarrer"
IDS_CONTROL_PANEL "Panneau de configuration"
IDS_PRINTERS "Imprimantes"
IDS_BROWSE "Parcourir..."
IDS_BROWSE "Parcourir"
IDS_SEARCH_PRG "Recherche Programme..."
IDS_ALL_USERS "Tous les utilisateurs\\"
END
@@ -41,7 +41,7 @@
#define IDC_SHUTDOWN 0x1002
#define IDC_LAUNCH 0x1003
#define IDC_START_HELP 0x1004
#define IDC_SEARCH 0x1005
#define IDC_SEARCH_FILES 0x1005
#define IDC_SEARCH_COMPUTER 0x1006
#define IDC_SETTINGS 0x1007
#define IDC_ADMIN 0x1008
@@ -58,6 +58,7 @@
#define IDC_PRINTERS 0x1013
#define IDC_BROWSE 0x1014
#define IDC_SEARCH_PROGRAM 0x1015
#define IDC_SEARCH 0x1016
#define IDC_FIRST_MENU 0x3000
@@ -794,8 +794,6 @@ LRESULT StartMenuRoot::Init(LPCREATESTRUCT pcs)
// insert hard coded start entries
AddButton(ResString(IDS_PROGRAMS), 0, true, IDC_PROGRAMS);
AddButton(ResString(IDS_SEARCH_PRG), 0, false, IDC_SEARCH_PROGRAM);
AddButton(ResString(IDS_DOCUMENTS), 0, true, IDC_DOCUMENTS);
#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003)
@@ -816,12 +814,7 @@ LRESULT StartMenuRoot::Init(LPCREATESTRUCT pcs)
#else
if (IS_VALUE_ZERO(hkey, _T("NoFind")))
#endif
AddButton(ResString(IDS_SEARCH), 0, false, IDC_SEARCH);
#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003)
if (!g_Globals._SHRestricted || !SHRestricted(REST_HASFINDCOMPUTERS))
#endif
AddButton(ResString(IDS_SEARCH_COMPUTER),0,false, IDC_SEARCH_COMPUTER);
AddButton(ResString(IDS_SEARCH), 0, true, IDC_SEARCH);
AddButton(ResString(IDS_START_HELP), 0, false, IDC_START_HELP);
@@ -919,11 +912,6 @@ int StartMenuRoot::Command(int id, int code)
CreateSubmenu(id, CSIDL_COMMON_PROGRAMS, CSIDL_PROGRAMS, ResString(IDS_PROGRAMS));
break;
case IDC_SEARCH_PROGRAM:
CloseStartMenu(id);
Dialog::DoModal(IDD_SEARCH_PROGRAM, WINDOW_CREATOR(FindProgramDlg));
break;
case IDC_EXPLORE:
CloseStartMenu(id);
explorer_show_frame(_hwnd, SW_SHOWNORMAL);
@@ -956,11 +944,7 @@ int StartMenuRoot::Command(int id, int code)
break;
case IDC_SEARCH:
ShowSearchDialog();
break;
case IDC_SEARCH_COMPUTER:
ShowSearchComputer();
CreateSubmenu(id, ResString(IDS_SEARCH), STARTMENU_CREATOR(SearchMenu));
break;
case IDC_LOGOFF:
@@ -1025,22 +1009,6 @@ void StartMenuRoot::ShowRestartDialog(HWND hwndOwner, UINT flags)
(*RestartDlg)(hwndOwner, (LPWSTR)L"You selected <Log Off>.\n\n", flags); ///@todo ANSI string conversion if needed
}
void StartMenuRoot::ShowSearchDialog()
{
static DynamicFct<SHFINDFILES> SHFindFiles(TEXT("SHELL32"), 90);
if (SHFindFiles)
(*SHFindFiles)(NULL, NULL);
}
void StartMenuRoot::ShowSearchComputer()
{
static DynamicFct<SHFINDCOMPUTER> SHFindComputer(TEXT("SHELL32"), 91);
if (SHFindComputer)
(*SHFindComputer)(NULL, NULL);
}
void SettingsMenu::AddEntries()
{
@@ -1125,6 +1093,60 @@ int BrowseMenu::Command(int id, int code)
}
void SearchMenu::AddEntries()
{
super::AddEntries();
AddButton(ResString(IDS_SEARCH_PRG), 0, false, IDC_SEARCH_PROGRAM);
AddButton(ResString(IDS_SEARCH_FILES), 0, false, IDC_SEARCH_FILES);
#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003)
if (!g_Globals._SHRestricted || !SHRestricted(REST_HASFINDCOMPUTERS))
#endif
AddButton(ResString(IDS_SEARCH_COMPUTER), 0, false, IDC_SEARCH_COMPUTER);
}
int SearchMenu::Command(int id, int code)
{
switch(id) {
case IDC_SEARCH_PROGRAM:
CloseStartMenu(id);
Dialog::DoModal(IDD_SEARCH_PROGRAM, WINDOW_CREATOR(FindProgramDlg));
break;
case IDC_SEARCH_FILES:
ShowSearchDialog();
break;
case IDC_SEARCH_COMPUTER:
ShowSearchComputer();
break;
default:
return super::Command(id, code);
}
return 0;
}
void SearchMenu::ShowSearchDialog()
{
static DynamicFct<SHFINDFILES> SHFindFiles(TEXT("SHELL32"), 90);
if (SHFindFiles)
(*SHFindFiles)(NULL, NULL);
}
void SearchMenu::ShowSearchComputer()
{
static DynamicFct<SHFINDCOMPUTER> SHFindComputer(TEXT("SHELL32"), 91);
if (SHFindComputer)
(*SHFindComputer)(NULL, NULL);
}
RecentStartMenu::RecentStartMenu(HWND hwnd, const StartMenuCreateInfo& create_info)
: super(hwnd, create_info)
{
@@ -248,8 +248,6 @@ protected:
static void ShowLaunchDialog(HWND hwndDesktopBar);
static void ShowExitWindowsDialog(HWND hwndOwner);
static void ShowRestartDialog(HWND hwndOwner, UINT flags);
static void ShowSearchDialog();
static void ShowSearchComputer();
};
@@ -289,6 +287,27 @@ protected:
};
/// Search sub-startmenu
struct SearchMenu : public StartMenu
{
typedef StartMenu super;
SearchMenu(HWND hwnd, const StartMenuCreateInfo& create_info)
: super(hwnd, create_info)
{
}
void TrackStartmenu();
protected:
void AddEntries();
int Command(int id, int code);
static void ShowSearchDialog();
static void ShowSearchComputer();
};
/// "Recent Files" sub-start menu
struct RecentStartMenu : public StartMenu
{