Changeset 29 for branches/1.0
- Timestamp:
- Apr 21, 2010, 7:37:01 PM (15 years ago)
- Location:
- branches/1.0/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0/src/build.cmd
r28 r29 1 1 @echo off 2 echo Cleaning. 2 3 @del uni.o 3 4 @del uni.pdr 4 5 @del .\de\uni.res 5 echo Done cleaning. 6 gcc -o utils.o utils.c -c>>build.log 6 echo Done. 7 echo Compiling. 8 gcc -o utils.o utils.c -c>build.log 7 9 gcc -o splpd.o splpd.c -c>>build.log 8 gcc -o uni.o uni.c -c> build.log9 10 echo Done compiling.10 gcc -o uni.o uni.c -c>>build.log 11 echo Done. 12 echo Compiling resources. 11 13 cd de 12 RC -r uni.RC uni.RES 14 RC -r uni.RC uni.RES >>build.log 13 15 cd .. 14 echo Done compiling resource. 16 echo Done. 17 echo Linking. 15 18 gcc -Zdll -Zbin-files -Zomf -o uni.pdr utils.o splpd.o uni.o uni.def .\de\uni.res >>build.log 16 echo Done linking. 19 echo Done. 20 echo Attaching EAS. 17 21 ea2 -e DEFAULT_PORT=UNI uni.pdr >>build.log 18 echo Done attaching EA.22 echo Done. 19 23 rem d: 20 24 rem cd \OS2\DLL -
branches/1.0/src/de/uni.dlg
r20 r29 26 26 LTEXT "Working directory:", DT_DIRECTORY, 13, 45, 203, 8 27 27 ENTRYFIELD "", ID_DIRECTORY, 15, 33, 200, 8, ES_MARGIN 28 PUSHBUTTON "Find", PB_FIND, 13, 86, 62, 14, WS_DISABLED 28 PUSHBUTTON "Find", DID_FIND, 13, 86, 62, 14 29 PUSHBUTTON "Setup Wizard", DID_SETUPWIZARD, 155, 86, 62, 14 29 30 END 30 31 END -
branches/1.0/src/uni.c
r26 r29 12 12 #include <stdio.h> 13 13 #include <stdlib.h> 14 #include <process.h> 14 15 #include "utils.h" 15 16 … … 23 24 CHAR szTemp[ STR_LEN_PORTDESC ]; 24 25 CHAR pwBuffer[256]; 26 CHAR setupwiz[256]; 27 CHAR setupparms[256]; 25 28 USHORT i; 26 29 ULONG rc = 0; 27 30 PUCHAR token; 31 BOOL ulResult = MBID_ERROR; 32 BOOL fResult; 33 FILEDLG fd; 34 CHAR szMessage[ _MAX_PATH]; 35 CHAR szDrive[ _MAX_PATH]; 36 CHAR szDir[ _MAX_PATH]; 37 PSZ pszButtonCode; 28 38 29 39 switch (msg) … … 31 41 case WM_INITDLG: 32 42 // WinSendDlgItemMsg(hDlg,ID_BINARY,BM_SETCHECK,MPFROM2SHORT(1,0),NULL); 43 WinSendDlgItemMsg(hDlg,ID_PROGRAM, EM_SETTEXTLIMIT, MPFROMSHORT(128),NULL); 44 WinSendDlgItemMsg(hDlg,ID_PARAMETERS,EM_SETTEXTLIMIT, MPFROMSHORT(128),NULL); 45 WinSendDlgItemMsg(hDlg,ID_DIRECTORY, EM_SETTEXTLIMIT, MPFROMSHORT(128),NULL); 46 33 47 pUniData = (PUNIDATA)mp2; 34 48 WinSetWindowULong (hDlg, QWL_USER, (ULONG)pUniData); … … 158 172 WinDismissDlg(hDlg, TRUE); 159 173 break; 174 case DID_FIND: 175 // setup data 176 memset( &fd, 0, sizeof( fd)); 177 fd.cbSize = sizeof( fd); 178 fd.fl = FDS_CENTER | FDS_HELPBUTTON | FDS_OPEN_DIALOG; 179 fd.pszTitle = "Find executable"; 180 181 WinQueryDlgItemText (hDlg, ID_PROGRAM, sizeof(szTemp), szTemp ); 182 if (strlen(szTemp) > 0) { 183 _splitpath(szTemp, szDrive, szDir, NULL, NULL); 184 strncat(szDrive, szDir, strlen(szDir) -1); 185 strcat(szDrive,"\\*"); 186 strcpy( fd.szFullFile,szDrive); 187 } 188 else strcpy( fd.szFullFile, "C:\\*"); 189 190 // launch dialog 191 fResult = WinFileDlg( HWND_DESKTOP, hDlg, &fd); 192 if (!fResult) 193 sprintf( szMessage, "error launching WinFileDlg\n"); 194 else if (fd.lReturn == DID_OK) { 195 WinSetDlgItemText(hDlg,ID_PROGRAM,fd.szFullFile); 196 _splitpath(fd.szFullFile, szDrive, szDir, NULL, NULL); 197 strncat(szDrive, szDir, strlen(szDir) -1); 198 WinSetDlgItemText(hDlg,ID_DIRECTORY,szDrive); 199 } 200 else 201 sprintf( szMessage, "error occurred!\n"); 202 break; 203 case DID_SETUPWIZARD: 204 // preliminary 205 WinDismissDlg(hDlg, TRUE); 206 sprintf(setupwiz,"unipdrcfg.exe"); 207 rc = spawnlp(P_NOWAIT,setupwiz,setupwiz,pUniData->pszPortName,NULL); 208 // preliminary 209 WinDismissDlg(hDlg, TRUE); 210 break; 160 211 case DID_CANCEL: 161 212 WinDismissDlg(hDlg, MBID_CANCEL); … … 193 244 } 194 245 246 /* 247 static ULONG _launchFileDlg( HWND hwnd, HWND hwndBubbleHelp) 248 249 { 250 BOOL ulResult = MBID_ERROR; 251 BOOL fResult; 252 FILEDLG fd; 253 254 CHAR szMessage[ _MAX_PATH]; 255 PSZ pszButtonCode; 256 257 // stop bubble help 258 WtkDeactivateBubbleHelp( hwndBubbleHelp); 259 260 do 261 { 262 // setup data 263 memset( &fd, 0, sizeof( fd)); 264 fd.cbSize = sizeof( fd); 265 fd.fl = FDS_CENTER | FDS_HELPBUTTON | FDS_OPEN_DIALOG; 266 fd.pszTitle = "System File test dialog"; 267 strcpy( fd.szFullFile, "C:\\*"); 268 269 // launch dialog 270 fResult = WinFileDlg( HWND_DESKTOP, hwnd, &fd); 271 272 if (!fResult) 273 sprintf( szMessage, "error launching WinFileDlg\n"); 274 else if (fd.lReturn == DID_OK) 275 sprintf( szMessage, "file is: %s\n", fd.szFullFile); 276 else 277 sprintf( szMessage, "error occurred!\n"); 278 279 switch (fd.lReturn) 280 { 281 case DID_OK: pszButtonCode = "(DID_OK)"; break; 282 case DID_CANCEL: pszButtonCode = "(DID_CANCEL)"; break; 283 case DID_ERROR: pszButtonCode = "(DID_ERROR)"; break; 284 default: pszButtonCode = ""; break; 285 } 286 287 sprintf( &szMessage[ strlen( szMessage)], 288 "\015\015" 289 "return code is: %u %s\015" 290 "WinFileDlg error source code is: %u\015", 291 fd.lReturn, pszButtonCode, fd.lSRC); 292 293 WinMessageBox( HWND_DESKTOP, hwnd, szMessage, "File Dialog Result", 294 IDDLG_MSGBOX_RESULTFILEDLG, MB_MOVEABLE | MB_OK | MB_HELP); 295 296 // on error return error code 297 if (!fResult) 298 break; 299 300 // hand over result 301 ulResult = fd.lReturn; 302 303 } while (FALSE); 304 305 306 // restart bubble help 307 WtkActivateBubbleHelp( hwndBubbleHelp); 308 return ulResult; 309 } 310 */ -
branches/1.0/src/uni.h
r26 r29 44 44 #define INCL_DOSERRORS 45 45 #define INCL_WINHOOKS 46 #define INCL_WINSTDDLGS /* CUA controls and dialogs */ 46 47 47 48 #include <os2.h> … … 239 240 } PORTNAMES, *PPORTNAMES; 240 241 241 #define GB_UNICFG 206 242 #define ID_PROGRAM 210 243 #define DT_PROGRAM 211 244 #define ID_PARAMETERS 212 245 #define DT_PARAMETERS 213 246 #define DT_DIRECTORY 214 247 #define ID_DIRECTORY 215 248 #define PB_FIND 216 242 #define GB_UNICFG 201 243 #define ID_PROGRAM 202 244 #define DT_PROGRAM 203 245 #define ID_PARAMETERS 204 246 #define DT_PARAMETERS 205 247 #define DT_DIRECTORY 206 248 #define ID_DIRECTORY 207 249 #define DID_FIND 208 250 #define DID_SETUPWIZARD 209
Note:
See TracChangeset
for help on using the changeset viewer.