summaryrefslogtreecommitdiff
path: root/src/mir_app/src/FontOptions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mir_app/src/FontOptions.cpp')
-rw-r--r--src/mir_app/src/FontOptions.cpp123
1 files changed, 0 insertions, 123 deletions
diff --git a/src/mir_app/src/FontOptions.cpp b/src/mir_app/src/FontOptions.cpp
index de970855bb..3f06d57471 100644
--- a/src/mir_app/src/FontOptions.cpp
+++ b/src/mir_app/src/FontOptions.cpp
@@ -1213,127 +1213,4 @@ static FontInternal* sttFindFont(OBJLIST<FontInternal> &fonts, char *module, cha
static FontInternal fntHeader, fntGeneral, fntSmall;
-static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- int i;
- LOGFONT lf;
-
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
-
- fntHeader = *sttFindFont(font_id_list, "Fonts", "Header");
- UpdateFontSettings(&fntHeader, &fntHeader.value);
- fntGeneral = *sttFindFont(font_id_list, "Fonts", "Generic");
- UpdateFontSettings(&fntGeneral, &fntGeneral.value);
- fntSmall = *sttFindFont(font_id_list, "Fonts", "Small");
- UpdateFontSettings(&fntSmall, &fntSmall.value);
- return TRUE;
-
- case WM_DRAWITEM:
- {
- FontInternal *pf = 0;
- DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)lParam;
- switch (dis->CtlID) {
- case IDC_PREVIEWHEADER:
- pf = &fntHeader;
- break;
- case IDC_PREVIEWGENERAL:
- pf = &fntGeneral;
- break;
- case IDC_PREVIEWSMALL:
- pf = &fntSmall;
- break;
- }
-
- if (!pf)
- break;
-
- HFONT hFont = nullptr, hoFont = nullptr;
- CreateFromFontSettings(&pf->value, &lf);
- hFont = CreateFontIndirect(&lf);
- hoFont = (HFONT)SelectObject(dis->hDC, hFont);
- SetBkMode(dis->hDC, TRANSPARENT);
- SetTextColor(dis->hDC, GetSysColor(COLOR_BTNTEXT));
- FillRect(dis->hDC, &dis->rcItem, GetSysColorBrush(COLOR_BTNFACE));
- DrawText(dis->hDC, TranslateT("Sample text"), -1, &dis->rcItem, DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER | DT_WORD_ELLIPSIS | DT_CENTER);
- if (hoFont)
- SelectObject(dis->hDC, hoFont);
- return TRUE;
- }
-
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDC_CHOOSEFONTHEADER:
- case IDC_CHOOSEFONTGENERAL:
- case IDC_CHOOSEFONTSMALL:
- {
- FontInternal *pf = nullptr;
- switch (LOWORD(wParam)) {
- case IDC_CHOOSEFONTHEADER:
- pf = &fntHeader;
- break;
- case IDC_CHOOSEFONTGENERAL:
- pf = &fntGeneral;
- break;
- case IDC_CHOOSEFONTSMALL:
- pf = &fntSmall;
- break;
- };
-
- CreateFromFontSettings(&pf->value, &lf);
-
- CHOOSEFONT cf = { 0 };
- cf.lStructSize = sizeof(cf);
- cf.hwndOwner = hwndDlg;
- cf.lpLogFont = &lf;
- cf.lCustData = pf->flags;
- cf.Flags = CF_FORCEFONTEXIST | CF_INITTOLOGFONTSTRUCT | CF_SCREENFONTS;
- if (pf->flags & FIDF_ALLOWEFFECTS) {
- cf.Flags |= CF_EFFECTS | CF_ENABLEHOOK;
- cf.lpfnHook = CFHookProc;
- }
-
- if (ChooseFont(&cf)) {
- pf->value.size = (char)lf.lfHeight;
- pf->value.style = (lf.lfWeight >= FW_BOLD ? DBFONTF_BOLD : 0) | (lf.lfItalic ? DBFONTF_ITALIC : 0) | (lf.lfUnderline ? DBFONTF_UNDERLINE : 0) | (lf.lfStrikeOut ? DBFONTF_STRIKEOUT : 0);
- pf->value.charset = lf.lfCharSet;
- wcsncpy_s(pf->value.szFace, lf.lfFaceName, _TRUNCATE);
-
- InvalidateRect(GetDlgItem(hwndDlg, IDC_PREVIEWHEADER), nullptr, TRUE);
- InvalidateRect(GetDlgItem(hwndDlg, IDC_PREVIEWGENERAL), nullptr, TRUE);
- InvalidateRect(GetDlgItem(hwndDlg, IDC_PREVIEWSMALL), nullptr, TRUE);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- }
- return TRUE;
- }
- break;
-
- case WM_NOTIFY:
- if (((LPNMHDR)lParam)->idFrom == 0 && ((LPNMHDR)lParam)->code == PSN_APPLY) {
- for (i = 0; i < font_id_list.getCount(); i++) {
- FontInternal &F = font_id_list[i];
- if (F.deffontsettings.charset == SYMBOL_CHARSET)
- continue;
-
- COLORREF cl = F.value.colour;
- if (F.isHeader())
- F.value = fntHeader.value;
- else if ((F.flags & FIDF_CLASSMASK) == FIDF_CLASSSMALL)
- F.value = fntSmall.value;
- else
- F.value = fntGeneral.value;
-
- F.value.colour = cl;
- sttSaveFontData(hwndDlg, F);
- }
-
- OptionsChanged();
- }
- break;
- }
- return FALSE;
-}
-
INT_PTR CALLBACK DlgPluginOpt(HWND, UINT, WPARAM, LPARAM);