summaryrefslogtreecommitdiff
path: root/apps/windoze/CBuilder5/prototype/vrslstfrm.cpp
blob: f20e6a8f7a34dfe5d259076ac34f3a32b57a702a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "vrslstfrm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TVerseListFrm *VerseListFrm;
//---------------------------------------------------------------------------
__fastcall TVerseListFrm::TVerseListFrm(TComponent* Owner, ListKey &iVerseList)
	: TForm(Owner), verseList(iVerseList)
{
	pvrtf = new SWDispRTF(this);

	pvrtf->Parent = plPreview;
	pvrtf->Align = alClient;
	pvrtf->ScrollBars = ssVertical;
	pvrtf->ReadOnly = true;
}
//---------------------------------------------------------------------------

void __fastcall TVerseListFrm::ListBox1Click(TObject *Sender)
{
	ModMap::iterator target;
	target = Form1->mainmgr->Modules.find(Form1->textTabs->pageControl->ActivePage->Caption.c_str());
	if (target != Form1->mainmgr->Modules.end()) {
		SWKey *savekey = *(*target).second;
		(*target).second->SetKey(ListBox1->Items->Strings[ListBox1->ItemIndex].c_str());
		pvrtf->Display(*(*target).second);
		(*target).second->SetKey(*savekey);
	}
}
//---------------------------------------------------------------------------

void __fastcall TVerseListFrm::ListBox1DblClick(TObject *Sender)
{
	Form1->DefaultVSKey = ListBox1->Items->Strings[ListBox1->ItemIndex].c_str();
	Form1->TextKeyChanged();
}
//---------------------------------------------------------------------------
void __fastcall TVerseListFrm::FormShow(TObject *Sender)
{
		for (verseList = TOP; (!verseList.Error()); verseList++)
			ListBox1->Items->Add((const char *)verseList);
}
//---------------------------------------------------------------------------