Changeset 1160
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/arccnrs.c
r1120 r1160 88 88 #include "strutil.h" // GetPString 89 89 #include "notebook.h" // CfgDlgProc 90 #include "worker.h" // Action, MassAction 91 #include "avv.h" // ArcReviewDlgProc, rewrite_archiverbb2 92 #include "chklist.h" // CenterOverWindow, CheckListProc 93 #include "common.h" // CommonCreateTextChildren, CommonFrameWndProc, CommonTextPaint 94 #include "draglist.h" // DragOne 95 #include "valid.h" // GetDesktopName, TestCDates 96 #include "mainwnd.h" // MakeBubble, TopWindowName 97 #include "objwin.h" // MakeObjWin 98 #include "shadow.h" // MakeShadows 99 #include "objcnr.h" // ObjCnrDlgProc 100 #include "printer.h" // PrintListThread 101 #include "srchpath.h" // RunFM2Util 102 #include "misc.h" // SayFilter, SaySort 103 #include "select.h" // SelectAll, SelectList 104 #include "findrec.h" // ShowCnrRecord 105 #include "walkem.h" // WalkExtractDlgProc 90 106 #include "fm3dll.h" 107 #include "misc.h" // AdjustCnrColVis, QuickPopup, SetSortChecks, SwitchCommand 108 #include "select.h" // DeselectAll, InvertAll 91 109 #include "fortify.h" 92 110 -
trunk/dll/chklist.c
r907 r1160 29 29 #include "errutil.h" // Dos_Error... 30 30 #include "strutil.h" // GetPString 31 #include "getnames.h" // CustomFileDlg 32 #include "chklist.h" 33 #include "info.h" // FileInfoProc 34 #include "defview.h" // QuickView 35 #include "valid.h" // IsExecutable 31 36 #include "fm3dll.h" 32 37 -
trunk/dll/commafmt.c
r907 r1160 31 31 #include <string.h> 32 32 33 #include "commafmt.h" 33 34 #include "fm3dll.h" 34 35 -
trunk/dll/findrec.c
r907 r1160 18 18 19 19 #include "fm3dll.h" 20 #include "findrec.h" 20 21 21 22 PCNRITEM FindCnrRecord(HWND hwndCnr, CHAR * filename, PCNRITEM pciParent, -
trunk/dll/fonts.c
r907 r1160 18 18 #define INCL_WIN 19 19 #define INCL_GPI 20 #define INCL_LONGLONG // dircnrs.h20 #define INCL_LONGLONG // dircnrs.h 21 21 22 22 #include "fm3str.h" 23 #include "errutil.h" // Dos_Error... 24 #include "strutil.h" // GetPString 23 #include "errutil.h" // Dos_Error... 24 #include "strutil.h" // GetPString 25 #include "fonts.h" 25 26 #include "fm3dll.h" 27 28 //static VOID SetFont(HWND hwnd); 26 29 27 30 #pragma data_seg(DATA1) … … 43 46 SIZEF sizef; 44 47 45 hps = WinGetScreenPS(HWND_DESKTOP); /* Screen presentation space */48 hps = WinGetScreenPS(HWND_DESKTOP); /* Screen presentation space */ 46 49 47 50 /* … … 68 71 WinReleasePS(hps); 69 72 70 } /* end ConvertVectorPointSize() */73 } /* end ConvertVectorPointSize() */ 71 74 72 75 VOID SetPresParamFromFattrs(HWND hwnd, FATTRS * fattrs, 73 SHORT sNominalPointSize, FIXED fxPointSize)76 SHORT sNominalPointSize, FIXED fxPointSize) 74 77 { 75 78 … … 82 85 if ((((USHORT) FIXEDFRAC(fxPointSize) * 100) / 65536) > 0) 83 86 sprintf(&s[strlen(s)], "%hd.", 84 ((USHORT) FIXEDFRAC(fxPointSize) * 100) / 65536);87 ((USHORT) FIXEDFRAC(fxPointSize) * 100) / 65536); 85 88 } 86 89 strcat(s, fattrs->szFacename); … … 108 111 } 109 112 113 #if 0 // JBS 110 114 VOID SetFont(HWND hwnd) 111 115 { … … 124 128 } 125 129 DosExitCritSec(); 126 memset(&fontdlg, 0, sizeof(fontdlg)); /* initialize all fields */130 memset(&fontdlg, 0, sizeof(fontdlg)); /* initialize all fields */ 127 131 hps = WinGetPS(hwnd); 128 132 GpiQueryFontMetrics(hps, sizeof(FONTMETRICS), &fm); … … 153 157 WinReleasePS(fontdlg.hpsScreen); 154 158 SetPresParamFromFattrs(hwnd, &fontdlg.fAttrs, fontdlg.sNominalPointSize, 155 fontdlg.fxPointSize);159 fontdlg.fxPointSize); 156 160 } 161 #endif 157 162 158 163 FATTRS *SetMLEFont(HWND hwndMLE, FATTRS * fattrs, ULONG flags) … … 173 178 FONTMETRICS fontMetrics; 174 179 CHAR szFamily[CCHMAXPATH], *szPreview; 175 static FIXED fxPointSize = 0; /* keep track of this for vector fonts */180 static FIXED fxPointSize = 0; /* keep track of this for vector fonts */ 176 181 177 182 if ((flags & 1) && !fattrs) … … 184 189 } 185 190 DosExitCritSec(); 186 memset(&fontDlg, 0, sizeof(fontDlg)); /* initialize all fields */191 memset(&fontDlg, 0, sizeof(fontDlg)); /* initialize all fields */ 187 192 /* 188 193 * Get the current font attributes … … 191 196 if (!(flags & 1)) 192 197 WinSendMsg(hwndMLE, MLM_QUERYFONT, 193 MPFROMP((PFATTRS) & (fontDlg.fAttrs)), NULL);198 MPFROMP((PFATTRS) & (fontDlg.fAttrs)), NULL); 194 199 else 195 200 memcpy(&fontDlg.fAttrs, fattrs, sizeof(FATTRS)); … … 198 203 199 204 GpiCreateLogFont(hps, (PSTR8) fontDlg.fAttrs.szFacename, 1, 200 &(fontDlg.fAttrs));205 &(fontDlg.fAttrs)); 201 206 GpiSetCharSet(hps, 1); 202 207 GpiQueryFontMetrics(hps, sizeof(FONTMETRICS), &fontMetrics); … … 208 213 * Initialize the FONTDLG structure with the current font 209 214 */ 210 fontDlg.cbSize = sizeof(FONTDLG); /* sizeof(FONTDLG) */211 fontDlg.hpsScreen = WinGetScreenPS(HWND_DESKTOP); /* Screen presentation space */212 fontDlg.hpsPrinter = NULLHANDLE; /* Printer presentation space */215 fontDlg.cbSize = sizeof(FONTDLG); /* sizeof(FONTDLG) */ 216 fontDlg.hpsScreen = WinGetScreenPS(HWND_DESKTOP); /* Screen presentation space */ 217 fontDlg.hpsPrinter = NULLHANDLE; /* Printer presentation space */ 213 218 214 219 fontDlg.pszTitle = GetPString(IDS_SETVIEWERFONTTITLETEXT); 215 220 fontDlg.pszPreview = szPreview; 216 fontDlg.pszPtSizeList = NULL; /* Application provided size list */217 fontDlg.pfnDlgProc = NULL; /* Dialog subclass procedure */218 strcpy(szFamily, fontMetrics.szFamilyname); /* Family name of font */219 fontDlg.pszFamilyname = szFamily; /* point to Family name of font */220 fontDlg.fxPointSize = fxPointSize; /* Point size the user selected */221 fontDlg.fl = FNTS_CENTER | /* FNTS_* flags - dialog styles */221 fontDlg.pszPtSizeList = NULL; /* Application provided size list */ 222 fontDlg.pfnDlgProc = NULL; /* Dialog subclass procedure */ 223 strcpy(szFamily, fontMetrics.szFamilyname); /* Family name of font */ 224 fontDlg.pszFamilyname = szFamily; /* point to Family name of font */ 225 fontDlg.fxPointSize = fxPointSize; /* Point size the user selected */ 226 fontDlg.fl = FNTS_CENTER | /* FNTS_* flags - dialog styles */ 222 227 FNTS_INITFROMFATTRS; 223 228 if (flags & 2) … … 229 234 else if (flags & 16) 230 235 fontDlg.fl |= FNTS_VECTORONLY; 231 fontDlg.flFlags = 0; /* FNTF_* state flags */236 fontDlg.flFlags = 0; /* FNTF_* state flags */ 232 237 /* Font type option bits */ 233 238 fontDlg.flType = (LONG) fontMetrics.fsType; 234 fontDlg.flTypeMask = 0; /* Mask of which font types to use */235 fontDlg.flStyle = 0; /* The selected style bits */236 fontDlg.flStyleMask = 0; /* Mask of which style bits to use */237 fontDlg.clrFore = CLR_NEUTRAL; /* Selected foreground color */238 fontDlg.clrBack = CLR_BACKGROUND; /* Selected background color */239 fontDlg.ulUser = 0; /* Blank field for application */240 fontDlg.lReturn = 0; /* Return Value of the Dialog */241 fontDlg.lEmHeight = 0; /* Em height of the current font */242 fontDlg.lXHeight = 0; /* X height of the current font */243 fontDlg.lExternalLeading = 0; /* External Leading of font */239 fontDlg.flTypeMask = 0; /* Mask of which font types to use */ 240 fontDlg.flStyle = 0; /* The selected style bits */ 241 fontDlg.flStyleMask = 0; /* Mask of which style bits to use */ 242 fontDlg.clrFore = CLR_NEUTRAL; /* Selected foreground color */ 243 fontDlg.clrBack = CLR_BACKGROUND; /* Selected background color */ 244 fontDlg.ulUser = 0; /* Blank field for application */ 245 fontDlg.lReturn = 0; /* Return Value of the Dialog */ 246 fontDlg.lEmHeight = 0; /* Em height of the current font */ 247 fontDlg.lXHeight = 0; /* X height of the current font */ 248 fontDlg.lExternalLeading = 0; /* External Leading of font */ 244 249 /* Nominal Point Size of font */ 245 250 fontDlg.sNominalPointSize = fontMetrics.sNominalPointSize; 246 fontDlg.usWeight = fontMetrics.usWeightClass; /* The boldness of the font */247 fontDlg.usWidth = fontMetrics.usWidthClass; /* The width of the font */248 fontDlg.x = 0; /* X coordinate of the dialog */249 fontDlg.y = 0; /* Y coordinate of the dialog */251 fontDlg.usWeight = fontMetrics.usWeightClass; /* The boldness of the font */ 252 fontDlg.usWidth = fontMetrics.usWidthClass; /* The width of the font */ 253 fontDlg.x = 0; /* X coordinate of the dialog */ 254 fontDlg.y = 0; /* Y coordinate of the dialog */ 250 255 // fontDlg.usDlgId = IDD_FONT; /* ID of a custom dialog template */ 251 fontDlg.usFamilyBufLen = sizeof(szFamily); /*Length of family name buffer */256 fontDlg.usFamilyBufLen = sizeof(szFamily); /*Length of family name buffer */ 252 257 253 258 /* … … 260 265 return NULL; 261 266 } 262 fxPointSize = fontDlg.fxPointSize; /* save point size for next dialog */267 fxPointSize = fontDlg.fxPointSize; /* save point size for next dialog */ 263 268 264 269 /* … … 277 282 return fattrs; 278 283 279 } /* End of SetMLEFont() */284 } /* End of SetMLEFont() */ 280 285 281 286 #pragma alloc_text(FONTS,ConvertVectorFontSize,SetFont,SetMLEFont) -
trunk/dll/info.c
r1039 r1160 43 43 #include "errutil.h" // Dos_Error... 44 44 #include "strutil.h" // GetPString 45 #include "attribs.h" // AttrListDlgProc 46 #include "defview.h" // DefaultView 47 #include "info.h" 48 #include "valid.h" // IsBinary 49 #include "seticon.h" // SetIconDlgProc 45 50 #include "fm3dll.h" 46 51 #include "fortify.h" -
trunk/dll/literal.c
r1047 r1160 30 30 31 31 #include "errutil.h" // Dos_Error... 32 #include "literal.h" 32 33 #include "fm3dll.h" 33 34 #include "fortify.h" -
trunk/dll/rename.c
r907 r1160 25 25 #include "errutil.h" // Dos_Error... 26 26 #include "strutil.h" // GetPString 27 #include "copyf.h" // AdjustWildcardName 28 #include "rename.h" 29 #include "valid.h" // TestFDates 27 30 #include "fm3dll.h" 28 31 -
trunk/dll/tools.c
r1140 r1160 40 40 #include "pathutil.h" // BldFullPathName 41 41 #include "fortify.h" 42 #include "loadbmp.h" // LoadBitmapFromFileNum 42 43 #include "fm3dll.h" 43 44 -
trunk/dll/uudecode.c
r907 r1160 25 25 #define INCL_DOS 26 26 #define INCL_WIN 27 #define INCL_LONGLONG // dircnrs.h27 #define INCL_LONGLONG // dircnrs.h 28 28 29 29 #include "fm3dlg.h" 30 30 #include "fm3str.h" 31 #include "makelist.h" // AddToList 32 #include "errutil.h" // Dos_Error... 33 #include "strutil.h" // GetPString 31 #include "makelist.h" // AddToList 32 #include "errutil.h" // Dos_Error... 33 #include "strutil.h" // GetPString 34 #include "defview.h" 35 #include "uudecode.h" 34 36 #include "fm3dll.h" 35 37 … … 41 43 42 44 /* single character decode */ 43 #define DEC(c) (((c) - ' ') & 077)45 #define DEC(c) (((c) - ' ') & 077) 44 46 45 47 int UUD(char *filename, CHAR * dest) … … 55 57 if (!in) { 56 58 saymsg(MB_CANCEL, 57 HWND_DESKTOP,58 GetPString(IDS_ERRORTEXT),59 GetPString(IDS_COMPCANTOPENTEXT), filename);59 HWND_DESKTOP, 60 GetPString(IDS_ERRORTEXT), 61 GetPString(IDS_COMPCANTOPENTEXT), filename); 60 62 return ret; 61 63 } … … 66 68 fclose(in); 67 69 saymsg(MB_CANCEL, 68 HWND_DESKTOP,69 GetPString(IDS_ERRORTEXT),70 GetPString(IDS_UUDNOBEGINTEXT), filename);70 HWND_DESKTOP, 71 GetPString(IDS_ERRORTEXT), 72 GetPString(IDS_UUDNOBEGINTEXT), filename); 71 73 return ret; 72 74 } 73 75 if (!strncmp(buf, "begin ", 6)) 74 76 break; 75 } // for77 } // for 76 78 *dest = 0; 77 79 sscanf(buf, "begin %o %259s", &mode, dest); … … 103 105 fclose(in); 104 106 saymsg(MB_CANCEL, 105 HWND_DESKTOP,106 GetPString(IDS_ERRORTEXT),107 GetPString(IDS_UUDCANTOPENFORTEXT), dest, filename);107 HWND_DESKTOP, 108 GetPString(IDS_ERRORTEXT), 109 GetPString(IDS_UUDCANTOPENFORTEXT), dest, filename); 108 110 return ret; 109 111 } … … 176 178 wk = (WORKER *) mp2; 177 179 if (wk->li && wk->li->list && wk->li->list[0]) { 178 WinSendDlgItemMsg(hwnd, MRG_TARGETNAME, EM_SETTEXTLIMIT,179 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);180 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);180 WinSendDlgItemMsg(hwnd, MRG_TARGETNAME, EM_SETTEXTLIMIT, 181 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 182 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); 181 183 } 182 184 else 183 WinDismissDlg(hwnd, 0);185 WinDismissDlg(hwnd, 0); 184 186 } 185 187 else … … 199 201 p = strrchr(wk->li->targetpath, '\\'); 200 202 if (p) 201 start = (p + 1) - wk->li->targetpath;203 start = (p + 1) - wk->li->targetpath; 202 204 WinSendDlgItemMsg(hwnd, MRG_TARGETNAME, EM_SETSEL, 203 MPFROM2SHORT(start, CCHMAXPATH), MPVOID);205 MPFROM2SHORT(start, CCHMAXPATH), MPVOID); 204 206 for (x = 0; wk->li->list[x]; x++) { 205 if (IsFile(wk->li->list[x]) == 1) {206 numfiles++;207 WinSendDlgItemMsg(hwnd, MRG_LISTBOX, LM_INSERTITEM,208 MPFROM2SHORT(LIT_END, 0),209 MPFROMP(wk->li->list[x]));210 }207 if (IsFile(wk->li->list[x]) == 1) { 208 numfiles++; 209 WinSendDlgItemMsg(hwnd, MRG_LISTBOX, LM_INSERTITEM, 210 MPFROM2SHORT(LIT_END, 0), 211 MPFROMP(wk->li->list[x])); 212 } 211 213 } 212 214 WinCheckButton(hwnd, MRG_BINARY, (wk->li->type == IDM_MERGEBINARY)); 213 215 if (!numfiles) { 214 saymsg(MB_CANCEL | MB_ICONEXCLAMATION,215 hwnd,216 GetPString(IDS_SILLYERRORTEXT),217 GetPString(IDS_MERGEWASTETEXT));218 WinDismissDlg(hwnd, 0);216 saymsg(MB_CANCEL | MB_ICONEXCLAMATION, 217 hwnd, 218 GetPString(IDS_SILLYERRORTEXT), 219 GetPString(IDS_MERGEWASTETEXT)); 220 WinDismissDlg(hwnd, 0); 219 221 } 220 222 } … … 226 228 switch (SHORT2FROMMP(mp1)) { 227 229 case LN_ENTER: 228 {229 SHORT x;230 CHAR szBuffer[CCHMAXPATH];231 232 x = (SHORT) WinSendDlgItemMsg(hwnd, MRG_LISTBOX, LM_QUERYSELECTION,233 MPFROMSHORT(LIT_FIRST), MPVOID);234 if (x >= 0) {235 *szBuffer = 0;236 WinSendDlgItemMsg(hwnd, MRG_LISTBOX, LM_QUERYITEMTEXT,237 MPFROM2SHORT(x, CCHMAXPATH), MPFROMP(szBuffer));238 if (*szBuffer)239 QuickEdit(hwnd, szBuffer);240 }241 }242 break;230 { 231 SHORT x; 232 CHAR szBuffer[CCHMAXPATH]; 233 234 x = (SHORT) WinSendDlgItemMsg(hwnd, MRG_LISTBOX, LM_QUERYSELECTION, 235 MPFROMSHORT(LIT_FIRST), MPVOID); 236 if (x >= 0) { 237 *szBuffer = 0; 238 WinSendDlgItemMsg(hwnd, MRG_LISTBOX, LM_QUERYITEMTEXT, 239 MPFROM2SHORT(x, CCHMAXPATH), MPFROMP(szBuffer)); 240 if (*szBuffer) 241 QuickEdit(hwnd, szBuffer); 242 } 243 } 244 break; 243 245 } 244 246 break; … … 252 254 case UM_SETDIR: 253 255 PaintRecessedWindow(WinWindowFromID(hwnd, MRG_HELP), (HPS) 0, FALSE, 254 TRUE);256 TRUE); 255 257 return 0; 256 258 … … 264 266 wk = WinQueryWindowPtr(hwnd, QWL_USER); 265 267 if (wk) { 266 CHAR filename[CCHMAXPATH];267 268 strcpy(filename, wk->li->targetpath);269 if (export_filename(HWND_DESKTOP, filename, FALSE) && *filename) {270 strcpy(wk->li->targetpath, filename);271 WinSetDlgItemText(hwnd, MRG_TARGETNAME, wk->li->targetpath);272 }268 CHAR filename[CCHMAXPATH]; 269 270 strcpy(filename, wk->li->targetpath); 271 if (export_filename(HWND_DESKTOP, filename, FALSE) && *filename) { 272 strcpy(wk->li->targetpath, filename); 273 WinSetDlgItemText(hwnd, MRG_TARGETNAME, wk->li->targetpath); 274 } 273 275 } 274 276 break; … … 276 278 case MRG_REMOVE: 277 279 { 278 SHORT x;279 280 x = (SHORT) WinSendDlgItemMsg(hwnd, MRG_LISTBOX, LM_QUERYSELECTION,281 MPFROMSHORT(LIT_FIRST), MPVOID);282 if (x >= 0)283 WinSendDlgItemMsg(hwnd, MRG_LISTBOX, LM_DELETEITEM,284 MPFROMSHORT(x), MPVOID);280 SHORT x; 281 282 x = (SHORT) WinSendDlgItemMsg(hwnd, MRG_LISTBOX, LM_QUERYSELECTION, 283 MPFROMSHORT(LIT_FIRST), MPVOID); 284 if (x >= 0) 285 WinSendDlgItemMsg(hwnd, MRG_LISTBOX, LM_DELETEITEM, 286 MPFROMSHORT(x), MPVOID); 285 287 } 286 288 break; … … 289 291 case MRG_TOP: 290 292 { 291 SHORT x;292 CHAR szBuffer[CCHMAXPATH];293 294 x = (SHORT) WinSendDlgItemMsg(hwnd, MRG_LISTBOX, LM_QUERYSELECTION,295 MPFROMSHORT(LIT_FIRST), MPVOID);296 if (x >= 0) {297 *szBuffer = 0;298 WinSendDlgItemMsg(hwnd, MRG_LISTBOX, LM_QUERYITEMTEXT,299 MPFROM2SHORT(x, CCHMAXPATH), MPFROMP(szBuffer));300 if (*szBuffer) {301 WinSendDlgItemMsg(hwnd, MRG_LISTBOX, LM_DELETEITEM,302 MPFROMSHORT(x), MPVOID);303 if (SHORT1FROMMP(mp1) == MRG_TOP)304 WinSendDlgItemMsg(hwnd, MRG_LISTBOX, LM_INSERTITEM,305 MPFROM2SHORT(0, 0), MPFROMP(szBuffer));306 else307 WinSendDlgItemMsg(hwnd, MRG_LISTBOX, LM_INSERTITEM,308 MPFROM2SHORT(LIT_END, 0), MPFROMP(szBuffer));309 }310 }293 SHORT x; 294 CHAR szBuffer[CCHMAXPATH]; 295 296 x = (SHORT) WinSendDlgItemMsg(hwnd, MRG_LISTBOX, LM_QUERYSELECTION, 297 MPFROMSHORT(LIT_FIRST), MPVOID); 298 if (x >= 0) { 299 *szBuffer = 0; 300 WinSendDlgItemMsg(hwnd, MRG_LISTBOX, LM_QUERYITEMTEXT, 301 MPFROM2SHORT(x, CCHMAXPATH), MPFROMP(szBuffer)); 302 if (*szBuffer) { 303 WinSendDlgItemMsg(hwnd, MRG_LISTBOX, LM_DELETEITEM, 304 MPFROMSHORT(x), MPVOID); 305 if (SHORT1FROMMP(mp1) == MRG_TOP) 306 WinSendDlgItemMsg(hwnd, MRG_LISTBOX, LM_INSERTITEM, 307 MPFROM2SHORT(0, 0), MPFROMP(szBuffer)); 308 else 309 WinSendDlgItemMsg(hwnd, MRG_LISTBOX, LM_INSERTITEM, 310 MPFROM2SHORT(LIT_END, 0), MPFROMP(szBuffer)); 311 } 312 } 311 313 } 312 314 break; … … 318 320 case IDM_HELP: 319 321 if (hwndHelp) 320 WinSendMsg(hwndHelp, HM_DISPLAY_HELP,321 MPFROM2SHORT(HELP_MERGE, 0), MPFROMSHORT(HM_RESOURCEID));322 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 323 MPFROM2SHORT(HELP_MERGE, 0), MPFROMSHORT(HM_RESOURCEID)); 322 324 break; 323 325 … … 325 327 wk = WinQueryWindowPtr(hwnd, QWL_USER); 326 328 if (wk) { 327 BOOL append, binary;328 CHAR **list = NULL, **test, szBuffer[CCHMAXPATH];329 UINT numfiles = 0, numalloc = 0;330 INT error;331 SHORT x, y;332 333 *szBuffer = 0;334 WinQueryDlgItemText(hwnd, MRG_TARGETNAME, CCHMAXPATH, szBuffer);335 if (!*szBuffer) {336 DosBeep(50, 100);337 WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, MRG_TARGETNAME));338 break;339 }340 if (DosQueryPathInfo(szBuffer,341 FIL_QUERYFULLNAME,342 wk->li->targetpath, CCHMAXPATH)) {343 DosBeep(50, 100);344 WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, MRG_TARGETNAME));345 break;346 }347 WinSetDlgItemText(hwnd, MRG_TARGETNAME, szBuffer);348 append = WinQueryButtonCheckstate(hwnd, MRG_APPEND);349 binary = WinQueryButtonCheckstate(hwnd, MRG_BINARY);350 wk->li->type = (append && binary) ? IDM_MERGEBINARYAPPEND :351 (append) ? IDM_MERGETEXTAPPEND :352 (binary) ? IDM_MERGEBINARY : IDM_MERGETEXT;353 x = (SHORT) WinSendDlgItemMsg(hwnd,354 MRG_LISTBOX,355 LM_QUERYITEMCOUNT, MPVOID, MPVOID);356 for (y = 0; y < x; y++) {357 *szBuffer = 0;358 WinSendDlgItemMsg(hwnd,359 MRG_LISTBOX,360 LM_QUERYITEMTEXT,361 MPFROM2SHORT(y, CCHMAXPATH), MPFROMP(szBuffer));362 if (*szBuffer) {363 error = AddToList(szBuffer, &list, &numfiles, &numalloc);364 if (error) {365 Runtime_Error(pszSrcFile, __LINE__, "AddToList");366 break;367 }368 }369 }370 if (numfiles && list && numfiles + 1 < numalloc) {371 test =372 xrealloc(list, sizeof(CHAR *) * (numfiles + 1), pszSrcFile,373 __LINE__);374 if (test)375 list = test;376 }377 if (!list || !list[0]) {378 Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT);379 break;380 }381 else {382 FreeList(wk->li->list);383 wk->li->list = list;384 }329 BOOL append, binary; 330 CHAR **list = NULL, **test, szBuffer[CCHMAXPATH]; 331 UINT numfiles = 0, numalloc = 0; 332 INT error; 333 SHORT x, y; 334 335 *szBuffer = 0; 336 WinQueryDlgItemText(hwnd, MRG_TARGETNAME, CCHMAXPATH, szBuffer); 337 if (!*szBuffer) { 338 DosBeep(50, 100); 339 WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, MRG_TARGETNAME)); 340 break; 341 } 342 if (DosQueryPathInfo(szBuffer, 343 FIL_QUERYFULLNAME, 344 wk->li->targetpath, CCHMAXPATH)) { 345 DosBeep(50, 100); 346 WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, MRG_TARGETNAME)); 347 break; 348 } 349 WinSetDlgItemText(hwnd, MRG_TARGETNAME, szBuffer); 350 append = WinQueryButtonCheckstate(hwnd, MRG_APPEND); 351 binary = WinQueryButtonCheckstate(hwnd, MRG_BINARY); 352 wk->li->type = (append && binary) ? IDM_MERGEBINARYAPPEND : 353 (append) ? IDM_MERGETEXTAPPEND : 354 (binary) ? IDM_MERGEBINARY : IDM_MERGETEXT; 355 x = (SHORT) WinSendDlgItemMsg(hwnd, 356 MRG_LISTBOX, 357 LM_QUERYITEMCOUNT, MPVOID, MPVOID); 358 for (y = 0; y < x; y++) { 359 *szBuffer = 0; 360 WinSendDlgItemMsg(hwnd, 361 MRG_LISTBOX, 362 LM_QUERYITEMTEXT, 363 MPFROM2SHORT(y, CCHMAXPATH), MPFROMP(szBuffer)); 364 if (*szBuffer) { 365 error = AddToList(szBuffer, &list, &numfiles, &numalloc); 366 if (error) { 367 Runtime_Error(pszSrcFile, __LINE__, "AddToList"); 368 break; 369 } 370 } 371 } 372 if (numfiles && list && numfiles + 1 < numalloc) { 373 test = 374 xrealloc(list, sizeof(CHAR *) * (numfiles + 1), pszSrcFile, 375 __LINE__); 376 if (test) 377 list = test; 378 } 379 if (!list || !list[0]) { 380 Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT); 381 break; 382 } 383 else { 384 FreeList(wk->li->list); 385 wk->li->list = list; 386 } 385 387 } 386 388 WinDismissDlg(hwnd, 1); 387 389 break; 388 } // switch WM_COMMAND mp1390 } // switch WM_COMMAND mp1 389 391 return 0; 390 } // switch msg392 } // switch msg 391 393 return WinDefDlgProc(hwnd, msg, mp1, mp2); 392 394 }
Note:
See TracChangeset
for help on using the changeset viewer.
