Changeset 265 for trunk/src/user32/dialog.cpp
- Timestamp:
- Jul 4, 1999, 9:03:36 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/dialog.cpp
r217 r265 1 /* $Id: dialog.cpp,v 1. 5 1999-06-26 13:46:21sandervl Exp $ */1 /* $Id: dialog.cpp,v 1.6 1999-07-04 19:02:38 sandervl Exp $ */ 2 2 3 3 /* … … 20 20 //****************************************************************************** 21 21 //****************************************************************************** 22 HWND WIN32API CreateDialogParamA(HINSTANCE hinst, LPCSTR lpszTemplate, 23 HWND hwndOwner, DLGPROC dlgproc, 24 22 HWND WIN32API CreateDialogParamA(HINSTANCE hinst, LPCSTR lpszTemplate, 23 HWND hwndOwner, DLGPROC dlgproc, 24 LPARAM lParamInit) 25 25 { 26 26 HWND rc; … … 31 31 WriteLog("OS2CreateDialogParamA %s\n", lpszTemplate); 32 32 #endif 33 33 lpszTemplate = (LPCSTR)ConvertNameId(hinst, (char *)lpszTemplate); 34 34 } 35 35 #ifdef DEBUG … … 38 38 39 39 if(dlgproc) { 40 41 40 dialog = new Win32WindowProc((WNDPROC)dlgproc); 41 rc = O32_CreateDialogParam(hinst, lpszTemplate, hwndOwner, (DLGPROC_O32)dialog->GetOS2Callback(), lParamInit); 42 42 } 43 43 else rc = O32_CreateDialogParam(hinst, lpszTemplate, hwndOwner, (DLGPROC_O32)O32_DefDlgProc, lParamInit); 44 44 45 45 if(rc == 0 && dialog) { 46 46 delete(dialog); 47 47 } 48 48 … … 54 54 //****************************************************************************** 55 55 //****************************************************************************** 56 HWND WIN32API CreateDialogParamW(HINSTANCE hinst, LPCWSTR lpszTemplate, 57 HWND hwndOwner, DLGPROC dlgproc, 58 56 HWND WIN32API CreateDialogParamW(HINSTANCE hinst, LPCWSTR lpszTemplate, 57 HWND hwndOwner, DLGPROC dlgproc, 58 LPARAM lParamInit) 59 59 { 60 60 HWND rc; 61 61 62 62 if((int)lpszTemplate >> 16 != 0) {//convert string name identifier to numeric id 63 63 char *astring = UnicodeToAsciiString((LPWSTR)lpszTemplate); 64 64 #ifdef DEBUG 65 65 WriteLog("OS2CreateDialogParamW %s\n", astring); 66 66 #endif 67 68 67 lpszTemplate = (LPWSTR)ConvertNameId(hinst, astring); 68 FreeAsciiString(astring); 69 69 } 70 70 #ifdef DEBUG … … 73 73 74 74 Win32WindowProc *dialog = new Win32WindowProc((WNDPROC)dlgproc); 75 75 76 76 rc = O32_CreateDialogParam(hinst, (LPCSTR)lpszTemplate, hwndOwner, (DLGPROC_O32)dialog->GetOS2Callback(), lParamInit); 77 77 if(rc == 0) { 78 78 delete(dialog); 79 79 } 80 80 … … 86 86 //****************************************************************************** 87 87 //****************************************************************************** 88 HWND WIN32API CreateDialogIndirectParamA(HINSTANCE hinst, 89 DLGTEMPLATE *dlgtemplate, 90 HWND hwndParent, DLGPROC dlgproc, 91 92 { 93 HWND 88 HWND WIN32API CreateDialogIndirectParamA(HINSTANCE hinst, 89 DLGTEMPLATE *dlgtemplate, 90 HWND hwndParent, DLGPROC dlgproc, 91 LPARAM lParamInit) 92 { 93 HWND hwnd; 94 94 DLGTEMPLATE *os2dlg; 95 95 … … 99 99 hwnd = O32_CreateDialogIndirectParam(hinst, os2dlg, hwndParent, (DLGPROC_O32)dialog->GetOS2Callback(), lParamInit); 100 100 if(hwnd == 0) { 101 101 delete(dialog); 102 102 } 103 103 #ifdef DEBUG … … 108 108 //****************************************************************************** 109 109 //****************************************************************************** 110 HWND WIN32API CreateDialogIndirectParamW(HINSTANCE hinst, 111 DLGTEMPLATE *dlgtemplate, 112 HWND hwndParent, DLGPROC dlgproc, 113 114 { 115 HWND 110 HWND WIN32API CreateDialogIndirectParamW(HINSTANCE hinst, 111 DLGTEMPLATE *dlgtemplate, 112 HWND hwndParent, DLGPROC dlgproc, 113 LPARAM lParamInit) 114 { 115 HWND hwnd; 116 116 DLGTEMPLATE *os2dlg; 117 117 … … 121 121 hwnd = O32_CreateDialogIndirectParam(hinst, os2dlg, hwndParent, (DLGPROC_O32)dialog->GetOS2Callback(), lParamInit); 122 122 if(hwnd == 0) { 123 123 delete(dialog); 124 124 } 125 125 dprintf(("CreateDialogIndirectParamW returned %X\n", hwnd)); … … 128 128 //****************************************************************************** 129 129 //****************************************************************************** 130 BOOL WIN32API DialogBoxIndirectParamA(HINSTANCE hinst, 131 DLGTEMPLATE *dlgtemplate, 132 HWND hwndParent, DLGPROC dlgproc, 133 130 BOOL WIN32API DialogBoxIndirectParamA(HINSTANCE hinst, 131 DLGTEMPLATE *dlgtemplate, 132 HWND hwndParent, DLGPROC dlgproc, 133 LPARAM lParamInit) 134 134 { 135 135 BOOL rc; … … 137 137 138 138 os2dlg = ConvertWin32DlgTemplate(dlgtemplate); 139 139 140 Win32WindowProc *dialog = new Win32WindowProc((WNDPROC)dlgproc, os2dlg); 140 141 … … 146 147 //****************************************************************************** 147 148 //****************************************************************************** 148 BOOL WIN32API DialogBoxIndirectParamW(HINSTANCE hinst, 149 DLGTEMPLATE *dlgtemplate, 150 HWND hwndParent, DLGPROC dlgproc, 151 149 BOOL WIN32API DialogBoxIndirectParamW(HINSTANCE hinst, 150 DLGTEMPLATE *dlgtemplate, 151 HWND hwndParent, DLGPROC dlgproc, 152 LPARAM lParamInit) 152 153 { 153 154 BOOL rc; … … 165 166 //****************************************************************************** 166 167 int WIN32API DialogBoxParamA(HINSTANCE hinst, LPCSTR lpszTemplate, HWND hwndOwner, 167 168 DLGPROC dlgprc, LPARAM lParamInit) 168 169 { 169 170 int rc; 170 171 171 172 if((int)lpszTemplate >> 16 != 0) {//convert string name identifier to numeric id 172 173 174 } 175 else { 176 173 dprintf(("DialogBoxParam %s\n", lpszTemplate)); 174 lpszTemplate = (LPCSTR)ConvertNameId(hinst, (char *)lpszTemplate); 175 } 176 else { 177 dprintf(("DialogBoxParam %d\n", (int)lpszTemplate)); 177 178 } 178 179 … … 185 186 //****************************************************************************** 186 187 //****************************************************************************** 187 int WIN32API DialogBoxParamW(HINSTANCE arg1, LPCWSTR arg2, HWND arg3, 188 188 int WIN32API DialogBoxParamW(HINSTANCE arg1, LPCWSTR arg2, HWND arg3, 189 DLGPROC arg4, LPARAM arg5) 189 190 { 190 191 int rc; … … 193 194 194 195 if((int)arg2 >> 16 != 0) { 195 196 astring = UnicodeToAsciiString((LPWSTR)arg2); 196 197 } 197 198 else astring = (char *)arg2; … … 200 201 Win32WindowProc *dialog = new Win32WindowProc((WNDPROC)arg4); 201 202 rc = DialogBoxParamA(arg1, astring, arg3, arg4, arg5); 202 203 if((int)astring >> 16 != 0) 203 204 if((int)astring >> 16 != 0) FreeAsciiString(astring); 204 205 205 206 dprintf(("OS2DialogBoxIndirectParamA returned %d\n", rc)); … … 208 209 } 209 210 //****************************************************************************** 210 //****************************************************************************** 211 211 // CB: Loads and starts a native OS/2 dialog with Win32 DlgProc 212 // (used in COMCTL32) 213 // full name: NativeDialogBoxIndirectParam 214 //****************************************************************************** 215 INT WINAPI NativeDlgBoxIP(HMODULE hmodule, 216 HINSTANCE hinst, LPCSTR lpszName, 217 HWND hwndParent, DLGPROC dlgproc, 218 LPARAM lParamInit) 219 { 220 BOOL rc; 221 DLGTEMPLATE *os2dlg; 222 HRSRC hRes; 223 224 dprintf(("NativeDlgBoxIP")); 225 226 hRes = O32_FindResource(hmodule,lpszName,RT_DIALOGA); 227 if (hRes == 0) return (INT)-1; 228 229 dprintf((" hRes = %d",hRes)); 230 231 os2dlg = (DLGTEMPLATE*)O32_LoadResource(hmodule,hRes); 232 if (os2dlg == NULL) return (INT)-1; 233 234 dprintf((" os2dlg = %d",os2dlg)); 235 236 Win32WindowProc *dialog = new Win32WindowProc((WNDPROC)dlgproc,os2dlg); 237 rc = O32_DialogBoxIndirectParam(hinst,os2dlg,hwndParent,(DLGPROC_O32)dialog->GetOS2Callback(),lParamInit); 238 //dialog already destroyed when this returns 239 dprintf(("NativeDlgBoxIP returned %X\n", rc)); 240 241 return rc; 242 } 243 //****************************************************************************** 244 //****************************************************************************** 245 //****************************************************************************** 246 // CB: Loads and starts a native OS/2 dialog with Win32 DlgProc 247 // (used in COMCTL32) 248 // full name: NativeCreateDialogIndirectParam 249 //****************************************************************************** 250 INT WINAPI NativeCreateDlgIP(HMODULE hmodule, 251 HINSTANCE hinst, LPCSTR lpszName, 252 HWND hwndParent, DLGPROC dlgproc, 253 LPARAM lParamInit) 254 { 255 BOOL rc; 256 DLGTEMPLATE *os2dlg; 257 HRSRC hRes; 258 259 dprintf(("NativeCreateDlgBoxIP")); 260 261 hRes = O32_FindResource(hmodule,lpszName,RT_DIALOGA); 262 if (hRes == 0) return (INT)-1; 263 264 dprintf((" hRes = %d",hRes)); 265 266 os2dlg = (DLGTEMPLATE*)O32_LoadResource(hmodule,hRes); 267 if (os2dlg == NULL) return (INT)-1; 268 269 dprintf((" os2dlg = %d",os2dlg)); 270 271 Win32WindowProc *dialog = new Win32WindowProc((WNDPROC)dlgproc,os2dlg); 272 rc = O32_CreateDialogIndirectParam(hinst,os2dlg,hwndParent,(DLGPROC_O32)dialog->GetOS2Callback(),lParamInit); 273 //dialog already destroyed when this returns 274 dprintf(("NativeDlgBoxIP returned %X\n", rc)); 275 276 return rc; 277 } 278 //****************************************************************************** 279 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.