Changeset 125 for trunk/settings.cpp


Ignore:
Timestamp:
Aug 14, 2021, 7:06:23 PM (4 years ago)
Author:
Gregg Young
Message:

Update About setting page; improve unicode font selection;

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/settings.cpp

    r115 r125  
    620620            }
    621621            break;
    622 
     622#ifndef _QUIET_
    623623        case WID_PB_ABOUT:
    624624            AboutBox (hwnd);
    625625            break;
    626 
     626#endif
    627627        case DID_CANCEL:
    628628            {
     
    12981298            WinSetCp(hmq, 1207); // UPF-8 Unicode
    12991299            WinRemovePresParam(hwnd, PP_FONTNAMESIZE);
     1300#ifndef _QUIET_ //??
    13001301            pset->GetLanguages(WinWindowFromID (hwnd, WID_LB_LANGUAGES));
    1301 
     1302#endif
    13021303#ifdef _DOLOGDEBUG_
    13031304            LogDebug( "Page4Procedure: WM_INITDLG: after GetLanguages()" );
    13041305#endif
    1305             HDIR          hdir;
    1306             ULONG         c, fl;
    1307             FILEFINDBUF3  findbuf;
    1308             APIRET        rc;
    1309             PSZ           psz;
    1310 
    1311             // find all hlps and add the names to the language list
    1312             fl   = FILE_NORMAL;
    1313             hdir = HDIR_CREATE;
    1314             c    = 1;
    1315             rc   = DosFindFirst ("*.hlp", &hdir, fl, &findbuf,
    1316                                  sizeof (findbuf), &c, FIL_STANDARD);
    1317 #ifdef _DOLOGDEBUG_
    1318             LogDebug( "Page4Procedure: WM_INITDLG: Entering help file loop ..." );
    1319 #endif
    1320             while (!rc)
    1321             {
    1322 #ifdef _DOLOGDEBUG_
    1323                 LogDebug( "Page4Procedure: WM_INITDLG: Doing '%s' ...", findbuf.achName );
    1324 #endif
    1325                 if ((psz = strchr (findbuf.achName, '.')))
    1326                     *psz = '\0';
    1327                 findbuf.achName[0] = toupper (findbuf.achName[0]);
    1328                 WinInsertLboxItem (WinWindowFromID (hwnd, WID_LB_LANGUAGESHELP),
    1329                                    LIT_END, findbuf.achName);
    1330                 c = 1;
    1331                 rc = DosFindNext (hdir, &findbuf, sizeof (findbuf), &c);
    1332             }
    1333             DosFindClose (hdir);
    1334 #ifdef _DOLOGDEBUG_
    1335             LogDebug( "Page4Procedure: WM_INITDLG: help file loop done." );
    1336 #endif
    1337 
     1306#ifndef _QUIET_
    13381307            WinSendMsg (hwnd, UM_SETTINGS2DIALOG, 0,0);
    13391308
     
    13411310                WinEnableWindow (WinWindowFromID (hwnd, WID_ST_LANGNOTE),
    13421311                                 FALSE);
     1312#endif
    13431313#ifdef _DOLOGDEBUG_
    13441314            LogDebug( "Page4Procedure: end WM_INITDLG" );
     
    13861356            if (uconv_object1207)
    13871357                UniFreeUconvObject(uconv_object1207);
    1388            
    1389             if (pset->GetLangID() == RU || pset->GetLangID() == CZ || pset->GetLangID() == PL) {
     1358            CHAR *env, *p;
     1359            env = getenv("OSDIR");
     1360            p = env;
     1361            p++;
     1362            if (!stricmp(p, ":\\sys")) {
     1363                strcpy(ucFont, "9.Workplace Sans");
     1364                WinSetPresParam(hwnd, PP_FONTNAMESIZE, strlen(ucFont) + 1, ucFont);
     1365            }
     1366            /*if (pset->GetLangID() == RU || pset->GetLangID() == CZ || pset->GetLangID() == PL) {*/
     1367            else {
    13901368                strcpy(ucFont, "9.Times New Roman MT 30");
    13911369                WinSetPresParam(hwnd, PP_FONTNAMESIZE, strlen(ucFont) + 1, ucFont);
    13921370            }
    1393             else if (g_installer) {
    1394                 strcpy(ucFont, "9.WarpSans");
     1371            /*else if (g_installer) {
     1372                strcpy(ucFont, 9.WarpSans");
    13951373                WinSetPresParam(hwnd, PP_FONTNAMESIZE, strlen(ucFont) + 1, ucFont);
    1396             }
     1374            } */
    13971375        return MRESULT (FALSE);
    13981376        }
     
    14021380            WinPostMsg( g_hwndSettingsDialog, msg, mp1, mp2 );
    14031381        return MRESULT( FALSE );
    1404 
     1382#ifndef _QUIET_
    14051383    case UM_SETTINGS2DIALOG:
    14061384        {
     
    14371415                WinSendDlgItemMsg (hwnd, WID_LB_LANGUAGES, LM_SELECTITEM,
    14381416                                   MPFROMSHORT (0), MPFROMSHORT (TRUE));
    1439             hwndLB = WinWindowFromID (hwnd, WID_LB_LANGUAGESHELP);
    1440             c = WinQueryLboxCount (hwndLB);
    1441 
    1442             for (i = 0; i < c; i++)
    1443             {
    1444 #ifdef _DOLOGDEBUG_
    1445                 LogDebug( "Page4Procedure: UM_SETTINGS2DIALOG: i.2 = %d", i );
    1446 #endif
    1447                 WinQueryLboxItemText (hwndLB, i, ach, sizeof (ach));
    1448                 if (stricmp (pset->QueryString (SEI_LANGUAGEHELP), ach) == 0)
    1449                     break;
    1450             }
    1451 #ifdef _DOLOGDEBUG_
    1452             LogDebug( "Page4Procedure: UM_SETTINGS2DIALOG: after loop 2" );
    1453 #endif
    1454             if (i < c)
    1455                 WinSendDlgItemMsg (hwnd, WID_LB_LANGUAGESHELP, LM_SELECTITEM,
    1456                                    MPFROMSHORT (i), MPFROMSHORT (TRUE));
    1457             else
    1458                 WinSendDlgItemMsg (hwnd, WID_LB_LANGUAGESHELP, LM_SELECTITEM,
    1459                                    MPFROMSHORT (0), MPFROMSHORT (TRUE));
    14601417#ifdef _DOLOGDEBUG_
    14611418            LogDebug( "Page4Procedure: end UM_SETTINGS2DIALOG" );
     
    14631420        }
    14641421        return MRESULT (FALSE);
    1465 
     1422#endif
    14661423    case WM_DESTROY:
    14671424#ifndef _QUIET_
     
    15941551
    15951552// ** SelectLanguage ****************************************************** /*FOLD00*/
    1596 
     1553#ifndef _QUIET_
    15971554VOID Settings :: SelectLanguage (VOID)
    15981555{
     
    16141571    Dialog (TRUE);
    16151572}
     1573#endif
    16161574
    16171575// ** GetLanguages ******************************************************** /*FOLD00*/
    1618 
     1576#ifndef _QUIET_ //??
    16191577USHORT Settings :: GetLanguages (HWND hwnd)
    16201578{
     
    17131671    return 1;
    17141672}
    1715 
     1673#endif
    17161674// ** GetFileExtension **************************************************** /*FOLD00*/
    17171675
Note: See TracChangeset for help on using the changeset viewer.