From c38cb0123b71a557697543cf1931178bdd1b5d04 Mon Sep 17 00:00:00 2001 From: Juergen Schmied Date: Fri, 12 Nov 1999 01:02:27 +0000 Subject: [PATCH] Made the buttons in the filedlg change when selecting a different view type by the context menu, cleanup. --- dlls/commdlg/cdlg.h | 2 ++ dlls/commdlg/filedlg95.c | 28 +++++++++++++++------------- dlls/commdlg/filedlgbrowser.c | 18 ++++++++++++++---- dlls/commdlg/filedlgbrowser.h | 34 ++++++++++++++++++++++++++++++++++ dlls/commdlg/rsrc.rc | 2 +- dlls/shell32/shlview.c | 26 ++++++++++++++++---------- include/dlgs.h | 38 -------------------------------------- include/wine/obj_shellview.h | 2 ++ 8 files changed, 84 insertions(+), 66 deletions(-) diff --git a/dlls/commdlg/cdlg.h b/dlls/commdlg/cdlg.h index 4fd5b0f3056..d4eccd333ce 100644 --- a/dlls/commdlg/cdlg.h +++ b/dlls/commdlg/cdlg.h @@ -7,6 +7,8 @@ #ifndef _WINE_DLL_CDLG_H #define _WINE_DLL_CDLG_H +#include "dlgs.h" + /*---------------- 16-bit ----------------*/ extern HINSTANCE16 COMMDLG_hInstance; extern HINSTANCE COMMDLG_hInstance32; diff --git a/dlls/commdlg/filedlg95.c b/dlls/commdlg/filedlg95.c index f10079078d9..c7ed801bf30 100644 --- a/dlls/commdlg/filedlg95.c +++ b/dlls/commdlg/filedlg95.c @@ -921,22 +921,24 @@ static LRESULT FILEDLG95_OnWMCommand(HWND hwnd, WPARAM wParam, LPARAM lParam) case IDC_LOOKIN: FILEDLG95_LOOKIN_OnCommand(hwnd,wNotifyCode); break; + + /* --- toolbar --- */ /* Up folder button */ - case IDC_UPFOLDER: + case FCIDM_TB_UPFOLDER: FILEDLG95_SHELL_UpFolder(hwnd); break; + /* New folder button */ + case FCIDM_TB_NEWFOLDER: + FILEDLG95_SHELL_NewFolder(hwnd); + break; /* List option button */ - case IDC_LIST: + case FCIDM_TB_SMALLICON: FILEDLG95_SHELL_ExecuteCommand(hwnd,CMDSTR_VIEWLIST); break; /* Details option button */ - case IDC_DETAILS: + case FCIDM_TB_REPORTVIEW: FILEDLG95_SHELL_ExecuteCommand(hwnd,CMDSTR_VIEWDETAILS); break; - /* New folder button */ - case IDC_NEWFOLDER: - FILEDLG95_SHELL_NewFolder(hwnd); - break; case IDC_FILENAME: break; @@ -972,12 +974,12 @@ static LRESULT FILEDLG95_OnWMGetIShellBrowser(HWND hwnd) static LRESULT FILEDLG95_InitUI(HWND hwnd) { TBBUTTON tbb[] = - {{VIEW_PARENTFOLDER, IDC_UPFOLDER, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 }, - {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, {0, 0}, 0, 0 }, - {VIEW_NEWFOLDER, IDC_NEWFOLDER, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 }, - {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, {0, 0}, 0, 0 }, - {VIEW_LIST, IDC_LIST, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 }, - {VIEW_DETAILS, IDC_DETAILS, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 }, + {{VIEW_PARENTFOLDER, FCIDM_TB_UPFOLDER, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 }, + {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, {0, 0}, 0, 0 }, + {VIEW_NEWFOLDER, FCIDM_TB_NEWFOLDER, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 }, + {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, {0, 0}, 0, 0 }, + {VIEW_LIST, FCIDM_TB_SMALLICON, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 }, + {VIEW_DETAILS, FCIDM_TB_REPORTVIEW, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 }, }; RECT rectTB; diff --git a/dlls/commdlg/filedlgbrowser.c b/dlls/commdlg/filedlgbrowser.c index 6c4eeeb6e58..1c487f12611 100644 --- a/dlls/commdlg/filedlgbrowser.c +++ b/dlls/commdlg/filedlgbrowser.c @@ -503,11 +503,21 @@ HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface, { ICOM_THIS(IShellBrowserImpl, iface); + LRESULT lres; + + TRACE("(%p)->(0x%08x 0x%08x 0x%08x 0x%08lx %p)\n", This, id, uMsg, wParam, lParam, pret); - TRACE("(%p)\n", This); - - /* Feature not implemented */ - return E_NOTIMPL; + switch (id) + { + case FCW_TOOLBAR: + lres = SendDlgItemMessageA( This->hwndOwner, IDC_TOOLBAR, uMsg, wParam, lParam); + break; + default: + FIXME("ctrl id: %x\n", id); + return E_NOTIMPL; + } + if (pret) *pret = lres; + return S_OK; } /************************************************************************** * IShellBrowserImpl_SetMenuSB diff --git a/dlls/commdlg/filedlgbrowser.h b/dlls/commdlg/filedlgbrowser.h index ca0572fb5d3..809f06b9ece 100644 --- a/dlls/commdlg/filedlgbrowser.h +++ b/dlls/commdlg/filedlgbrowser.h @@ -69,6 +69,40 @@ typedef struct } FileOpenDlgInfos; /*********************************************************************** + * Control ID's + */ +#define IDS_ABOUTBOX 101 +#define IDS_DOCUMENTFOLDERS 102 +#define IDS_PERSONAL 103 +#define IDS_FAVORITES 104 +#define IDS_PATH 105 +#define IDS_DESKTOP 106 + +#define IDS_FONTS 108 +#define IDS_MYCOMPUTER 110 +#define IDS_SYSTEMFOLDERS 112 +#define IDS_LOCALHARDRIVES 113 +#define IDS_FILENOTFOUND 114 +#define IDS_VERIFYFILE 115 +#define IDS_CREATEFILE 116 + +#define IDC_OPENREADONLY chx1 + +#define IDC_TOOLBARSTATIC stc1 +#define IDC_FILETYPESTATIC stc2 +#define IDC_FILENAMESTATIC stc3 +#define IDC_LOOKINSTATIC stc4 + +#define IDC_SHELLSTATIC lst1 + +#define IDC_FILETYPE cmb1 +#define IDC_LOOKIN cmb2 + +#define IDC_FILENAME edt1 + +#define IDC_TOOLBAR ctl1 + +/*********************************************************************** * Prototypes for the methods of the IShellBrowserImpl class */ /* Constructor */ diff --git a/dlls/commdlg/rsrc.rc b/dlls/commdlg/rsrc.rc index 5f8b3653b7a..c63171e8c72 100644 --- a/dlls/commdlg/rsrc.rc +++ b/dlls/commdlg/rsrc.rc @@ -5,9 +5,9 @@ #include "winuser.h" #include "winnls.h" -#include "dlgs.h" #include "cdlg.h" #include "winspool.h" +#include "filedlgbrowser.h" /* * Everything that does not depend on language, diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c index 0913e5b7112..b73a004d50c 100644 --- a/dlls/shell32/shlview.c +++ b/dlls/shell32/shlview.c @@ -207,11 +207,7 @@ static HRESULT OnStateChange(IShellViewImpl * This, UINT uFlags) return ret; } /********************************************************** - * - * ##### helperfunctions for initializing the view ##### - */ -/********************************************************** - * set the toolbar buttons + * set the toolbar of the filedialog buttons */ static void CheckToolbar(IShellViewImpl * This) { @@ -219,17 +215,24 @@ static void CheckToolbar(IShellViewImpl * This) TRACE("\n"); - IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_CHECKBUTTON, + if (IsInCommDlg(This)) + { + IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_CHECKBUTTON, FCIDM_TB_SMALLICON, (This->FolderSettings.ViewMode==FVM_LIST)? TRUE : FALSE, &result); - IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_CHECKBUTTON, + IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_CHECKBUTTON, FCIDM_TB_REPORTVIEW, (This->FolderSettings.ViewMode==FVM_DETAILS)? TRUE : FALSE, &result); - IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_ENABLEBUTTON, + IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_ENABLEBUTTON, FCIDM_TB_SMALLICON, TRUE, &result); - IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_ENABLEBUTTON, + IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_ENABLEBUTTON, FCIDM_TB_REPORTVIEW, TRUE, &result); + } } /********************************************************** + * + * ##### helperfunctions for initializing the view ##### + */ +/********************************************************** * change the style of the listview control */ static void SetStyle(IShellViewImpl * This, DWORD dwAdd, DWORD dwRemove) @@ -960,21 +963,25 @@ static LRESULT ShellView_OnCommand(IShellViewImpl * This,DWORD dwCmdID, DWORD dw case FCIDM_SHVIEW_SMALLICON: This->FolderSettings.ViewMode = FVM_SMALLICON; SetStyle (This, LVS_SMALLICON, LVS_TYPEMASK); + CheckToolbar(This); break; case FCIDM_SHVIEW_BIGICON: This->FolderSettings.ViewMode = FVM_ICON; SetStyle (This, LVS_ICON, LVS_TYPEMASK); + CheckToolbar(This); break; case FCIDM_SHVIEW_LISTVIEW: This->FolderSettings.ViewMode = FVM_LIST; SetStyle (This, LVS_LIST, LVS_TYPEMASK); + CheckToolbar(This); break; case FCIDM_SHVIEW_REPORTVIEW: This->FolderSettings.ViewMode = FVM_DETAILS; SetStyle (This, LVS_REPORT, LVS_TYPEMASK); + CheckToolbar(This); break; /* the menu-ID's for sorting are 0x30... see shrec.rc */ @@ -986,7 +993,6 @@ static LRESULT ShellView_OnCommand(IShellViewImpl * This,DWORD dwCmdID, DWORD dw This->ListViewSortInfo.bIsAscending = TRUE; This->ListViewSortInfo.nLastHeaderID = This->ListViewSortInfo.nHeaderID; ListView_SortItems(This->hWndList, ShellView_ListViewCompareItems, (LPARAM) (&(This->ListViewSortInfo))); - CheckToolbar(This); break; default: diff --git a/include/dlgs.h b/include/dlgs.h index 261978c1de8..5e16c81b331 100644 --- a/include/dlgs.h +++ b/include/dlgs.h @@ -196,42 +196,4 @@ #define COLORMGMTDLGORD 1551 #define NEWFILEOPENV2ORD 1552 -/* fixme: move away */ -#define IDS_ABOUTBOX 101 -#define IDS_DOCUMENTFOLDERS 102 -#define IDS_PERSONAL 103 -#define IDS_FAVORITES 104 -#define IDS_PATH 105 -#define IDS_DESKTOP 106 - -#define IDS_FONTS 108 -#define IDS_MYCOMPUTER 110 -#define IDS_SYSTEMFOLDERS 112 -#define IDS_LOCALHARDRIVES 113 -#define IDS_FILENOTFOUND 114 -#define IDS_VERIFYFILE 115 -#define IDS_CREATEFILE 116 - -#define IDC_OPENREADONLY chx1 - -#define IDC_TOOLBARSTATIC stc1 -#define IDC_FILETYPESTATIC stc2 -#define IDC_FILENAMESTATIC stc3 -#define IDC_LOOKINSTATIC stc4 - -#define IDC_SHELLSTATIC lst1 - -#define IDC_FILETYPE cmb1 -#define IDC_LOOKIN cmb2 - -#define IDC_FILENAME edt1 - -/* fixme: replace with FCIDM_* constants */ -#define IDC_UPFOLDER 1009 -#define IDC_NEWFOLDER 1010 -#define IDC_LIST 1011 -#define IDC_DETAILS 1012 - -#define IDC_TOOLBAR ctl1 - #endif /* #ifdef __WINE_DLGS_H */ diff --git a/include/wine/obj_shellview.h b/include/wine/obj_shellview.h index 29cbfd2dfe9..63a3f0d9355 100644 --- a/include/wine/obj_shellview.h +++ b/include/wine/obj_shellview.h @@ -72,6 +72,8 @@ typedef struct IShellView IShellView, *LPSHELLVIEW; #define FCIDM_SHVIEWLAST 0x7fff #define FCIDM_BROWSERFIRST 0xA000 /* undocumented toolbar items from stddlg's*/ +#define FCIDM_TB_UPFOLDER 0xA001 +#define FCIDM_TB_NEWFOLDER 0xA002 #define FCIDM_TB_SMALLICON 0xA003 #define FCIDM_TB_REPORTVIEW 0xA004 -- 2.11.4.GIT