Changeset 1436
- Timestamp:
- Jun 27, 2009, 5:26:13 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
-
bitmaps/cdrom.bmp (modified) ( previous)
-
bitmaps/floppy.bmp (modified) ( previous)
-
bitmaps/hdrive.bmp (modified) ( previous)
-
bitmaps/ramdisk.bmp (modified) ( previous)
-
bitmaps/remote.bmp (modified) ( previous)
-
bitmaps/remov.bmp (modified) ( previous)
-
bitmaps/virtual.bmp (modified) ( previous)
-
dll/fm3dll2.h (modified) (1 diff)
-
dll/init.c (modified) (1 diff)
-
dll/init.h (modified) (1 diff)
-
dll/mainwnd.c (modified) (21 diffs)
-
dll/mainwnd.h (modified) (1 diff)
-
dll/mainwnd2.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/fm3dll2.h
r1362 r1436 485 485 #define IDM_DRIVESMENU 3899 486 486 #define IDM_DRIVEA 3900 487 #define IDM_DRIVEATEXT 3950 487 // Drive button IDs use 3900 - 3925 488 488 489 489 #define IDM_COMMANDSMENU 4000 -
trunk/dll/init.c
r1434 r1436 250 250 HMODULE FM3DllHandle; 251 251 PCSZ FM3Folder = "<FM3_Folder>"; 252 PCSZ FNT_HELVETICA = "Helvetica"; 252 253 PCSZ FNT_6HELVETICA = "6.Helvetica"; 253 254 PCSZ FNT_8HELVETICA = "8.Helvetica"; -
trunk/dll/init.h
r1409 r1436 79 79 extern ULONG ulTimeFmt; 80 80 extern ULONG ulDateFmt; 81 extern PCSZ FNT_HELVETICA; 81 82 extern PCSZ FNT_6HELVETICA; 82 83 extern PCSZ FNT_8HELVETICA; -
trunk/dll/mainwnd.c
r1429 r1436 87 87 add State.version key for check 88 88 07 Jun 09 GKY Fix IDM_BLINK to not leave a DataBar? on the screen when fDataMin is TRUE. 89 21 Jun 09 GKY Added drive letter to bitmap buttons in drive bar; Eliminate static drive 90 letter windows; Use button ID to identify drive letter for processing. 89 91 90 92 ***********************************************************************/ … … 169 171 #include "excputil.h" // xbeginthread 170 172 173 #define DRIVEBAR_FONT_LCID 10 174 171 175 static BOOL CloseDirCnrChildren(HWND hwndClient); 172 176 static BOOL RestoreDirCnrState(HWND hwndClient, PSZ pszStateName, BOOL noview); … … 252 256 id = WinQueryWindowUShort(hwndB, QWS_ID); 253 257 *dv = 0; 254 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwndB, QW_PARENT),255 id + 50), sizeof(dv), dv);258 *dv = id - IDM_DRIVEA + 'A'; 259 strcpy(dv + 1, ":"); 256 260 d = toupper(*dv); 257 261 if (isalpha(d) && d > 'B' && … … 274 278 (fsa.cUnitAvail * 100) / fsa.cUnit : 0; 275 279 CommaFmtULL(szQty, sizeof(szQty), ullFreeQty, ' '); 276 sprintf(s, "%s (%lu%%) free", szQty, ulPctFree);280 sprintf(s, "%s %s (%lu%%) %s", dv, szQty, ulPctFree, GetPString(IDS_FREETEXT)); 277 281 } 278 282 if ((!hwndBubble || … … 1831 1835 CHAR dv[4]; 1832 1836 1833 *dv = 0; 1834 WinQueryWindowText(WinWindowFromID(hwnd, SHORT1FROMMP(mp1) + 50), 1835 2, dv); 1837 *dv = SHORT1FROMMP(mp1) - IDM_DRIVEA + 'A'; 1838 strcpy(dv + 1, ":\\"); 1836 1839 if (isalpha(*dv)) { 1837 1840 … … 1885 1888 break; 1886 1889 1890 case WM_PAINT: 1891 { 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 1895 HBITMAP hbm; 1896 POINTL ptlStart; 1897 ULONG x, iconid; 1898 FATTRS fat; 1899 SIZEF sizfCharBox; 1900 1901 id = WinQueryWindowUShort(hwnd, QWS_ID); 1902 *szDrv = 0; 1903 x = id - IDM_DRIVEA; 1904 *szDrv = x + 'A'; 1905 strcpy(szDrv + 1, ":"); 1906 if (x > 1) { 1907 if (driveflags[x] & DRIVE_CDROM) 1908 iconid = CDROM_ICON; 1909 else 1910 iconid = (driveflags[x] & DRIVE_REMOVABLE) ? 1911 REMOVABLE_ICON : 1912 (driveflags[x] & DRIVE_VIRTUAL) ? 1913 VIRTUAL_ICON : 1914 (driveflags[x] & DRIVE_REMOTE) ? 1915 REMOTE_ICON : 1916 (driveflags[x] & DRIVE_RAMDISK) ? 1917 RAMDISK_ICON : 1918 (driveflags[x] & DRIVE_ZIPSTREAM) ? 1919 ZIPSTREAM_ICON : DRIVE_ICON; 1920 } 1921 else 1922 iconid = FLOPPY_ICON; 1923 hps = WinBeginPaint(hwnd, (HPS) 0, NULL); 1924 if (hps) { 1925 hbm = GpiLoadBitmap(hps, 0, iconid, 0, 0); 1926 if (hbm) 1927 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); 1934 x = GpiCreateLogFont(hps, NULL, DRIVEBAR_FONT_LCID, &fat); 1935 if (x != GPI_ERROR) { 1936 GpiSetCharSet(hps, DRIVEBAR_FONT_LCID); 1937 sizfCharBox.cx = MAKEFIXED(10,0); //Font size 1938 sizfCharBox.cy = MAKEFIXED(14,0); 1939 GpiSetCharBox( hps, &sizfCharBox ); 1940 GpiSetColor(hps, iconid == RAMDISK_ICON ? CLR_YELLOW : CLR_DARKBLUE); 1941 ptlStart.x = 1L; //Char box position 1942 ptlStart.y = 7L; 1943 GpiCharStringAt(hps, &ptlStart, strlen(szDrv), szDrv); 1944 GpiDeleteSetId(hps, DRIVEBAR_FONT_LCID); 1945 } 1946 WinEndPaint(hps); 1947 } 1948 } 1949 break; 1950 1887 1951 case UM_SETUP6: 1888 1952 if (helpid == WinQueryWindowUShort(hwnd, QWS_ID)) { … … 1916 1980 hwndMenu = (HWND) 0; 1917 1981 id = WinQueryWindowUShort(hwnd, QWS_ID); 1918 *szDrv = 0; 1919 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1920 id + 50), sizeof(szDrv), szDrv); 1982 *szDrv = id - IDM_DRIVEA + 'A'; 1983 strcpy(szDrv + 1, ":"); 1921 1984 if (isalpha(*szDrv)) { 1922 1985 hwndMenu = WinLoadMenu(HWND_DESKTOP, FM3ModHandle, MAIN_DRIVES); … … 1926 1989 UINT iDrv; 1927 1990 1928 strcpy(szDrv + 2, "\\");1991 strcat(szDrv, "\\"); 1929 1992 MakeValidDir(szDrv); 1930 1993 // Disable menus if MakeValidDir changes drive letter fixme this section doesn't do anything see treecnt.c 1931 1994 rdy = toupper(*szDrv) == toupper(chDrv); 1932 iDrv = toupper(*szDrv) - 'A';1995 iDrv = toupper(*szDrv) - 'A'; 1933 1996 if (!rdy || ~driveflags[iDrv] & DRIVE_REMOTE) 1934 1997 WinEnableMenuItem(hwndMenu, IDM_DETACH, FALSE); … … 1970 2033 case WM_BUTTON3CLICK: 1971 2034 id = WinQueryWindowUShort(hwnd, QWS_ID); 1972 *szDrv = 0; 1973 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1974 id + 50), sizeof(szDrv), szDrv); 2035 *szDrv = id - IDM_DRIVEA + 'A'; 2036 strcpy(szDrv + 1, ":"); 1975 2037 if (isalpha(*szDrv)) { 1976 2038 strcat(szDrv, "\\"); … … 1986 2048 case UM_COMMAND: 1987 2049 id = WinQueryWindowUShort(hwnd, QWS_ID); 1988 *szDrv = 0; 1989 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1990 id + 50), sizeof(szDrv), szDrv); 2050 *szDrv = id - IDM_DRIVEA + 'A'; 2051 strcpy(szDrv + 1, ":"); 1991 2052 if (isalpha(*szDrv)) { 1992 2053 strcat(szDrv, "\\"); … … 1997 2058 case DM_DRAGOVER: 1998 2059 id = WinQueryWindowUShort(hwnd, QWS_ID); 1999 *szDrv = 0; 2000 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 2001 id + 50), sizeof(szDrv), szDrv); 2060 *szDrv = id - IDM_DRIVEA + 'A'; 2061 strcpy(szDrv + 1, ":"); 2002 2062 if (isalpha(*szDrv) && 2003 2063 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) { … … 2014 2074 case DM_DRAGLEAVE: 2015 2075 id = WinQueryWindowUShort(hwnd, QWS_ID); 2016 *szDrv = 0; 2017 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 2018 id + 50), sizeof(szDrv), szDrv); 2076 *szDrv = id - IDM_DRIVEA + 'A'; 2077 strcpy(szDrv + 1, ":"); 2019 2078 if (isalpha(*szDrv) && 2020 2079 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) { … … 2028 2087 case DM_DROPHELP: 2029 2088 id = WinQueryWindowUShort(hwnd, QWS_ID); 2030 *szDrv = 0; 2031 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 2032 id + 50), sizeof(szDrv), szDrv); 2089 *szDrv = id - IDM_DRIVEA + 'A'; 2090 strcpy(szDrv + 1, ":"); 2033 2091 if (isalpha(*szDrv) && 2034 2092 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) { … … 2040 2098 case DM_DROP: 2041 2099 id = WinQueryWindowUShort(hwnd, QWS_ID); 2042 *szDrv = 0; 2043 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 2044 id + 50), sizeof(szDrv), szDrv); 2100 *szDrv = id - IDM_DRIVEA + 'A'; 2101 strcpy(szDrv + 1, ":"); 2045 2102 if (isalpha(*szDrv) && 2046 2103 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) { … … 2202 2259 VOID BuildDriveBarButtons(HWND hwndT) 2203 2260 { 2204 register ULONG x, y = 0; 2205 ULONG ulDriveNum, ulDriveMap, iconid; 2206 CHAR s[8]; 2261 register ULONG x; 2262 ULONG ulDriveNum, ulDriveMap; 2207 2263 HENUM henum; 2208 2264 HWND hwndB; … … 2219 2275 for (x = 0; x < 26; x++) { 2220 2276 if ((ulDriveMap & (1L << x)) && !(driveflags[x] & DRIVE_IGNORE)) { 2221 if (x > 1) {2222 if (driveflags[x] & DRIVE_CDROM)2223 iconid = CDROM_ICON;2224 else2225 iconid = (driveflags[x] & DRIVE_REMOVABLE) ?2226 REMOVABLE_ICON :2227 (driveflags[x] & DRIVE_VIRTUAL) ?2228 VIRTUAL_ICON :2229 (driveflags[x] & DRIVE_REMOTE) ?2230 REMOTE_ICON :2231 (driveflags[x] & DRIVE_RAMDISK) ?2232 RAMDISK_ICON :2233 (driveflags[x] & DRIVE_ZIPSTREAM) ?2234 ZIPSTREAM_ICON :DRIVE_ICON;2235 }2236 else2237 iconid = FLOPPY_ICON;2238 sprintf(s, "#%lu", iconid);2239 2277 hwndB = WinCreateWindow(hwndT, 2240 2278 WC_DRIVEBUTTONS, 2241 s,2242 BS_NOPOINTERFOCUS | BS_BITMAP | BS_PUSHBUTTON,2279 0, 2280 BS_NOPOINTERFOCUS | BS_USERBUTTON, 2243 2281 0, 2244 2282 0, 2245 28,2246 18,2247 hwndT, HWND_TOP, y+ IDM_DRIVEA, NULL, NULL);2283 DRIVE_BUTTON_WIDTH, 2284 DRIVE_BUTTON_HEIGTH, 2285 hwndT, HWND_TOP, x + IDM_DRIVEA, NULL, NULL); 2248 2286 if (!hwndB) 2249 2287 Win_Error(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__, 2250 2288 PCSZ_WINCREATEWINDOW); 2251 else {2289 else { 2252 2290 WinSetWindowPos(hwndB, HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER); 2253 sprintf(s, "%c:", (CHAR) x + 'A');2254 hwndB = WinCreateWindow(hwndT,2255 WC_STATIC,2256 s,2257 SS_TEXT | DT_LEFT | DT_VCENTER,2258 0,2259 0,2260 10,2261 18,2262 hwndT,2263 HWND_TOP, y + IDM_DRIVEATEXT, NULL, NULL);2264 if (!hwndB)2265 Win_Error(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,2266 PCSZ_WINCREATEWINDOW);2267 else {2268 //fixme to allow user to change presparams 1-10-09 GKY2269 SetPresParams(hwndB,2270 &RGBGREY,2271 &RGBBLACK, &RGBGREY, FNT_6HELVETICA);2272 WinSetWindowPos(hwndB, HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER);2273 }2274 y++;2275 2291 } 2276 2292 } … … 2298 2314 henum = WinBeginEnumWindows(hwndT); 2299 2315 while ((hwndB = WinGetNextWindow(henum)) != NULLHANDLE) { 2300 if (WinQueryWindowUShort(hwndB, QWS_ID) > IDM_DRIVEA + 27) 2301 ctrlxsize = 10; 2302 else 2303 ctrlxsize = 28; 2316 ctrlxsize = DRIVE_BUTTON_WIDTH; 2304 2317 WinSetWindowPos(hwndB, 2305 2318 HWND_TOP, 2306 ctrlxpos, ctrlypos, ctrlxsize, 18, SWP_MOVE | SWP_SHOW);2319 ctrlxpos, ctrlypos, ctrlxsize, DRIVE_BUTTON_HEIGTH, SWP_MOVE | SWP_SHOW); 2307 2320 ctrlxpos += (ctrlxsize + 2); 2308 if (ctrlxsize == 10) { 2309 if (ctrlxpos + (42 + ((fShowTarget && DriveLines == 0) ? 2310 256 : 0)) > xwidth) { 2311 ctrlxpos = 2; 2312 ctrlypos += 18; 2313 DriveLines++; 2314 } 2321 if (ctrlxpos + (DRIVE_BUTTON_WIDTH + 4 + ((fShowTarget && DriveLines == 0) ? 2322 256 : 0)) > xwidth) { 2323 ctrlxpos = 2; 2324 ctrlypos += DRIVE_BUTTON_HEIGTH; 2325 DriveLines++; 2315 2326 } 2316 2327 } … … 3139 3150 PrfQueryProfileString(fmprof, FM3Str, szKey, NULL, targetdir, sizeof(targetdir)); 3140 3151 PrfWriteProfileString(fmprof, FM3Str, "TargetDir", targetdir); 3141 SetTargetDir(NULL , TRUE);3152 SetTargetDir(NULLHANDLE, TRUE); 3142 3153 } 3143 3154 size = sizeof(SWP); … … 3987 3998 (WinQuerySysValue(HWND_DESKTOP, 3988 3999 SV_CYSIZEBORDER) * 2)) - 4)); 3989 prectl->yTop -= (16 * (DriveLines * 18));4000 prectl->yTop -= (16 * (DriveLines * DRIVE_BUTTON_HEIGTH)); 3990 4001 } 3991 4002 if (fUserComboBox) { … … 4016 4027 PSWP pswp, pswpClient, pswpNew; 4017 4028 SWP swpClient; 4018 LONG theight = 48L, dheight = 20L, width, sheight = 20, bheight = 20;4029 LONG theight = 48L, dheight = DRIVE_BUTTON_HEIGTH + 2, width, sheight = 20, bheight = 20; 4019 4030 4020 4031 sCount = (SHORT) oldproc(hwnd, msg, mp1, mp2); … … 4150 4161 pswpNew->cx = pswpClient->cx - 6; 4151 4162 AutoviewHeight = min(AutoviewHeight, pswpClient->cy - 116); 4152 AutoviewHeight = max(AutoviewHeight, 36);4163 AutoviewHeight = max(AutoviewHeight, 40); 4153 4164 pswpNew->cy = AutoviewHeight; 4154 4165 pswpClient->y += (AutoviewHeight + 6); -
trunk/dll/mainwnd.h
r1402 r1436 20 20 21 21 #include "colors.h" // typedef for RGB2 22 23 #define DRIVE_BUTTON_WIDTH 28 24 #define DRIVE_BUTTON_HEIGTH 21 22 25 23 26 void BubbleHelp(HWND hwnd, BOOL other, BOOL data, BOOL above, PCSZ help); -
trunk/dll/mainwnd2.c
r1416 r1436 204 204 (WinQuerySysValue(HWND_DESKTOP, 205 205 SV_CYSIZEBORDER) * 2)) - 4)); 206 prectl->yTop -= (16 * (DriveLines * 18));206 prectl->yTop -= (16 * (DriveLines * 22)); 207 207 prectl->yTop -= 2; 208 208 if (fAutoView) { 209 209 AutoviewHeight = min(AutoviewHeight, 210 210 (prectl->yTop - prectl->yBottom) - 116); 211 AutoviewHeight = max(AutoviewHeight, 36);211 AutoviewHeight = max(AutoviewHeight, 44); 212 212 prectl->yBottom += (AutoviewHeight + 6); 213 213 } … … 222 222 PSWP pswp, pswpClient, pswpNew; 223 223 SWP swpClient; 224 ULONG theight = 48L, dheight = 20, bheight = 20, sheight = 20;224 ULONG theight = 48L, dheight = DRIVE_BUTTON_HEIGTH + 2, bheight = 20, sheight = 20; 225 225 LONG width, lastx; 226 226 … … 328 328 pswpNew->cx = pswpClient->cx - 6; 329 329 AutoviewHeight = min(AutoviewHeight, pswpClient->cy - 116); 330 AutoviewHeight = max(AutoviewHeight, 36);330 AutoviewHeight = max(AutoviewHeight, 44); 331 331 pswpNew->cy = AutoviewHeight; 332 332 pswpClient->y += (AutoviewHeight + 6);
Note:
See TracChangeset
for help on using the changeset viewer.
