MCPcopy Create free account
hub / github.com/NetHack/NetHack / mswin_preference_update

Function mswin_preference_update

outdated/sys/wince/mswproc.c:1558–1680  ·  view source on GitHub ↗

handle options updates here */

Source from the content-addressed store, hash-verified

1556
1557/* handle options updates here */
1558void
1559mswin_preference_update(const char *pref)
1560{
1561 HDC hdc;
1562
1563 if (_stricmp(pref, "font_menu") == 0
1564 || _stricmp(pref, "font_size_menu") == 0) {
1565 if (iflags.wc_fontsiz_menu < NHFONT_SIZE_MIN
1566 || iflags.wc_fontsiz_menu > NHFONT_SIZE_MAX)
1567 iflags.wc_fontsiz_menu = NHFONT_DEFAULT_SIZE;
1568
1569 hdc = GetDC(GetNHApp()->hMainWnd);
1570 mswin_get_font(NHW_MENU, ATR_NONE, hdc, TRUE);
1571 mswin_get_font(NHW_MENU, ATR_BOLD, hdc, TRUE);
1572 mswin_get_font(NHW_MENU, ATR_DIM, hdc, TRUE);
1573 mswin_get_font(NHW_MENU, ATR_ULINE, hdc, TRUE);
1574 mswin_get_font(NHW_MENU, ATR_BLINK, hdc, TRUE);
1575 mswin_get_font(NHW_MENU, ATR_INVERSE, hdc, TRUE);
1576 ReleaseDC(GetNHApp()->hMainWnd, hdc);
1577
1578 mswin_layout_main_window(NULL);
1579 return;
1580 }
1581
1582 if (_stricmp(pref, "font_status") == 0
1583 || _stricmp(pref, "font_size_status") == 0) {
1584 if (iflags.wc_fontsiz_status < NHFONT_SIZE_MIN
1585 || iflags.wc_fontsiz_status > NHFONT_SIZE_MAX)
1586 iflags.wc_fontsiz_status = NHFONT_DEFAULT_SIZE;
1587
1588 hdc = GetDC(GetNHApp()->hMainWnd);
1589 mswin_get_font(NHW_STATUS, ATR_NONE, hdc, TRUE);
1590 mswin_get_font(NHW_STATUS, ATR_BOLD, hdc, TRUE);
1591 mswin_get_font(NHW_STATUS, ATR_DIM, hdc, TRUE);
1592 mswin_get_font(NHW_STATUS, ATR_ULINE, hdc, TRUE);
1593 mswin_get_font(NHW_STATUS, ATR_BLINK, hdc, TRUE);
1594 mswin_get_font(NHW_STATUS, ATR_INVERSE, hdc, TRUE);
1595 ReleaseDC(GetNHApp()->hMainWnd, hdc);
1596
1597 mswin_layout_main_window(NULL);
1598 return;
1599 }
1600
1601 if (_stricmp(pref, "font_message") == 0
1602 || _stricmp(pref, "font_size_message") == 0) {
1603 if (iflags.wc_fontsiz_message < NHFONT_SIZE_MIN
1604 || iflags.wc_fontsiz_message > NHFONT_SIZE_MAX)
1605 iflags.wc_fontsiz_message = NHFONT_DEFAULT_SIZE;
1606
1607 hdc = GetDC(GetNHApp()->hMainWnd);
1608 mswin_get_font(NHW_MESSAGE, ATR_NONE, hdc, TRUE);
1609 mswin_get_font(NHW_MESSAGE, ATR_BOLD, hdc, TRUE);
1610 mswin_get_font(NHW_MESSAGE, ATR_DIM, hdc, TRUE);
1611 mswin_get_font(NHW_MESSAGE, ATR_ULINE, hdc, TRUE);
1612 mswin_get_font(NHW_MESSAGE, ATR_BLINK, hdc, TRUE);
1613 mswin_get_font(NHW_MESSAGE, ATR_INVERSE, hdc, TRUE);
1614 ReleaseDC(GetNHApp()->hMainWnd, hdc);
1615

Callers

nothing calls this directly

Calls 8

_stricmpFunction · 0.85
mswin_set_fullscreenFunction · 0.85
GetNHAppFunction · 0.70
mswin_get_fontFunction · 0.70
mswin_layout_main_windowFunction · 0.70
mswin_cliparoundFunction · 0.70
mswin_select_map_modeFunction · 0.70
mswin_hwnd_from_winidFunction · 0.70

Tested by

no test coverage detected