integrate optional SDI mode into main explorer branch

svn path=/trunk/; revision=9574
This commit is contained in:
Martin Fuchs 2004-05-31 22:39:12 +00:00
parent 48da820991
commit dc4726b0da
14 changed files with 1749 additions and 862 deletions

View file

@ -481,9 +481,9 @@ LRESULT DesktopWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
HRESULT DesktopWindow::OnDefaultCommand(LPIDA pida)
{
if (MainFrame::OpenShellFolders(pida, 0))
/*@@ if (SDIMainFrame::OpenShellFolders(pida, 0))
return S_OK;
*/
return E_NOTIMPL;
}

View file

@ -1,17 +1,4 @@
// =Memo for future Japanese maintainer=
// For future ease of maintenance, I marked "FIXME?" on strings I suspect I have
// mistranslated or I haven't translated(especially, "IDM_WINEFILE" have many
// suspected strings because I haven't tested under WINE). Others are set as is in
// purpose. BTW, I feel it strange that the word;"directory" turns into "folder" for
// Japanese Windows(..or English Windows also use "folder" instead of "directory"? I
// have no idea). I obeyed as the MS do. Also, there might be some menus which have
// different shortcut keys between EN-Win and JA-Win but I dunno which ones are =D
// Despite I'm not sure that we can use "MS UI Gothic" under ROS, I changed "MS Sans
// Serif" to "MS UI Gothic" because it's lear that MS Sans Serif doesn't suit for
// the Japanese(most of you know this, I suppose).
// - M.T
//Microsoft Developer Studio generated resource script.
// Microsoft Visual C++ generated resource script.
//
#include "explorer_intres.h"
@ -26,7 +13,7 @@
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Japanese resources
// Japanisch resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN)
#ifdef _WIN32
@ -39,7 +26,7 @@ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
// Menu
//
IDM_MAINFRAME MENU PRELOAD DISCARDABLE
IDM_MDIFRAME MENU
BEGIN
POPUP "ファイル(&F)"
BEGIN
@ -49,6 +36,7 @@ BEGIN
BEGIN
MENUITEM "ツールバー(&T)", ID_VIEW_TOOL_BAR
MENUITEM "ステータスバー(&S)", ID_VIEW_STATUSBAR
MENUITEM "最新の情報に更新(&R)\tF5", ID_REFRESH
END
POPUP "ウィンドウ(&W)"
BEGIN
@ -58,7 +46,6 @@ BEGIN
MENUITEM "垂直に整列(&V)\tShift+F4", ID_WINDOW_TILE_VERT
MENUITEM "自動整列", ID_WINDOW_AUTOSORT
MENUITEM "最小化された子ウィンドウを整列(&S)", ID_WINDOW_ARRANGE
MENUITEM "<22>Å<EFBFBD>VÌ<E2809A>î•ñÉ<E2809A>X<EFBFBD>V(&R)\tF5", ID_REFRESH
END
POPUP "ヘルプ(&H)"
BEGIN
@ -68,7 +55,7 @@ BEGIN
END
END
IDM_WINEFILE MENU FIXED IMPURE
IDM_WINEFILE MENU
BEGIN
POPUP "ファイル(&F)"
BEGIN
@ -178,7 +165,7 @@ BEGIN
END
END
IDM_DESKTOPBAR MENU DISCARDABLE
IDM_DESKTOPBAR MENU
BEGIN
POPUP ""
BEGIN
@ -189,14 +176,34 @@ BEGIN
END
END
IDM_SDIFRAME MENU
BEGIN
POPUP "ファイル(&F)"
BEGIN
MENUITEM "終了(&X)", ID_FILE_EXIT
END
POPUP "表\示(&V)"
BEGIN
MENUITEM "ツールバー(&T)", ID_VIEW_TOOL_BAR
MENUITEM "ステータスバー(&S)", ID_VIEW_STATUSBAR
MENUITEM "最新の情報に更新(&R)\tF5", ID_REFRESH
END
POPUP "ヘルプ(&H)"
BEGIN
MENUITEM "Explorer &FAQ...", ID_EXPLORER_FAQ
MENUITEM "&About Explorer...", ID_ABOUT_EXPLORER
MENUITEM "About &OS...", ID_ABOUT_WINDOWS
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_EXECUTE DIALOG FIXED IMPURE 15, 13, 210, 63
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
IDD_EXECUTE DIALOG 15, 13, 210, 63
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Execute"
FONT 8, "MS UI Gothic"
BEGIN
@ -212,8 +219,8 @@ BEGIN
END
IDD_SEARCH_PROGRAM DIALOGEX 0, 0, 144, 65
STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU | WS_THICKFRAME
STYLE DS_SETFONT | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE |
WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
EXSTYLE WS_EX_APPWINDOW
CAPTION "スタートメニューからプログラムを検索"
FONT 9, "MS UI Gothic", 0, 0, 0x1
@ -225,8 +232,8 @@ BEGIN
WS_TABSTOP,7,25,130,33
END
IDD_DESKBAR_DESKTOP DIALOG DISCARDABLE 0, 0, 212, 172
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
IDD_DESKBAR_DESKTOP DIALOG 0, 0, 212, 172
STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "デスクトップのプロパティ"
FONT 9, "MS UI Gothic"
BEGIN
@ -258,15 +265,15 @@ BEGIN
WS_TABSTOP,159,121,46,44
END
IDD_DESKBAR_TASKBAR DIALOG DISCARDABLE 0, 0, 210, 154
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
IDD_DESKBAR_TASKBAR DIALOG 0, 0, 210, 154
STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "タスクバーのプロパティ"
FONT 9, "MS UI Gothic"
BEGIN
END
IDD_DESKBAR_STARTMENU DIALOG DISCARDABLE 0, 0, 210, 154
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
IDD_DESKBAR_STARTMENU DIALOG 0, 0, 210, 154
STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "スタートメニューのプロパティ"
FONT 9, "MS UI Gothic"
BEGIN
@ -278,7 +285,7 @@ END
// String Table
//
STRINGTABLE DISCARDABLE
STRINGTABLE
BEGIN
IDS_TITLE "ReactOS Explorer"
IDS_START "スタート"
@ -297,7 +304,7 @@ BEGIN
IDS_ADMIN "管理ツール"
END
STRINGTABLE DISCARDABLE
STRINGTABLE
BEGIN
IDS_NETWORK "ネットワーク"
IDS_CONNECTIONS "ネットワーク接続"
@ -318,18 +325,18 @@ BEGIN
IDS_TASKBAR "タスクバー"
END
STRINGTABLE DISCARDABLE
STRINGTABLE
BEGIN
IDS_STARTMENU "スタートメニュー"
IDS_MINIMIZE_ALL "全ウィンドウを最小化"
END
#endif // Japanese resources
#endif // Japanisch resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// German (Germany) resources
// Deutsch (Deutschland) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
#ifdef _WIN32
@ -343,18 +350,18 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
1 TEXTINCLUDE
BEGIN
"explorer_intres.h\0"
END
2 TEXTINCLUDE DISCARDABLE
2 TEXTINCLUDE
BEGIN
"#include <windows.h>\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
@ -362,7 +369,7 @@ END
#endif // APSTUDIO_INVOKED
#endif // German (Germany) resources
#endif // Deutsch (Deutschland) resources
/////////////////////////////////////////////////////////////////////////////
@ -376,3 +383,4 @@ END
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View file

