Sync to Wine-20040813:

Alexandre Julliard
- Avoid some non-portable makefile constructs, and get rid of the
  ALTNAMES variable.
- Get rid of the non-standard ICOM_VTABLE macro.
Henning Gerhardt <henning.gerhardt@web.de>
- Minor fixes and updates to the German resource files.
Jacek Caban <jack@itma.pwr.wroc.pl>
- Translation update.
Mike McCormack <mike@codeweavers.com>
- Unicode file dialogs send and receive unicode messages.
Jacek Caban <jack@itma.pwr.wroc.pl>
- Fix a bug in passing parameters to CFn_WMInitDialog and CFn_WMCommand
  in FormatCharDlgProcW.
James Hawkins <truiken@gmail.com>
- Cleanup A->W cross calls.
- Better fix for collate icon behavior.

svn path=/trunk/; revision=10533
This commit is contained in:
Gé van Geldorp 2004-08-14 19:21:01 +00:00
parent 6d0e0e250c
commit 5dd30e3526
8 changed files with 212 additions and 245 deletions

View file

@ -4,11 +4,8 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = comdlg32.dll
IMPORTS = shell32 shlwapi comctl32 winspool user32 gdi32 kernel32 ntdll
ALTNAMES = commdlg.dll
EXTRALIBS = -luuid
SPEC_SRCS16 = $(ALTNAMES:.dll=.spec)
C_SRCS = \
cdlg32.c \
colordlg.c \
@ -28,6 +25,8 @@ C_SRCS16 = \
generic.c \
printdlg16.c
SPEC_SRCS16 = commdlg.spec
RC_SRCS = rsrc.rc
RC_BINSRC = cdlg_xx.rc
RC_BINARIES = \

View file

@ -1,5 +1,6 @@
/*
* Copyright 1994 Martin von Loewis
* Copyright 2004 Henning Gerhardt
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -282,7 +283,7 @@ FONT 8, "Helv"
PUSHBUTTON "&Hilfe", pshHelp, 50, 161, 48,14, WS_GROUP
GROUPBOX "Drucker", grp4, 8, 4, 272,84, WS_GROUP
CONTROL "In Fi&le drucken", chx1, "Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,212,70,64,12
CONTROL "In Da&tei drucken", chx1, "Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,212,70,64,12
PUSHBUTTON "&Eigenschaften", psh2, 212, 17, 60,14, WS_GROUP
LTEXT "&Name:", stc6, 16, 20, 36,8
COMBOBOX cmb4, 52, 18, 152,152,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP
@ -355,7 +356,7 @@ STRINGTABLE DISCARDABLE
IDS_PATH "System Ordner"
IDS_DESKTOP "Desktop"
IDS_FONTS "Schriftarten"
IDS_MYCOMPUTER "Mein Computer"
IDS_MYCOMPUTER "Arbeitsplatz"
}
STRINGTABLE DISCARDABLE
@ -433,3 +434,23 @@ Bitte geben sie einen Wert zwischen %d und %d an."
PD32_PRINTER_STATUS_SERVER_UNKNOWN "Druckserver unbekannt; "
PD32_PRINTER_STATUS_POWER_SAVE "Stromsparmodus; "
}
STRINGTABLE DISCARDABLE /* Color names */
{
IDS_COLOR_BLACK "Schwarz"
IDS_COLOR_MAROON "Kastanienbraun"
IDS_COLOR_GREEN "Grün"
IDS_COLOR_OLIVE "Olivgrün"
IDS_COLOR_NAVY "Dunkelblau"
IDS_COLOR_PURPLE "Violett"
IDS_COLOR_TEAL "Teal"
IDS_COLOR_GRAY "Grau"
IDS_COLOR_SILVER "Silber"
IDS_COLOR_RED "Rot"
IDS_COLOR_LIME "Hellgrün"
IDS_COLOR_YELLOW "Gelb"
IDS_COLOR_BLUE "Blau"
IDS_COLOR_FUCHSIA "Lila"
IDS_COLOR_AQUA "Aqua"
IDS_COLOR_WHITE "Weiß"
}

View file

@ -114,7 +114,7 @@ END
/* CONTROL "" ,710,"STATIC",WS_BORDER|SS_SIMPLE|WS_TABSTOP|WS_GROUP, 152,4,118,116 */
CHOOSE_FONT DIALOG 13, 54, 264, 147
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Font"
CAPTION "Czcionka"
FONT 8, "Helv"
BEGIN
LTEXT "&Czcionka:", 1088, 6,3,40,9, WS_CHILD | WS_VISIBLE | WS_GROUP

