Changeset 6327 for trunk/src


Ignore:
Timestamp:
Jul 14, 2001, 10:36:19 AM (24 years ago)
Author:
sandervl
Message:

query menu font from os2.ini

Location:
trunk/src/user32
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/oslibprf.cpp

    r6072 r6327  
    1 /* $Id: oslibprf.cpp,v 1.1 2001-06-23 07:20:55 achimha Exp $ */
     1/* $Id: oslibprf.cpp,v 1.2 2001-07-14 08:36:17 sandervl Exp $ */
    22/*
    33 * Profile API wrappers for OS/2
     
    2323    return PrfQueryProfileInt(hini, pszApp, pszKey, sDefault);
    2424}
     25
     26LONG OSLibPrfQueryProfileString(OSLIB_HINI hini, char *pszApp, char *pszKey, char *pszDefault, char *buffer, ULONG buflen)
     27{
     28    return PrfQueryProfileString(hini, pszApp, pszKey, pszDefault, buffer, buflen);
     29}
  • trunk/src/user32/oslibprf.h

    r6072 r6327  
    1 /* $Id: oslibprf.h,v 1.1 2001-06-23 07:20:55 achimha Exp $ */
     1/* $Id: oslibprf.h,v 1.2 2001-07-14 08:36:18 sandervl Exp $ */
    22/*
    33 * Profile API wrappers for OS/2
     
    2222
    2323LONG OSLibPrfQueryProfileInt(OSLIB_HINI hini, char *pszApp, char *pszKey, LONG sDefault);
     24LONG OSLibPrfQueryProfileString(OSLIB_HINI hini, char *pszApp, char *pszKey, char *pszDefault, char *buffer, ULONG buflen);
    2425
    2526#endif
  • trunk/src/user32/user32.cpp

    r6177 r6327  
    1 /* $Id: user32.cpp,v 1.106 2001-07-05 18:10:56 sandervl Exp $ */
     1/* $Id: user32.cpp,v 1.107 2001-07-14 08:36:19 sandervl Exp $ */
    22
    33/*
     
    730730            LPLOGFONTA lpLogFont = &(lpnm->lfMenuFont);
    731731            if(fOS2Look) {
    732                 GetProfileStringA("Desktop", "MenuFont", "WarpSans",
    733                                   lpLogFont->lfFaceName, LF_FACESIZE);
    734                 lpLogFont->lfWeight = FW_BOLD;
    735                 lpLogFont->lfHeight = -GetProfileIntA("Desktop","MenuFontSize", 16);
     732                char fontname[128];
     733                char *pszFontName;
     734                BOOL fFound = TRUE;
     735
     736                if(OSLibPrfQueryProfileString(OSLIB_HINI_USER, "PM_SystemFonts", "Menus", "", fontname, sizeof(fontname)) == 1) {
     737                    if(OSLibPrfQueryProfileString(OSLIB_HINI_USER, "PM_SystemFonts", "DefaultFont", "", fontname, sizeof(fontname)) == 1) {
     738                        fFound = FALSE;
     739                    }
     740                }
     741                if(fFound) {
     742                    pszFontName = fontname;
     743                    while(*pszFontName != '.' && *pszFontName != 0) pszFontName++;
     744                    if(*pszFontName) {
     745                        *pszFontName++ = 0;
     746
     747                        strncpy(lpLogFont->lfFaceName, pszFontName, sizeof(lpLogFont->lfFaceName));
     748                        lpLogFont->lfFaceName[sizeof(lpLogFont->lfFaceName)-1] = 0;
     749                        lpLogFont->lfWeight = FW_NORMAL;
     750                        lpLogFont->lfHeight = 16; //atoi(fontname);
     751                    }
     752                    else fFound = FALSE;
     753                }
     754                if(!fFound) {
     755                    GetProfileStringA("Desktop", "MenuFont", "WarpSans",
     756                                      lpLogFont->lfFaceName, LF_FACESIZE);
     757                    lpLogFont->lfWeight = FW_BOLD;
     758                    lpLogFont->lfHeight = -GetProfileIntA("Desktop","MenuFontSize", 16);
     759                }
    736760                lpLogFont->lfWidth = 0;
    737761                lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
Note: See TracChangeset for help on using the changeset viewer.