diff options
Diffstat (limited to 'apps/windoze/CBuilder5/BibleCS/optionfrm.cpp')
-rw-r--r-- | apps/windoze/CBuilder5/BibleCS/optionfrm.cpp | 73 |
1 files changed, 62 insertions, 11 deletions
diff --git a/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp b/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp index 2aeec2e..ac5c69d 100644 --- a/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp +++ b/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp @@ -27,7 +27,8 @@ __fastcall TOptionsfrm::TOptionsfrm(TComponent* Owner) FontDialogComment = new TFontSelFrm(this); FontDialogLD = new TFontSelFrm(this); FontDialogPopup = new TFontSelFrm(this); -} + FontDialogSearch = new TFontSelFrm(this); + } //--------------------------------------------------------------------------- void __fastcall TOptionsfrm::btnCurrVerseClick(TObject *Sender) { @@ -37,7 +38,7 @@ void __fastcall TOptionsfrm::btnCurrVerseClick(TObject *Sender) } //--------------------------------------------------------------------------- -//TODO 1 -cOptions: add per module font size selection +//DONE -oDavid 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 @@ -109,6 +110,12 @@ void __fastcall TOptionsfrm::btnFontClick(TObject *Sender) UpdatePreview(); else CopyFontDlg(FontDialogPopup, tempFrm); break; + case 5: + CopyFontDlg(tempFrm, FontDialogSearch); + if(FontDialogSearch->ShowModal() == mrOk) + UpdatePreview(); + else CopyFontDlg(FontDialogSearch, tempFrm); + break; } delete tempFrm; } @@ -139,7 +146,7 @@ void __fastcall TOptionsfrm::btnFieldClrClick(TObject *Sender) } //--------------------------------------------------------------------------- -// TODO 2 -cOptions: add new category, Search Results +// DONE 1 -oDavid -cOptions: add new category, Search Results void __fastcall TOptionsfrm::cmbTextSelectChange(TObject *Sender) { UpdatePreview(); @@ -169,21 +176,35 @@ void TOptionsfrm::UpdatePreview() switch (cmbTextSelect->ItemIndex) { - case 2: + case 2: // Commentary Windows TRxRichEditX::TColorToRGB(FontDialogComment->Font->Color, vsColorRed, vsColorGreen, vsColorBlue); TRxRichEditX::TColorToRGB(ColorDialogVerseNum->Color, numColorRed, numColorGreen, numColorBlue); strcpy(font, FontDialogComment->Font->Name.c_str()); fontSize = FontDialogComment->Font->Size; RTFPreview->Color = FontDialogComment->BackColor; break; - case 3: + case 3: // Lexicon/Dictionary Windows TRxRichEditX::TColorToRGB(FontDialogLD->Font->Color, vsColorRed, vsColorGreen, vsColorBlue); TRxRichEditX::TColorToRGB(ColorDialogVerseNum->Color, numColorRed, numColorGreen, numColorBlue); strcpy(font, FontDialogLD->Font->Name.c_str()); fontSize = FontDialogLD->Font->Size; RTFPreview->Color = FontDialogLD->BackColor; break; - default: + case 4: // Popup Windows + TRxRichEditX::TColorToRGB(FontDialogPopup->Font->Color, vsColorRed, vsColorGreen, vsColorBlue); + TRxRichEditX::TColorToRGB(ColorDialogVerseNum->Color, numColorRed, numColorGreen, numColorBlue); + strcpy(font, FontDialogPopup->Font->Name.c_str()); + fontSize = FontDialogPopup->Font->Size; + RTFPreview->Color = FontDialogPopup->BackColor; + break; + case 5: // Search Result Windows + TRxRichEditX::TColorToRGB(FontDialogSearch->Font->Color, vsColorRed, vsColorGreen, vsColorBlue); + TRxRichEditX::TColorToRGB(ColorDialogVerseNum->Color, numColorRed, numColorGreen, numColorBlue); + strcpy(font, FontDialogSearch->Font->Name.c_str()); + fontSize = FontDialogSearch->Font->Size; + RTFPreview->Color = FontDialogSearch->BackColor; + break; + default: // Bible Windows TRxRichEditX::TColorToRGB(FontDialogText->Font->Color, vsColorRed, vsColorGreen, vsColorBlue); TRxRichEditX::TColorToRGB(ColorDialogVerseNum->Color, numColorRed, numColorGreen, numColorBlue); strcpy(font, FontDialogText->Font->Name.c_str()); @@ -263,22 +284,26 @@ void __fastcall TOptionsfrm::SaveSchemeClick(TObject *Sender) emap.erase("CommentBackColor"); emap.insert(ConfigEntMap::value_type("CommentBackColor", IntToStr(FontDialogComment->BackColor).c_str())); emap.erase("LDBackColor"); emap.insert(ConfigEntMap::value_type("LDBackColor", IntToStr(FontDialogLD->BackColor).c_str())); emap.erase("PopupBackColor"); emap.insert(ConfigEntMap::value_type("PopupBackColor", IntToStr(FontDialogPopup->BackColor).c_str())); + emap.erase("SearchBackColor"); emap.insert(ConfigEntMap::value_type("SearchBackColor", IntToStr(FontDialogSearch->BackColor).c_str())); emap.erase("TextFontName"); emap.insert(ConfigEntMap::value_type("TextFontName", (FontDialogText->Font->Name).c_str())); emap.erase("CommentFontName"); emap.insert(ConfigEntMap::value_type("CommentFontName", (FontDialogComment->Font->Name).c_str())); emap.erase("LDFontName"); emap.insert(ConfigEntMap::value_type("LDFontName", (FontDialogLD->Font->Name).c_str())); emap.erase("PopupFontName"); emap.insert(ConfigEntMap::value_type("PopupFontName", (FontDialogPopup->Font->Name).c_str())); + emap.erase("SearchFontName"); emap.insert(ConfigEntMap::value_type("SearchFontName", (FontDialogSearch->Font->Name).c_str())); emap.erase("TextFontSize"); emap.insert(ConfigEntMap::value_type("TextFontSize", IntToStr(FontDialogText->Font->Size).c_str())); emap.erase("CommentFontSize"); emap.insert(ConfigEntMap::value_type("CommentFontSize", IntToStr(FontDialogComment->Font->Size).c_str())); emap.erase("LDFontSize"); emap.insert(ConfigEntMap::value_type("LDFontSize", IntToStr(FontDialogLD->Font->Size).c_str())); emap.erase("PopupFontSize"); emap.insert(ConfigEntMap::value_type("PopupFontSize", IntToStr(FontDialogPopup->Font->Size).c_str())); + emap.erase("SearchFontSize"); emap.insert(ConfigEntMap::value_type("SearchFontSize", IntToStr(FontDialogSearch->Font->Size).c_str())); emap.erase("TextFontColor"); emap.insert(ConfigEntMap::value_type("TextFontColor", IntToStr(FontDialogText->Font->Color).c_str())); emap.erase("CommentFontColor"); emap.insert(ConfigEntMap::value_type("CommentFontColor", IntToStr(FontDialogComment->Font->Color).c_str())); emap.erase("LDFontColor"); emap.insert(ConfigEntMap::value_type("LDFontColor", IntToStr(FontDialogLD->Font->Color).c_str())); emap.erase("PopupFontColor"); emap.insert(ConfigEntMap::value_type("PopupFontColor", IntToStr(FontDialogPopup->Font->Color).c_str())); - + emap.erase("SearchFontColor"); emap.insert(ConfigEntMap::value_type("SearchFontColor", IntToStr(FontDialogSearch->Font->Color).c_str())); + schemeconf.Sections["Appearance"] = emap; schemeconf.Save(); }else{ @@ -420,9 +445,8 @@ void TOptionsfrm::GetCurrentScheme() void __fastcall TOptionsfrm::btnModFontsClick(TObject *Sender) { TModuleFonts *pDlg = new TModuleFonts(this); - pDlg->ShowModal(); - - delete pDlg; + pDlg->ShowModal(); + delete pDlg; } //--------------------------------------------------------------------------- @@ -569,10 +593,16 @@ void TOptionsfrm::LoadDispSettings(SWConfig* config) { FontDialogLD->BackColor = TColor(atoi((*(*sit).second.find("LDBackColor")).second.c_str())); else FontDialogLD->BackColor = TColor(clWhite); + if ((*sit).second.find("PopupBackColor") != (*sit).second.end()) FontDialogPopup->BackColor = TColor(atoi((*(*sit).second.find("PopupBackColor")).second.c_str())); else - FontDialogPopup->BackColor = TColor(14680063); // 13434879 == cream color + FontDialogSearch->BackColor = TColor(14680063); // 13434879 == cream color + + if ((*sit).second.find("SearchBackColor") != (*sit).second.end()) + FontDialogSearch->BackColor = TColor(atoi((*(*sit).second.find("SearchBackColor")).second.c_str())); + else + FontDialogSearch->BackColor = TColor(clWhite); //**** Font Face Name ****// if ((*sit).second.find("TextFontName") != (*sit).second.end()) @@ -593,6 +623,11 @@ void TOptionsfrm::LoadDispSettings(SWConfig* config) { FontDialogPopup->Font->Name = ((*(*sit).second.find("PopupFontName")).second.c_str()); else FontDialogPopup->Font->Name = "Times New Roman"; + + if ((*sit).second.find("SearchFontName") != (*sit).second.end()) + FontDialogSearch->Font->Name = ((*(*sit).second.find("SearchFontName")).second.c_str()); + else + FontDialogSearch->Font->Name = "Times New Roman"; //**** Font Size ****// if ((*sit).second.find("TextFontSize") != (*sit).second.end()) @@ -608,10 +643,16 @@ void TOptionsfrm::LoadDispSettings(SWConfig* config) { FontDialogLD->Font->Size = (atoi ((*(*sit).second.find("LDFontSize")).second.c_str())); else FontDialogLD->Font->Size = 10; + if ((*sit).second.find("PopupFontSize") != (*sit).second.end()) FontDialogPopup->Font->Size = (atoi ((*(*sit).second.find("PopupFontSize")).second.c_str())); else FontDialogPopup->Font->Size = 10; + + if ((*sit).second.find("SearchFontSize") != (*sit).second.end()) + FontDialogSearch->Font->Size = (atoi ((*(*sit).second.find("SearchFontSize")).second.c_str())); + else + FontDialogSearch->Font->Size = 10; //**** Font ForeColor ****// if ((*sit).second.find("TextFontColor") != (*sit).second.end()) @@ -628,10 +669,16 @@ void TOptionsfrm::LoadDispSettings(SWConfig* config) { FontDialogLD->Font->Color = TColor(atoi ((*(*sit).second.find("LDFontColor")).second.c_str())); else FontDialogLD->Font->Color = clBlack; + if ((*sit).second.find("PopupFontColor") != (*sit).second.end()) FontDialogPopup->Font->Color = TColor(atoi ((*(*sit).second.find("PopupFontColor")).second.c_str())); else FontDialogPopup->Font->Color = clBlack; + + if ((*sit).second.find("SearchFontColor") != (*sit).second.end()) + FontDialogSearch->Font->Color = TColor(atoi ((*(*sit).second.find("SearchFontColor")).second.c_str())); + else + FontDialogSearch->Font->Color = clBlack; } } @@ -734,21 +781,25 @@ void TOptionsfrm::extractSettings(SWConfig* config) { 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["SearchBackColor"] = IntToStr(Optionsfrm->FontDialogSearch->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["SearchFontName"] = (Optionsfrm->FontDialogSearch->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["SearchFontSize"] = IntToStr(Optionsfrm->FontDialogSearch->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["SearchFontColor"] = IntToStr(Optionsfrm->FontDialogSearch->Font->Color).c_str(); emap["locale"] = (const char *)Optionsfrm->localeCB->Items->Objects[Optionsfrm->localeCB->ItemIndex]; |