void AnnunText::SetColorScheme( ColorScheme cs ) { ocpnStyle::Style* style = g_StyleManager->GetCurrentStyle(); m_backBrush = *wxTheBrushList->FindOrCreateBrush( GetGlobalColor( _T("UBLCK") ), wxBRUSHSTYLE_SOLID ); m_default_text_color = style->consoleFontColor; RefreshFonts(); }
void dlgConfigFontsShowModal() { wf = LoadDialog(CallBackTable, XCSoarInterface::main_window, Layout::landscape ? _T("IDR_XML_CONFIG_FONTS_L") : _T("IDR_XML_CONFIG_FONTS")); if (wf == NULL) return; ((WndButton *)wf->FindByName(_T("cmdClose")))->SetOnClickNotify(OnCloseClicked); WndProperty *wp; wp = (WndProperty*)wf->FindByName(_T("prpUseCustomFonts")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*)wp->GetDataField(); dfb->Set(Appearance.UseCustomFonts); ShowFontEditButtons(dfb->GetAsBoolean()); wp->RefreshDisplay(); RefreshFonts(); } FontRegistryChanged = false; changed = false; wf->ShowModal(); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); if (dfb) { if (Appearance.UseCustomFonts != dfb->GetAsBoolean()) { Appearance.UseCustomFonts = !Appearance.UseCustomFonts; Profile::Set(szProfileUseCustomFonts, Appearance.UseCustomFonts); changed = true; } } } TempInfoWindowFont.reset(); TempTitleWindowFont.reset(); TempMapWindowFont.reset(); TempTitleSmallWindowFont.reset(); TempMapWindowBoldFont.reset(); TempCDIWindowFont.reset(); TempMapLabelFont.reset(); TempMapLabelImportantFont.reset(); if (changed) { Profile::Save(); MessageBoxX(_("Changes to configuration saved. Restart XCSoar to apply changes."), _T(""), MB_OK); } delete wf; }
static void OnUseCustomFontData(DataField *Sender, DataField::DataAccessKind_t Mode) { switch (Mode) { case DataField::daChange: RefreshFonts(); break; case DataField::daSpecial: return; } }
AnnunText::AnnunText( wxWindow *parent, wxWindowID id, const wxString& LegendElement, const wxString& ValueElement ) : wxWindow( parent, id, wxDefaultPosition, wxDefaultSize, wxNO_BORDER ) { m_label = _T("Label"); m_value = _T("-----"); m_plabelFont = FontMgr::Get().FindOrCreateFont( 14, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, FALSE, wxString( _T("Arial Bold") ) ); m_pvalueFont = FontMgr::Get().FindOrCreateFont( 24, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, FALSE, wxString( _T("helvetica") ), wxFONTENCODING_ISO8859_1 ); m_LegendTextElement = LegendElement; m_ValueTextElement = ValueElement; RefreshFonts(); }
void dlgConfigFontsShowModal() { wf = LoadDialog(CallBackTable, XCSoarInterface::main_window, Layout::landscape ? _T("IDR_XML_CONFIG_FONTS_L") : _T("IDR_XML_CONFIG_FONTS")); if (wf == NULL) return; ((WndButton *)wf->FindByName(_T("cmdClose")))->SetOnClickNotify(OnCloseClicked); UISettings &ui_settings = CommonInterface::SetUISettings(); LoadFormProperty(*wf, _T("prpUseCustomFonts"), ui_settings.custom_fonts); ShowFontEditButtons(ui_settings.custom_fonts); RefreshFonts(); FontRegistryChanged = false; changed = false; wf->ShowModal(); changed |= SaveFormProperty(*wf, _T("prpUseCustomFonts"), szProfileUseCustomFonts, ui_settings.custom_fonts); TempInfoWindowFont.reset(); TempTitleWindowFont.reset(); TempMapWindowFont.reset(); TempTitleSmallWindowFont.reset(); TempMapWindowBoldFont.reset(); TempCDIWindowFont.reset(); TempMapLabelFont.reset(); TempMapLabelImportantFont.reset(); if (changed) { Profile::Save(); MessageBoxX(_("Changes to configuration saved. Restart XCSoar to apply changes."), _T(""), MB_OK); } delete wf; }
static void EditFont(const TCHAR *prp_name, const TCHAR *profile_key, const LOGFONT &log_font) { // updates registry for font info and updates LogFont values #define MAX_EDITFONT_DESC_LEN 100 TCHAR FontDesc[MAX_EDITFONT_DESC_LEN]; LOGFONT custom_log_font; if (!Profile::GetFont(profile_key, &custom_log_font)) custom_log_font = log_font; GetFontDescription(FontDesc, prp_name, MAX_EDITFONT_DESC_LEN); if (dlgFontEditShowModal(FontDesc, custom_log_font, log_font)) { Profile::SetFont(profile_key, custom_log_font); FontRegistryChanged = true; RefreshFonts(); } }