aboutsummaryrefslogtreecommitdiffstats
path: root/apps/windoze/CBuilder5/BibleCS/searchfrm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'apps/windoze/CBuilder5/BibleCS/searchfrm.cpp')
-rw-r--r--apps/windoze/CBuilder5/BibleCS/searchfrm.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/apps/windoze/CBuilder5/BibleCS/searchfrm.cpp b/apps/windoze/CBuilder5/BibleCS/searchfrm.cpp
index c9f70a2..43c0694 100644
--- a/apps/windoze/CBuilder5/BibleCS/searchfrm.cpp
+++ b/apps/windoze/CBuilder5/BibleCS/searchfrm.cpp
@@ -19,8 +19,8 @@ TsearchForm *searchForm;
//---------------------------------------------------------------------------
__fastcall TsearchForm::TsearchForm(TComponent* Owner)
: TForm(Owner) {
+ initializing = true;
pvrtf = new TRxRichEditX(this);
-
pvrtf->Parent = plPreview;
pvrtf->Align = alClient;
pvrtf->ScrollBars = ssVertical;
@@ -114,11 +114,12 @@ void __fastcall TsearchForm::ListBox1DblClick(TObject *Sender)
TListItem *focused = resultsLV->ItemFocused;
if (focused) {
int row = focused->Index;
+ SWKey *key = (SWKey *)*target;
+ (*key) = resultsLV->Items->Item[row]->Caption.c_str();
if (targetpc == Form1->LexDictPageControl) {
Form1->DictKeyEdit->Text = resultsLV->Items->Item[row]->Caption.c_str();
}
else {
- *(Form1->DefaultVSKey) = resultsLV->Items->Item[row]->Caption.c_str();
Form1->TextKeyChanged();
}
}
@@ -180,8 +181,11 @@ void __fastcall TsearchForm::TSearchThread::FillListBox(void)
TListItem *pItem;
SWKey *savekey = (SWKey *)*(parent->target);
- if (!savekey->Persist())
+ SWKey origKeyVal = *savekey;
+ if (!savekey->Persist()) {
savekey = 0;
+ }
+
for (results = TOP; !results.Error(); results++) {
parent->target->setKey(results);
pItem = parent->resultsLV->Items->Add();
@@ -192,6 +196,8 @@ void __fastcall TsearchForm::TSearchThread::FillListBox(void)
}
if (savekey)
parent->target->setKey(*savekey);
+ else parent->target->setKey(origKeyVal); //remove our persist key
+
// ListBox1->Items->Pack(); // so Count is set correctly (per helpfile)
parent->Caption = ((AnsiString)parent->resultsLV->Items->Count + (AnsiString)" " + (AnsiString)((parent->resultsLV->Items->Count == 1) ? _tr("match") : _tr("matches"))) + (AnsiString)" from [ " + (AnsiString)parent->target->Description() + (AnsiString)" (" + (AnsiString)parent->target->Name() + (AnsiString)") ]";
parent->searchBtn->Caption = _tr("Search");
@@ -242,8 +248,7 @@ void __fastcall TsearchForm::FormShow(TObject *Sender)
{
populateRanges();
fillList();
- Button1Click(0);
- Button1Click(0);
+ Button1Click(0); //initially hide the modSelect sidebar
}
//---------------------------------------------------------------------------
@@ -337,6 +342,7 @@ void __fastcall TsearchForm::FormActivate(TObject *Sender)
SearchText->SetFocus();
}
}
+ initializing = false;
}
void TsearchForm::setTarget(SWModule *itarget) {