View file

@ -781,27 +781,37 @@ HRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode)
if(!fodInfos) return 0;
if(fodInfos->unicode)
FIXME("sending OPENFILENAMEA structure. Hook is expecting OPENFILENAMEW!\n");
if(fodInfos->DlgInfos.hwndCustomDlg)
{
OFNOTIFYA ofnNotify;
HRESULT ret;
ofnNotify.hdr.hwndFrom=hwndParentDlg;
ofnNotify.hdr.idFrom=0;
ofnNotify.hdr.code = uCode;
ofnNotify.lpOFN = fodInfos->ofnInfos;
ofnNotify.pszFile = NULL;
TRACE("CALL NOTIFY for %x\n", uCode);
ret = SendMessageA(fodInfos->DlgInfos.hwndCustomDlg,WM_NOTIFY,0,(LPARAM)&ofnNotify);
if(fodInfos->unicode)
{
OFNOTIFYW ofnNotify;
ofnNotify.hdr.hwndFrom=hwndParentDlg;
ofnNotify.hdr.idFrom=0;
ofnNotify.hdr.code = uCode;
ofnNotify.lpOFN = (LPOPENFILENAMEW) fodInfos->ofnInfos;
ofnNotify.pszFile = NULL;
ret = SendMessageW(fodInfos->DlgInfos.hwndCustomDlg,WM_NOTIFY,0,(LPARAM)&ofnNotify);
}
else
{
OFNOTIFYA ofnNotify;
ofnNotify.hdr.hwndFrom=hwndParentDlg;
ofnNotify.hdr.idFrom=0;
ofnNotify.hdr.code = uCode;
ofnNotify.lpOFN = fodInfos->ofnInfos;
ofnNotify.pszFile = NULL;
ret = SendMessageA(fodInfos->DlgInfos.hwndCustomDlg,WM_NOTIFY,0,(LPARAM)&ofnNotify);
}
TRACE("RET NOTIFY\n");
return ret;
}
return TRUE;
}
HRESULT FILEDLG95_Handle_GetFilePath(HWND hwnd, DWORD size, LPSTR buffer)
HRESULT FILEDLG95_Handle_GetFilePath(HWND hwnd, DWORD size, LPVOID buffer)
{
UINT sizeUsed = 0, n, total;
LPWSTR lpstrFileList = NULL;
@ -820,38 +830,71 @@ HRESULT FILEDLG95_Handle_GetFilePath(HWND hwnd, DWORD size, LPSTR buffer)
TRACE("path >%s< filespec >%s< %d files\n",
debugstr_w(lpstrCurrentDir),debugstr_w(lpstrFileList),n);
total = WideCharToMultiByte(CP_ACP, 0, lpstrCurrentDir, -1,
NULL, 0, NULL, NULL);
total += WideCharToMultiByte(CP_ACP, 0, lpstrFileList, sizeUsed,
NULL, 0, NULL, NULL);
/* Prepend the current path */
n = WideCharToMultiByte(CP_ACP, 0, lpstrCurrentDir, -1,
buffer, size, NULL, NULL);
if(n<size)
if( fodInfos->unicode )
{
/* 'n' includes trailing \0 */
buffer[n-1] = '\\';
WideCharToMultiByte(CP_ACP, 0, lpstrFileList, sizeUsed,
&buffer[n], size-n, NULL, NULL);
LPWSTR bufW = buffer;
total = strlenW(lpstrCurrentDir) + 1 + sizeUsed;
/* Prepend the current path */
n = strlenW(lpstrCurrentDir) + 1;
strncpyW( bufW, lpstrCurrentDir, size );
if(n<size)
{
/* 'n' includes trailing \0 */
bufW[n-1] = '\\';
memcpy( &bufW[n], lpstrFileList, (size-n)*sizeof(WCHAR) );
}
TRACE("returned -> %s\n",debugstr_wn(bufW, total));
}
else
{
LPSTR bufA = buffer;
total = WideCharToMultiByte(CP_ACP, 0, lpstrCurrentDir, -1,
NULL, 0, NULL, NULL);
total += WideCharToMultiByte(CP_ACP, 0, lpstrFileList, sizeUsed,
NULL, 0, NULL, NULL);
/* Prepend the current path */
n = WideCharToMultiByte(CP_ACP, 0, lpstrCurrentDir, -1,
bufA, size, NULL, NULL);
if(n<size)
{
/* 'n' includes trailing \0 */
bufA[n-1] = '\\';
WideCharToMultiByte(CP_ACP, 0, lpstrFileList, sizeUsed,
&bufA[n], size-n, NULL, NULL);
}
TRACE("returned -> %s\n",debugstr_an(bufA, total));
}
MemFree(lpstrFileList);
TRACE("returned -> %s\n",debugstr_a(buffer));
return total;
}
HRESULT FILEDLG95_Handle_GetFileSpec(HWND hwnd, DWORD size, LPSTR buffer)
HRESULT FILEDLG95_Handle_GetFileSpec(HWND hwnd, DWORD size, LPVOID buffer)
{
UINT sizeUsed = 0;
LPWSTR lpstrFileList = NULL;
FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr);
TRACE("CDM_GETSPEC:\n");
FILEDLG95_FILENAME_GetFileNames(hwnd, &lpstrFileList, &sizeUsed);
WideCharToMultiByte(CP_ACP, 0, lpstrFileList, sizeUsed, buffer, size, NULL, NULL);
if( fodInfos->unicode )
{
LPWSTR bufW = buffer;
memcpy( bufW, lpstrFileList, sizeof(WCHAR)*sizeUsed );
}
else
{
LPSTR bufA = buffer;
sizeUsed = WideCharToMultiByte( CP_ACP, 0, lpstrFileList, sizeUsed,
NULL, 0, NULL, NULL);
WideCharToMultiByte(CP_ACP, 0, lpstrFileList, sizeUsed,
bufA, size, NULL, NULL);
}
MemFree(lpstrFileList);
return sizeUsed;
@ -864,29 +907,45 @@ HRESULT FILEDLG95_Handle_GetFileSpec(HWND hwnd, DWORD size, LPSTR buffer)
*/
HRESULT FILEDLG95_HandleCustomDialogMessages(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
char lpstrPath[MAX_PATH];
FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr);
if(!fodInfos) return -1;
switch(uMsg)
{
case CDM_GETFILEPATH:
return FILEDLG95_Handle_GetFilePath(hwnd, (UINT)wParam, (LPSTR)lParam);
return FILEDLG95_Handle_GetFilePath(hwnd, (UINT)wParam, (LPVOID)lParam);
case CDM_GETFOLDERPATH:
TRACE("CDM_GETFOLDERPATH:\n");
SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrPath);
if ((LPSTR)lParam!=NULL)
lstrcpynA((LPSTR)lParam,lpstrPath,(int)wParam);
return strlen(lpstrPath);
if( fodInfos->unicode )
{
WCHAR lpstrPath[MAX_PATH], *bufW = (LPWSTR)lParam;
SHGetPathFromIDListW(fodInfos->ShellInfos.pidlAbsCurrent,lpstrPath);
if (bufW)
lstrcpynW(bufW,lpstrPath,(int)wParam);
return strlenW(lpstrPath);
}
else
{
char lpstrPath[MAX_PATH], *bufA = (LPSTR)lParam;
SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrPath);
if (bufA)
lstrcpynA(bufA,lpstrPath,(int)wParam);
return strlen(lpstrPath);
}
case CDM_GETSPEC:
return FILEDLG95_Handle_GetFileSpec(hwnd, (UINT)wParam, (LPSTR)lParam);
case CDM_SETCONTROLTEXT:
TRACE("CDM_SETCONTROLTEXT:\n");
if ( 0 != lParam )
SetDlgItemTextA( hwnd, (UINT) wParam, (LPSTR) lParam );
if ( lParam )
{
if( fodInfos->unicode )
SetDlgItemTextW( hwnd, (UINT) wParam, (LPWSTR) lParam );
else
SetDlgItemTextA( hwnd, (UINT) wParam, (LPSTR) lParam );
}
return TRUE;
case CDM_HIDECONTROL:

