source: trunk/src/comdlg32/comdlg32.cpp@ 5481

Last change on this file since 5481 was 5481, checked in by sandervl, 24 years ago

compile fixes

File size: 4.4 KB
Line 
1/* $Id: comdlg32.cpp,v 1.29 2001-04-05 05:55:07 sandervl Exp $ */
2
3/*
4 * COMDLG32 implementation
5 *
6 * Copyright 1998 Sander van Leeuwen
7 * Copyright 1999 Patrick Haller
8 *
9 * Project Odin Software License can be found in LICENSE.TXT
10 *
11 */
12
13
14/****************************************************************************
15 * Includes *
16 ****************************************************************************/
17
18#include <os2win.h>
19#include <stdarg.h>
20#include <stdlib.h>
21#include <string.h>
22#include <misc.h>
23#include <odinwrap.h>
24#include <winuser32.h>
25#include <unicode.h>
26
27ODINDEBUGCHANNEL(COMDLG32-COMDLG32)
28
29
30#define COMDLG32_CHECKHOOK(a,b,c) \
31 if(a->Flags & b) \
32 { \
33 a->lpfnHook = 0; \
34 } \
35 a->hwndOwner = Win32ToOS2Handle(a->hwndOwner);
36
37#define COMDLG32_CHECKHOOK2(a,b,c,d) \
38 if(a->Flags & b) \
39 { \
40 a->d = 0; \
41 } \
42 a->hwndOwner = Win32ToOS2Handle(a->hwndOwner);
43
44
45/*****************************************************************************
46 * Name :
47 * Purpose :
48 * Parameters:
49 * Variables :
50 * Result :
51 * Remark :
52 * Status :
53 *
54 * Author : Patrick Haller [Tue, 1998/02/10 01:55]
55 *****************************************************************************/
56
57ODINFUNCTION1(BOOL, PrintDlgA,
58 LPPRINTDLGA, lppd)
59{
60
61 COMDLG32_CHECKHOOK2(lppd, PD_ENABLEPRINTHOOK, LPPRINTHOOKPROC,lpfnPrintHook)
62 COMDLG32_CHECKHOOK2(lppd, PD_ENABLESETUPHOOK, LPSETUPHOOKPROC,lpfnSetupHook)
63
64 return O32_PrintDlg(lppd);
65}
66
67
68/*****************************************************************************
69 * Name :
70 * Purpose :
71 * Parameters:
72 * Variables :
73 * Result :
74 * Remark :
75 * Status :
76 *
77 * Author : Patrick Haller [Tue, 1998/02/10 01:55]
78 *****************************************************************************/
79
80ODINFUNCTION1(BOOL, PrintDlgW,
81 LPPRINTDLGW, lppd)
82{
83
84 PRINTDLGA pd;
85 BOOL bResult;
86
87 memcpy(&pd, // make binary copy first to save all the fields
88 lppd,
89 sizeof(pd));
90
91 // convert to ASCII string
92 if ((lppd->Flags & PD_ENABLEPRINTTEMPLATE) &&
93 (lppd->lpPrintTemplateName != NULL))
94 pd.lpPrintTemplateName = UnicodeToAsciiString((WCHAR*)lppd->lpPrintTemplateName);
95 else
96 pd.lpPrintTemplateName = NULL;
97
98 if ((lppd->Flags & PD_ENABLESETUPTEMPLATE) &&
99 (lppd->lpSetupTemplateName != NULL))
100 pd.lpSetupTemplateName = UnicodeToAsciiString((WCHAR*)lppd->lpSetupTemplateName);
101 else
102 pd.lpSetupTemplateName = NULL;
103
104 COMDLG32_CHECKHOOK2((&pd), PD_ENABLEPRINTHOOK, LPPRINTHOOKPROC,lpfnPrintHook)
105 COMDLG32_CHECKHOOK2((&pd), PD_ENABLESETUPHOOK, LPSETUPHOOKPROC,lpfnSetupHook)
106
107 bResult = O32_PrintDlg(&pd); // call ASCII API
108
109 if (pd.lpPrintTemplateName != NULL) FreeAsciiString((char*)pd.lpPrintTemplateName);
110 if (pd.lpSetupTemplateName != NULL) FreeAsciiString((char*)pd.lpSetupTemplateName);
111
112 // copy back result
113 lppd->Flags = pd.Flags;
114 lppd->nFromPage = pd.nFromPage;
115 lppd->nToPage = pd.nToPage;
116 lppd->nMinPage = pd.nMinPage;
117 lppd->nMaxPage = pd.nMaxPage;
118 lppd->nCopies = pd.nCopies;
119 //@@@PH: all pass-back fields ?
120
121 return bResult;
122}
123
124
125/*****************************************************************************
126 * Name :
127 * Purpose :
128 * Parameters:
129 * Variables :
130 * Result :
131 * Remark :
132 * Status :
133 *
134 * Author : Patrick Haller [Tue, 1998/02/10 01:55]
135 *****************************************************************************/
136
137ODINFUNCTION1(BOOL, PageSetupDlgA,
138 LPPAGESETUPDLGA, lppsd)
139{
140
141 dprintf(("COMDLG32: PageSetupDlgA not implemented.\n"));
142
143 //COMDLG32_CHECKHOOK2(lppsd, PSD_ENABLESETUPHOOK, LPPAGESETUPHOOK, lpfnPageSetupHook)
144
145 return(FALSE);
146}
147
148
149/*****************************************************************************
150 * Name :
151 * Purpose :
152 * Parameters:
153 * Variables :
154 * Result :
155 * Remark :
156 * Status :
157 *
158 * Author : Patrick Haller [Tue, 1998/02/10 01:55]
159 *****************************************************************************/
160
161ODINFUNCTION1(BOOL, PageSetupDlgW,
162 LPPAGESETUPDLGW, lppsd)
163{
164
165 dprintf(("COMDLG32: PageSetupDlgW(%08xh) not implemented.\n"));
166
167 //COMDLG32_CHECKHOOK2(lppsd, PSD_ENABLESETUPHOOK, LPPAGESETUPHOOK, lpfnPageSetupHook)
168
169 return(FALSE);
170}
171
Note: See TracBrowser for help on using the repository browser.