@ -535,31 +535,7 @@ void explorer_show_frame(int cmdshow, LPTSTR lpCmdLine)
g_Globals._prescan_nodes = false;
// create main window
HWND hMainFrame = MainFrame::Create();
if (hMainFrame) {
g_Globals._hMainWnd = hMainFrame;
ShowWindow(hMainFrame, cmdshow);
UpdateWindow(hMainFrame);
bool valid_dir = false;
if (lpCmdLine) {
DWORD attribs = GetFileAttributes(lpCmdLine);
if (attribs!=INVALID_FILE_ATTRIBUTES && (attribs&FILE_ATTRIBUTE_DIRECTORY))
valid_dir = true;
else if (*lpCmdLine==':' || *lpCmdLine=='"')
valid_dir = true;
}
// Open the first child window after initializing the application
if (valid_dir)
PostMessage(hMainFrame, PM_OPEN_WINDOW, 0, (LPARAM)lpCmdLine);
else
PostMessage(hMainFrame, PM_OPEN_WINDOW, OWM_EXPLORE|OWM_DETAILS, 0);
}
MainFrameBase::Create(lpCmdLine, true, cmdshow);
}

View file

@ -65,7 +65,7 @@
#define CLASSNAME_WINEFILETREE TEXT("WFS_Tree")
#include "shell/mainframe.h"
#include "shell/pane.h"
#include "shell/filechild.h"
#include "shell/shellbrowser.h"
#include "shell/mainframe.h"

View file

@ -56,9 +56,10 @@
#define IDB_IMAGES 107
#define IDD_EXECUTE 108
#define IDR_MAINFRAME 109
#define IDM_MAINFRAME 110
#define IDM_MDIFRAME 110
#define ID_EXECUTE 111
#define IDM_WINEFILE 112
#define IDM_SDIFRAME 113
#define IDI_LOGOFF 124
#define IDI_FOLDERARROW 125
#define IDI_ARROW 125
@ -164,11 +165,11 @@
#define ID_ABOUT_WINDOWS 40002
#define ID_ABOUT_EXPLORER 40003
#define ID_DESKTOPBAR_SETTINGS 40004
#define ID_GO_BACK 40005
#define ID_GO_FORWARD 40006
#define ID_GO_HOME 40007
#define ID_GO_SEARCH 40008
#define ID_GO_UP 40009
#define ID_GO_BACK 40005
#define ID_GO_FORWARD 40006
#define ID_GO_HOME 40007
#define ID_GO_SEARCH 40008
#define ID_GO_UP 40009
#define ID_STOP 40010
#define ID_MINIMIZE_ALL 40011
#define ID_EXPLORE 40012
@ -178,6 +179,8 @@
#define ID_SHOW_HIDDEN_ICONS 40016
#define ID_CONFIG_NOTIFYAREA 40017
#define ID_CONFIG_TIME 40018
#define ID_VIEW_MDI 40019
#define ID_VIEW_SDI 40020
#define ID_SWITCH_DESKTOP_1 50000
#define ID_WINDOW_NEW 0xE130
#define ID_WINDOW_ARRANGE 0xE131
@ -196,7 +199,7 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 166
#define _APS_NEXT_COMMAND_VALUE 40019
#define _APS_NEXT_COMMAND_VALUE 40021
#define _APS_NEXT_CONTROL_VALUE 1029
#define _APS_NEXT_SYMED_VALUE 101
#endif

View file