View file

@ -45,9 +45,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
typedef struct
{
ICOM_VTABLE(IShellBrowser) * lpVtbl;
ICOM_VTABLE(ICommDlgBrowser) * lpVtblCommDlgBrowser;
ICOM_VTABLE(IServiceProvider)* lpVtblServiceProvider;
IShellBrowserVtbl * lpVtbl;
ICommDlgBrowserVtbl * lpVtblCommDlgBrowser;
IServiceProviderVtbl* lpVtblServiceProvider;
DWORD ref; /* Reference counter */
HWND hwndOwner; /* Owner dialog of the interface */
@ -56,9 +56,9 @@ typedef struct
/**************************************************************************
* vtable
*/
static ICOM_VTABLE(IShellBrowser) IShellBrowserImpl_Vtbl;
static ICOM_VTABLE(ICommDlgBrowser) IShellBrowserImpl_ICommDlgBrowser_Vtbl;
static ICOM_VTABLE(IServiceProvider) IShellBrowserImpl_IServiceProvider_Vtbl;
static IShellBrowserVtbl IShellBrowserImpl_Vtbl;
static ICommDlgBrowserVtbl IShellBrowserImpl_ICommDlgBrowser_Vtbl;
static IServiceProviderVtbl IShellBrowserImpl_IServiceProvider_Vtbl;
/**************************************************************************
* Local Prototypes
@ -630,7 +630,7 @@ HRESULT WINAPI IShellBrowserImpl_TranslateAcceleratorSB(IShellBrowser *iface,
return E_NOTIMPL;
}
static ICOM_VTABLE(IShellBrowser) IShellBrowserImpl_Vtbl =
static IShellBrowserVtbl IShellBrowserImpl_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
/* IUnknown */
@ -855,7 +855,7 @@ HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *iface, IS
return S_OK;
}
static ICOM_VTABLE(ICommDlgBrowser) IShellBrowserImpl_ICommDlgBrowser_Vtbl =
static ICommDlgBrowserVtbl IShellBrowserImpl_ICommDlgBrowser_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
/* IUnknown */
@ -945,7 +945,7 @@ HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryService(
}
static ICOM_VTABLE(IServiceProvider) IShellBrowserImpl_IServiceProvider_Vtbl =
static IServiceProviderVtbl IShellBrowserImpl_IServiceProvider_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
/* IUnknown */

