Made the buttons in the filedlg change when selecting a different

view type by the context menu, cleanup.
This commit is contained in:
Juergen Schmied 1999-11-12 01:02:27 +00:00 committed by Alexandre Julliard
parent c7ca3dde99
commit c38cb0123b
8 changed files with 84 additions and 66 deletions

View File

@ -7,6 +7,8 @@
#ifndef _WINE_DLL_CDLG_H #ifndef _WINE_DLL_CDLG_H
#define _WINE_DLL_CDLG_H #define _WINE_DLL_CDLG_H
#include "dlgs.h"
/*---------------- 16-bit ----------------*/ /*---------------- 16-bit ----------------*/
extern HINSTANCE16 COMMDLG_hInstance; extern HINSTANCE16 COMMDLG_hInstance;
extern HINSTANCE COMMDLG_hInstance32; extern HINSTANCE COMMDLG_hInstance32;

View File

@ -921,22 +921,24 @@ static LRESULT FILEDLG95_OnWMCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
case IDC_LOOKIN: case IDC_LOOKIN:
FILEDLG95_LOOKIN_OnCommand(hwnd,wNotifyCode); FILEDLG95_LOOKIN_OnCommand(hwnd,wNotifyCode);
break; break;
/* --- toolbar --- */
/* Up folder button */ /* Up folder button */
case IDC_UPFOLDER: case FCIDM_TB_UPFOLDER:
FILEDLG95_SHELL_UpFolder(hwnd); FILEDLG95_SHELL_UpFolder(hwnd);
break; break;
/* New folder button */
case FCIDM_TB_NEWFOLDER:
FILEDLG95_SHELL_NewFolder(hwnd);
break;
/* List option button */ /* List option button */
case IDC_LIST: case FCIDM_TB_SMALLICON:
FILEDLG95_SHELL_ExecuteCommand(hwnd,CMDSTR_VIEWLIST); FILEDLG95_SHELL_ExecuteCommand(hwnd,CMDSTR_VIEWLIST);
break; break;
/* Details option button */ /* Details option button */
case IDC_DETAILS: case FCIDM_TB_REPORTVIEW:
FILEDLG95_SHELL_ExecuteCommand(hwnd,CMDSTR_VIEWDETAILS); FILEDLG95_SHELL_ExecuteCommand(hwnd,CMDSTR_VIEWDETAILS);
break; break;
/* New folder button */
case IDC_NEWFOLDER:
FILEDLG95_SHELL_NewFolder(hwnd);
break;
case IDC_FILENAME: case IDC_FILENAME:
break; break;
@ -972,12 +974,12 @@ static LRESULT FILEDLG95_OnWMGetIShellBrowser(HWND hwnd)
static LRESULT FILEDLG95_InitUI(HWND hwnd) static LRESULT FILEDLG95_InitUI(HWND hwnd)
{ {
TBBUTTON tbb[] = TBBUTTON tbb[] =
{{VIEW_PARENTFOLDER, IDC_UPFOLDER, 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 }, {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, {0, 0}, 0, 0 },
{VIEW_NEWFOLDER, IDC_NEWFOLDER, TBSTATE_ENABLED, TBSTYLE_BUTTON, {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 }, {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, {0, 0}, 0, 0 },
{VIEW_LIST, IDC_LIST, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 }, {VIEW_LIST, FCIDM_TB_SMALLICON, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 },
{VIEW_DETAILS, IDC_DETAILS, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 }, {VIEW_DETAILS, FCIDM_TB_REPORTVIEW, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 },
}; };
RECT rectTB; RECT rectTB;

View File

@ -503,11 +503,21 @@ HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface,
{ {
ICOM_THIS(IShellBrowserImpl, 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); switch (id)
{
/* Feature not implemented */ case FCW_TOOLBAR:
return E_NOTIMPL; 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 * IShellBrowserImpl_SetMenuSB

View File

@ -68,6 +68,40 @@ typedef struct
} FileOpenDlgInfos; } 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 * Prototypes for the methods of the IShellBrowserImpl class
*/ */

View File

@ -5,9 +5,9 @@
#include "winuser.h" #include "winuser.h"
#include "winnls.h" #include "winnls.h"
#include "dlgs.h"
#include "cdlg.h" #include "cdlg.h"
#include "winspool.h" #include "winspool.h"
#include "filedlgbrowser.h"
/* /*
* Everything that does not depend on language, * Everything that does not depend on language,

View File

@ -207,11 +207,7 @@ static HRESULT OnStateChange(IShellViewImpl * This, UINT uFlags)
return ret; return ret;
} }
/********************************************************** /**********************************************************
* * set the toolbar of the filedialog buttons
* ##### helperfunctions for initializing the view #####
*/
/**********************************************************
* set the toolbar buttons
*/ */
static void CheckToolbar(IShellViewImpl * This) static void CheckToolbar(IShellViewImpl * This)
{ {
@ -219,16 +215,23 @@ static void CheckToolbar(IShellViewImpl * This)
TRACE("\n"); 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); 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); 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); 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); FCIDM_TB_REPORTVIEW, TRUE, &result);
}
} }
/**********************************************************
*
* ##### helperfunctions for initializing the view #####
*/
/********************************************************** /**********************************************************
* change the style of the listview control * change the style of the listview control
*/ */
@ -960,21 +963,25 @@ static LRESULT ShellView_OnCommand(IShellViewImpl * This,DWORD dwCmdID, DWORD dw
case FCIDM_SHVIEW_SMALLICON: case FCIDM_SHVIEW_SMALLICON:
This->FolderSettings.ViewMode = FVM_SMALLICON; This->FolderSettings.ViewMode = FVM_SMALLICON;
SetStyle (This, LVS_SMALLICON, LVS_TYPEMASK); SetStyle (This, LVS_SMALLICON, LVS_TYPEMASK);
CheckToolbar(This);
break; break;
case FCIDM_SHVIEW_BIGICON: case FCIDM_SHVIEW_BIGICON:
This->FolderSettings.ViewMode = FVM_ICON; This->FolderSettings.ViewMode = FVM_ICON;
SetStyle (This, LVS_ICON, LVS_TYPEMASK); SetStyle (This, LVS_ICON, LVS_TYPEMASK);
CheckToolbar(This);
break; break;
case FCIDM_SHVIEW_LISTVIEW: case FCIDM_SHVIEW_LISTVIEW:
This->FolderSettings.ViewMode = FVM_LIST; This->FolderSettings.ViewMode = FVM_LIST;
SetStyle (This, LVS_LIST, LVS_TYPEMASK); SetStyle (This, LVS_LIST, LVS_TYPEMASK);
CheckToolbar(This);
break; break;
case FCIDM_SHVIEW_REPORTVIEW: case FCIDM_SHVIEW_REPORTVIEW:
This->FolderSettings.ViewMode = FVM_DETAILS; This->FolderSettings.ViewMode = FVM_DETAILS;
SetStyle (This, LVS_REPORT, LVS_TYPEMASK); SetStyle (This, LVS_REPORT, LVS_TYPEMASK);
CheckToolbar(This);
break; break;
/* the menu-ID's for sorting are 0x30... see shrec.rc */ /* 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.bIsAscending = TRUE;
This->ListViewSortInfo.nLastHeaderID = This->ListViewSortInfo.nHeaderID; This->ListViewSortInfo.nLastHeaderID = This->ListViewSortInfo.nHeaderID;
ListView_SortItems(This->hWndList, ShellView_ListViewCompareItems, (LPARAM) (&(This->ListViewSortInfo))); ListView_SortItems(This->hWndList, ShellView_ListViewCompareItems, (LPARAM) (&(This->ListViewSortInfo)));
CheckToolbar(This);
break; break;
default: default:

View File

@ -196,42 +196,4 @@
#define COLORMGMTDLGORD 1551 #define COLORMGMTDLGORD 1551
#define NEWFILEOPENV2ORD 1552 #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 */ #endif /* #ifdef __WINE_DLGS_H */

View File

@ -72,6 +72,8 @@ typedef struct IShellView IShellView, *LPSHELLVIEW;
#define FCIDM_SHVIEWLAST 0x7fff #define FCIDM_SHVIEWLAST 0x7fff
#define FCIDM_BROWSERFIRST 0xA000 #define FCIDM_BROWSERFIRST 0xA000
/* undocumented toolbar items from stddlg's*/ /* undocumented toolbar items from stddlg's*/
#define FCIDM_TB_UPFOLDER 0xA001
#define FCIDM_TB_NEWFOLDER 0xA002
#define FCIDM_TB_SMALLICON 0xA003 #define FCIDM_TB_SMALLICON 0xA003
#define FCIDM_TB_REPORTVIEW 0xA004 #define FCIDM_TB_REPORTVIEW 0xA004