Changeset 1438 for trunk/dll/mainwnd.c
- Timestamp:
- Jun 28, 2009, 10:47:00 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/dll/mainwnd.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/mainwnd.c
r1436 r1438 1891 1891 { 1892 1892 HPS hps; 1893 POINTL aptl[4] = { 0, 0, DRIVE_BUTTON_WIDTH - 1, DRIVE_BUTTON_HEIGTH - 1, 1894 0, 0, 27, 20}; //The last 2 numbers should be the width and heigth of the bitmap 1893 POINTL aptl[4] = {0, 0, DRIVE_BUTTON_WIDTH - 1, DRIVE_BUTTON_HEIGHT - 1, 1894 0, 0, DRIVE_BUTTON_WIDTH - 1, DRIVE_BUTTON_HEIGHT - 1}; 1895 //The last 2 numbers should be the width and height of the bitmap 1895 1896 HBITMAP hbm; 1897 PBITMAPINFOHEADER pbmpData; 1896 1898 POINTL ptlStart; 1897 1899 ULONG x, iconid; … … 1920 1922 } 1921 1923 else 1922 iconid = FLOPPY_ICON;1924 iconid = FLOPPY_ICON; 1923 1925 hps = WinBeginPaint(hwnd, (HPS) 0, NULL); 1924 1926 if (hps) { 1925 1927 hbm = GpiLoadBitmap(hps, 0, iconid, 0, 0); 1926 if (hbm) 1928 if (hbm) { 1929 pbmpData = xmallocz(sizeof(PBITMAPINFOHEADER), pszSrcFile, __LINE__); 1930 if (pbmpData) { 1931 GpiQueryBitmapParameters(hbm, pbmpData); 1932 aptl[1].x = pbmpData->cx; 1933 aptl[1].y = pbmpData->cy; 1934 aptl[3].x = pbmpData->cx; 1935 aptl[3].y = pbmpData->cy; 1936 free(pbmpData); 1937 } 1927 1938 GpiWCBitBlt(hps, hbm, 4L, aptl, ROP_SRCCOPY, BBO_PAL_COLORS); 1928 memset(&fat, 0, sizeof(fat)); 1929 fat.usRecordLength = sizeof(FATTRS); 1930 fat.fsSelection = FATTR_SEL_BOLD ; 1931 fat.usCodePage = 850; 1932 fat.fsFontUse = FATTR_FONTUSE_NOMIX; 1933 strcpy(fat.szFacename , FNT_HELVETICA); 1939 } 1940 memset(&fat, 0, sizeof(fat)); 1941 fat.usRecordLength = sizeof(FATTRS); 1942 fat.fsSelection = FATTR_SEL_BOLD ; 1943 fat.usCodePage = 850; 1944 fat.fsFontUse = FATTR_FONTUSE_NOMIX; 1945 strcpy(fat.szFacename , FNT_HELVETICA); 1934 1946 x = GpiCreateLogFont(hps, NULL, DRIVEBAR_FONT_LCID, &fat); 1935 1947 if (x != GPI_ERROR) { … … 1940 1952 GpiSetColor(hps, iconid == RAMDISK_ICON ? CLR_YELLOW : CLR_DARKBLUE); 1941 1953 ptlStart.x = 1L; //Char box position 1942 ptlStart.y = 7L;1954 ptlStart.y = 8L; 1943 1955 GpiCharStringAt(hps, &ptlStart, strlen(szDrv), szDrv); 1944 1956 GpiDeleteSetId(hps, DRIVEBAR_FONT_LCID); … … 1989 2001 UINT iDrv; 1990 2002 1991 strcat(szDrv, "\\");2003 strcat(szDrv, PCSZ_BACKSLASH); 1992 2004 MakeValidDir(szDrv); 1993 2005 // Disable menus if MakeValidDir changes drive letter fixme this section doesn't do anything see treecnt.c … … 2036 2048 strcpy(szDrv + 1, ":"); 2037 2049 if (isalpha(*szDrv)) { 2038 strcat(szDrv, "\\");2050 strcat(szDrv, PCSZ_BACKSLASH); 2039 2051 if (!FindDirCnrByName(szDrv, TRUE)) 2040 2052 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, szDrv); … … 2051 2063 strcpy(szDrv + 1, ":"); 2052 2064 if (isalpha(*szDrv)) { 2053 strcat(szDrv, "\\");2065 strcat(szDrv, PCSZ_BACKSLASH); 2054 2066 CommonDriveCmd(hwnd, szDrv, SHORT1FROMMP(mp1)); 2055 2067 } … … 2120 2132 if (li) { 2121 2133 strcpy(li->targetpath, szDrv); 2122 strcat(li->targetpath, "\\");2134 strcat(li->targetpath, PCSZ_BACKSLASH); 2123 2135 if (li->list && li->list[0] && IsRoot(li->list[0])) 2124 2136 li->type = DO_LINK; … … 2282 2294 0, 2283 2295 DRIVE_BUTTON_WIDTH, 2284 DRIVE_BUTTON_HEIG TH,2296 DRIVE_BUTTON_HEIGHT, 2285 2297 hwndT, HWND_TOP, x + IDM_DRIVEA, NULL, NULL); 2286 2298 if (!hwndB) … … 2299 2311 VOID ResizeDrives(HWND hwndT, long xwidth) 2300 2312 { 2301 register ULONG ctrlxpos = 2, ctrlypos = 0, ctrlxsize;2313 register ULONG ctrlxpos = 1, ctrlypos = 0, ctrlxsize; 2302 2314 HENUM henum; 2303 2315 HWND hwndB; … … 2310 2322 WinQueryWindowRect(hwndT, &rcl); 2311 2323 xwidth = rcl.xRight - ((WinQuerySysValue(HWND_DESKTOP, 2312 SV_CYSIZEBORDER) * 2) + 2);2324 SV_CYSIZEBORDER) * 2) + 1); 2313 2325 } 2314 2326 henum = WinBeginEnumWindows(hwndT); … … 2317 2329 WinSetWindowPos(hwndB, 2318 2330 HWND_TOP, 2319 ctrlxpos, ctrlypos, ctrlxsize, DRIVE_BUTTON_HEIG TH, SWP_MOVE | SWP_SHOW);2331 ctrlxpos, ctrlypos, ctrlxsize, DRIVE_BUTTON_HEIGHT, SWP_MOVE | SWP_SHOW); 2320 2332 ctrlxpos += (ctrlxsize + 2); 2321 if (ctrlxpos + (DRIVE_BUTTON_WIDTH + 4+ ((fShowTarget && DriveLines == 0) ?2333 if (ctrlxpos + (DRIVE_BUTTON_WIDTH + 2 + ((fShowTarget && DriveLines == 0) ? 2322 2334 256 : 0)) > xwidth) { 2323 ctrlxpos = 2;2324 ctrlypos += DRIVE_BUTTON_HEIG TH;2335 ctrlxpos = 1; 2336 ctrlypos += DRIVE_BUTTON_HEIGHT; 2325 2337 DriveLines++; 2326 2338 } … … 3998 4010 (WinQuerySysValue(HWND_DESKTOP, 3999 4011 SV_CYSIZEBORDER) * 2)) - 4)); 4000 prectl->yTop -= (16 * (DriveLines * DRIVE_BUTTON_HEIG TH));4012 prectl->yTop -= (16 * (DriveLines * DRIVE_BUTTON_HEIGHT)); 4001 4013 } 4002 4014 if (fUserComboBox) { … … 4027 4039 PSWP pswp, pswpClient, pswpNew; 4028 4040 SWP swpClient; 4029 LONG theight = 48L, dheight = DRIVE_BUTTON_HEIG TH + 2, width, sheight = 20, bheight = 20;4041 LONG theight = 48L, dheight = DRIVE_BUTTON_HEIGHT, width, sheight = 20, bheight = 20; 4030 4042 4031 4043 sCount = (SHORT) oldproc(hwnd, msg, mp1, mp2); … … 4136 4148 pswpNew->hwndInsertBehind = HWND_BOTTOM; 4137 4149 pswpNew->x = swpClient.x + 2; 4138 dheight += ((dheight - 2) * DriveLines);4139 pswpNew->y = (swpClient.y + swpClient.cy) - (dheight - 2);4150 dheight += ((dheight) * DriveLines); 4151 pswpNew->y = (swpClient.y + swpClient.cy) - (dheight); 4140 4152 if (fToolbar) 4141 4153 pswpNew->y -= theight; 4142 4154 pswpNew->cx = swpClient.cx - 4; 4143 pswpNew->cy = dheight - 4;4155 pswpNew->cy = dheight; 4144 4156 pswpClient->cy -= dheight; 4145 4157 sCount++;
Note:
See TracChangeset
for help on using the changeset viewer.
