static void LoadGUI() { assert(!locked); locked = true; WndProperty* wp; wp = (WndProperty*)wf->FindByName(_T("prpFontName")); if (wp) { DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField(); if (dfe) { dfe->Set(0); unsigned i; for (i = 0; i < dfe->Count(); i++) { if (_tcsncmp(dfe->GetAsString(), NewLogFont.lfFaceName, LF_FACESIZE) == 0) break; dfe->Inc(); } if (i == dfe->Count()) dfe->Set(dfe->addEnumText(NewLogFont.lfFaceName)); } wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(_T("prpFontHeight")); if (wp) { DataFieldInteger* dfi = (DataFieldInteger*)wp->GetDataField(); if (dfi) dfi->Set(NewLogFont.lfHeight); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(_T("prpFontWeight")); if (wp) { DataFieldBoolean* dfi = (DataFieldBoolean*)wp->GetDataField(); if (dfi) dfi->Set(NewLogFont.lfWeight > 500); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(_T("prpFontItalic")); if (wp) { DataFieldBoolean* dfb = (DataFieldBoolean*)wp->GetDataField(); if (dfb) dfb->Set(NewLogFont.lfItalic); wp->RefreshDisplay(); } locked = false; RedrawSampleFont(); }
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; }
void TaskPropertiesPanel::OnFAIFinishHeightChange(DataFieldBoolean &df) { OrderedTaskBehaviour &p = ordered_task->GetOrderedTaskBehaviour(); bool newvalue = df.GetAsBoolean(); if (newvalue != p.fai_finish) { p.fai_finish = newvalue; *task_changed = true; RefreshView(); } }
static void setVariables(void) { WndProperty *wp; wp = (WndProperty*)wf->FindByName(TEXT("prpIP11")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfIP11); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpIP12")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfIP12); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpIP13")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfIP13); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpIP14")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfIP14); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpIP15")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfIP15); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpIP16")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfIP16); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpIP17")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfIP17); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpIP21")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfIP21); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpIP22")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfIP22); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpIP23")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfIP23); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpIP24")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfIP24); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpIP31")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfIP31); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpIP32")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfIP32); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpIP33")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfIP33); wp->RefreshDisplay(); } }
static void setVariables(void) { WndProperty *wp; wp = (WndProperty*)wf->FindByName(TEXT("prpConfBB0")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfBB0); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpConfBB1")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfBB1); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpConfBB2")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfBB2); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpConfBB3")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfBB3); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpConfBB4")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfBB4); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpConfBB5")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfBB5); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpConfBB6")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfBB6); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpConfBB7")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfBB7); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpConfBB8")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfBB8); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpConfBB9")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfBB9); wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpConfBB0Auto")); if (wp) { DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField(); dfb->Set(ConfBB0Auto); wp->RefreshDisplay(); } }
void LoadGUI() { #define MAX_ENUM 10 IsInitialized=false; int i=0; WndProperty* wp; wp = (WndProperty*)wf->FindByName(TEXT("prpFontName")); if (wp) { DataFieldEnum* dfe; dfe = (DataFieldEnum*)wp->GetDataField(); if (dfe) { for (i=0 ;i < MAX_ENUM ; i++) { dfe->Dec(); } // rewind bool bFound=false; for (i=0 ;i < MAX_ENUM ; i++ ) { if (_tcsncmp(dfe->GetAsString(), NewLogFont.lfFaceName, LF_FACESIZE) == 0) { bFound=true; break; } dfe->Inc(); } if (!bFound) { dfe->addEnumText(NewLogFont.lfFaceName); for (i=0 ;i < MAX_ENUM ; i++) { dfe->Dec(); } // rewind for (i=0 ;i < MAX_ENUM ; i++ ) { if (_tcsncmp(dfe->GetAsString(), NewLogFont.lfFaceName,LF_FACESIZE) == 0) { break; } dfe->Inc(); } } } wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpFontHeight")); if (wp) { DataFieldInteger * dfi; dfi = (DataFieldInteger*)wp->GetDataField(); if (dfi) { dfi->Set(NewLogFont.lfHeight); } wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpFontWeight")); if (wp) { DataFieldInteger* dfi; dfi = (DataFieldInteger*)wp->GetDataField(); if (dfi) { dfi->Set(NewLogFont.lfWeight); } wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpFontItalic")); if (wp) { DataFieldBoolean* dfb; dfb = (DataFieldBoolean*)wp->GetDataField(); if (dfb) { dfb->Set(NewLogFont.lfItalic); } wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpFontPitchAndFamily")); if (wp) { DataFieldEnum * dfe; dfe = (DataFieldEnum*)wp->GetDataField(); if (dfe) { dfe->SetAsInteger(NewLogFont.lfPitchAndFamily); } wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpFontTrueType")); if (wp) { DataFieldBoolean* dfb; dfb = (DataFieldBoolean*)wp->GetDataField(); if (dfb) { dfb->Set(NewLogFont.lfQuality != NONANTIALIASED_QUALITY); //was dfb->Set(NewLogFont.lfQuality == LKFONT_QUALITY); dont know why } wp->RefreshDisplay(); } IsInitialized=true; RedrawSampleFont(); }
void LoadGUI() { #define MAX_ENUM 10 IsInitialized=false; int i=0; WndProperty* wp; wp = (WndProperty*)wf->FindByName(TEXT("prpFontName")); if (wp) { DataFieldEnum* dfe; dfe = (DataFieldEnum*)wp->GetDataField(); if (dfe) { for (i=0 ;i < MAX_ENUM ; i++) { dfe->Dec(); } // rewind bool bFound=false; for (i=0 ;i < MAX_ENUM ; i++ ) { if (_tcsncmp(dfe->GetAsString(), NewLogFont.lfFaceName, LF_FACESIZE) == 0) { bFound=true; break; } dfe->Inc(); } if (!bFound) { dfe->addEnumText(NewLogFont.lfFaceName); for (i=0 ;i < MAX_ENUM ; i++) { dfe->Dec(); } // rewind for (i=0 ;i < MAX_ENUM ; i++ ) { if (_tcsncmp(dfe->GetAsString(), NewLogFont.lfFaceName,LF_FACESIZE) == 0) { break; } dfe->Inc(); } } } wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpFontHeight")); if (wp) { DataFieldInteger * dfi; dfi = (DataFieldInteger*)wp->GetDataField(); if (dfi) { dfi->Set(NewLogFont.lfHeight); } wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpFontWeight")); if (wp) { DataFieldInteger* dfi; dfi = (DataFieldInteger*)wp->GetDataField(); if (dfi) { dfi->Set(NewLogFont.lfWeight); } wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpFontItalic")); if (wp) { DataFieldBoolean* dfb; dfb = (DataFieldBoolean*)wp->GetDataField(); if (dfb) { dfb->Set(NewLogFont.lfItalic); } wp->RefreshDisplay(); } wp = (WndProperty*)wf->FindByName(TEXT("prpFontPitchAndFamily")); if (wp) { DataFieldEnum * dfe; dfe = (DataFieldEnum*)wp->GetDataField(); if (dfe) { dfe->SetAsInteger(NewLogFont.lfPitchAndFamily); } wp->RefreshDisplay(); } // This is useless, because we ApplyClearType later on. We always use a general common quality. ApplyClearType(&NewLogFont); IsInitialized=true; RedrawSampleFont(); }