@ -37,7 +37,7 @@ BEGIN
END
END
IDM_MAINFRAME MENU PRELOAD DISCARDABLE
IDM_MDIFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "Îļþ(&F)"
BEGIN
@ -51,7 +51,9 @@ BEGIN
MENUITEM "²à±ßÀ¸(&S)", ID_VIEW_SIDE_BAR
MENUITEM "״̬À¸(&S)", ID_VIEW_STATUSBAR
MENUITEM SEPARATOR
MENUITEM "刷新(&R)\tF5", ID_REFRESH
MENUITEM "È«ÆÁ(&U)\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
MENUITEM "&SDI", ID_VIEW_SDI
END
POPUP "´°¿Ú(&W)"
BEGIN
@ -61,7 +63,30 @@ BEGIN
MENUITEM "×ÝÏòƽÆÌ(&V)\tShift+F4", ID_WINDOW_TILE_VERT
MENUITEM "×Ô¶¯ÅÅÁÐ(&A)", ID_WINDOW_AUTOSORT
MENUITEM "È«²¿×îС»¯(&S)", ID_WINDOW_ARRANGE
END
POPUP "帮助(&H)"
BEGIN
MENUITEM "浏览器帮助文档(&F)...", ID_EXPLORER_FAQ
MENUITEM "关于浏览器(&A)...", ID_ABOUT_EXPLORER
MENUITEM "关于操作系统(&O)...", ID_ABOUT_WINDOWS
END
END
IDM_SDIFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "文件(&F)"
BEGIN
MENUITEM "退出(&X)", ID_FILE_EXIT
END
POPUP "查看(&V)"
BEGIN
MENUITEM "工具栏(&T)", ID_VIEW_TOOL_BAR
MENUITEM "侧边栏(&S)", ID_VIEW_SIDE_BAR
MENUITEM "状态栏(&S)", ID_VIEW_STATUSBAR
MENUITEM SEPARATOR
MENUITEM "Ë¢ÐÂ(&R)\tF5", ID_REFRESH
MENUITEM "全屏(&U)\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
MENUITEM "&MDI", ID_VIEW_MDI
END
POPUP "°ïÖú(&H)"
BEGIN
@ -311,7 +336,7 @@ STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU | WS_THICKFRAME
EXSTYLE WS_EX_APPWINDOW
CAPTION "ÔÚ¿ªÊ¼²Ëµ¥ËÑË÷³ÌÐò"
FONT 8, "MS Sans Serif"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
LTEXT "&Filter:",IDC_STATIC,7,9,18,8
EDITTEXT IDC_FILTER,34,7,100,14,ES_AUTOHSCROLL
@ -417,7 +442,7 @@ LANGUAGE LANG_ROMANIAN, SUBLANG_DEFAULT
// Menu
//
IDM_MAINFRAME MENU PRELOAD DISCARDABLE
IDM_MDIFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&Fiºier"
BEGIN
@ -431,7 +456,9 @@ BEGIN
MENUITEM "&Bara de stare", ID_VIEW_STATUSBAR
MENUITEM "&Side Bar", ID_VIEW_SIDE_BAR
MENUITEM SEPARATOR
MENUITEM "&Resetare\tF5", ID_REFRESH
MENUITEM "F&ull Screen\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
MENUITEM "&SDI", ID_VIEW_SDI
END
POPUP "&Fereastrã"
BEGIN
@ -441,7 +468,30 @@ BEGIN
MENUITEM "Aliniazã &Vertical\tShift+F4", ID_WINDOW_TILE_VERT
MENUITEM "Aranjeazã automat", ID_WINDOW_AUTOSORT
MENUITEM "Aranjeazã &Simbolurile", ID_WINDOW_ARRANGE
END
POPUP "&Ajutor"
BEGIN
MENUITEM "Explorer &FAQ...", ID_EXPLORER_FAQ
MENUITEM "&Despre Explorer...", ID_ABOUT_EXPLORER
MENUITEM "Despre &OS...", ID_ABOUT_WINDOWS
END
END
IDM_SDIFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&Fi篿er"
BEGIN
MENUITEM "&Ie篿re", ID_FILE_EXIT
END
POPUP "&Prezentare"
BEGIN
MENUITEM "&Bara cu instrumente", ID_VIEW_TOOL_BAR
MENUITEM "&Bara de stare", ID_VIEW_STATUSBAR
MENUITEM "&Side Bar", ID_VIEW_SIDE_BAR
MENUITEM SEPARATOR
MENUITEM "&Resetare\tF5", ID_REFRESH
MENUITEM "F&ull Screen\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
MENUITEM "&MDI", ID_VIEW_MDI
END
POPUP "&Ajutor"
BEGIN
@ -708,7 +758,7 @@ BEGIN
END
END
IDM_MAINFRAME MENU PRELOAD DISCARDABLE
IDM_MDIFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&Datei"
BEGIN
@ -719,10 +769,12 @@ BEGIN
MENUITEM "&Toolbar", ID_VIEW_TOOL_BAR
MENUITEM "&Extra Bar", ID_VIEW_EXTRA_BAR
MENUITEM "Lauf&werkleiste", ID_VIEW_DRIVE_BAR, CHECKED
MENUITEM "&Side Bar", ID_VIEW_SIDE_BAR
MENUITEM "S&ide Bar", ID_VIEW_SIDE_BAR
MENUITEM "&Status Bar", ID_VIEW_STATUSBAR
MENUITEM SEPARATOR
MENUITEM "&Aktualisieren\tF5", ID_REFRESH
MENUITEM "&Vollbild\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
MENUITEM "&SDI", ID_VIEW_SDI
END
POPUP "&Fenster"
BEGIN
@ -732,9 +784,32 @@ BEGIN
MENUITEM "&Nebeneinander\tUmschalt+F4", ID_WINDOW_TILE_VERT
MENUITEM "au&tomatisch anordnen", ID_WINDOW_AUTOSORT
MENUITEM "&Symbole anordnen", ID_WINDOW_ARRANGE
MENUITEM "&Aktualisieren\tF5", ID_REFRESH
END
POPUP "&Help"
POPUP "&Hilfe"
BEGIN
MENUITEM "Explorer &FAQ...", ID_EXPLORER_FAQ
MENUITEM "&About Explorer...", ID_ABOUT_EXPLORER
MENUITEM "About &OS...", ID_ABOUT_WINDOWS
END
END
IDM_SDIFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&Datei"
BEGIN
MENUITEM "&Beenden", ID_FILE_EXIT
END
POPUP "&Ansicht"
BEGIN
MENUITEM "&Toolbar", ID_VIEW_TOOL_BAR
MENUITEM "S&ide Bar", ID_VIEW_SIDE_BAR
MENUITEM "&Status Bar", ID_VIEW_STATUSBAR
MENUITEM SEPARATOR
MENUITEM "&Aktualisieren\tF5", ID_REFRESH
MENUITEM "&Vollbild\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
MENUITEM "&MDI", ID_VIEW_MDI
END
POPUP "&Hilfe"
BEGIN
MENUITEM "Explorer &FAQ...", ID_EXPLORER_FAQ
MENUITEM "&About Explorer...", ID_ABOUT_EXPLORER
@ -778,6 +853,25 @@ BEGIN
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_ABOUT_EXPLORER, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 189
TOPMARGIN, 7
BOTTOMMARGIN, 102
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
@ -854,25 +948,6 @@ IDI_DOT ICON DISCARDABLE "res/dot.ico"
IDI_DOT_TRANS ICON DISCARDABLE "res/dot_trans.ico"
IDI_DOT_RED ICON DISCARDABLE "res/dot_red.ico"
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_ABOUT_EXPLORER, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 189
TOPMARGIN, 7
BOTTOMMARGIN, 102
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
@ -951,7 +1026,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
// Menu
//
IDM_MAINFRAME MENU PRELOAD DISCARDABLE
IDM_MDIFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
@ -965,7 +1040,9 @@ BEGIN
MENUITEM "&Side Bar", ID_VIEW_SIDE_BAR
MENUITEM "&Status Bar", ID_VIEW_STATUSBAR
MENUITEM SEPARATOR
MENUITEM "&Refresh\tF5", ID_REFRESH
MENUITEM "F&ull Screen\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
MENUITEM "&SDI", ID_VIEW_SDI
END
POPUP "&Window"
BEGIN
@ -975,7 +1052,30 @@ BEGIN
MENUITEM "Tile &Vertically\tShift+F4", ID_WINDOW_TILE_VERT
MENUITEM "Arrange Automatically", ID_WINDOW_AUTOSORT
MENUITEM "Arrange &Symbols", ID_WINDOW_ARRANGE
END
POPUP "&Help"
BEGIN
MENUITEM "Explorer &FAQ...", ID_EXPLORER_FAQ
MENUITEM "&About Explorer...", ID_ABOUT_EXPLORER
MENUITEM "About &OS...", ID_ABOUT_WINDOWS
END
END
IDM_SDIFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "E&xit", ID_FILE_EXIT
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_VIEW_TOOL_BAR
MENUITEM "&Side Bar", ID_VIEW_SIDE_BAR
MENUITEM "&Status Bar", ID_VIEW_STATUSBAR
MENUITEM SEPARATOR
MENUITEM "&Refresh\tF5", ID_REFRESH
MENUITEM "F&ull Screen\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
MENUITEM "&MDI", ID_VIEW_MDI
END
POPUP "&Help"
BEGIN
@ -1378,7 +1478,7 @@ LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
// Menu
//
IDM_MAINFRAME MENU PRELOAD DISCARDABLE
IDM_MDIFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&Fichier"
BEGIN
@ -1392,7 +1492,9 @@ BEGIN
MENUITEM "&Side Bar", ID_VIEW_SIDE_BAR
MENUITEM "Barre d'&état", ID_VIEW_STATUSBAR
MENUITEM SEPARATOR
MENUITEM "&Refresh\tF5", ID_REFRESH
MENUITEM "F&ull Screen\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
MENUITEM "&SDI", ID_VIEW_SDI
END
POPUP "&Window"
BEGIN
@ -1402,7 +1504,30 @@ BEGIN
MENUITEM "Tile &Vertically\tShift+F4", ID_WINDOW_TILE_VERT
MENUITEM "Arrange Automatically", ID_WINDOW_AUTOSORT
MENUITEM "Arrange &Symbols", ID_WINDOW_ARRANGE
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
IDM_SDIFRAME 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 "&Side Bar", ID_VIEW_SIDE_BAR
MENUITEM "Barre d'&閠at", ID_VIEW_STATUSBAR
MENUITEM SEPARATOR
MENUITEM "&Refresh\tF5", ID_REFRESH
MENUITEM "F&ull Screen\tCtrl+Shift+S", ID_VIEW_FULLSCREEN
MENUITEM "&MDI", ID_VIEW_MDI
END
POPUP "A&ide"
BEGIN

