-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinc__r2menu.pas
More file actions
104 lines (86 loc) · 3.08 KB
/
inc__r2menu.pas
File metadata and controls
104 lines (86 loc) · 3.08 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
{*******************************************************************************
NFK [R2]
Render Library / Menu object
Implementation
Contains:
...
*******************************************************************************}
{*******************************************************************************
r2menu
*******************************************************************************}
function r2menu.lastIndex(): shortint;
var
i:shortint;
begin
for i:= 0 to 99 do begin
if (Screens[i].Caption = '') then begin
result:= i;
break;
end;
end;
end;
//------------------------------------------------------------------------------
procedure r2menu.AddScreen(var Caption: string; scriptFile: string);
var
i:shortint;
begin
if ((Caption = '') or (scriptFile = '')) then exit;
if (not FileExists(scriptFile)) then exit;
i:= lastIndex;
Screens[i].Caption:= Caption;
Screens[i].Script.LoadFromFile(scriptFile);
end;
//------------------------------------------------------------------------------
procedure r2menu.DrawMenu(menuIndex: byte);
var
i: byte;
//m: r2;
begin
//
with Screens[menuIndex] do begin
for i:= 0 to ItemsCount-1 do begin
if ItemOrder[i].mType = mLabel then begin
with mLabels[i] do
case Font of
1: mainform.Font1.TextOut(Text, Left, Top, Color);
2: mainform.Font2.TextOut(Text, Left, Top, Color);
21: mainform.Font2b.TextOut(Text, Left, Top, Color);
22: mainform.Font2s.TextOut(Text, Left, Top, Color);
23: mainform.Font2ss.TextOut(Text, Left, Top, Color);
3: mainform.Font3.TextOut(Text, Left, Top, Color);
4: mainform.Font4.TextOut(Text, Left, Top, Color);
6: mainform.Font6.TextOut(Text, Left, Top, Color);
7: begin
nfkFont1.drawString(Text,Left,Top,$FF0000CC,1);
nfkFont1.drawString(Text,Left,Top,(menu1_alpha shl 24)+$0000FF,2);
end;
8: begin
nfkFont2.drawString(Text,Left,Top,$ffffffff,1);
end;
end;
end; // else
end;
end;
end;
{*******************************************************************************
r2menuItem
*******************************************************************************}
procedure r2menuItem.OnClick(Sender: r2menuLabel);
begin
// dummy
end;
procedure r2menuItem.OnMouseIn(Sender: r2menuLabel);
begin
// dummy
end;
procedure r2menuItem.OnMouseOut(Sender: r2menuLabel);
begin
// dummy
end;
{*******************************************************************************
r2menuScreen
*******************************************************************************}
procedure r2menuScreen.AddItem(Text: string; Font: string; Color: cardinal; Effect: cardinal; Region: TRect; Stete: byte);
begin
//
end;