-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMenuItem.inc
335 lines (280 loc) · 10.4 KB
/
MenuItem.inc
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
//----------------------------------------
// ´úÂëÓÉGenlibVcl¹¤¾ß×Ô¶¯Éú³É¡£
// Copyright ? ying32. All Rights Reserved.
//
//----------------------------------------
function MenuItem_Create(AOwner: TComponent): TMenuItem; cdecl;
begin
Result := TMenuItem.Create(AOwner);
end;
procedure MenuItem_Free(AObj: TMenuItem); cdecl;
begin
AObj.Free;
end;
procedure MenuItem_Insert(AObj: TMenuItem; Index: Integer; Item: TMenuItem); cdecl;
begin
AObj.Insert(Index, Item);
end;
procedure MenuItem_Delete(AObj: TMenuItem; Index: Integer); cdecl;
begin
AObj.Delete(Index);
end;
procedure MenuItem_Clear(AObj: TMenuItem); cdecl;
begin
AObj.Clear;
end;
procedure MenuItem_Click(AObj: TMenuItem); cdecl;
begin
AObj.Click;
end;
function MenuItem_IndexOf(AObj: TMenuItem; Item: TMenuItem): Integer; cdecl;
begin
Result := AObj.IndexOf(Item);
end;
function MenuItem_HasParent(AObj: TMenuItem): LongBool; cdecl;
begin
Result := AObj.HasParent;
end;
procedure MenuItem_Add(AObj: TMenuItem; Item: TMenuItem); cdecl;
begin
AObj.Add(Item);
end;
function MenuItem_FindComponent(AObj: TMenuItem; AName: PWideChar): TComponent; cdecl;
begin
Result := AObj.FindComponent(AName);
end;
function MenuItem_GetNamePath(AObj: TMenuItem): PWideChar; cdecl;
begin
Result := PWideChar(AObj.GetNamePath);
end;
procedure MenuItem_Assign(AObj: TMenuItem; Source: TPersistent); cdecl;
begin
AObj.Assign(Source);
end;
function MenuItem_ClassName(AObj: TMenuItem): PWideChar; cdecl;
begin
Result := ShortstrToPWideChar(AObj.ClassName);
end;
function MenuItem_Equals(AObj: TMenuItem; Obj: TObject): LongBool; cdecl;
begin
Result := AObj.Equals(Obj);
end;
function MenuItem_GetHashCode(AObj: TMenuItem): Integer; cdecl;
begin
Result := AObj.GetHashCode;
end;
function MenuItem_ToString(AObj: TMenuItem): PWideChar; cdecl;
begin
Result := PWideChar(AObj.ToString);
end;
function MenuItem_GetHandle(AObj: TMenuItem): HMENU; cdecl;
begin
Result := AObj.Handle;
end;
function MenuItem_GetParent(AObj: TMenuItem): TMenuItem; cdecl;
begin
Result := AObj.Parent;
end;
function MenuItem_GetAction(AObj: TMenuItem): TBasicAction; cdecl;
begin
Result := AObj.Action;
end;
procedure MenuItem_SetAction(AObj: TMenuItem; AValue: TBasicAction); cdecl;
begin
AObj.Action := AValue;
end;
//function MenuItem_GetAutoHotkeys(AObj: TMenuItem): TMenuItemAutoFlag; cdecl;
//begin
// Result := AObj.AutoHotkeys;
//end;
//
//procedure MenuItem_SetAutoHotkeys(AObj: TMenuItem; AValue: TMenuItemAutoFlag); cdecl;
//begin
// AObj.AutoHotkeys := AValue;
//end;
function MenuItem_GetBitmap(AObj: TMenuItem): TBitmap; cdecl;
begin
Result := AObj.Bitmap;
end;
procedure MenuItem_SetBitmap(AObj: TMenuItem; AValue: TBitmap); cdecl;
begin
AObj.Bitmap := AValue;
end;
function MenuItem_GetCaption(AObj: TMenuItem): PWideChar; cdecl;
begin
Result := PWideChar(AObj.Caption);
end;
procedure MenuItem_SetCaption(AObj: TMenuItem; AValue: PWideChar); cdecl;
begin
AObj.Caption := AValue;
end;
function MenuItem_GetChecked(AObj: TMenuItem): LongBool; cdecl;
begin
Result := AObj.Checked;
end;
procedure MenuItem_SetChecked(AObj: TMenuItem; AValue: LongBool); cdecl;
begin
AObj.Checked := AValue;
end;
function MenuItem_GetDefault(AObj: TMenuItem): LongBool; cdecl;
begin
Result := AObj.Default;
end;
procedure MenuItem_SetDefault(AObj: TMenuItem; AValue: LongBool); cdecl;
begin
AObj.Default := AValue;
end;
function MenuItem_GetEnabled(AObj: TMenuItem): LongBool; cdecl;
begin
Result := AObj.Enabled;
end;
procedure MenuItem_SetEnabled(AObj: TMenuItem; AValue: LongBool); cdecl;
begin
AObj.Enabled := AValue;
end;
function MenuItem_GetGroupIndex(AObj: TMenuItem): Byte; cdecl;
begin
Result := AObj.GroupIndex;
end;
procedure MenuItem_SetGroupIndex(AObj: TMenuItem; AValue: Byte); cdecl;
begin
AObj.GroupIndex := AValue;
end;
function MenuItem_GetHint(AObj: TMenuItem): PWideChar; cdecl;
begin
Result := PWideChar(AObj.Hint);
end;
procedure MenuItem_SetHint(AObj: TMenuItem; AValue: PWideChar); cdecl;
begin
AObj.Hint := AValue;
end;
//function MenuItem_GetImageIndex(AObj: TMenuItem): TImageIndex; cdecl;
//begin
// Result := AObj.ImageIndex;
//end;
//
//procedure MenuItem_SetImageIndex(AObj: TMenuItem; AValue: TImageIndex); cdecl;
//begin
// AObj.ImageIndex := AValue;
//end;
function MenuItem_GetShortCut(AObj: TMenuItem): TShortCut; cdecl;
begin
Result := AObj.ShortCut;
end;
procedure MenuItem_SetShortCut(AObj: TMenuItem; AValue: TShortCut); cdecl;
begin
AObj.ShortCut := AValue;
end;
function MenuItem_GetVisible(AObj: TMenuItem): LongBool; cdecl;
begin
Result := AObj.Visible;
end;
procedure MenuItem_SetVisible(AObj: TMenuItem; AValue: LongBool); cdecl;
begin
AObj.Visible := AValue;
end;
procedure MenuItem_SetOnClick(AObj: TMenuItem; AEventId: NativeUInt); stdcall;
begin
if AEventId = 0 then
begin
AObj.OnClick := nil;
TEventClass.Remove(AObj, geClick);
Exit;
end;
AObj.OnClick := TEventClass.OnClick;
TEventClass.Add(AObj, geClick, AEventId);
end;
function MenuItem_GetComponentCount(AObj: TMenuItem): Integer; cdecl;
begin
Result := AObj.ComponentCount;
end;
function MenuItem_GetComponentIndex(AObj: TMenuItem): Integer; cdecl;
begin
Result := AObj.ComponentIndex;
end;
procedure MenuItem_SetComponentIndex(AObj: TMenuItem; AValue: Integer); cdecl;
begin
AObj.ComponentIndex := AValue;
end;
function MenuItem_GetOwner(AObj: TMenuItem): TComponent; cdecl;
begin
Result := AObj.Owner;
end;
function MenuItem_GetName(AObj: TMenuItem): PWideChar; cdecl;
begin
Result := PWideChar(AObj.Name);
end;
procedure MenuItem_SetName(AObj: TMenuItem; AValue: PWideChar); cdecl;
begin
AObj.Name := AValue;
end;
function MenuItem_GetTag(AObj: TMenuItem): NativeInt; cdecl;
begin
Result := AObj.Tag;
end;
procedure MenuItem_SetTag(AObj: TMenuItem; AValue: NativeInt); cdecl;
begin
AObj.Tag := AValue;
end;
function MenuItem_GetItems(AObj: TMenuItem; Index: Integer): TMenuItem; cdecl;
begin
Result := AObj.Items[Index];
end;
function MenuItem_GetComponents(AObj: TMenuItem; AIndex: Integer): TComponent; cdecl;
begin
Result := AObj.Components[AIndex];
end;
exports
MenuItem_Create {$IFNDEF MSWINDOWS}name '_MenuItem_Create'{$ENDIF},
MenuItem_Free {$IFNDEF MSWINDOWS}name '_MenuItem_Free'{$ENDIF},
MenuItem_Insert {$IFNDEF MSWINDOWS}name '_MenuItem_Insert'{$ENDIF},
MenuItem_Delete {$IFNDEF MSWINDOWS}name '_MenuItem_Delete'{$ENDIF},
MenuItem_Clear {$IFNDEF MSWINDOWS}name '_MenuItem_Clear'{$ENDIF},
MenuItem_Click {$IFNDEF MSWINDOWS}name '_MenuItem_Click'{$ENDIF},
MenuItem_IndexOf {$IFNDEF MSWINDOWS}name '_MenuItem_IndexOf'{$ENDIF},
MenuItem_HasParent {$IFNDEF MSWINDOWS}name '_MenuItem_HasParent'{$ENDIF},
MenuItem_Add {$IFNDEF MSWINDOWS}name '_MenuItem_Add'{$ENDIF},
MenuItem_FindComponent {$IFNDEF MSWINDOWS}name '_MenuItem_FindComponent'{$ENDIF},
MenuItem_GetNamePath {$IFNDEF MSWINDOWS}name '_MenuItem_GetNamePath'{$ENDIF},
MenuItem_Assign {$IFNDEF MSWINDOWS}name '_MenuItem_Assign'{$ENDIF},
MenuItem_ClassName {$IFNDEF MSWINDOWS}name '_MenuItem_ClassName'{$ENDIF},
MenuItem_Equals {$IFNDEF MSWINDOWS}name '_MenuItem_Equals'{$ENDIF},
MenuItem_GetHashCode {$IFNDEF MSWINDOWS}name '_MenuItem_GetHashCode'{$ENDIF},
MenuItem_ToString {$IFNDEF MSWINDOWS}name '_MenuItem_ToString'{$ENDIF},
MenuItem_GetHandle {$IFNDEF MSWINDOWS}name '_MenuItem_GetHandle'{$ENDIF},
MenuItem_GetParent {$IFNDEF MSWINDOWS}name '_MenuItem_GetParent'{$ENDIF},
MenuItem_GetAction {$IFNDEF MSWINDOWS}name '_MenuItem_GetAction'{$ENDIF},
MenuItem_SetAction {$IFNDEF MSWINDOWS}name '_MenuItem_SetAction'{$ENDIF},
//MenuItem_GetAutoHotkeys {$IFNDEF MSWINDOWS}name '_MenuItem_GetAutoHotkeys'{$ENDIF},
//MenuItem_SetAutoHotkeys {$IFNDEF MSWINDOWS}name '_MenuItem_SetAutoHotkeys'{$ENDIF},
MenuItem_GetBitmap {$IFNDEF MSWINDOWS}name '_MenuItem_GetBitmap'{$ENDIF},
MenuItem_SetBitmap {$IFNDEF MSWINDOWS}name '_MenuItem_SetBitmap'{$ENDIF},
MenuItem_GetCaption {$IFNDEF MSWINDOWS}name '_MenuItem_GetCaption'{$ENDIF},
MenuItem_SetCaption {$IFNDEF MSWINDOWS}name '_MenuItem_SetCaption'{$ENDIF},
MenuItem_GetChecked {$IFNDEF MSWINDOWS}name '_MenuItem_GetChecked'{$ENDIF},
MenuItem_SetChecked {$IFNDEF MSWINDOWS}name '_MenuItem_SetChecked'{$ENDIF},
MenuItem_GetDefault {$IFNDEF MSWINDOWS}name '_MenuItem_GetDefault'{$ENDIF},
MenuItem_SetDefault {$IFNDEF MSWINDOWS}name '_MenuItem_SetDefault'{$ENDIF},
MenuItem_GetEnabled {$IFNDEF MSWINDOWS}name '_MenuItem_GetEnabled'{$ENDIF},
MenuItem_SetEnabled {$IFNDEF MSWINDOWS}name '_MenuItem_SetEnabled'{$ENDIF},
MenuItem_GetGroupIndex {$IFNDEF MSWINDOWS}name '_MenuItem_GetGroupIndex'{$ENDIF},
MenuItem_SetGroupIndex {$IFNDEF MSWINDOWS}name '_MenuItem_SetGroupIndex'{$ENDIF},
MenuItem_GetHint {$IFNDEF MSWINDOWS}name '_MenuItem_GetHint'{$ENDIF},
MenuItem_SetHint {$IFNDEF MSWINDOWS}name '_MenuItem_SetHint'{$ENDIF},
//MenuItem_GetImageIndex {$IFNDEF MSWINDOWS}name '_MenuItem_GetImageIndex'{$ENDIF},
//MenuItem_SetImageIndex {$IFNDEF MSWINDOWS}name '_MenuItem_SetImageIndex'{$ENDIF},
MenuItem_GetShortCut {$IFNDEF MSWINDOWS}name '_MenuItem_GetShortCut'{$ENDIF},
MenuItem_SetShortCut {$IFNDEF MSWINDOWS}name '_MenuItem_SetShortCut'{$ENDIF},
MenuItem_GetVisible {$IFNDEF MSWINDOWS}name '_MenuItem_GetVisible'{$ENDIF},
MenuItem_SetVisible {$IFNDEF MSWINDOWS}name '_MenuItem_SetVisible'{$ENDIF},
MenuItem_SetOnClick {$IFNDEF MSWINDOWS}name '_MenuItem_SetOnClick'{$ENDIF},
MenuItem_GetComponentCount {$IFNDEF MSWINDOWS}name '_MenuItem_GetComponentCount'{$ENDIF},
MenuItem_GetComponentIndex {$IFNDEF MSWINDOWS}name '_MenuItem_GetComponentIndex'{$ENDIF},
MenuItem_SetComponentIndex {$IFNDEF MSWINDOWS}name '_MenuItem_SetComponentIndex'{$ENDIF},
MenuItem_GetOwner {$IFNDEF MSWINDOWS}name '_MenuItem_GetOwner'{$ENDIF},
MenuItem_GetName {$IFNDEF MSWINDOWS}name '_MenuItem_GetName'{$ENDIF},
MenuItem_SetName {$IFNDEF MSWINDOWS}name '_MenuItem_SetName'{$ENDIF},
MenuItem_GetTag {$IFNDEF MSWINDOWS}name '_MenuItem_GetTag'{$ENDIF},
MenuItem_SetTag {$IFNDEF MSWINDOWS}name '_MenuItem_SetTag'{$ENDIF},
MenuItem_GetItems {$IFNDEF MSWINDOWS}name '_MenuItem_GetItems'{$ENDIF},
MenuItem_GetComponents {$IFNDEF MSWINDOWS}name '_MenuItem_GetComponents'{$ENDIF};