View file

@ -40,7 +40,7 @@ struct FileChildWndInfo : public ChildWndInfo
int _open_mode; //OPEN_WINDOW_MODE
};
/// information structure for creation of ShellBrowserChild
/// information structure for creation of MDIShellBrowserChild
struct ShellChildWndInfo : public FileChildWndInfo
{
typedef FileChildWndInfo super;

File diff suppressed because it is too large Load diff

View file

@ -30,13 +30,65 @@
enum OPEN_WINDOW_MODE {OWM_EXPLORE=1, OWM_DETAILS=2, OWM_PIDL=4};
/// Explorer frame window
struct MainFrame : public PreTranslateWindow
/// Explorer frame window base class
struct MainFrameBase : public PreTranslateWindow
{
typedef PreTranslateWindow super;
MainFrame(HWND hwnd);
~MainFrame();
MainFrameBase(HWND hwnd);
~MainFrameBase();
static HWND Create(LPCTSTR path, bool mdi=true, UINT cmdshow=SW_SHOWNORMAL);
WindowHandle _hwndrebar;
WindowHandle _htoolbar;
WindowHandle _hstatusbar;
WindowHandle _haddressedit;
WindowHandle _hcommandedit;
WindowHandle _hsidebar;
HIMAGELIST _himl;
HMENU _hMenuFrame;
HMENU _hMenuWindow;
MenuInfo _menu_info;
protected:
FullScreenParameters _fullscreen;
HACCEL _hAccel;
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
bool ProcessMessage(UINT nmsg, WPARAM wparam, LPARAM lparam, LRESULT* pres);
int Command(int id, int code);
int Notify(int id, NMHDR* pnmh);
virtual BOOL TranslateMsg(MSG* pmsg);
void toggle_child(HWND hwnd, UINT cmd, HWND hchild, int band_idx=-1);
void resize_frame_client();
virtual void resize_frame(int cx, int cy);
virtual void frame_get_clientspace(PRECT prect);
BOOL toggle_fullscreen();
void fullscreen_move();
void FillBookmarks();
virtual bool go_to(LPCTSTR url, bool new_window);
};
#ifndef _NO_MDI
struct MDIMainFrame : public MainFrameBase
{
typedef MainFrameBase super;
MDIMainFrame(HWND hwnd);
static HWND Create();
static HWND Create(LPCTSTR path, int mode=OWM_EXPLORE|OWM_DETAILS);
@ -47,47 +99,68 @@ struct MainFrame : public PreTranslateWindow
ChildWindow* CreateChild(LPCITEMIDLIST pidl, int mode=OWM_EXPLORE|OWM_DETAILS|OWM_PIDL);
protected:
FullScreenParameters _fullscreen;
#ifndef _NO_MDI
HWND _hmdiclient;
#endif
WindowHandle _hstatusbar;
WindowHandle _hwndrebar;
WindowHandle _htoolbar;
WindowHandle _hextrabar;
WindowHandle _hdrivebar;
WindowHandle _haddressedit;
WindowHandle _hcommandedit;
WindowHandle _hsidebar;
HIMAGELIST _himl;
HMENU _hMenuFrame;
HMENU _hMenuWindow;
MenuInfo _menu_info;
protected:
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
int Command(int id, int code);
int Notify(int id, NMHDR* pnmh);
void toggle_child(HWND hwnd, UINT cmd, HWND hchild, int band_idx=-1);
virtual BOOL TranslateMsg(MSG* pmsg);
bool activate_drive_window(LPCTSTR path);
bool activate_child_window(LPCTSTR filesys);
void resize_frame_rect(PRECT prect);
void resize_frame(int cx, int cy);
void resize_frame_client();
void frame_get_clientspace(PRECT prect);
BOOL toggle_fullscreen();
void fullscreen_move();
virtual void resize_frame(int cx, int cy);
virtual void frame_get_clientspace(PRECT prect);
void FillBookmarks();
bool go_to(LPCTSTR url, bool new_window);
virtual bool go_to(LPCTSTR url, bool new_window);
HACCEL _hAccel;
TCHAR _drives[BUFFER_LEN];
};
#endif
struct SDIMainFrame : public ShellBrowserChildT<MainFrameBase>
{
typedef ShellBrowserChildT<MainFrameBase> super;
SDIMainFrame(HWND hwnd);
static HWND Create();
protected:
ShellPathInfo _shellpath_info;
WindowHandle _left_hwnd;
WindowHandle _right_hwnd;
/**@todo focus handling for TAB switching
int _focus_pane; // 0: left 1: right
*/
int _split_pos;
int _last_split;
RECT _clnt_rect;
String _url;
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
int Command(int id, int code);
void resize_frame(int cx, int cy);
void resize_children();
void update_clnt_rect();
void update_shell_browser();
void jump_to(LPCTSTR path, int mode);
void jump_to(LPCITEMIDLIST path, int mode);
// interface BrowserCallback
virtual void entry_selected(Entry* entry);
void set_url(LPCTSTR url);
};

View file

@ -980,9 +980,9 @@ BOOL Pane::command(UINT cmd)
return TRUE;
}
MainFrame* Pane::get_frame()
MainFrameBase* Pane::get_frame()
{
HWND owner = GetParent(_hwnd);
return (MainFrame*)owner;
return (MainFrameBase*)owner;
}

View file

@ -101,7 +101,7 @@ protected:
void calc_width(LPDRAWITEMSTRUCT dis, int col, LPCTSTR str);
void calc_tabbed_width(LPDRAWITEMSTRUCT dis, int col, LPCTSTR str);
MainFrame* get_frame();
struct MainFrameBase* get_frame();
protected:
HIMAGELIST _himl;

View file