View file

@ -162,6 +162,59 @@ void _dump_cf_flags(DWORD cflags)
MESSAGE("\n");
}
/***********************************************************************
* ChooseFontW (COMDLG32.@)
*/
BOOL WINAPI ChooseFontW(LPCHOOSEFONTW lpChFont)
{
LPCVOID template;
HRSRC hResInfo;
HINSTANCE hDlginst;
HGLOBAL hDlgTmpl;
static const WCHAR chooseFontW[] = {'C','H','O','O','S','E','_',
'F','O','N','T',0};
if ( (lpChFont->Flags&CF_ENABLETEMPLATEHANDLE)!=0 )
{
template=(LPCVOID)lpChFont->hInstance;
} else
{
if ( (lpChFont->Flags&CF_ENABLETEMPLATE)!=0 )
{
hDlginst=lpChFont->hInstance;
if( !(hResInfo = FindResourceW(hDlginst, lpChFont->lpTemplateName,
(LPWSTR)RT_DIALOG)))
{
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE;
}
} else
{
hDlginst=COMDLG32_hInstance;
if (!(hResInfo = FindResourceW(hDlginst, chooseFontW, (LPWSTR)RT_DIALOG)))
{
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE;
}
}
if (!(hDlgTmpl = LoadResource(hDlginst, hResInfo )) ||
!(template = LockResource( hDlgTmpl )))
{
COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
return FALSE;
}
}
if (TRACE_ON(commdlg))
_dump_cf_flags(lpChFont->Flags);
if (lpChFont->Flags & (CF_SELECTSCRIPT | CF_NOVERTFONTS ))
FIXME(": unimplemented flag (ignored)\n");
return DialogBoxIndirectParamW(COMDLG32_hInstance, template,
lpChFont->hwndOwner, FormatCharDlgProcW, (LPARAM)lpChFont );
}
/***********************************************************************
* ChooseFontA (COMDLG32.@)
*/
@ -212,165 +265,6 @@ BOOL WINAPI ChooseFontA(LPCHOOSEFONTA lpChFont)
lpChFont->hwndOwner, FormatCharDlgProcA, (LPARAM)lpChFont );
}
/***********************************************************************
* ChooseFontW (COMDLG32.@)
*
* NOTES:
*
* The LOGFONT conversion functions will break if the structure ever
* grows beyond the lfFaceName element.
*
* The CHOOSEFONT conversion functions assume that both versions of
* lpLogFont and lpszStyle (if used) point to pre-allocated objects.
*
* The ASCII version of lpTemplateName is created by ChooseFontAtoW
* and freed by ChooseFontWtoA.
*/
inline static VOID LogFontWtoA(const LOGFONTW *lfw, LOGFONTA *lfa)
{
memcpy(lfa, lfw, sizeof(LOGFONTA));
WideCharToMultiByte(CP_ACP, 0, lfw->lfFaceName, -1, lfa->lfFaceName,
LF_FACESIZE, NULL, NULL);
lfa->lfFaceName[LF_FACESIZE - 1] = '\0';
}
inline static VOID LogFontAtoW(const LOGFONTA *lfa, LOGFONTW *lfw)
{
memcpy(lfw, lfa, sizeof(LOGFONTA));
MultiByteToWideChar(CP_ACP, 0, lfa->lfFaceName, -1, lfw->lfFaceName,
LF_FACESIZE);
lfw->lfFaceName[LF_FACESIZE - 1] = 0;
}
static BOOL ChooseFontWtoA(const CHOOSEFONTW *cfw, CHOOSEFONTA *cfa)
{
LOGFONTA *lpLogFont = cfa->lpLogFont;
LPSTR lpszStyle = cfa->lpszStyle;
memcpy(cfa, cfw, sizeof(CHOOSEFONTA));
cfa->lpLogFont = lpLogFont;
cfa->lpszStyle = lpszStyle;
LogFontWtoA(cfw->lpLogFont, lpLogFont);
if ((cfw->Flags&CF_ENABLETEMPLATE)!=0 && HIWORD(cfw->lpTemplateName)!=0)
{
cfa->lpTemplateName = HEAP_strdupWtoA(GetProcessHeap(), 0,
cfw->lpTemplateName);
if (cfa->lpTemplateName == NULL)
return FALSE;
}
if ((cfw->Flags & CF_USESTYLE) != 0 && cfw->lpszStyle != NULL)
{
WideCharToMultiByte(CP_ACP, 0, cfw->lpszStyle, -1, cfa->lpszStyle,
LF_FACESIZE, NULL, NULL);
cfa->lpszStyle[LF_FACESIZE - 1] = '\0';
}
return TRUE;
}
static VOID ChooseFontAtoW(const CHOOSEFONTA *cfa, CHOOSEFONTW *cfw)
{
LOGFONTW *lpLogFont = cfw->lpLogFont;
LPWSTR lpszStyle = cfw->lpszStyle;
LPCWSTR lpTemplateName = cfw->lpTemplateName;
memcpy(cfw, cfa, sizeof(CHOOSEFONTA));
cfw->lpLogFont = lpLogFont;
cfw->lpszStyle = lpszStyle;
cfw->lpTemplateName = lpTemplateName;
LogFontAtoW(cfa->lpLogFont, lpLogFont);
if ((cfa->Flags&CF_ENABLETEMPLATE)!=0 && HIWORD(cfa->lpTemplateName) != 0)
HeapFree(GetProcessHeap(), 0, (LPSTR)(cfa->lpTemplateName));
if ((cfa->Flags & CF_USESTYLE) != 0 && cfa->lpszStyle != NULL)
{
MultiByteToWideChar(CP_ACP, 0, cfa->lpszStyle, -1, cfw->lpszStyle,
LF_FACESIZE);
cfw->lpszStyle[LF_FACESIZE - 1] = 0;
}
}
BOOL WINAPI ChooseFontW(LPCHOOSEFONTW lpChFont)
{
CHOOSEFONTA cf_a;
LOGFONTA lf_a;
CHAR style_a[LF_FACESIZE];
cf_a.lpLogFont = &lf_a;
cf_a.lpszStyle = style_a;
if (ChooseFontWtoA(lpChFont, &cf_a) == FALSE)
{
COMDLG32_SetCommDlgExtendedError(CDERR_MEMALLOCFAILURE);
return FALSE;
}
if (ChooseFontA(&cf_a) == FALSE)
{
if (cf_a.lpTemplateName != NULL)
HeapFree(GetProcessHeap(), 0, (LPSTR)(cf_a.lpTemplateName));
return FALSE;
}
ChooseFontAtoW(&cf_a, lpChFont);
return TRUE;
}
#if 0
/***********************************************************************
* ChooseFontW (COMDLG32.@)
*/
BOOL WINAPI ChooseFontW(LPCHOOSEFONTW lpChFont)
{
BOOL bRet=FALSE;
CHOOSEFONTA cf32a;
LOGFONTA lf32a;
LPCVOID template;
HANDLE hResInfo, hDlgTmpl;
if (TRACE_ON(commdlg))
_dump_cf_flags(lpChFont->Flags);
if (!(hResInfo = FindResourceA(COMDLG32_hInstance, "CHOOSE_FONT", (LPSTR)RT_DIALOG)))
{
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE;
}
if (!(hDlgTmpl = LoadResource(COMDLG32_hInstance, hResInfo )) ||
!(template = LockResource( hDlgTmpl )))
{
COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
return FALSE;
}
if (lpChFont->Flags & (CF_SELECTSCRIPT | CF_NOVERTFONTS | CF_ENABLETEMPLATE |
CF_ENABLETEMPLATEHANDLE)) FIXME(": unimplemented flag (ignored)\n");
memcpy(&cf32a, lpChFont, sizeof(cf32a));
memcpy(&lf32a, lpChFont->lpLogFont, sizeof(LOGFONTA));
WideCharToMultiByte( CP_ACP, 0, lpChFont->lpLogFont->lfFaceName, -1,
lf32a.lfFaceName, LF_FACESIZE, NULL, NULL );
lf32a.lfFaceName[LF_FACESIZE-1] = 0;
cf32a.lpLogFont=&lf32a;
cf32a.lpszStyle=HEAP_strdupWtoA(GetProcessHeap(), 0, lpChFont->lpszStyle);
lpChFont->lpTemplateName=(LPWSTR)&cf32a;
bRet = DialogBoxIndirectParamW(COMDLG32_hInstance, template,
lpChFont->hwndOwner, FormatCharDlgProcW, (LPARAM)lpChFont );
HeapFree(GetProcessHeap(), 0, cf32a.lpszStyle);
lpChFont->lpTemplateName=(LPWSTR)cf32a.lpTemplateName;
memcpy(lpChFont->lpLogFont, &lf32a, sizeof(CHOOSEFONTA));
MultiByteToWideChar( CP_ACP, 0, lf32a.lfFaceName, -1,
lpChFont->lpLogFont->lfFaceName, LF_FACESIZE );
lpChFont->lpLogFont->lfFaceName[LF_FACESIZE-1] = 0;
return bRet;
}
#endif
#define TEXT_EXTRAS 4
#define TEXT_COLORS 16
@ -1235,7 +1129,6 @@ INT_PTR CALLBACK FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam,
LPARAM lParam)
{
LPCHOOSEFONTW lpcf32w;
LPCHOOSEFONTA lpcf32a;
INT_PTR res = FALSE;
if (uMsg!=WM_INITDIALOG)
{
@ -1250,8 +1143,7 @@ INT_PTR CALLBACK FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam,
else
{
lpcf32w=(LPCHOOSEFONTW)lParam;
lpcf32a=(LPCHOOSEFONTA)lpcf32w->lpTemplateName;
if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcf32a))
if (!CFn_WMInitDialog(hDlg, wParam, lParam, (LPCHOOSEFONTA)lpcf32w))
{
TRACE("CFn_WMInitDialog returned FALSE\n");
return FALSE;
@ -1259,7 +1151,6 @@ INT_PTR CALLBACK FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam,
if (CFn_HookCallChk32((LPCHOOSEFONTA)lpcf32w))
return CallWindowProcW((WNDPROC)lpcf32w->lpfnHook,hDlg,WM_INITDIALOG,wParam,lParam);
}
lpcf32a=(LPCHOOSEFONTA)lpcf32w->lpTemplateName;
switch (uMsg)
{
case WM_MEASUREITEM:
@ -1267,7 +1158,7 @@ INT_PTR CALLBACK FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam,
case WM_DRAWITEM:
return CFn_WMDrawItem(hDlg, wParam, lParam);
case WM_COMMAND:
return CFn_WMCommand(hDlg, wParam, lParam, lpcf32a);
return CFn_WMCommand(hDlg, wParam, lParam, (LPCHOOSEFONTW)lpcf32w);
case WM_DESTROY:
return CFn_WMDestroy(hDlg, wParam, lParam);
case WM_CHOOSEFONT_GETLOGFONT:

View file

@ -1204,6 +1204,10 @@ static LRESULT PRINTDLG_WMInitDialog(HWND hDlg, WPARAM wParam,
PrintStructures->hLandscapeIcon =
LoadIconA(COMDLG32_hInstance, "PD32_LANDSCAPE");
/* display the collate/no_collate icon */
SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON,
(LPARAM)PrintStructures->hNoCollateIcon);
if(PrintStructures->hCollateIcon == 0 ||
PrintStructures->hNoCollateIcon == 0 ||
PrintStructures->hPortraitIcon == 0 ||
@ -1308,6 +1312,10 @@ static LRESULT PRINTDLG_WMInitDialogW(HWND hDlg, WPARAM wParam,
PrintStructures->hLandscapeIcon =
LoadIconA(COMDLG32_hInstance, "PD32_LANDSCAPE");
/* display the collate/no_collate icon */
SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON,
(LPARAM)PrintStructures->hNoCollateIcon);
if(PrintStructures->hCollateIcon == 0 ||
PrintStructures->hNoCollateIcon == 0 ||
PrintStructures->hPortraitIcon == 0 ||
@ -1622,20 +1630,9 @@ static LRESULT PRINTDLG_WMCommandW(HWND hDlg, WPARAM wParam,
if(HIWORD(wParam) == EN_CHANGE) {
INT copies = GetDlgItemInt(hDlg, edt3, NULL, FALSE);
if(copies <= 1)
{
CheckDlgButton(hDlg, chx2, BST_UNCHECKED);
SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE,
(WPARAM) IMAGE_ICON, 0);
EnableWindow(GetDlgItem(hDlg, chx2), FALSE);
}
else
{
EnableWindow(GetDlgItem(hDlg, chx2), TRUE);
SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE,
(WPARAM) IMAGE_ICON,
(LPARAM)PrintStructures->hNoCollateIcon);
}
}
break;

View file

@ -1,10 +1,10 @@
Index: printdlg.c
===================================================================
RCS file: /home/wine/wine/dlls/commdlg/printdlg.c,v
retrieving revision 1.75
diff -u -r1.75 printdlg.c
--- printdlg.c 19 Apr 2004 20:12:15 -0000 1.75
+++ printdlg.c 16 Jun 2004 07:02:58 -0000
retrieving revision 1.78
diff -u -r1.78 printdlg.c
--- printdlg.c 19 Jul 2004 19:35:28 -0000 1.78
+++ printdlg.c 14 Aug 2004 19:34:17 -0000
@@ -341,7 +341,7 @@
lpdm->dmCollate =
(IsDlgButtonChecked(hDlg, chx2) == BST_CHECKED);
@ -107,7 +107,7 @@ diff -u -r1.75 printdlg.c
PRINTDLG_SetUpPaperComboBoxW(hDlg, cmb2,
PrintStructures->lpPrinterInfo->pPrinterName,
@@ -1490,7 +1490,7 @@
@@ -1498,7 +1498,7 @@
case rad1: /* Paperorientation */
if (lppd->Flags & PD_PRINTSETUP)
{
@ -116,7 +116,7 @@ diff -u -r1.75 printdlg.c
SendDlgItemMessageA(hDlg, ico1, STM_SETIMAGE, (WPARAM) IMAGE_ICON,
(LPARAM)(PrintStructures->hPortraitIcon));
}
@@ -1499,7 +1499,7 @@
@@ -1507,7 +1507,7 @@
case rad2: /* Paperorientation */
if (lppd->Flags & PD_PRINTSETUP)
{
@ -125,7 +125,7 @@ diff -u -r1.75 printdlg.c
SendDlgItemMessageA(hDlg, ico1, STM_SETIMAGE, (WPARAM) IMAGE_ICON,
(LPARAM)(PrintStructures->hLandscapeIcon));
}
@@ -1523,7 +1523,7 @@
@@ -1531,7 +1531,7 @@
{
DWORD Sel = SendDlgItemMessageA(hDlg, cmb2, CB_GETCURSEL, 0, 0);
if(Sel != CB_ERR)
@ -134,7 +134,7 @@ diff -u -r1.75 printdlg.c
CB_GETITEMDATA,
Sel, 0);
}
@@ -1533,7 +1533,7 @@
@@ -1541,7 +1541,7 @@
{
DWORD Sel = SendDlgItemMessageA(hDlg, cmb3, CB_GETCURSEL, 0, 0);
if(Sel != CB_ERR)
@ -143,7 +143,7 @@ diff -u -r1.75 printdlg.c
CB_GETITEMDATA, Sel,
0);
}
@@ -1544,8 +1544,8 @@
@@ -1552,8 +1552,8 @@
case rad1: /* orientation */
case rad2:
if (IsDlgButtonChecked(hDlg, rad1) == BST_CHECKED) {
@ -154,7 +154,7 @@ diff -u -r1.75 printdlg.c
SendDlgItemMessageA(hDlg, stc10, STM_SETIMAGE,
(WPARAM)IMAGE_ICON,
(LPARAM)PrintStructures->hPortraitIcon);
@@ -1554,8 +1554,8 @@
@@ -1562,8 +1562,8 @@
(LPARAM)PrintStructures->hPortraitIcon);
}
} else {
@ -165,7 +165,7 @@ diff -u -r1.75 printdlg.c
SendDlgItemMessageA(hDlg, stc10, STM_SETIMAGE,
(WPARAM)IMAGE_ICON,
(LPARAM)PrintStructures->hLandscapeIcon);
@@ -1654,7 +1654,7 @@
@@ -1662,7 +1662,7 @@
case rad1: /* Paperorientation */
if (lppd->Flags & PD_PRINTSETUP)
{
@ -174,7 +174,7 @@ diff -u -r1.75 printdlg.c
SendDlgItemMessageA(hDlg, ico1, STM_SETIMAGE, (WPARAM) IMAGE_ICON,
(LPARAM)(PrintStructures->hPortraitIcon));
}
@@ -1663,7 +1663,7 @@
@@ -1671,7 +1671,7 @@
case rad2: /* Paperorientation */
if (lppd->Flags & PD_PRINTSETUP)
{
@ -183,7 +183,7 @@ diff -u -r1.75 printdlg.c
SendDlgItemMessageA(hDlg, ico1, STM_SETIMAGE, (WPARAM) IMAGE_ICON,
(LPARAM)(PrintStructures->hLandscapeIcon));
}
@@ -1687,7 +1687,7 @@
@@ -1695,7 +1695,7 @@
{
DWORD Sel = SendDlgItemMessageA(hDlg, cmb2, CB_GETCURSEL, 0, 0);
if(Sel != CB_ERR)
@ -192,7 +192,7 @@ diff -u -r1.75 printdlg.c
CB_GETITEMDATA,
Sel, 0);
}
@@ -1697,7 +1697,7 @@
@@ -1705,7 +1705,7 @@
{
DWORD Sel = SendDlgItemMessageA(hDlg, cmb3, CB_GETCURSEL, 0, 0);
if(Sel != CB_ERR)
@ -201,7 +201,7 @@ diff -u -r1.75 printdlg.c
CB_GETITEMDATA, Sel,
0);
}
@@ -1708,8 +1708,8 @@
@@ -1716,8 +1716,8 @@
case rad1: /* orientation */
case rad2:
if (IsDlgButtonChecked(hDlg, rad1) == BST_CHECKED) {
@ -212,7 +212,7 @@ diff -u -r1.75 printdlg.c
SendDlgItemMessageA(hDlg, stc10, STM_SETIMAGE,
(WPARAM)IMAGE_ICON,
(LPARAM)PrintStructures->hPortraitIcon);
@@ -1718,8 +1718,8 @@
@@ -1726,8 +1726,8 @@
(LPARAM)PrintStructures->hPortraitIcon);
}
} else {
@ -223,7 +223,7 @@ diff -u -r1.75 printdlg.c
SendDlgItemMessageA(hDlg, stc10, STM_SETIMAGE,
(WPARAM)IMAGE_ICON,
(LPARAM)PrintStructures->hLandscapeIcon);
@@ -2911,7 +2911,7 @@
@@ -2919,7 +2919,7 @@
/***********************************************************************
* PrintDlgExA (COMDLG32.@)
*/
@ -232,7 +232,7 @@ diff -u -r1.75 printdlg.c
{
FIXME("stub\n");
return E_NOTIMPL;
@@ -2919,7 +2919,7 @@
@@ -2927,7 +2927,7 @@
/***********************************************************************
* PrintDlgExW (COMDLG32.@)
*/