-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dictionary.cpp
74 lines (71 loc) · 1.94 KB
/
Dictionary.cpp
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//---------------------------------------------------------------------------
//#include <vcl.h>
#include <stddef.h>
#include "Dictionary.h"
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma hdrstop
#pragma package(smart_init)
Dictionary::Dictionary(Words *Word)
{
WordS=Word;
Link=NULL;
}
Dictionary::Dictionary(AnsiString Name,int exec)
{
Words *a=new Words(Name,exec);
WordS=a;
Link=NULL;
}
Dictionary::Dictionary(char *Name,int exec)
{
Words *a=new Words(AnsiString(Name),exec);
WordS=a;
Link=NULL;
}
Dictionary::~Dictionary()
{
delete Link;
delete WordS;
}
Dictionary * Dictionary::Add(Dictionary *Dict)
{
Link=Dict;
return Link;
}
Words * Dictionary::Find(AnsiString Wrd)
{
if (WordS->Name==Wrd) return WordS; else
{ if (Link!=NULL) return Link->Find(Wrd);
else return NULL;
} ;
}
static int ExecuteFile(const AnsiString FileName,
const AnsiString Params,
const AnsiString DefaultDir,
int ShowCmd)
{
char zFileName[255], zParams[255], zDir[255];
return (int) ShellExecute(Application->MainForm->Handle,
NULL,
strcpy(zFileName,
FileName.c_str()),
strcpy(zParams,
Params.c_str()),
strcpy(zDir,
DefaultDir.c_str()),
ShowCmd);
}
void Dictionary::ShowHelp()
{
if (HelpFile!="") {
AnsiString a=GetCurrentDir()+"\\Help\\"+HelpFile;
Form1->OpenURL(a);
}
}
Dictionary * Dictionary::FindDictionary(AnsiString Wrd)
{
if (WordS->Name==Wrd) return this; else {
if (Link!=NULL) return Link->FindDictionary(Wrd); else
return NULL ; }
}