| 1 | /* $Id: dialog.cpp,v 1.6 1999-08-24 18:58:00 phaller Exp $ */ | 
|---|
| 2 |  | 
|---|
| 3 | /* | 
|---|
| 4 | * Win32 dialog API functions for OS/2 | 
|---|
| 5 | * | 
|---|
| 6 | * Copyright 1998 Sander van Leeuwen | 
|---|
| 7 | * | 
|---|
| 8 | * | 
|---|
| 9 | * Project Odin Software License can be found in LICENSE.TXT | 
|---|
| 10 | * | 
|---|
| 11 | */ | 
|---|
| 12 | #include <os2win.h> | 
|---|
| 13 | #include <nameid.h> | 
|---|
| 14 | #include "user32.h" | 
|---|
| 15 | #include "wndproc.h" | 
|---|
| 16 | #include "wndclass.h" | 
|---|
| 17 |  | 
|---|
| 18 | //****************************************************************************** | 
|---|
| 19 | //****************************************************************************** | 
|---|
| 20 | HWND WIN32API CreateDialogParamA(HINSTANCE hinst, LPCSTR lpszTemplate, | 
|---|
| 21 | HWND hwndOwner, DLGPROC dlgproc, | 
|---|
| 22 | LPARAM lParamInit) | 
|---|
| 23 | { | 
|---|
| 24 | HWND rc; | 
|---|
| 25 |  | 
|---|
| 26 | if((int)lpszTemplate >> 16 != 0) {//convert string name identifier to numeric id | 
|---|
| 27 | #ifdef DEBUG | 
|---|
| 28 | WriteLog("OS2CreateDialogParamA %s\n", lpszTemplate); | 
|---|
| 29 | #endif | 
|---|
| 30 | lpszTemplate = (LPCSTR)ConvertNameId(hinst, (char *)lpszTemplate); | 
|---|
| 31 | } | 
|---|
| 32 | #ifdef DEBUG | 
|---|
| 33 | else WriteLog("OS2CreateDialogParamA %d\n", (int)lpszTemplate); | 
|---|
| 34 | #endif | 
|---|
| 35 |  | 
|---|
| 36 | return(rc); | 
|---|
| 37 | } | 
|---|
| 38 | //****************************************************************************** | 
|---|
| 39 | //****************************************************************************** | 
|---|
| 40 | HWND WIN32API CreateDialogParamW(HINSTANCE hinst, LPCWSTR lpszTemplate, | 
|---|
| 41 | HWND hwndOwner, DLGPROC dlgproc, | 
|---|
| 42 | LPARAM lParamInit) | 
|---|
| 43 | { | 
|---|
| 44 | HWND rc; | 
|---|
| 45 |  | 
|---|
| 46 | if((int)lpszTemplate >> 16 != 0) {//convert string name identifier to numeric id | 
|---|
| 47 | char *astring = UnicodeToAsciiString((LPWSTR)lpszTemplate); | 
|---|
| 48 | #ifdef DEBUG | 
|---|
| 49 | WriteLog("OS2CreateDialogParamW %s\n", astring); | 
|---|
| 50 | #endif | 
|---|
| 51 | lpszTemplate = (LPWSTR)ConvertNameId(hinst, astring); | 
|---|
| 52 | FreeAsciiString(astring); | 
|---|
| 53 | } | 
|---|
| 54 | #ifdef DEBUG | 
|---|
| 55 | else WriteLog("OS2CreateDialogParamW %d\n", (int)lpszTemplate); | 
|---|
| 56 | #endif | 
|---|
| 57 |  | 
|---|
| 58 | return(rc); | 
|---|
| 59 | } | 
|---|
| 60 | //****************************************************************************** | 
|---|
| 61 | //****************************************************************************** | 
|---|
| 62 | HWND WIN32API CreateDialogIndirectParamA(HINSTANCE hinst, | 
|---|
| 63 | DLGTEMPLATE *dlgtemplate, | 
|---|
| 64 | HWND hwndParent, DLGPROC dlgproc, | 
|---|
| 65 | LPARAM lParamInit) | 
|---|
| 66 | { | 
|---|
| 67 | HWND hwnd; | 
|---|
| 68 |  | 
|---|
| 69 | return(0); | 
|---|
| 70 | } | 
|---|
| 71 | //****************************************************************************** | 
|---|
| 72 | //****************************************************************************** | 
|---|
| 73 | HWND WIN32API CreateDialogIndirectParamW(HINSTANCE hinst, | 
|---|
| 74 | DLGTEMPLATE *dlgtemplate, | 
|---|
| 75 | HWND hwndParent, DLGPROC dlgproc, | 
|---|
| 76 | LPARAM lParamInit) | 
|---|
| 77 | { | 
|---|
| 78 | HWND hwnd; | 
|---|
| 79 |  | 
|---|
| 80 | return(0); | 
|---|
| 81 | } | 
|---|
| 82 | //****************************************************************************** | 
|---|
| 83 | //****************************************************************************** | 
|---|
| 84 | BOOL WIN32API DialogBoxIndirectParamA(HINSTANCE hinst, | 
|---|
| 85 | DLGTEMPLATE *dlgtemplate, | 
|---|
| 86 | HWND hwndParent, DLGPROC dlgproc, | 
|---|
| 87 | LPARAM lParamInit) | 
|---|
| 88 | { | 
|---|
| 89 | return(0); | 
|---|
| 90 | } | 
|---|
| 91 | //****************************************************************************** | 
|---|
| 92 | //****************************************************************************** | 
|---|
| 93 | BOOL WIN32API DialogBoxIndirectParamW(HINSTANCE hinst, | 
|---|
| 94 | DLGTEMPLATE *dlgtemplate, | 
|---|
| 95 | HWND hwndParent, DLGPROC dlgproc, | 
|---|
| 96 | LPARAM lParamInit) | 
|---|
| 97 | { | 
|---|
| 98 | return(0); | 
|---|
| 99 | } | 
|---|
| 100 | //****************************************************************************** | 
|---|
| 101 | //****************************************************************************** | 
|---|
| 102 | int WIN32API DialogBoxParamA(HINSTANCE hinst, LPCSTR lpszTemplate, HWND hwndOwner, | 
|---|
| 103 | DLGPROC dlgprc, LPARAM  lParamInit) | 
|---|
| 104 | { | 
|---|
| 105 | int rc; | 
|---|
| 106 |  | 
|---|
| 107 | if((int)lpszTemplate >> 16 != 0) {//convert string name identifier to numeric id | 
|---|
| 108 | dprintf(("DialogBoxParam %s\n", lpszTemplate)); | 
|---|
| 109 | lpszTemplate = (LPCSTR)ConvertNameId(hinst, (char *)lpszTemplate); | 
|---|
| 110 | } | 
|---|
| 111 | else { | 
|---|
| 112 | dprintf(("DialogBoxParam %d\n", (int)lpszTemplate)); | 
|---|
| 113 | } | 
|---|
| 114 |  | 
|---|
| 115 | return(0); | 
|---|
| 116 | } | 
|---|
| 117 | //****************************************************************************** | 
|---|
| 118 | //****************************************************************************** | 
|---|
| 119 | int WIN32API DialogBoxParamW(HINSTANCE arg1, LPCWSTR arg2, HWND arg3, | 
|---|
| 120 | DLGPROC arg4, LPARAM arg5) | 
|---|
| 121 | { | 
|---|
| 122 | int   rc; | 
|---|
| 123 | char *astring = NULL; | 
|---|
| 124 |  | 
|---|
| 125 |  | 
|---|
| 126 | if((int)arg2 >> 16 != 0) { | 
|---|
| 127 | astring = UnicodeToAsciiString((LPWSTR)arg2); | 
|---|
| 128 | } | 
|---|
| 129 | else    astring = (char *)arg2; | 
|---|
| 130 | dprintf(("OS2DialogBoxParamW\n")); | 
|---|
| 131 |  | 
|---|
| 132 | if((int)astring >> 16 != 0) FreeAsciiString(astring); | 
|---|
| 133 |  | 
|---|
| 134 | dprintf(("OS2DialogBoxIndirectParamA returned %d\n", rc)); | 
|---|
| 135 |  | 
|---|
| 136 | return(0); | 
|---|
| 137 | } | 
|---|
| 138 | //****************************************************************************** | 
|---|
| 139 | //****************************************************************************** | 
|---|
| 140 |  | 
|---|