diff options
-rw-r--r-- | apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp | 54 | ||||
-rw-r--r-- | apps/windoze/CBuilder5/BibleCS/optionfrm.cpp | 279 | ||||
-rw-r--r-- | apps/windoze/CBuilder5/BibleCS/optionfrm.dfm | 15 |
3 files changed, 161 insertions, 187 deletions
diff --git a/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp b/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp index 48db473..d09bac2 100644 --- a/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp +++ b/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp @@ -567,7 +567,7 @@ void TRxRichEditX::getDisplayPrefs(DISP_ATTRIBS *attribs, SWModule *module /*, c } // If we still have no name we will set it to a default value if (attribs->fontName == "") - attribs->fontName = "MS Sans Serif"; + attribs->fontName = "Times New Roman"; // If the module uses it's own font size load that else we will try the config file else we will use the default @@ -584,11 +584,16 @@ void TRxRichEditX::getDisplayPrefs(DISP_ATTRIBS *attribs, SWModule *module /*, c attribs->fontSize = 10; else attribs->fontSize = StrToInt(fontSize); - string entryColor = Form1->optionsconf->Sections["Appearance"]["CurrentVSColor"]; + string entryColor = Form1->optionsconf->Sections["Appearance"]["VSNumberColor"]; if (entryColor == "") attribs->entryKeyColor = clBlue; else attribs->entryKeyColor = StrToInt((AnsiString)entryColor.c_str()); + string currentVSColor = Form1->optionsconf->Sections["Appearance"]["CurrentVSColor"]; + if (currentVSColor == "") + attribs->currentVSColor = clBlue; + else attribs->currentVSColor = StrToInt((AnsiString)entryColor.c_str()); + string morphColor = Form1->optionsconf->Sections["Appearance"]["MorphColor"]; if (morphColor == "") attribs->morphColor = clBlue; @@ -676,6 +681,7 @@ void TRxRichEditX::buildRTFHeader() { SectionMap::iterator sit; string value; ConfigEntMap::iterator entry; + string tmpval; int CurrVSRed, CurrVSGreen, CurrVSBlue, BodyRed, BodyGreen, BodyBlue, VSNumRed, VSNumGreen, VSNumBlue, MorphRed, MorphGreen, MorphBlue, StrongsRed, StrongsGreen, StrongsBlue; @@ -706,43 +712,11 @@ void TRxRichEditX::buildRTFHeader() { sprintf(buf2, "{\\fonttbl{\\f0\\fdecor\\fprq2 Times New Roman;}{\\f1\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f7\\froman\\fcharset2\\fprq2 Symbol;}{\\f8\\froman\\fcharset2\\fprq2 Symbol;}}"); strcat(buf1, buf2); } - - if ((sit = Form1->optionsconf->Sections.find("Appearance")) != Form1->optionsconf->Sections.end()) { - ConfigEntMap §ion = (*sit).second; - - CurrVSColor = TColor((((entry = section.find("CurrentVSColor")) != section.end()) ? atoi((*entry).second.c_str()) : 16711680)); - TColorToRGB(CurrVSColor, CurrVSRed, CurrVSGreen, CurrVSBlue); - - VSNumColor = TColor((((entry = section.find("VSNumberColor")) != section.end()) ? atoi((*entry).second.c_str()) : 0)); - TColorToRGB(VSNumColor, VSNumRed, VSNumGreen, VSNumBlue); - - StrongsColor = TColor((((entry = section.find("StrongsColor")) != section.end()) ? atoi((*entry).second.c_str()) : 16711935)); - TColorToRGB(StrongsColor, StrongsRed, StrongsGreen, StrongsBlue); - - MorphColor = TColor((((entry = section.find("MorphColor")) != section.end()) ? atoi((*entry).second.c_str()) : 60534)); - TColorToRGB(MorphColor, MorphRed, MorphGreen, MorphBlue); - - if (getType() == "Text") { - BodyColor = TColor((((entry = section.find("TextFontColor")) != section.end()) ? atoi((*entry).second.c_str()) : 0)); - TColorToRGB(BodyColor, BodyRed, BodyGreen, BodyBlue); - } - else if (getType() == "Comment") { - BodyColor = TColor((((entry = section.find("CommentFontColor")) != section.end()) ? atoi((*entry).second.c_str()) : 0)); - TColorToRGB(BodyColor, BodyRed, BodyGreen, BodyBlue); - } - else if (getType()== "LD") { - BodyColor = TColor((((entry = section.find("LDFontColor")) != section.end()) ? atoi((*entry).second.c_str()) : 0)); - TColorToRGB(BodyColor, BodyRed, BodyGreen, BodyBlue); - } - else if (getType() == "Popup") { - BodyColor = TColor((((entry = section.find("PopupFontColor")) != section.end()) ? atoi((*entry).second.c_str()) : 0)); - TColorToRGB(BodyColor, BodyRed, BodyGreen, BodyBlue); - } - else { - BodyRed = 0; - BodyGreen = 0; - BodyBlue = 0; - } + TColorToRGB(dispAttribs.currentVSColor, CurrVSRed, CurrVSGreen, CurrVSBlue); + TColorToRGB(dispAttribs.entryKeyColor, VSNumRed, VSNumGreen, VSNumBlue); + TColorToRGB(dispAttribs.strongsColor, StrongsRed, StrongsGreen, StrongsBlue); + TColorToRGB(dispAttribs.morphColor, MorphRed, MorphGreen, MorphBlue); + TColorToRGB(dispAttribs.fontColor, BodyRed, BodyGreen, BodyBlue); // Color Table: // 1: Verse Number/ Verse info @@ -764,11 +738,13 @@ void TRxRichEditX::buildRTFHeader() { // 7: Verse/Body Text Color sprintf(buf2, "\\red%d\\green%d\\blue%d;}",BodyRed, BodyGreen, BodyBlue); strcat(buf1, buf2); + /* } else { sprintf(buf2, "{\\colortbl;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red255\\green0\\blue0;\\red0\\green\\blue0;\\red0\\green\\blue0;\\red0\\green\\blue0;}"); strcat(buf1, buf2); } + */ RTFHeader = buf1; } diff --git a/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp b/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp index b1ebf3a..8810f07 100644 --- a/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp +++ b/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp @@ -511,167 +511,152 @@ void __fastcall TOptionsfrm::shpMorphClrMouseDown(TObject *Sender, void TOptionsfrm::LoadDispSettings(SWConfig* config) { SectionMap::iterator sit; + string tmpval; - if ((sit = config->Sections.find("Appearance")) != config->Sections.end()) { - if ((*sit).second.find("CurrentVSColor") != (*sit).second.end()){ - shpCurrVSClr->Brush->Color = TColor(atoi((*(*sit).second.find("CurrentVSColor")).second.c_str())); - ColorDialogVS->Color = TColor(atoi((*(*sit).second.find("CurrentVSColor")).second.c_str())); - } - else { - shpCurrVSClr->Brush->Color = TColor(clBlue); - ColorDialogVS->Color = TColor(clBlue); - } - if ((*sit).second.find("AutoVSColor") != (*sit).second.end()) { - AutoVSColor->Checked = (atoi((*(*sit).second.find("AutoVSColor")).second.c_str()) == 0) ? false : true; - } - else { - AutoVSColor->Checked = true; - } + if((tmpval = config->Sections["Appearance"]["AutoVSColor"]) == "0"){ + AutoVSColor->Checked = false; + } + else { + AutoVSColor->Checked = true; + } + + if((tmpval = config->Sections["Appearance"]["CurrentVSColor"]) != ""){ + shpCurrVSClr->Brush->Color = TColor(atoi(tmpval.c_str())); + ColorDialogVS->Color = shpCurrVSClr->Brush->Color; + } + else { + shpCurrVSClr->Brush->Color = TColor(clBlue); + ColorDialogVS->Color = clBlue; + } + + if((tmpval = config->Sections["Appearance"]["StrongsColor"]) != ""){ + shpStrongClr->Brush->Color = TColor(atoi(tmpval.c_str())); + ColorDialogStrongs->Color = shpStrongClr->Brush->Color; + } + else { + shpStrongClr->Brush->Color = TColor(16711935); // Magenta + ColorDialogStrongs->Color = shpStrongClr->Brush->Color; + } - if ((*sit).second.find("StrongsColor") != (*sit).second.end()){ - shpStrongClr->Brush->Color = TColor(atoi((*(*sit).second.find("StrongsColor")).second.c_str())); - ColorDialogStrongs->Color = TColor(atoi((*(*sit).second.find("StrongsColor")).second.c_str())); - } - else{ - shpStrongClr->Brush->Color = TColor(16711935); // Magenta - ColorDialogStrongs->Color = TColor(16711935); - } + if((tmpval = config->Sections["Appearance"]["MorphColor"]) != ""){ + shpMorphClr->Brush->Color = TColor(atoi(tmpval.c_str())); + ColorDialogMorph->Color = shpMorphClr->Brush->Color; + } + else { + shpMorphClr->Brush->Color = TColor(60534); // Light Green + ColorDialogMorph->Color = shpMorphClr->Brush->Color; + } + + if((tmpval = config->Sections["Appearance"]["VSNumberColor"]) != ""){ + shpNumClr->Brush->Color = TColor(atoi(tmpval.c_str())); + ColorDialogVerseNum->Color = shpNumClr->Brush->Color; + } + else { + shpNumClr->Brush->Color = clBlue; + ColorDialogVerseNum->Color = shpNumClr->Brush->Color; + } - if ((*sit).second.find("MorphColor") != (*sit).second.end()){ - shpMorphClr->Brush->Color = TColor(atoi((*(*sit).second.find("MorphColor")).second.c_str())); - ColorDialogMorph->Color = TColor(atoi((*(*sit).second.find("MorphColor")).second.c_str())); - } - else{ - shpMorphClr->Brush->Color = TColor(60534); // Light Green - ColorDialogMorph->Color = TColor(60534); - } + if((tmpval = config->Sections["Appearance"]["FieldColor"]) != ""){ + shpFieldClr->Brush->Color = TColor(atoi(tmpval.c_str())); + ColorDialogField->Color = shpFieldClr->Brush->Color; + } + else { + shpFieldClr->Brush->Color = clAqua; + ColorDialogField->Color = shpFieldClr->Brush->Color; + } - if ((*sit).second.find("VSNumberColor") != (*sit).second.end()){ - shpNumClr->Brush->Color = TColor(atoi((*(*sit).second.find("VSNumberColor")).second.c_str())); - ColorDialogVerseNum->Color = TColor(atoi((*(*sit).second.find("VSNumberColor")).second.c_str())); - } - else{ - shpNumClr->Brush->Color = TColor(clBlue); - ColorDialogVerseNum->Color = TColor(clBlue); - } + if((tmpval = config->Sections["Appearance"]["VSNumberColor"]) != ""){ + shpCurrVSClr->Brush->Color = TColor(atoi(tmpval.c_str())); + ColorDialogVerseNum->Color = shpCurrVSClr->Brush->Color; + } + else { + shpCurrVSClr->Brush->Color = clBlue; + ColorDialogVerseNum->Color = shpCurrVSClr->Brush->Color; + } - if ((*sit).second.find("FieldColor") != (*sit).second.end()){ - shpFieldClr->Brush->Color = TColor(atoi((*(*sit).second.find("FieldColor")).second.c_str())); - ColorDialogField->Color = TColor(atoi((*(*sit).second.find("FieldColor")).second.c_str())); - } - else{ - shpFieldClr->Brush->Color = TColor(clAqua); - ColorDialogField->Color = TColor(clAqua); - } + //**** Font BackColor ****// + if((tmpval = config->Sections["Appearance"]["TextBackColor"]) != "") + FontDialogText->BackColor = TColor(atoi(tmpval.c_str())); + else FontDialogText->BackColor = clWhite; + if((tmpval = config->Sections["Appearance"]["CommentBackColor"]) != "") + FontDialogComment->BackColor = TColor(atoi(tmpval.c_str())); + else FontDialogComment->BackColor = clWhite; - if ((*sit).second.find("VSNumberColor") != (*sit).second.end()) - ColorDialogVerseNum->Color = TColor(atoi ((*(*sit).second.find("VSNumberColor")).second.c_str())); - else - ColorDialogVerseNum->Color = clBlue; + if((tmpval = config->Sections["Appearance"]["LDBackColor"]) != "") + FontDialogLD->BackColor = TColor(atoi(tmpval.c_str())); + else FontDialogLD->BackColor = clWhite; - //**** Font BackColor ****// - if ((*sit).second.find("TextBackColor") != (*sit).second.end()) - FontDialogText->BackColor = TColor(atoi((*(*sit).second.find("TextBackColor")).second.c_str())); - else - FontDialogText->BackColor = TColor(clWhite); - - if ((*sit).second.find("CommentBackColor") != (*sit).second.end()) - FontDialogComment->BackColor = TColor(atoi((*(*sit).second.find("CommentBackColor")).second.c_str())); - else - FontDialogComment->BackColor = TColor(clWhite); - - if ((*sit).second.find("LDBackColor") != (*sit).second.end()) - 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 - 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); + if((tmpval = config->Sections["Appearance"]["PopupBackColor"]) != "") + FontDialogPopup->BackColor = TColor(atoi(tmpval.c_str())); + else FontDialogPopup->BackColor = clWhite; + + if((tmpval = config->Sections["Appearance"]["SearchBackColor"]) != "") + FontDialogSearch->BackColor = TColor(atoi(tmpval.c_str())); + else FontDialogSearch->BackColor = clWhite; //**** Font Face Name ****// - if ((*sit).second.find("TextFontName") != (*sit).second.end()) - FontDialogText->Font->Name = ((*(*sit).second.find("TextFontName")).second.c_str()); - else - FontDialogText->Font->Name = "Times New Roman"; - - if ((*sit).second.find("CommentFontName") != (*sit).second.end()) - FontDialogComment->Font->Name = ((*(*sit).second.find("CommentFontName")).second.c_str()); - else - FontDialogComment->Font->Name = "Times New Roman"; - - if ((*sit).second.find("LDFontName") != (*sit).second.end()) - FontDialogLD->Font->Name = ((*(*sit).second.find("LDFontName")).second.c_str()); - else - FontDialogLD->Font->Name = "Times New Roman"; - if ((*sit).second.find("PopupFontName") != (*sit).second.end()) - 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"; + if((tmpval = config->Sections["Appearance"]["TextFontName"]) != "") + FontDialogText->Font->Name = tmpval.c_str(); + else FontDialogText->Font->Name = "Times New Roman"; + + if((tmpval = config->Sections["Appearance"]["CommentFontName"]) != "") + FontDialogComment->Font->Name = tmpval.c_str(); + else FontDialogComment->Font->Name = "Times New Roman"; + + if((tmpval = config->Sections["Appearance"]["LDFontName"]) != "") + FontDialogLD->Font->Name = tmpval.c_str(); + else FontDialogLD->Font->Name = "Times New Roman"; + + if((tmpval = config->Sections["Appearance"]["PopupFontName"]) != "") + FontDialogPopup->Font->Name = tmpval.c_str(); + else FontDialogPopup->Font->Name = "Times New Roman"; + + if((tmpval = config->Sections["Appearance"]["SearchFontName"]) != "") + FontDialogSearch->Font->Name = tmpval.c_str(); + else FontDialogSearch->Font->Name = "Times New Roman"; //**** Font Size ****// - if ((*sit).second.find("TextFontSize") != (*sit).second.end()) - FontDialogText->Font->Size = (atoi ((*(*sit).second.find("TextFontSize")).second.c_str())); - else - FontDialogText->Font->Size = 10; - if ((*sit).second.find("CommentFontSize") != (*sit).second.end()) - FontDialogComment->Font->Size = (atoi ((*(*sit).second.find("CommentFontSize")).second.c_str())); - else - FontDialogComment->Font->Size = 10; - - if ((*sit).second.find("LDFontSize") != (*sit).second.end()) - 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; + if((tmpval = config->Sections["Appearance"]["TextFontSize"]) != "") + FontDialogText->Font->Size = atoi(tmpval.c_str()); + else FontDialogText->Font->Size = 10; + + if((tmpval = config->Sections["Appearance"]["CommentFontSize"]) != "") + FontDialogComment->Font->Size = atoi(tmpval.c_str()); + else FontDialogComment->Font->Size = 10; + + if((tmpval = config->Sections["Appearance"]["LDFontSize"]) != "") + FontDialogLD->Font->Size = atoi(tmpval.c_str()); + else FontDialogLD->Font->Size = 10; + + if((tmpval = config->Sections["Appearance"]["PopupFontSize"]) != "") + FontDialogPopup->Font->Size = atoi(tmpval.c_str()); + else FontDialogPopup->Font->Size = 10; + + if((tmpval = config->Sections["Appearance"]["SearchFontSize"]) != "") + FontDialogSearch->Font->Size = atoi(tmpval.c_str()); + else FontDialogSearch->Font->Size = 10; //**** Font ForeColor ****// - if ((*sit).second.find("TextFontColor") != (*sit).second.end()) - FontDialogText->Font->Color = TColor(atoi ((*(*sit).second.find("TextFontColor")).second.c_str())); - else - FontDialogText->Font->Color = clBlack; - - if ((*sit).second.find("CommentFontColor") != (*sit).second.end()) - FontDialogComment->Font->Color = TColor(atoi ((*(*sit).second.find("CommentFontColor")).second.c_str())); - else - FontDialogComment->Font->Color = clBlack; - - if ((*sit).second.find("LDFontColor") != (*sit).second.end()) - 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; - } + if((tmpval = config->Sections["Appearance"]["TextFontColor"]) != "") + FontDialogText->Font->Color = TColor(atoi(tmpval.c_str())); + else FontDialogText->Font->Color = clBlack; + + if((tmpval = config->Sections["Appearance"]["CommentFontColor"]) != "") + FontDialogComment->Font->Color = TColor(atoi(tmpval.c_str())); + else FontDialogComment->Font->Color = clBlack; + + if((tmpval = config->Sections["Appearance"]["LDFontColor"]) != "") + FontDialogLD->Font->Color = TColor(atoi(tmpval.c_str())); + else FontDialogLD->Font->Color = clBlack; + + if((tmpval = config->Sections["Appearance"]["PopupFontColor"]) != "") + FontDialogPopup->Font->Color = TColor(atoi(tmpval.c_str())); + else FontDialogPopup->Font->Color = clBlack; + + if((tmpval = config->Sections["Appearance"]["SearchFontColor"]) != "") + FontDialogSearch->Font->Color = TColor(atoi(tmpval.c_str())); + else FontDialogSearch->Font->Color = clBlack; } diff --git a/apps/windoze/CBuilder5/BibleCS/optionfrm.dfm b/apps/windoze/CBuilder5/BibleCS/optionfrm.dfm index d10653b..4f45b33 100644 --- a/apps/windoze/CBuilder5/BibleCS/optionfrm.dfm +++ b/apps/windoze/CBuilder5/BibleCS/optionfrm.dfm @@ -51,6 +51,9 @@ object Optionsfrm: TOptionsfrm Align = alBottom
BevelOuter = bvNone
TabOrder = 0
+ DesignSize = (
+ 527
+ 41)
object OkBtn: TBitBtn
Left = 334
Top = 9
@@ -75,8 +78,9 @@ object Optionsfrm: TOptionsfrm Top = 0
Width = 527
Height = 284
- ActivePage = TabSheet1
+ ActivePage = TabSheet3
Align = alClient
+ TabIndex = 2
TabOrder = 1
object TabSheet1: TTabSheet
Caption = 'General'
@@ -96,6 +100,9 @@ object Optionsfrm: TOptionsfrm Align = alClient
Caption = 'Personalize'
TabOrder = 0
+ DesignSize = (
+ 519
+ 163)
object Label4: TLabel
Left = 7
Top = 103
@@ -285,6 +292,9 @@ object Optionsfrm: TOptionsfrm Anchors = [akLeft, akTop, akRight, akBottom]
Caption = 'Daily Devotionals'
TabOrder = 1
+ DesignSize = (
+ 277
+ 151)
object Label9: TLabel
Left = 8
Top = 24
@@ -377,6 +387,9 @@ object Optionsfrm: TOptionsfrm Align = alClient
Caption = 'Display Colors'
TabOrder = 0
+ DesignSize = (
+ 519
+ 256)
object Label2: TLabel
Left = 7
Top = 17
|