@ -31,21 +31,22 @@
#include "../explorer_intres.h"
ShellBrowserChild::ShellBrowserChild(HWND hwnd, const ShellChildWndInfo& info)
: super(hwnd, info),
_create_info(info)
ShellBrowser::ShellBrowser(HWND hwnd, HWND left_hwnd, WindowHandle& right_hwnd, ShellPathInfo& create_info, HIMAGELIST himl, BrowserCallback* cb)
: _hwnd(hwnd),
_left_hwnd(left_hwnd),
_right_hwnd(right_hwnd),
_create_info(create_info),
_himl(himl),
_callback(cb)
{
_pShellView = NULL;
_pDropTarget = NULL;
_himlSmall = 0;
_last_sel = 0;
// store path into history
if (info._path && *info._path)
_url_history.push(info._path);
_cur_dir = NULL;
}
ShellBrowserChild::~ShellBrowserChild()
ShellBrowser::~ShellBrowser()
{
if (_pShellView)
_pShellView->Release();
@ -54,73 +55,87 @@ ShellBrowserChild::~ShellBrowserChild()
_pDropTarget->Release();
_pDropTarget = NULL;
}
if (_right_hwnd) {
DestroyWindow(_right_hwnd);
_right_hwnd = 0;
}
}
LRESULT ShellBrowserChild::Init(LPCREATESTRUCT pcs)
LRESULT ShellBrowser::Init(HWND hWndFrame)
{
CONTEXT("ShellBrowserChild::Init()");
if (super::Init(pcs))
return 1;
_hWndFrame = GetParent(pcs->hwndParent);
ClientRect rect(_hwnd);
SHFILEINFO sfi;
_himlSmall = (HIMAGELIST)SHGetFileInfo(TEXT("C:\\"), 0, &sfi, sizeof(SHFILEINFO), SHGFI_SYSICONINDEX|SHGFI_SMALLICON);
// _himlLarge = (HIMAGELIST)SHGetFileInfo(TEXT("C:\\"), 0, &sfi, sizeof(SHFILEINFO), SHGFI_SYSICONINDEX|SHGFI_LARGEICON);
CONTEXT("ShellBrowser::Init()");
_hWndFrame = hWndFrame;
const String& root_name = GetDesktopFolder().get_name(_create_info._root_shell_path, SHGDN_FORPARSING);
_root._drive_type = DRIVE_UNKNOWN;
_root._sort_order = SORT_NAME;
lstrcpy(_root._volname, root_name); // most of the time "Desktop"
_root._fs_flags = 0;
lstrcpy(_root._fs, TEXT("Desktop"));
//@@ _root._entry->read_tree(shell_info._root_shell_path.get_folder(), info._shell_path, _root._sort_order/*_sortOrder*/);
/*@todo
we should call read_tree() here to iterate through the hierarchy and open all folders from shell_info._root_shell_path to shell_info._shell_path
-> see FileChildWindow::FileChildWindow()
*/
_root._entry = new ShellDirectory(GetDesktopFolder(), _create_info._root_shell_path, _hwnd);
_root._entry->read_directory_base(_root._sort_order);
jump_to(_create_info._shell_path);
// -> set_curdir()
_root._entry->read_directory();
/* already filled by ShellDirectory constructor
lstrcpy(_root._entry->_data.cFileName, TEXT("Desktop")); */
// create explorer treeview
if (_create_info._open_mode & OWM_EXPLORE)
_left_hwnd = CreateWindowEx(0, WC_TREEVIEW, NULL,
WS_CHILD|WS_TABSTOP|WS_VISIBLE|WS_CHILD|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS|TVS_SHOWSELALWAYS,//|TVS_NOTOOLTIPS
0, rect.top, _split_pos-SPLIT_WIDTH/2, rect.bottom-rect.top,
_hwnd, (HMENU)IDC_FILETREE, g_Globals._hInstance, 0);
if (_left_hwnd) {
TreeView_SetImageList(_left_hwnd, _himlSmall, TVSIL_NORMAL);
TreeView_SetScrollTime(_left_hwnd, 100);
InitializeTree();
InitDragDrop();
} else
UpdateFolderView(_create_info._shell_path.get_folder());
return 0;
}
void ShellBrowser::jump_to(LPCITEMIDLIST pidl)
{
Entry* entry = NULL;
void ShellBrowserChild::InitializeTree()
//@@
if (!_cur_dir)
_cur_dir = static_cast<ShellDirectory*>(_root._entry);
/*@todo
we should call read_tree() here to iterate through the hierarchy and open all folders from shell_info._root_shell_path to shell_info._shell_path
_root._entry->read_tree(shell_info._root_shell_path.get_folder(), info._shell_path, SORT_NAME);
-> see FileChildWindow::FileChildWindow()
*/
if (_cur_dir) {
static DynamicFct<LPITEMIDLIST(WINAPI*)(LPCITEMIDLIST, LPCITEMIDLIST)> ILFindChild(TEXT("SHELL32"), 24);
LPCITEMIDLIST child_pidl;
if (ILFindChild)
child_pidl = (*ILFindChild)(_cur_dir->create_absolute_pidl(), pidl);
else
child_pidl = pidl; // This is not correct in the common case, but works on the desktop level.
if (child_pidl) {
_cur_dir->smart_scan();
entry = _cur_dir->find_entry(child_pidl);
if (entry)
_callback->entry_selected(entry);
}
}
//@@ work around as long as we don't iterate correctly through the ShellEntry tree
if (!entry)
UpdateFolderView(ShellFolder(pidl));
}
void ShellBrowser::InitializeTree(HIMAGELIST himl)
{
CONTEXT("ShellBrowserChild::InitializeTree()");
TreeView_SetImageList(_left_hwnd, himl, TVSIL_NORMAL);
TreeView_SetScrollTime(_left_hwnd, 100);
TV_INSERTSTRUCT tvInsert;
tvInsert.hParent = 0;
@ -138,10 +153,9 @@ void ShellBrowserChild::InitializeTree()
TreeView_Expand(_left_hwnd, hItem, TVE_EXPAND);
}
bool ShellBrowserChild::InitDragDrop()
bool ShellBrowser::InitDragDrop()
{
CONTEXT("ShellBrowserChild::InitDragDrop()");
CONTEXT("ShellBrowser::InitDragDrop()");
_pDropTarget = new TreeDropTarget(_left_hwnd);
@ -171,9 +185,9 @@ bool ShellBrowserChild::InitDragDrop()
}
void ShellBrowserChild::OnTreeItemRClick(int idCtrl, LPNMHDR pnmh)
void ShellBrowser::OnTreeItemRClick(int idCtrl, LPNMHDR pnmh)
{
CONTEXT("ShellBrowserChild::OnTreeItemRClick()");
CONTEXT("ShellBrowser::OnTreeItemRClick()");
TVHITTESTINFO tvhti;
@ -185,13 +199,13 @@ void ShellBrowserChild::OnTreeItemRClick(int idCtrl, LPNMHDR pnmh)
if (TVHT_ONITEM & tvhti.flags) {
ClientToScreen(_left_hwnd, &tvhti.pt);
Tree_DoItemMenu(_left_hwnd, tvhti.hItem , &tvhti.pt);
Tree_DoItemMenu(_left_hwnd, tvhti.hItem, &tvhti.pt);
}
}
void ShellBrowserChild::Tree_DoItemMenu(HWND hwndTreeView, HTREEITEM hItem, LPPOINT pptScreen)
void ShellBrowser::Tree_DoItemMenu(HWND hwndTreeView, HTREEITEM hItem, LPPOINT pptScreen)
{
CONTEXT("ShellBrowserChild::Tree_DoItemMenu()");
CONTEXT("ShellBrowser::Tree_DoItemMenu()");
LPARAM itemData = TreeView_GetItemData(hwndTreeView, hItem);
@ -214,45 +228,47 @@ void ShellBrowserChild::Tree_DoItemMenu(HWND hwndTreeView, HTREEITEM hItem, LPPO
}
}
void ShellBrowserChild::OnTreeGetDispInfo(int idCtrl, LPNMHDR pnmh)
void ShellBrowser::OnTreeGetDispInfo(int idCtrl, LPNMHDR pnmh)
{
CONTEXT("ShellBrowserChild::OnTreeGetDispInfo()");
CONTEXT("ShellBrowser::OnTreeGetDispInfo()");
LPNMTVDISPINFO lpdi = (LPNMTVDISPINFO)pnmh;
ShellEntry* entry = (ShellEntry*)lpdi->item.lParam;
if (lpdi->item.mask & TVIF_TEXT)
lpdi->item.pszText = entry->_display_name;
if (lpdi->item.mask & (/*TVIF_TEXT|*/TVIF_IMAGE|TVIF_SELECTEDIMAGE)) {
ShellPath pidl_abs = entry->create_absolute_pidl(); // Caching of absolute PIDLs could enhance performance.
LPCITEMIDLIST pidl = pidl_abs;
SHFILEINFO sfi;
/*
if (entry) {
if (lpdi->item.mask & TVIF_TEXT)
if (SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), SHGFI_PIDL|SHGFI_DISPLAYNAME))
lstrcpy(lpdi->item.pszText, sfi.szDisplayName); ///@todo look at cchTextMax if there is enough space available
else
lpdi->item.pszText = entry->_data.cFileName;
*/
if (lpdi->item.mask & TVIF_IMAGE)
if ((HIMAGELIST)SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), SHGFI_PIDL|SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_LINKOVERLAY) == _himlSmall)
lpdi->item.iImage = sfi.iIcon;
else
lpdi->item.iImage = -1;
lpdi->item.pszText = entry->_display_name;
if (lpdi->item.mask & TVIF_SELECTEDIMAGE)
if ((HIMAGELIST)SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), SHGFI_PIDL|SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_OPENICON) == _himlSmall)
lpdi->item.iSelectedImage = sfi.iIcon;
else
lpdi->item.iSelectedImage = -1;
if (lpdi->item.mask & (/*TVIF_TEXT|*/TVIF_IMAGE|TVIF_SELECTEDIMAGE)) {
ShellPath pidl_abs = entry->create_absolute_pidl(); // Caching of absolute PIDLs could enhance performance.
LPCITEMIDLIST pidl = pidl_abs;
SHFILEINFO sfi;
/*
if (lpdi->item.mask & TVIF_TEXT)
if (SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), SHGFI_PIDL|SHGFI_DISPLAYNAME))
lstrcpy(lpdi->item.pszText, sfi.szDisplayName); ///@todo look at cchTextMax if there is enough space available
else
lpdi->item.pszText = entry->_data.cFileName;
*/
if (lpdi->item.mask & TVIF_IMAGE)
if ((HIMAGELIST)SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), SHGFI_PIDL|SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_LINKOVERLAY) == _himl)
lpdi->item.iImage = sfi.iIcon;
else
lpdi->item.iImage = -1;
if (lpdi->item.mask & TVIF_SELECTEDIMAGE)
if ((HIMAGELIST)SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), SHGFI_PIDL|SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_OPENICON) == _himl)
lpdi->item.iSelectedImage = sfi.iIcon;
else
lpdi->item.iSelectedImage = -1;
}
}
}
void ShellBrowserChild::OnTreeItemExpanding(int idCtrl, LPNMTREEVIEW pnmtv)
void ShellBrowser::OnTreeItemExpanding(int idCtrl, LPNMTREEVIEW pnmtv)
{
CONTEXT("ShellBrowserChild::OnTreeItemExpanding()");
CONTEXT("ShellBrowser::OnTreeItemExpanding()");
if (pnmtv->action == TVE_COLLAPSE)
TreeView_Expand(_left_hwnd, pnmtv->itemNew.hItem, TVE_COLLAPSE|TVE_COLLAPSERESET);
@ -275,9 +291,9 @@ void ShellBrowserChild::OnTreeItemExpanding(int idCtrl, LPNMTREEVIEW pnmtv)
}
}
int ShellBrowserChild::InsertSubitems(HTREEITEM hParentItem, Entry* entry, IShellFolder* pParentFolder)
int ShellBrowser::InsertSubitems(HTREEITEM hParentItem, Entry* entry, IShellFolder* pParentFolder)
{
CONTEXT("ShellBrowserChild::InsertSubitems()");
CONTEXT("ShellBrowser::InsertSubitems()");
WaitCursor wait;
@ -328,47 +344,21 @@ int ShellBrowserChild::InsertSubitems(HTREEITEM hParentItem, Entry* entry, IShel
return cnt;
}
void ShellBrowserChild::OnTreeItemSelected(int idCtrl, LPNMTREEVIEW pnmtv)
void ShellBrowser::OnTreeItemSelected(int idCtrl, LPNMTREEVIEW pnmtv)
{
CONTEXT("ShellBrowserChild::OnTreeItemSelected()");
CONTEXT("ShellBrowser::OnTreeItemSelected()");
ShellEntry* entry = (ShellEntry*)pnmtv->itemNew.lParam;
_last_sel = pnmtv->itemNew.hItem;
if (entry->_etype == ET_SHELL) {
IShellFolder* folder;
if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
folder = static_cast<ShellDirectory*>(entry)->_folder;
else
folder = entry->get_parent_folder();
if (!folder) {
assert(folder);
return;
}
TCHAR path[MAX_PATH];
if (entry->get_path(path)) {
String url;
if (path[0] == ':')
url.printf(TEXT("shell://%s"), path);
else
url.printf(TEXT("file://%s"), path);
set_url(url);
}
UpdateFolderView(folder);
}
if (entry)
_callback->entry_selected(entry);
}
void ShellBrowserChild::UpdateFolderView(IShellFolder* folder)
void ShellBrowser::UpdateFolderView(IShellFolder* folder)
{
CONTEXT("ShellBrowserChild::UpdateFolderView()");
CONTEXT("ShellBrowser::UpdateFolderView()");
FOLDERSETTINGS fs;
IShellView* pLastShellView = _pShellView;
@ -397,63 +387,15 @@ void ShellBrowserChild::UpdateFolderView(IShellFolder* folder)
pLastShellView->UIActivate(SVUIA_DEACTIVATE);
pLastShellView->DestroyViewWindow();
pLastShellView->Release();
ClientRect clnt(_hwnd);
resize_children(clnt.right, clnt.bottom);
}
_pShellView->UIActivate(SVUIA_ACTIVATE_NOFOCUS);
}
LRESULT ShellBrowserChild::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
HRESULT ShellBrowser::OnDefaultCommand(LPIDA pida)
{
switch(nmsg) {
case WM_GETISHELLBROWSER: // for Registry Explorer Plugin
return (LRESULT)static_cast<IShellBrowser*>(this);
case PM_GET_SHELLBROWSER_PTR:
return (LRESULT)this;
case PM_DISPATCH_COMMAND: {
switch(LOWORD(wparam)) {
case ID_WINDOW_NEW: {CONTEXT("ShellBrowserChild PM_DISPATCH_COMMAND ID_WINDOW_NEW");
ShellBrowserChild::create(_create_info);
break;}
case ID_REFRESH:
//@todo refresh shell child
break;
default:
return super::WndProc(nmsg, wparam, lparam);
}
return TRUE;}
default:
return super::WndProc(nmsg, wparam, lparam);
}
return 0;
}
int ShellBrowserChild::Notify(int id, NMHDR* pnmh)
{
switch(pnmh->code) {
case TVN_GETDISPINFO: OnTreeGetDispInfo(id, pnmh); break;
case TVN_SELCHANGED: OnTreeItemSelected(id, (LPNMTREEVIEW)pnmh); break;
case TVN_ITEMEXPANDING: OnTreeItemExpanding(id, (LPNMTREEVIEW)pnmh); break;
case NM_RCLICK: OnTreeItemRClick(id, pnmh); break;
default: return super::Notify(id, pnmh);
}
return 0;
}
HRESULT ShellBrowserChild::OnDefaultCommand(LPIDA pida)
{
CONTEXT("ShellBrowserChild::OnDefaultCommand()");
CONTEXT("ShellBrowser::OnDefaultCommand()");
if (pida->cidl >= 1) {
if (_left_hwnd) { // explorer mode
@ -479,7 +421,7 @@ HRESULT ShellBrowserChild::OnDefaultCommand(LPIDA pida)
}
}
} else { // no tree control
if (MainFrame::OpenShellFolders(pida, _hWndFrame))
if (MDIMainFrame::OpenShellFolders(pida, _hWndFrame))
return S_OK;
/* create new Frame Window
@ -493,9 +435,9 @@ HRESULT ShellBrowserChild::OnDefaultCommand(LPIDA pida)
}
HTREEITEM ShellBrowserChild::select_entry(HTREEITEM hitem, Entry* entry, bool expand)
HTREEITEM ShellBrowser::select_entry(HTREEITEM hitem, Entry* entry, bool expand)
{
CONTEXT("ShellBrowserChild::select_entry()");
CONTEXT("ShellBrowser::select_entry()");
if (expand && !TreeView_Expand(_left_hwnd, hitem, TVE_EXPAND))
return 0;
@ -517,28 +459,7 @@ HTREEITEM ShellBrowserChild::select_entry(HTREEITEM hitem, Entry* entry, bool ex
}
String ShellBrowserChild::jump_to_int(LPCTSTR url)
{
String dir, fname;
if (!_tcsnicmp(url, TEXT("shell://"), 8)) {
if (jump_to_pidl(ShellPath(url+8)))
return url;
}
if (SplitFileSysURL(url, dir, fname)) {
///@todo use fname
if (jump_to_pidl(ShellPath(dir)))
return FmtString(TEXT("file://%s"), (LPCTSTR)dir);
}
return String();
}
bool ShellBrowserChild::jump_to_pidl(LPCITEMIDLIST pidl)
bool ShellBrowser::jump_to_pidl(LPCITEMIDLIST pidl)
{
if (!_root._entry)
return false;
@ -569,3 +490,171 @@ bool ShellBrowserChild::jump_to_pidl(LPCITEMIDLIST pidl)
return false;
}
#ifndef _NO_MDI
MDIShellBrowserChild::MDIShellBrowserChild(HWND hwnd, const ShellChildWndInfo& info)
: super(hwnd, info),
_create_info(info),
_shellpath_info(info) //@@ copies info -> no referenz to _create_info !
{
/**todo Conversion of shell path into path string -> store into URL history
// store path into history
if (info._path && *info._path)
_url_history.push(info._path);
*/
}
MDIShellBrowserChild* MDIShellBrowserChild::create(const ShellChildWndInfo& info)
{
ChildWindow* child = ChildWindow::create(info, info._pos.rcNormalPosition,
WINDOW_CREATOR_INFO(MDIShellBrowserChild,ShellChildWndInfo), CLASSNAME_CHILDWND, NULL, info._pos.showCmd==SW_SHOWMAXIMIZED? WS_MAXIMIZE: 0);
return static_cast<MDIShellBrowserChild*>(child);
}
LRESULT MDIShellBrowserChild::Init(LPCREATESTRUCT pcs)
{
CONTEXT("MDIShellBrowserChild::Init()");
if (super::Init(pcs))
return 1;
init_himl();
update_shell_browser();
if (&*_shellBrowser)
if (_left_hwnd)
_shellBrowser->Init(_himlSmall);
else
_shellBrowser->UpdateFolderView(_create_info._shell_path.get_folder());
return 0;
}
LRESULT MDIShellBrowserChild::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
{
switch(nmsg) {
case PM_DISPATCH_COMMAND: {
switch(LOWORD(wparam)) {
case ID_WINDOW_NEW: {CONTEXT("MDIShellBrowserChild PM_DISPATCH_COMMAND ID_WINDOW_NEW");
MDIShellBrowserChild::create(_create_info);
break;}
case ID_REFRESH:
//@todo refresh shell child
break;
case ID_VIEW_SDI:
MainFrameBase::Create(_url, false);
break;
default:
return super::WndProc(nmsg, wparam, lparam);
}
return TRUE;}
default:
return super::WndProc(nmsg, wparam, lparam);
}
return 0;
}
void MDIShellBrowserChild::update_shell_browser()
{
int split_pos = DEFAULT_SPLIT_POS;
if (_shellBrowser.get()) {
split_pos = _split_pos;
delete _shellBrowser.release();
}
// create explorer treeview
if (_create_info._open_mode & OWM_EXPLORE) {
if (!_left_hwnd) {
ClientRect rect(_hwnd);
_left_hwnd = CreateWindowEx(0, WC_TREEVIEW, NULL,
WS_CHILD|WS_TABSTOP|WS_VISIBLE|WS_CHILD|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS|TVS_SHOWSELALWAYS,//|TVS_NOTOOLTIPS
0, rect.top, split_pos-SPLIT_WIDTH/2, rect.bottom-rect.top,
_hwnd, (HMENU)IDC_FILETREE, g_Globals._hInstance, 0);
}
} else {
if (_left_hwnd) {
DestroyWindow(_left_hwnd);
_left_hwnd = 0;
}
}
_shellBrowser = auto_ptr<ShellBrowser>(new ShellBrowser(_hwnd, _left_hwnd, _right_hwnd,
_shellpath_info, _himlSmall, this));
_shellBrowser->Init(_hwnd);
}
String MDIShellBrowserChild::jump_to_int(LPCTSTR url)
{
String dir, fname;
if (!_tcsnicmp(url, TEXT("shell://"), 8)) {
if (_shellBrowser->jump_to_pidl(ShellPath(url+8)))
return url;
}
if (SplitFileSysURL(url, dir, fname)) {
///@todo use fname
if (_shellBrowser->jump_to_pidl(ShellPath(dir)))
return FmtString(TEXT("file://%s"), (LPCTSTR)dir);
}
return String();
}
void MDIShellBrowserChild::entry_selected(Entry* entry)
{
if (entry->_etype == ET_SHELL) {
ShellEntry* shell_entry = static_cast<ShellEntry*>(entry);
IShellFolder* folder;
if (shell_entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
folder = static_cast<ShellDirectory*>(shell_entry)->_folder;
else
folder = shell_entry->get_parent_folder();
if (!folder) {
assert(folder);
return;
}
TCHAR path[MAX_PATH];
if (shell_entry->get_path(path)) {
String url;
if (path[0] == ':')
url.printf(TEXT("shell://%s"), path);
else
url.printf(TEXT("file://%s"), path);
set_url(url);
}
_shellBrowser->UpdateFolderView(folder);
// set size of new created shell view windows
ClientRect rt(_hwnd);
resize_children(rt.right, rt.bottom);
}
}
#endif

View file

@ -29,26 +29,37 @@
#include "../utility/shellbrowserimpl.h"
/// Implementation of IShellBrowserImpl interface in explorer child windows
struct ShellBrowserChild : public ChildWindow, public IShellBrowserImpl
/// information structure to hold current shell folder information
struct ShellPathInfo
{
typedef ChildWindow super;
ShellPathInfo(int mode=0) : _open_mode(mode) {}
ShellBrowserChild(HWND hwnd, const ShellChildWndInfo& info);
~ShellBrowserChild();
static ShellBrowserChild* create(const FileChildWndInfo& info)
ShellPathInfo(const ShellChildWndInfo& info)
: _shell_path(info._shell_path),
_root_shell_path(info._root_shell_path),
_open_mode(info._open_mode)
{
#ifndef _NO_MDI
ChildWindow* child = ChildWindow::create(info, info._pos.rcNormalPosition,
WINDOW_CREATOR_INFO(ShellBrowserChild,ShellChildWndInfo), CLASSNAME_CHILDWND, NULL, info._pos.showCmd==SW_SHOWMAXIMIZED? WS_MAXIMIZE: 0);
#else
///@todo SDI implementation
#endif
return static_cast<ShellBrowserChild*>(child);
}
ShellPath _shell_path;
ShellPath _root_shell_path;
int _open_mode; //OPEN_WINDOW_MODE
};
struct BrowserCallback
{
virtual void entry_selected(Entry* entry) = 0;
};
/// Implementation of IShellBrowserImpl interface in explorer child windows
struct ShellBrowser : public IShellBrowserImpl
{
ShellBrowser(HWND hwnd, HWND left_hwnd, WindowHandle& right_hwnd, ShellPathInfo& create_info, HIMAGELIST himl, BrowserCallback* cb);
virtual ~ShellBrowser();
//IOleWindow
virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND* lphwnd)
{
@ -101,39 +112,148 @@ struct ShellBrowserChild : public ChildWindow, public IShellBrowserImpl
const Root& get_root() const {return _root;}
protected:
Root _root;
WindowHandle _hWndFrame;
ShellChildWndInfo _create_info;
ShellFolder _folder;
IShellView* _pShellView; // current hosted shellview
HIMAGELIST _himlSmall; // list
// HIMAGELIST _himlLarge; // shell image
TreeDropTarget* _pDropTarget;
HTREEITEM _last_sel;
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
int Notify(int id, NMHDR* pnmh);
LRESULT Init(LPCREATESTRUCT);
void InitializeTree(/*const FileChildWndInfo& info*/);
int InsertSubitems(HTREEITEM hParentItem, Entry* entry, IShellFolder* pParentFolder);
bool InitDragDrop();
virtual String jump_to_int(LPCTSTR url);
bool jump_to_pidl(LPCITEMIDLIST pidl);
HRESULT OnDefaultCommand(LPIDA pida);
void OnTreeGetDispInfo(int idCtrl, LPNMHDR pnmh);
void OnTreeItemExpanding(int idCtrl, LPNMTREEVIEW pnmtv);
void OnTreeItemRClick(int idCtrl, LPNMHDR pnmh);
void OnTreeItemSelected(int idCtrl, LPNMTREEVIEW pnmtv);
LRESULT Init(HWND hWndFrame);
void Init(HIMAGELIST himl)
{
InitializeTree(himl);
InitDragDrop();
}
int InsertSubitems(HTREEITEM hParentItem, Entry* entry, IShellFolder* pParentFolder);
bool jump_to_pidl(LPCITEMIDLIST pidl);
HRESULT OnDefaultCommand(LPIDA pida);
void UpdateFolderView(IShellFolder* folder);
void Tree_DoItemMenu(HWND hwndTreeView, HTREEITEM hItem, LPPOINT pptScreen);
HTREEITEM select_entry(HTREEITEM hitem, Entry* entry, bool expand=true);
protected:
HWND _hwnd;
HWND _left_hwnd;
WindowHandle& _right_hwnd;
ShellPathInfo& _create_info;
HIMAGELIST _himl;
BrowserCallback* _callback;
WindowHandle _hWndFrame;
ShellFolder _folder;
IShellView* _pShellView; // current hosted shellview
TreeDropTarget* _pDropTarget;
HTREEITEM _last_sel;
Root _root;
ShellDirectory* _cur_dir;
void InitializeTree(HIMAGELIST himl);
bool InitDragDrop();
// for SDIMainFrame
void jump_to(LPCITEMIDLIST pidl);
};
template<typename BASE> struct ShellBrowserChildT
: public BASE, public BrowserCallback
{
typedef BASE super;
// constructor for SDIMainFrame
ShellBrowserChildT(HWND hwnd)
: super(hwnd)
{
_himlSmall = 0;
}
// constructor for MDIShellBrowserChild
ShellBrowserChildT(HWND hwnd, const ShellChildWndInfo& info)
: super(hwnd, info)
{
_himlSmall = 0;
}
void init_himl()
{
SHFILEINFO sfi;
_himlSmall = (HIMAGELIST)SHGetFileInfo(TEXT("C:\\"), 0, &sfi, sizeof(SHFILEINFO), SHGFI_SYSICONINDEX|SHGFI_SMALLICON);
// _himlLarge = (HIMAGELIST)SHGetFileInfo(TEXT("C:\\"), 0, &sfi, sizeof(SHFILEINFO), SHGFI_SYSICONINDEX|SHGFI_LARGEICON);
}
protected:
HIMAGELIST _himlSmall; // list
// HIMAGELIST _himlLarge; // shell image
protected:
auto_ptr<ShellBrowser> _shellBrowser;
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
{
switch(nmsg) {
case PM_GET_SHELLBROWSER_PTR:
return (LRESULT)&*_shellBrowser;
case WM_GETISHELLBROWSER: // for Registry Explorer Plugin
return (LRESULT)static_cast<IShellBrowser*>(&*_shellBrowser);
default:
return super::WndProc(nmsg, wparam, lparam);
}
return 0;
}
int Notify(int id, NMHDR* pnmh)
{
if (&*_shellBrowser)
switch(pnmh->code) {
case TVN_GETDISPINFO: _shellBrowser->OnTreeGetDispInfo(id, pnmh); break;
case TVN_SELCHANGED: _shellBrowser->OnTreeItemSelected(id, (LPNMTREEVIEW)pnmh); break;
case TVN_ITEMEXPANDING: _shellBrowser->OnTreeItemExpanding(id, (LPNMTREEVIEW)pnmh); break;
case NM_RCLICK: _shellBrowser->OnTreeItemRClick(id, pnmh); break;
default: return super::Notify(id, pnmh);
}
else
return super::Notify(id, pnmh);
return 0;
}
};
#ifndef _NO_MDI
struct MDIShellBrowserChild : public ShellBrowserChildT<ChildWindow>
{
typedef ShellBrowserChildT<ChildWindow> super;
MDIShellBrowserChild(HWND hwnd, const ShellChildWndInfo& info);
static MDIShellBrowserChild* create(const ShellChildWndInfo& info);
LRESULT Init(LPCREATESTRUCT);
virtual String jump_to_int(LPCTSTR url);
protected:
ShellChildWndInfo _create_info;
ShellPathInfo _shellpath_info;
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
void update_shell_browser();
// interface BrowserCallback
virtual void entry_selected(Entry* entry);
};
#endif

View file

@ -1675,7 +1675,7 @@ int StartMenuHandler::Command(int id, int code)
case IDC_CONTROL_PANEL:
CloseStartMenu(id);
MainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"), 0);
//@@SDIMainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"), 0);
break;
case IDC_ADMIN: