Commit c38cb012 authored by Juergen Schmied's avatar Juergen Schmied Committed by Alexandre Julliard

Made the buttons in the filedlg change when selecting a different

view type by the context menu, cleanup.
parent c7ca3dde
......@@ -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;
......
......@@ -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 },
{{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, 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 },
{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_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;
......
......@@ -503,11 +503,21 @@ HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface,
{
ICOM_THIS(IShellBrowserImpl, iface);
LRESULT lres;
TRACE("(%p)\n", This);
TRACE("(%p)->(0x%08x 0x%08x 0x%08x 0x%08lx %p)\n", This, id, uMsg, wParam, lParam, pret);
/* Feature not implemented */
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
......
......@@ -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 */
......
......@@ -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,
......
......@@ -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,6 +215,8 @@ static void CheckToolbar(IShellViewImpl * This)
TRACE("\n");
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,
......@@ -227,9 +225,14 @@ static void CheckToolbar(IShellViewImpl * This)
FCIDM_TB_SMALLICON, TRUE, &result);
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:
......
......@@ -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 */
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment