Changeset 36 for trunk/dll/mainwnd.c
- Timestamp:
- Oct 17, 2002, 3:53:23 AM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/mainwnd.c
r33 r36 10 10 11 11 Revisions 11 Jun 02 SHL - Drop obsolete xor code 12 16 Oct 02 SHL - Handle large partitions 12 13 13 14 ***********************************************************************/ … … 57 58 58 59 59 MRESULT EXPENTRY MainObjectWndProc (HWND hwnd,ULONG msg,MPARAM mp1, 60 MPARAM mp2) { 60 MRESULT EXPENTRY MainObjectWndProc (HWND hwnd,ULONG msg,MPARAM mp1, MPARAM mp2) { 61 61 62 62 switch(msg) { … … 96 96 97 97 FSALLOCATE fsa; 98 CHAR s[90],tpm[38],*kfree; 99 ULONG freebytes,percentfree; 98 CHAR s[90],szQty[38],*pszUM; 99 ULONG ulPctFree; 100 float fltFreeQty; 100 101 101 102 if(!DosQueryFSInfo((d - 'A') + 1, … … 103 104 &fsa, 104 105 sizeof(FSALLOCATE))) { 105 f reebytes =fsa.cUnitAvail *106 107 if(f reebytes>= (1024 * 1024)) {108 f reebytes/= (1024 * 1024);109 kfree= "mb";106 fltFreeQty = (float)fsa.cUnitAvail * 107 (fsa.cSectorUnit * fsa.cbSector); 108 if(fltFreeQty >= (1024 * 1024)) { 109 fltFreeQty /= (1024 * 1024); 110 pszUM = "mb"; 110 111 } 111 else if(f reebytes>= 1024) {112 f reebytes/= 1024;113 kfree= "kb";112 else if(fltFreeQty >= 1024) { 113 fltFreeQty /= 1024; 114 pszUM = "kb"; 114 115 } 115 116 else 116 kfree = "b"; 117 percentfree = (fsa.cUnit && fsa.cUnitAvail) ? 118 (fsa.cUnitAvail * 100) / fsa.cUnit : 119 0; 120 commafmt(tpm, 121 sizeof(tpm), 122 freebytes); 117 pszUM = "b"; 118 ulPctFree = (fsa.cUnit && fsa.cUnitAvail) ? 119 (fsa.cUnitAvail * 100) / fsa.cUnit : 0; 120 commafmt(szQty, 121 sizeof(szQty), 122 (ULONG)fltFreeQty); 123 123 sprintf(s, 124 124 "%s%s (%lu%%) free", 125 tpm,126 kfree,127 percentfree);125 szQty, 126 pszUM, 127 ulPctFree); 128 128 } 129 129 if((!hwndBubble || … … 210 210 VOID MakeMainObjWin (VOID *args) { 211 211 212 HAB 213 HMQ 212 HAB hab2; 213 HMQ hmq2; 214 214 QMSG qmsg2; 215 215 … … 289 289 HWND TopWindowName (HWND hwndParent,HWND exclude,CHAR *ret) { 290 290 291 HENUM 292 HWND 291 HENUM henum; 292 HWND hwndC = (HWND)0,hwndDir,hwndClient; 293 293 USHORT id; 294 294 PCNRITEM pci = NULL; … … 378 378 HWND FindDirCnrByName (CHAR *directory,BOOL restore) { 379 379 380 HENUM 381 HWND 382 CHAR 380 HENUM henum; 381 HWND hwndF = (HWND)0,hwndC,hwndDir; 382 CHAR retstr[CCHMAXPATH]; 383 383 384 384 if(hwndMain) { … … 456 456 VOID ResizeTools (HWND hwnd) { 457 457 458 register ULONG 459 INT 460 461 register TOOL 462 SWP 463 register ULONG 458 register ULONG butx = 18L; 459 INT attrib = SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_ZORDER | SWP_NOREDRAW, 460 noattrib; 461 register TOOL *tool,*starttool; 462 SWP *swp; 463 register ULONG numtools,x; 464 464 465 465 if(!fToolbar) … … 565 565 MRESULT EXPENTRY DropDownListProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) { 566 566 567 PFNWP 568 static HWND 569 USHORT 570 static BOOL 567 PFNWP oldproc = (PFNWP)INSTDATA(hwnd); 568 static HWND hwndMenu = (HWND)0; 569 USHORT id; 570 static BOOL emphasized = FALSE; 571 571 572 572 switch(msg) { … … 815 815 if(hwndBubble) { 816 816 817 HPS 818 POINTL 819 LONG 820 char 821 SWP 817 HPS hps; 818 POINTL aptl[TXTBOX_COUNT],ptl,tptl; 819 LONG lxScreen,sx,sy,extra = 0,lyScreen; 820 char *p,*pp,*wp; 821 SWP swp; 822 822 823 823 WinQueryWindowPos(hwnd,&swp); … … 921 921 case WM_PAINT: 922 922 { 923 HPS 924 SWP 923 HPS hps; 924 SWP swp; 925 925 POINTL ptl,aptl[TXTBOX_COUNT]; 926 CHAR 927 ULONG 926 CHAR *s,*p,*pp,*wp; 927 ULONG extra,tlen,y; 928 928 929 929 hps = WinBeginPaint(hwnd,(HPS)0,NULL); … … 1148 1148 MRESULT EXPENTRY ChildButtonProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) { 1149 1149 1150 USHORT 1151 register TOOL 1152 static HWND 1150 USHORT id; 1151 register TOOL *tool; 1152 static HWND hwndMenu = (HWND)0; 1153 1153 1154 1154 switch(msg) { … … 1188 1188 break; 1189 1189 1190 case IDM_HIDEANYTOOL: 1191 case IDM_HIDETOOL: 1190 case IDM_HIDEANYTOOL: /* hide any tool */ 1191 case IDM_HIDETOOL: /* hide tool */ 1192 1192 if(SHORT1FROMMP(mp1) == IDM_HIDETOOL) 1193 1193 id = WinQueryWindowUShort(hwnd,QWS_ID); … … 1206 1206 break; 1207 1207 1208 case IDM_SHOWTOOLS: 1208 case IDM_SHOWTOOLS: /* show all tools */ 1209 1209 tool = toolhead; 1210 1210 while(tool) { … … 1215 1215 break; 1216 1216 1217 case IDM_DELETEANYTOOL: 1218 case IDM_DELETETOOL: 1217 case IDM_DELETEANYTOOL: /* delete any button */ 1218 case IDM_DELETETOOL: /* delete button */ 1219 1219 if(SHORT1FROMMP(mp1) == IDM_DELETETOOL) 1220 1220 id = WinQueryWindowUShort(hwnd,QWS_ID); … … 1228 1228 return 0; 1229 1229 1230 case IDM_EDITANYTOOL: 1231 case IDM_EDITTOOL: 1230 case IDM_EDITANYTOOL: /* edit any button */ 1231 case IDM_EDITTOOL: /* edit button */ 1232 1232 if(SHORT1FROMMP(mp1) == IDM_EDITTOOL) 1233 1233 id = WinQueryWindowUShort(hwnd,QWS_ID); … … 1249 1249 break; 1250 1250 1251 case IDM_ADDTOOL: 1251 case IDM_ADDTOOL: /* add tool */ 1252 1252 id = (USHORT)WinDlgBox(HWND_DESKTOP,hwnd,AddToolProc,FM3ModHandle, 1253 1253 ADDBTN_FRAME,MPVOID); … … 1306 1306 case DM_DRAGOVER: 1307 1307 { 1308 PDRAGINFO pDInfo; /* Pointer to DRAGINFO*/1309 1310 pDInfo = (PDRAGINFO)mp1; 1311 DrgAccessDraginfo(pDInfo); /* Access DRAGINFO*/1308 PDRAGINFO pDInfo; /* Pointer to DRAGINFO */ 1309 1310 pDInfo = (PDRAGINFO)mp1; /* Get DRAGINFO pointer */ 1311 DrgAccessDraginfo(pDInfo); /* Access DRAGINFO */ 1312 1312 id = WinQueryWindowUShort(hwnd,QWS_ID); 1313 1313 tool = find_tool(id); 1314 1314 if(!tool) { 1315 1315 DrgFreeDraginfo(pDInfo); 1316 return(MRFROM2SHORT(DOR_NEVERDROP,0)); /* Drop not valid 1316 return(MRFROM2SHORT(DOR_NEVERDROP,0)); /* Drop not valid */ 1317 1317 } 1318 1318 if(!(tool->flags & T_DROPABLE)) { 1319 1319 DrgFreeDraginfo(pDInfo); 1320 return(MRFROM2SHORT(DOR_NEVERDROP,0)); /* Drop not valid 1320 return(MRFROM2SHORT(DOR_NEVERDROP,0)); /* Drop not valid */ 1321 1321 } 1322 1322 { 1323 PDRAGITEM pDItem; /* Pointer to DRAGITEM*/1324 1325 pDItem = DrgQueryDragitemPtr(pDInfo, /* Access DRAGITEM*/1326 0); /* Index to DRAGITEM*/1327 if(DrgVerifyRMF(pDItem, 1328 DRM_OS2FILE,/* mechanisms and data */1329 NULL)) { /* formats*/1323 PDRAGITEM pDItem; /* Pointer to DRAGITEM */ 1324 1325 pDItem = DrgQueryDragitemPtr(pDInfo, /* Access DRAGITEM */ 1326 0); /* Index to DRAGITEM */ 1327 if(DrgVerifyRMF(pDItem, /* Check valid rendering */ 1328 DRM_OS2FILE, /* mechanisms and data */ 1329 NULL)) { /* formats */ 1330 1330 if(!(tool->flags & T_EMPHASIZED)) { 1331 1331 tool->flags |= T_EMPHASIZED; … … 1333 1333 DrgFreeDraginfo(pDInfo); 1334 1334 } 1335 return(MRFROM2SHORT(DOR_DROP, 1336 DO_MOVE));/* Move operation valid */1335 return(MRFROM2SHORT(DOR_DROP, /* Return okay to drop */ 1336 DO_MOVE)); /* Move operation valid */ 1337 1337 } 1338 1338 DrgFreeDraginfo(pDInfo); … … 1409 1409 VOID BuildTools (HWND hwndT,BOOL resize) { 1410 1410 1411 register TOOL 1412 register ULONGctrlxpos = 18L;1413 CHAR 1414 HENUM 1415 HWND 1411 register TOOL *tool; 1412 register ULONG ctrlxpos = 18L; 1413 CHAR s[33]; 1414 HENUM henum; 1415 HWND hwndTool; 1416 1416 1417 1417 henum = WinBeginEnumWindows(hwndT); … … 1448 1448 if(!hwndTool) { 1449 1449 1450 HBITMAP 1450 HBITMAP hbm; 1451 1451 1452 1452 hbm = LoadBitmapFromFileNum(tool->id); … … 1561 1561 MRESULT EXPENTRY CommandLineProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) { 1562 1562 1563 PFNWP 1564 static BOOL 1563 PFNWP oldproc = (PFNWP)WinQueryWindowPtr(hwnd,0); 1564 static BOOL lbup = FALSE; 1565 1565 1566 1566 switch(msg) { … … 1636 1636 { 1637 1637 static char directory[CCHMAXPATH],cl[1000]; 1638 char**list = NULL;1639 ULONGlen;1640 HWNDhwndCnr;1638 char **list = NULL; 1639 ULONG len; 1640 HWND hwndCnr; 1641 1641 1642 1642 *directory = *cl = 0; 1643 strcpy(cl,GetCmdSpec(FALSE));1643 strcpy(cl,GetCmdSpec(FALSE)); 1644 1644 strcat(cl," /C "); 1645 1645 len = strlen(cl); … … 2038 2038 CNRDRAGINFO cnd; 2039 2039 LISTINFO *li; 2040 ULONG 2040 ULONG action = UM_ACTION; 2041 2041 2042 2042
Note:
See TracChangeset
for help on using the changeset viewer.