diff options
Diffstat (limited to 'apps/windoze/CBuilder5/BibleCS/optionfrm.cpp')
-rw-r--r-- | apps/windoze/CBuilder5/BibleCS/optionfrm.cpp | 97 |
1 files changed, 48 insertions, 49 deletions
diff --git a/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp b/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp index 84b9763..2aeec2e 100644 --- a/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp +++ b/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp @@ -37,6 +37,9 @@ void __fastcall TOptionsfrm::btnCurrVerseClick(TObject *Sender) } //--------------------------------------------------------------------------- +//TODO 1 -cOptions: add per module font size selection +//TODO 1 -cOptions: add 'general' dictionary besides strongs for lookups of words +//TODO 1 -cOptions: add per module 'general' dictionary void __fastcall TOptionsfrm::FormCreate(TObject *Sender) { @@ -153,7 +156,7 @@ void __fastcall TOptionsfrm::cmbSchemeSelectChange(TObject *Sender) } //--------------------------------------------------------------------------- -// TODO 1 -cOptions: Change to use RxRichEditX somehow, so we're consistent with look and feel of real control +// TODO 1 -cOptions: Change preview to use RxRichEditX, so we're consistent with look and feel of real control void TOptionsfrm::UpdatePreview() { char buffTemp[512], buffFinal[512], font[64]; @@ -720,80 +723,76 @@ void TOptionsfrm::extractSettings(SWConfig* config) { string tmpval; emap = config->Sections["Appearance"]; - emap.erase("AutoVSColor"); emap.insert(ConfigEntMap::value_type("AutoVSColor", IntToStr((Optionsfrm->AutoVSColor->Checked)?1:0).c_str())); - emap.erase("CurrentVSColor"); emap.insert(ConfigEntMap::value_type("CurrentVSColor", IntToStr(Optionsfrm->ColorDialogVS->Color).c_str())); - emap.erase("StrongsColor"); emap.insert(ConfigEntMap::value_type("StrongsColor", IntToStr(Optionsfrm->ColorDialogStrongs->Color).c_str())); - emap.erase("MorphColor"); emap.insert(ConfigEntMap::value_type("MorphColor", IntToStr(Optionsfrm->ColorDialogMorph->Color).c_str())); - emap.erase("VSNumberColor"); emap.insert(ConfigEntMap::value_type("VSNumberColor", IntToStr(Optionsfrm->ColorDialogVerseNum->Color).c_str())); - emap.erase("FieldColor"); emap.insert(ConfigEntMap::value_type("FieldColor", IntToStr(Optionsfrm->ColorDialogField->Color).c_str())); - - emap.erase("TextBackColor"); emap.insert(ConfigEntMap::value_type("TextBackColor", IntToStr(Optionsfrm->FontDialogText->BackColor).c_str())); - emap.erase("CommentBackColor"); emap.insert(ConfigEntMap::value_type("CommentBackColor", IntToStr(Optionsfrm->FontDialogComment->BackColor).c_str())); - emap.erase("LDBackColor"); emap.insert(ConfigEntMap::value_type("LDBackColor", IntToStr(Optionsfrm->FontDialogLD->BackColor).c_str())); - emap.erase("PopupBackColor"); emap.insert(ConfigEntMap::value_type("PopupBackColor", IntToStr(Optionsfrm->FontDialogPopup->BackColor).c_str())); - - emap.erase("TextFontName"); emap.insert(ConfigEntMap::value_type("TextFontName", (Optionsfrm->FontDialogText->Font->Name).c_str())); - emap.erase("CommentFontName"); emap.insert(ConfigEntMap::value_type("CommentFontName", (Optionsfrm->FontDialogComment->Font->Name).c_str())); - emap.erase("LDFontName"); emap.insert(ConfigEntMap::value_type("LDFontName", (Optionsfrm->FontDialogLD->Font->Name).c_str())); - emap.erase("PopupFontName"); emap.insert(ConfigEntMap::value_type("PopupFontName", (Optionsfrm->FontDialogPopup->Font->Name).c_str())); - - emap.erase("TextFontSize"); emap.insert(ConfigEntMap::value_type("TextFontSize", IntToStr(Optionsfrm->FontDialogText->Font->Size).c_str())); - emap.erase("CommentFontSize"); emap.insert(ConfigEntMap::value_type("CommentFontSize", IntToStr(Optionsfrm->FontDialogComment->Font->Size).c_str())); - emap.erase("LDFontSize"); emap.insert(ConfigEntMap::value_type("LDFontSize", IntToStr(Optionsfrm->FontDialogLD->Font->Size).c_str())); - emap.erase("PopupFontSize"); emap.insert(ConfigEntMap::value_type("PopupFontSize", IntToStr(Optionsfrm->FontDialogPopup->Font->Size).c_str())); - - emap.erase("TextFontColor"); emap.insert(ConfigEntMap::value_type("TextFontColor", IntToStr(Optionsfrm->FontDialogText->Font->Color).c_str())); - emap.erase("CommentFontColor"); emap.insert(ConfigEntMap::value_type("CommentFontColor", IntToStr(Optionsfrm->FontDialogComment->Font->Color).c_str())); - emap.erase("LDFontColor"); emap.insert(ConfigEntMap::value_type("LDFontColor", IntToStr(Optionsfrm->FontDialogLD->Font->Color).c_str())); - emap.erase("PopupFontColor"); emap.insert(ConfigEntMap::value_type("PopupFontColor", IntToStr(Optionsfrm->FontDialogPopup->Font->Color).c_str())); - - emap.erase("locale"); emap.insert(ConfigEntMap::value_type("locale", (const char *)Optionsfrm->localeCB->Items->Objects[Optionsfrm->localeCB->ItemIndex])); + emap["AutoVSColor"] = IntToStr((Optionsfrm->AutoVSColor->Checked)?1:0).c_str(); + emap["CurrentVSColor"] = IntToStr(Optionsfrm->ColorDialogVS->Color).c_str(); + emap["StrongsColor"] = IntToStr(Optionsfrm->ColorDialogStrongs->Color).c_str(); + emap["MorphColor"] = IntToStr(Optionsfrm->ColorDialogMorph->Color).c_str(); + emap["VSNumberColor"] = IntToStr(Optionsfrm->ColorDialogVerseNum->Color).c_str(); + emap["FieldColor"] = IntToStr(Optionsfrm->ColorDialogField->Color).c_str(); + + emap["TextBackColor"] = IntToStr(Optionsfrm->FontDialogText->BackColor).c_str(); + emap["CommentBackColor"] = IntToStr(Optionsfrm->FontDialogComment->BackColor).c_str(); + emap["LDBackColor"] = IntToStr(Optionsfrm->FontDialogLD->BackColor).c_str(); + emap["PopupBackColor"] = IntToStr(Optionsfrm->FontDialogPopup->BackColor).c_str(); + + emap["TextFontName"] = (Optionsfrm->FontDialogText->Font->Name).c_str(); + emap["CommentFontName"] = (Optionsfrm->FontDialogComment->Font->Name).c_str(); + emap["LDFontName"] = (Optionsfrm->FontDialogLD->Font->Name).c_str(); + emap["PopupFontName"] = (Optionsfrm->FontDialogPopup->Font->Name).c_str(); + + emap["TextFontSize"] = IntToStr(Optionsfrm->FontDialogText->Font->Size).c_str(); + emap["CommentFontSize"] = IntToStr(Optionsfrm->FontDialogComment->Font->Size).c_str(); + emap["LDFontSize"] = IntToStr(Optionsfrm->FontDialogLD->Font->Size).c_str(); + emap["PopupFontSize"] = IntToStr(Optionsfrm->FontDialogPopup->Font->Size).c_str(); + + emap["TextFontColor"] = IntToStr(Optionsfrm->FontDialogText->Font->Color).c_str(); + emap["CommentFontColor"] = IntToStr(Optionsfrm->FontDialogComment->Font->Color).c_str(); + emap["LDFontColor"] = IntToStr(Optionsfrm->FontDialogLD->Font->Color).c_str(); + emap["PopupFontColor"] = IntToStr(Optionsfrm->FontDialogPopup->Font->Color).c_str(); + + emap["locale"] = (const char *)Optionsfrm->localeCB->Items->Objects[Optionsfrm->localeCB->ItemIndex]; + config->Sections["Appearance"] = emap; emap = config->Sections["ModDefaults"]; if (Optionsfrm->greekDefCB->ItemIndex > -1) { - emap.erase("GreekDef"); emap.insert(ConfigEntMap::value_type("GreekDef", (const char *)Optionsfrm->greekDefCB->Items->Objects[Optionsfrm->greekDefCB->ItemIndex])); + emap["GreekDef"] = (const char *)Optionsfrm->greekDefCB->Items->Objects[Optionsfrm->greekDefCB->ItemIndex]; } if (Optionsfrm->greekParseCB->ItemIndex > -1) { - emap.erase("GreekParse"); emap.insert(ConfigEntMap::value_type("GreekParse", (const char *)Optionsfrm->greekParseCB->Items->Objects[Optionsfrm->greekParseCB->ItemIndex])); + emap["GreekParse"] = (const char *)Optionsfrm->greekParseCB->Items->Objects[Optionsfrm->greekParseCB->ItemIndex]; } if (Optionsfrm->hebrewDefCB->ItemIndex > -1) { - emap.erase("HebrewDef"); emap.insert(ConfigEntMap::value_type("HebrewDef", (const char *)Optionsfrm->hebrewDefCB->Items->Objects[Optionsfrm->hebrewDefCB->ItemIndex])); + emap["HebrewDef"] = (const char *)Optionsfrm->hebrewDefCB->Items->Objects[Optionsfrm->hebrewDefCB->ItemIndex]; } if (Optionsfrm->hebrewParseCB->ItemIndex > -1) { - emap.erase("HebrewParse"); emap.insert(ConfigEntMap::value_type("HebrewParse", (const char *)Optionsfrm->hebrewParseCB->Items->Objects[Optionsfrm->hebrewParseCB->ItemIndex])); + emap["HebrewParse"] = (const char *)Optionsfrm->hebrewParseCB->Items->Objects[Optionsfrm->hebrewParseCB->ItemIndex]; } if (Optionsfrm->dailyDefaultCB->ItemIndex > -1) { - emap.erase("DailyDevotion"); emap.insert(ConfigEntMap::value_type("DailyDevotion", (const char *)Optionsfrm->dailyDefaultCB->Items->Objects[Optionsfrm->dailyDefaultCB->ItemIndex])); + emap["DailyDevotion"] = (const char *)Optionsfrm->dailyDefaultCB->Items->Objects[Optionsfrm->dailyDefaultCB->ItemIndex]; } if (Optionsfrm->strongsNumsCB->ItemIndex > -1) { - emap.erase("StrongsNumbers"); emap.insert(ConfigEntMap::value_type("StrongsNumbers", (const char *)Optionsfrm->strongsNumsCB->Items->Objects[Optionsfrm->strongsNumsCB->ItemIndex])); + emap["StrongsNumbers"] = (const char *)Optionsfrm->strongsNumsCB->Items->Objects[Optionsfrm->strongsNumsCB->ItemIndex]; } config->Sections["ModDefaults"] = emap; emap = config->Sections["Bookmarks"]; - emap.erase("AutoSavePersonal"); emap.insert(ConfigEntMap::value_type("AutoSavePersonal", IntToStr((Optionsfrm->AutoBMPersonal->Checked)?1:0).c_str())); - emap.erase("AutoSaveOther"); emap.insert(ConfigEntMap::value_type("AutoSaveOther", IntToStr((Optionsfrm->AutoBMOther->Checked)?1:0).c_str())); + emap["AutoSavePersonal"] = IntToStr((Optionsfrm->AutoBMPersonal->Checked)?1:0).c_str(); + emap["AutoSaveOther"] = IntToStr((Optionsfrm->AutoBMOther->Checked)?1:0).c_str(); config->Sections["Bookmarks"] = emap; - emap = config->Sections["Layout"]; - emap.erase("AutoSaveLayout"); emap.insert(ConfigEntMap::value_type("AutoSaveLayout", IntToStr((Optionsfrm->AutoLayout->Checked)?1:0).c_str())); - config->Sections["Layout"] = emap; + config->Sections["Layout"]["AutoSaveLayout"] = IntToStr((Optionsfrm->AutoLayout->Checked)?1:0).c_str(); - emap = config->Sections["Hints"]; - emap.erase("On"); emap.insert(ConfigEntMap::value_type("On", IntToStr((Optionsfrm->HintPopups->Checked)?1:0).c_str())); - config->Sections["Hints"] = emap; + config->Sections["Hints"]["On"] = IntToStr((Optionsfrm->HintPopups->Checked)?1:0).c_str(); - emap = config->Sections["HintStrongs"]; - emap.erase("On"); emap.insert(ConfigEntMap::value_type("On", IntToStr((Optionsfrm->HintStrongs->Checked)?1:0).c_str())); - config->Sections["HintStrongs"] = emap; + config->Sections["HintStrongs"]["On"] = IntToStr((Optionsfrm->HintStrongs->Checked)?1:0).c_str(); emap = config->Sections["General"]; - emap.erase("TipOfTheDay"); emap.insert(ConfigEntMap::value_type("TipOfTheDay", (Optionsfrm->devSplashCB->Checked)?"Devotional":"")); - emap.erase("DevsAsDicts"); emap.insert(ConfigEntMap::value_type("DevsAsDicts", (Optionsfrm->devsAsDictsCB->Checked)?"true":"false")); - emap.erase("GlosAsDicts"); emap.insert(ConfigEntMap::value_type("GlosAsDicts", (Optionsfrm->glosAsDictsCB->Checked)?"true":"false")); + emap["TipOfTheDay"] = (Optionsfrm->devSplashCB->Checked)?"Devotional":""; + emap["DevsAsDicts"] = (Optionsfrm->devsAsDictsCB->Checked)?"true":"false"; + emap["GlosAsDicts"] = (Optionsfrm->glosAsDictsCB->Checked)?"true":"false"; + config->Sections["General"] = emap; } |