source: cprs/branches/tmg-cprs/TMG_Extra/tntUniCode/Source/TntActnList.pas@ 1682

Last change on this file since 1682 was 672, checked in by Kevin Toppenberg, 15 years ago

Adding source to tntControls for compilation

File size: 27.9 KB
Line 
1
2{*****************************************************************************}
3{ }
4{ Tnt Delphi Unicode Controls }
5{ http://www.tntware.com/delphicontrols/unicode/ }
6{ Version: 2.3.0 }
7{ }
8{ Copyright (c) 2002-2007, Troy Wolbrink (troy.wolbrink@tntware.com) }
9{ }
10{*****************************************************************************}
11
12unit TntActnList;
13
14{$INCLUDE TntCompilers.inc}
15
16interface
17
18uses
19 Classes, Controls, ActnList, Buttons, ExtCtrls, ComCtrls, StdCtrls, Menus;
20
21type
22{TNT-WARN TActionList}
23 TTntActionList = class(TActionList{TNT-ALLOW TActionList})
24 private
25 FCheckActionsTimer: TTimer;
26 procedure CheckActions(Sender: TObject);
27 public
28 constructor Create(AOwner: TComponent); override;
29 end;
30
31 ITntAction = interface
32 ['{59D0AE37-8161-4AD6-9102-14B28E5761EB}']
33 end;
34
35//---------------------------------------------------------------------------------------------
36// ACTIONS
37//---------------------------------------------------------------------------------------------
38
39{TNT-WARN TCustomAction}
40 TTntCustomAction = class(TCustomAction{TNT-ALLOW TCustomAction}, ITntAction)
41 private
42 function GetCaption: WideString;
43 procedure SetCaption(const Value: WideString);
44 function GetHint: WideString;
45 procedure SetHint(const Value: WideString);
46 protected
47 procedure DefineProperties(Filer: TFiler); override;
48 public
49 procedure Assign(Source: TPersistent); override;
50 public
51 property Caption: WideString read GetCaption write SetCaption;
52 property Hint: WideString read GetHint write SetHint;
53 end;
54
55{TNT-WARN TAction}
56 TTntAction = class(TAction{TNT-ALLOW TAction}, ITntAction)
57 private
58 function GetCaption: WideString;
59 procedure SetCaption(const Value: WideString);
60 function GetHint: WideString;
61 procedure SetHint(const Value: WideString);
62 protected
63 procedure DefineProperties(Filer: TFiler); override;
64 public
65 procedure Assign(Source: TPersistent); override;
66 published
67 property Caption: WideString read GetCaption write SetCaption;
68 property Hint: WideString read GetHint write SetHint;
69 end;
70
71//---------------------------------------------------------------------------------------------
72
73// MENU ACTION LINK
74//---------------------------------------------------------------------------------------------
75
76{TNT-WARN TMenuActionLink}
77 TTntMenuActionLink = class(TMenuActionLink{TNT-ALLOW TMenuActionLink})
78 protected
79 function IsCaptionLinked: Boolean; override;
80 function IsHintLinked: Boolean; override;
81 procedure SetCaption(const Value: string{TNT-ALLOW string}); override;
82 procedure SetHint(const Value: string{TNT-ALLOW string}); override;
83 end;
84
85//---------------------------------------------------------------------------------------------
86// CONTROL ACTION LINKS
87//---------------------------------------------------------------------------------------------
88
89{TNT-WARN TListViewActionLink}
90 TTntListViewActionLink = class(TListViewActionLink{TNT-ALLOW TListViewActionLink})
91 protected
92 function IsCaptionLinked: Boolean; override;
93 function IsHintLinked: Boolean; override;
94 procedure SetCaption(const Value: string{TNT-ALLOW string}); override;
95 procedure SetHint(const Value: string{TNT-ALLOW string}); override;
96 end;
97
98{TNT-WARN TComboBoxExActionLink}
99 TTntComboBoxExActionLink = class(TComboBoxExActionLink{TNT-ALLOW TComboBoxExActionLink})
100 protected
101 function IsCaptionLinked: Boolean; override;
102 function IsHintLinked: Boolean; override;
103 procedure SetCaption(const Value: string{TNT-ALLOW string}); override;
104 procedure SetHint(const Value: string{TNT-ALLOW string}); override;
105 end;
106
107{TNT-WARN TSpeedButtonActionLink}
108 TTntSpeedButtonActionLink = class(TSpeedButtonActionLink{TNT-ALLOW TSpeedButtonActionLink})
109 protected
110 function IsCaptionLinked: Boolean; override;
111 function IsHintLinked: Boolean; override;
112 procedure SetCaption(const Value: string{TNT-ALLOW string}); override;
113 procedure SetHint(const Value: string{TNT-ALLOW string}); override;
114 {$IFDEF COMPILER_10_UP}
115 function IsImageIndexLinked: Boolean; override;
116 procedure SetImageIndex(Value: Integer); override;
117 {$ENDIF}
118 end;
119
120{$IFDEF COMPILER_10_UP}
121{TNT-WARN TBitBtnActionLink}
122 TTntBitBtnActionLink = class(TBitBtnActionLink{TNT-ALLOW TBitBtnActionLink})
123 protected
124 function IsCaptionLinked: Boolean; override;
125 function IsHintLinked: Boolean; override;
126 procedure SetCaption(const Value: string{TNT-ALLOW string}); override;
127 procedure SetHint(const Value: string{TNT-ALLOW string}); override;
128 {$IFDEF COMPILER_10_UP}
129 function IsImageIndexLinked: Boolean; override;
130 procedure SetImageIndex(Value: Integer); override;
131 {$ENDIF}
132 end;
133{$ENDIF}
134
135{TNT-WARN TToolButtonActionLink}
136 TTntToolButtonActionLink = class(TToolButtonActionLink{TNT-ALLOW TToolButtonActionLink})
137 protected
138 function IsCaptionLinked: Boolean; override;
139 function IsHintLinked: Boolean; override;
140 procedure SetCaption(const Value: string{TNT-ALLOW string}); override;
141 procedure SetHint(const Value: string{TNT-ALLOW string}); override;
142 end;
143
144{TNT-WARN TButtonActionLink}
145 TTntButtonActionLink = class(TButtonActionLink{TNT-ALLOW TButtonActionLink})
146 protected
147 function IsCaptionLinked: Boolean; override;
148 function IsHintLinked: Boolean; override;
149 procedure SetCaption(const Value: string{TNT-ALLOW string}); override;
150 procedure SetHint(const Value: string{TNT-ALLOW string}); override;
151 end;
152
153{TNT-WARN TWinControlActionLink}
154 TTntWinControlActionLink = class(TWinControlActionLink{TNT-ALLOW TWinControlActionLink})
155 protected
156 function IsCaptionLinked: Boolean; override;
157 function IsHintLinked: Boolean; override;
158 procedure SetCaption(const Value: string{TNT-ALLOW string}); override;
159 procedure SetHint(const Value: string{TNT-ALLOW string}); override;
160 end;
161
162{TNT-WARN TControlActionLink}
163 TTntControlActionLink = class(TControlActionLink{TNT-ALLOW TControlActionLink})
164 protected
165 function IsCaptionLinked: Boolean; override;
166 function IsHintLinked: Boolean; override;
167 procedure SetCaption(const Value: string{TNT-ALLOW string}); override;
168 procedure SetHint(const Value: string{TNT-ALLOW string}); override;
169 end;
170
171//---------------------------------------------------------------------------------------------
172// helper procs
173//---------------------------------------------------------------------------------------------
174
175//-- TCustomAction helper routines
176procedure TntAction_SetCaption(Action: TCustomAction{TNT-ALLOW TCustomAction}; const Value: WideString);
177function TntAction_GetCaption(Action: TCustomAction{TNT-ALLOW TCustomAction}): WideString;
178function TntAction_GetNewCaption(Action: TCustomAction{TNT-ALLOW TCustomAction}; const Default: WideString): WideString;
179procedure TntAction_SetHint(Action: TCustomAction{TNT-ALLOW TCustomAction}; const Value: WideString);
180function TntAction_GetHint(Action: TCustomAction{TNT-ALLOW TCustomAction}): WideString;
181function TntAction_GetNewHint(Action: TCustomAction{TNT-ALLOW TCustomAction}; const Default: WideString): WideString;
182procedure TntAction_AfterInherited_Assign(Action: TCustomAction{TNT-ALLOW TCustomAction}; Source: TPersistent);
183
184// -- TControl helper routines
185function TntControl_GetActionLinkClass(Control: TControl; InheritedLinkClass: TControlActionLinkClass): TControlActionLinkClass;
186procedure TntControl_BeforeInherited_ActionChange(Control: TControl; Sender: TObject; CheckDefaults: Boolean);
187
188// -- TControlActionLink helper routines
189function TntActionLink_IsCaptionLinked(InheritedIsCaptionLinked: Boolean; Action: TBasicAction; FClient: TControl): Boolean;
190function TntActionLink_IsHintLinked(InheritedIsHintLinked: Boolean; Action: TBasicAction; FClient: TControl): Boolean;
191procedure TntActionLink_SetCaption(IsCaptionLinked: Boolean; Action: TBasicAction; FClient: TControl; const Value: string{TNT-ALLOW string});
192procedure TntActionLink_SetHint(IsHintLinked: Boolean; Action: TBasicAction; FClient: TControl; const Value: string{TNT-ALLOW string});
193
194type
195 TUpgradeActionListItemsProc = procedure (ActionList: TTntActionList);
196
197var
198 UpgradeActionListItemsProc: TUpgradeActionListItemsProc;
199
200implementation
201
202uses
203 SysUtils, TntMenus, TntClasses, TntControls;
204
205{ TActionListList }
206
207type
208 TActionListList = class(TList)
209 private
210 FActionList: TTntActionList;
211 protected
212 procedure Notify(Ptr: Pointer; Action: TListNotification); override;
213 end;
214
215procedure TActionListList.Notify(Ptr: Pointer; Action: TListNotification);
216begin
217 inherited;
218 if (Action = lnAdded) and (FActionList <> nil) and (Ptr <> nil)
219 and (not Supports(TObject(Ptr), ITntAction)) then
220 begin
221 FActionList.FCheckActionsTimer.Enabled := False;
222 FActionList.FCheckActionsTimer.Enabled := True;
223 end;
224end;
225
226{ THackActionList }
227
228type
229{$IFDEF COMPILER_6} // verified against VCL source in Delphi 6 and BCB 6
230 THackCustomActionList = class(TComponent)
231 private
232 FActions: TList;
233 end;
234{$ENDIF}
235{$IFDEF DELPHI_7} // verified against VCL source in Delphi 7
236 THackCustomActionList = class(TComponent)
237 private
238 FActions: TList;
239 end;
240{$ENDIF}
241{$IFDEF DELPHI_9} // verified against VCL source in Delphi 9
242 THackCustomActionList = class(TComponent)
243 private
244 FActions: TList;
245 end;
246{$ENDIF}
247{$IFDEF DELPHI_10} // verified against VCL source in Delphi 10
248 THackCustomActionList = class(TComponent)
249 private
250 FActions: TList;
251 end;
252{$ENDIF}
253
254{ TTntActionList }
255
256constructor TTntActionList.Create(AOwner: TComponent);
257begin
258 inherited;
259 if (csDesigning in ComponentState) then begin
260 FCheckActionsTimer := TTimer.Create(Self);
261 FCheckActionsTimer.Enabled := False;
262 FCheckActionsTimer.Interval := 50;
263 FCheckActionsTimer.OnTimer := CheckActions;
264 //
265 THackCustomActionList(Self).FActions.Free;
266 THackCustomActionList(Self).FActions := TActionListList.Create;
267 TActionListList(THackCustomActionList(Self).FActions).FActionList := Self;
268 end;
269end;
270
271procedure TTntActionList.CheckActions(Sender: TObject);
272begin
273 if FCheckActionsTimer <> nil then begin
274 FCheckActionsTimer.Enabled := False;
275 end;
276 Assert(csDesigning in ComponentState);
277 Assert(Assigned(UpgradeActionListItemsProc));
278 UpgradeActionListItemsProc(Self);
279end;
280
281{ TCustomActionHelper }
282
283type
284 TCustomActionHelper = class(TComponent)
285 private
286 FAction: TCustomAction{TNT-ALLOW TCustomAction};
287 private
288 FCaption: WideString;
289 FSettingNewCaption: Boolean;
290 FOldWideCaption: WideString;
291 FNewAnsiCaption: AnsiString;
292 procedure SetAnsiCaption(const Value: AnsiString);
293 function SettingNewCaption: Boolean;
294 procedure SetCaption(const Value: WideString);
295 function GetCaption: WideString;
296 private
297 FHint: WideString;
298 FSettingNewHint: Boolean;
299 FOldWideHint: WideString;
300 FNewAnsiHint: AnsiString;
301 procedure SetAnsiHint(const Value: AnsiString);
302 function SettingNewHint: Boolean;
303 procedure SetHint(const Value: WideString);
304 function GetHint: WideString;
305 end;
306
307procedure TCustomActionHelper.SetAnsiCaption(const Value: AnsiString);
308begin
309 FAction.Caption := Value;
310 if (Value = '') and (FNewAnsiCaption <> '') then
311 FOldWideCaption := '';
312end;
313
314function TCustomActionHelper.SettingNewCaption: Boolean;
315begin
316 Result := FSettingNewCaption and (FAction.Caption <> FNewAnsiCaption);
317end;
318
319function TCustomActionHelper.GetCaption: WideString;
320begin
321 if SettingNewCaption then
322 Result := FOldWideCaption
323 else
324 Result := GetSyncedWideString(FCaption, FAction.Caption)
325end;
326
327procedure TCustomActionHelper.SetCaption(const Value: WideString);
328begin
329 FOldWideCaption := GetCaption;
330 FNewAnsiCaption := Value;
331 FSettingNewCaption := True;
332 try
333 SetSyncedWideString(Value, FCaption, FAction.Caption, SetAnsiCaption)
334 finally
335 FSettingNewCaption := False;
336 end;
337end;
338
339procedure TCustomActionHelper.SetAnsiHint(const Value: AnsiString);
340begin
341 FAction.Hint := Value;
342 if (Value = '') and (FNewAnsiHint <> '') then
343 FOldWideHint := '';
344end;
345
346function TCustomActionHelper.SettingNewHint: Boolean;
347begin
348 Result := FSettingNewHint and (FAction.Hint <> FNewAnsiHint);
349end;
350
351function TCustomActionHelper.GetHint: WideString;
352begin
353 if SettingNewHint then
354 Result := FOldWideHint
355 else
356 Result := GetSyncedWideString(FHint, FAction.Hint)
357end;
358
359procedure TCustomActionHelper.SetHint(const Value: WideString);
360begin
361 FOldWideHint := GetHint;
362 FNewAnsiHint := Value;
363 FSettingNewHint := True;
364 try
365 SetSyncedWideString(Value, FHint, FAction.Hint, SetAnsiHint)
366 finally
367 FSettingNewHint := False;
368 end;
369end;
370
371function FindActionHelper(Action: TCustomAction{TNT-ALLOW TCustomAction}): TCustomActionHelper;
372var
373 i: integer;
374begin
375 Assert(Action <> nil);
376 Result := nil;
377 if Supports(Action, ITntAction) then begin
378 for i := 0 to Action.ComponentCount - 1 do begin
379 if Action.Components[i] is TCustomActionHelper then begin
380 Result := TCustomActionHelper(Action.Components[i]);
381 break;
382 end;
383 end;
384 if Result = nil then begin
385 Result := TCustomActionHelper.Create(Action);
386 Result.FAction := Action;
387 end;
388 end;
389end;
390
391//-- TCustomAction helper routines
392
393procedure TntAction_SetCaption(Action: TCustomAction{TNT-ALLOW TCustomAction}; const Value: WideString);
394begin
395 if Supports(Action, ITntAction) then
396 with FindActionHelper(Action) do
397 SetCaption(Value)
398 else
399 Action.Caption := Value;
400end;
401
402function TntAction_GetCaption(Action: TCustomAction{TNT-ALLOW TCustomAction}): WideString;
403begin
404 if Supports(Action, ITntAction) then
405 with FindActionHelper(Action) do
406 Result := GetCaption
407 else
408 Result := Action.Caption;
409end;
410
411function TntAction_GetNewCaption(Action: TCustomAction{TNT-ALLOW TCustomAction}; const Default: WideString): WideString;
412begin
413 Result := Default;
414 if Supports(Action, ITntAction) then
415 with FindActionHelper(Action) do
416 if SettingNewCaption then
417 Result := FCaption;
418end;
419
420procedure TntAction_SetHint(Action: TCustomAction{TNT-ALLOW TCustomAction}; const Value: WideString);
421begin
422 if Supports(Action, ITntAction) then
423 with FindActionHelper(Action) do
424 SetHint(Value)
425 else
426 Action.Hint := Value;
427end;
428
429function TntAction_GetHint(Action: TCustomAction{TNT-ALLOW TCustomAction}): WideString;
430begin
431 if Supports(Action, ITntAction) then
432 with FindActionHelper(Action) do
433 Result := GetHint
434 else
435 Result := Action.Hint;
436end;
437
438function TntAction_GetNewHint(Action: TCustomAction{TNT-ALLOW TCustomAction}; const Default: WideString): WideString;
439begin
440 Result := Default;
441 if Supports(Action, ITntAction) then
442 with FindActionHelper(Action) do
443 if SettingNewHint then
444 Result := FHint;
445end;
446
447procedure TntAction_AfterInherited_Assign(Action: TCustomAction{TNT-ALLOW TCustomAction}; Source: TPersistent);
448begin
449 with Action do begin
450 if (Source is TCustomAction{TNT-ALLOW TCustomAction}) then begin
451 Caption := TntAction_GetCaption(Source as TCustomAction{TNT-ALLOW TCustomAction});
452 Hint := TntAction_GetHint(Source as TCustomAction{TNT-ALLOW TCustomAction});
453 end else if (Source is TControl) then begin
454 Caption := TntControl_GetText(Source as TControl);
455 Hint := TntControl_GetHint(Source as TControl);
456 end;
457 end;
458end;
459
460// -- TControl helper routines
461
462function TntControl_GetActionLinkClass(Control: TControl; InheritedLinkClass: TControlActionLinkClass): TControlActionLinkClass;
463begin
464 if Control is TCustomListView{TNT-ALLOW TCustomListView} then
465 Result := TTntListViewActionLink
466 else if Control is TComboBoxEx then
467 Result := TTntComboBoxExActionLink
468 else if Control is TSpeedButton{TNT-ALLOW TSpeedButton} then
469 Result := TTntSpeedButtonActionLink
470 {$IFDEF COMPILER_10_UP}
471 else if Control is TBitBtn{TNT-ALLOW TBitBtn} then
472 Result := TTntBitBtnActionLink
473 {$ENDIF}
474 else if Control is TToolButton{TNT-ALLOW TToolButton} then
475 Result := TTntToolButtonActionLink
476 else if Control is TButtonControl then
477 Result := TTntButtonActionLink
478 else if Control is TWinControl then
479 Result := TTntWinControlActionLink
480 else
481 Result := TTntControlActionLink;
482
483 Assert(Result.ClassParent = InheritedLinkClass);
484end;
485
486procedure TntControl_BeforeInherited_ActionChange(Control: TControl; Sender: TObject; CheckDefaults: Boolean);
487begin
488 if (Sender is TCustomAction{TNT-ALLOW TCustomAction}) and Supports(Sender, ITntAction) then begin
489 if not CheckDefaults or (TntControl_GetText(Control) = '') or (TntControl_GetText(Control) = Control.Name) then
490 TntControl_SetText(Control, TntAction_GetCaption(TCustomAction{TNT-ALLOW TCustomAction}(Sender)));
491 if not CheckDefaults or (TntControl_GetHint(Control) = '') then
492 TntControl_SetHint(Control, TntAction_GetHint(TCustomAction{TNT-ALLOW TCustomAction}(Sender)));
493 end;
494end;
495
496// -- TControlActionLink helper routines
497
498function TntActionLink_IsCaptionLinked(InheritedIsCaptionLinked: Boolean; Action: TBasicAction; FClient: TControl): Boolean;
499begin
500 Result := InheritedIsCaptionLinked
501 and (TntAction_GetCaption(Action as TCustomAction{TNT-ALLOW TCustomAction}) = TntControl_GetText(FClient));
502end;
503
504function TntActionLink_IsHintLinked(InheritedIsHintLinked: Boolean; Action: TBasicAction; FClient: TControl): Boolean;
505begin
506 Result := InheritedIsHintLinked
507 and (TntAction_GetHint(Action as TCustomAction{TNT-ALLOW TCustomAction}) = TntControl_GetHint(FClient));
508end;
509
510procedure TntActionLink_SetCaption(IsCaptionLinked: Boolean; Action: TBasicAction; FClient: TControl; const Value: string{TNT-ALLOW string});
511begin
512 if IsCaptionLinked then
513 TntControl_SetText(FClient, TntAction_GetNewCaption(Action as TCustomAction{TNT-ALLOW TCustomAction}, Value));
514end;
515
516procedure TntActionLink_SetHint(IsHintLinked: Boolean; Action: TBasicAction; FClient: TControl; const Value: string{TNT-ALLOW string});
517begin
518 if IsHintLinked then
519 TntControl_SetHint(FClient, TntAction_GetNewHint(Action as TCustomAction{TNT-ALLOW TCustomAction}, Value));
520end;
521
522//---------------------------------------------------------------------------------------------
523// ACTIONS
524//---------------------------------------------------------------------------------------------
525
526{ TTntCustomAction }
527
528procedure TTntCustomAction.Assign(Source: TPersistent);
529begin
530 inherited;
531 TntAction_AfterInherited_Assign(Self, Source);
532end;
533
534procedure TTntCustomAction.DefineProperties(Filer: TFiler);
535begin
536 inherited;
537 TntPersistent_AfterInherited_DefineProperties(Filer, Self);
538end;
539
540function TTntCustomAction.GetCaption: WideString;
541begin
542 Result := TntAction_GetCaption(Self);
543end;
544
545procedure TTntCustomAction.SetCaption(const Value: WideString);
546begin
547 TntAction_SetCaption(Self, Value);
548end;
549
550function TTntCustomAction.GetHint: WideString;
551begin
552 Result := TntAction_GetHint(Self);
553end;
554
555procedure TTntCustomAction.SetHint(const Value: WideString);
556begin
557 TntAction_SetHint(Self, Value);
558end;
559
560{ TTntAction }
561
562procedure TTntAction.Assign(Source: TPersistent);
563begin
564 inherited;
565 TntAction_AfterInherited_Assign(Self, Source);
566end;
567
568procedure TTntAction.DefineProperties(Filer: TFiler);
569begin
570 inherited;
571 TntPersistent_AfterInherited_DefineProperties(Filer, Self);
572end;
573
574function TTntAction.GetCaption: WideString;
575begin
576 Result := TntAction_GetCaption(Self);
577end;
578
579procedure TTntAction.SetCaption(const Value: WideString);
580begin
581 TntAction_SetCaption(Self, Value);
582end;
583
584function TTntAction.GetHint: WideString;
585begin
586 Result := TntAction_GetHint(Self);
587end;
588
589procedure TTntAction.SetHint(const Value: WideString);
590begin
591 TntAction_SetHint(Self, Value);
592end;
593
594//---------------------------------------------------------------------------------------------
595// MENU ACTION LINK
596//---------------------------------------------------------------------------------------------
597
598{ TTntMenuActionLink }
599
600function TTntMenuActionLink.IsCaptionLinked: Boolean;
601begin
602 Result := inherited IsCaptionLinked
603 and WideSameCaption(TntAction_GetCaption(Action as TCustomAction{TNT-ALLOW TCustomAction}), (FClient as TTntMenuItem).Caption);
604end;
605
606function TTntMenuActionLink.IsHintLinked: Boolean;
607begin
608 Result := inherited IsHintLinked
609 and (TntAction_GetHint(Action as TCustomAction{TNT-ALLOW TCustomAction}) = (FClient as TTntMenuItem).Hint);
610end;
611
612procedure TTntMenuActionLink.SetCaption(const Value: string{TNT-ALLOW string});
613begin
614 if IsCaptionLinked then
615 (FClient as TTntMenuItem).Caption := TntAction_GetNewCaption(Action as TCustomAction{TNT-ALLOW TCustomAction}, Value);
616end;
617
618procedure TTntMenuActionLink.SetHint(const Value: string{TNT-ALLOW string});
619begin
620 if IsHintLinked then
621 (FClient as TTntMenuItem).Hint := TntAction_GetNewHint(Action as TCustomAction{TNT-ALLOW TCustomAction}, Value);
622end;
623
624//---------------------------------------------------------------------------------------------
625// CONTROL ACTION LINKS
626//---------------------------------------------------------------------------------------------
627
628{ TTntListViewActionLink }
629
630function TTntListViewActionLink.IsCaptionLinked: Boolean;
631begin
632 Result := TntActionLink_IsCaptionLinked(inherited IsCaptionLinked, Action, FClient);
633end;
634
635function TTntListViewActionLink.IsHintLinked: Boolean;
636begin
637 Result := TntActionLink_IsHintLinked(inherited IsHintLinked, Action, FClient);
638end;
639
640procedure TTntListViewActionLink.SetCaption(const Value: string{TNT-ALLOW string});
641begin
642 TntActionLink_SetCaption(IsCaptionLinked, Action, FClient, Value);
643end;
644
645procedure TTntListViewActionLink.SetHint(const Value: string{TNT-ALLOW string});
646begin
647 TntActionLink_SetHint(IsHintLinked, Action, FClient, Value);
648end;
649
650{ TTntComboBoxExActionLink }
651
652function TTntComboBoxExActionLink.IsCaptionLinked: Boolean;
653begin
654 Result := TntActionLink_IsCaptionLinked(inherited IsCaptionLinked, Action, FClient);
655end;
656
657function TTntComboBoxExActionLink.IsHintLinked: Boolean;
658begin
659 Result := TntActionLink_IsHintLinked(inherited IsHintLinked, Action, FClient);
660end;
661
662procedure TTntComboBoxExActionLink.SetCaption(const Value: string{TNT-ALLOW string});
663begin
664 TntActionLink_SetCaption(IsCaptionLinked, Action, FClient, Value);
665end;
666
667procedure TTntComboBoxExActionLink.SetHint(const Value: string{TNT-ALLOW string});
668begin
669 TntActionLink_SetHint(IsHintLinked, Action, FClient, Value);
670end;
671
672{ TTntSpeedButtonActionLink }
673
674function TTntSpeedButtonActionLink.IsCaptionLinked: Boolean;
675begin
676 Result := TntActionLink_IsCaptionLinked(inherited IsCaptionLinked, Action, FClient);
677end;
678
679function TTntSpeedButtonActionLink.IsHintLinked: Boolean;
680begin
681 Result := TntActionLink_IsHintLinked(inherited IsHintLinked, Action, FClient);
682end;
683
684procedure TTntSpeedButtonActionLink.SetCaption(const Value: string{TNT-ALLOW string});
685begin
686 TntActionLink_SetCaption(IsCaptionLinked, Action, FClient, Value);
687end;
688
689procedure TTntSpeedButtonActionLink.SetHint(const Value: string{TNT-ALLOW string});
690begin
691 TntActionLink_SetHint(IsHintLinked, Action, FClient, Value);
692end;
693
694{$IFDEF COMPILER_10_UP}
695// bug fix for VCL where ImageIndex on Action ALWAYS overrides the Glyph.
696
697function TTntSpeedButtonActionLink.IsImageIndexLinked: Boolean;
698begin
699 Result := Action is TCustomAction{TNT-ALLOW TCustomAction}; // taken from TActionLink.IsImageIndexLinked
700end;
701
702procedure TTntSpeedButtonActionLink.SetImageIndex(Value: Integer);
703begin
704 ; // taken from TActionLink.IsImageIndexLinked
705end;
706{$ENDIF}
707
708{$IFDEF COMPILER_10_UP}
709{ TTntBitBtnActionLink }
710
711function TTntBitBtnActionLink.IsCaptionLinked: Boolean;
712begin
713 Result := TntActionLink_IsCaptionLinked(inherited IsCaptionLinked, Action, FClient);
714end;
715
716function TTntBitBtnActionLink.IsHintLinked: Boolean;
717begin
718 Result := TntActionLink_IsHintLinked(inherited IsHintLinked, Action, FClient);
719end;
720
721procedure TTntBitBtnActionLink.SetCaption(const Value: string{TNT-ALLOW string});
722begin
723 TntActionLink_SetCaption(IsCaptionLinked, Action, FClient, Value);
724end;
725
726procedure TTntBitBtnActionLink.SetHint(const Value: string{TNT-ALLOW string});
727begin
728 TntActionLink_SetHint(IsHintLinked, Action, FClient, Value);
729end;
730
731{$IFDEF COMPILER_10_UP}
732// bug fix for VCL where ImageIndex on Action ALWAYS overrides the Glyph.
733
734function TTntBitBtnActionLink.IsImageIndexLinked: Boolean;
735begin
736 Result := Action is TCustomAction{TNT-ALLOW TCustomAction}; // taken from TActionLink.IsImageIndexLinked
737end;
738
739procedure TTntBitBtnActionLink.SetImageIndex(Value: Integer);
740begin
741 ; // taken from TActionLink.IsImageIndexLinked
742end;
743{$ENDIF}
744
745{$ENDIF}
746
747{ TTntToolButtonActionLink }
748
749function TTntToolButtonActionLink.IsCaptionLinked: Boolean;
750begin
751 Result := TntActionLink_IsCaptionLinked(inherited IsCaptionLinked, Action, FClient);
752end;
753
754function TTntToolButtonActionLink.IsHintLinked: Boolean;
755begin
756 Result := TntActionLink_IsHintLinked(inherited IsHintLinked, Action, FClient);
757end;
758
759procedure TTntToolButtonActionLink.SetCaption(const Value: string{TNT-ALLOW string});
760begin
761 TntActionLink_SetCaption(IsCaptionLinked, Action, FClient, Value);
762end;
763
764procedure TTntToolButtonActionLink.SetHint(const Value: string{TNT-ALLOW string});
765begin
766 TntActionLink_SetHint(IsHintLinked, Action, FClient, Value);
767end;
768
769{ TTntButtonActionLink }
770
771function TTntButtonActionLink.IsCaptionLinked: Boolean;
772begin
773 Result := TntActionLink_IsCaptionLinked(inherited IsCaptionLinked, Action, FClient);
774end;
775
776function TTntButtonActionLink.IsHintLinked: Boolean;
777begin
778 Result := TntActionLink_IsHintLinked(inherited IsHintLinked, Action, FClient);
779end;
780
781procedure TTntButtonActionLink.SetCaption(const Value: string{TNT-ALLOW string});
782begin
783 TntActionLink_SetCaption(IsCaptionLinked, Action, FClient, Value);
784end;
785
786procedure TTntButtonActionLink.SetHint(const Value: string{TNT-ALLOW string});
787begin
788 TntActionLink_SetHint(IsHintLinked, Action, FClient, Value);
789end;
790
791{ TTntWinControlActionLink }
792
793function TTntWinControlActionLink.IsCaptionLinked: Boolean;
794begin
795 Result := TntActionLink_IsCaptionLinked(inherited IsCaptionLinked, Action, FClient);
796end;
797
798function TTntWinControlActionLink.IsHintLinked: Boolean;
799begin
800 Result := TntActionLink_IsHintLinked(inherited IsHintLinked, Action, FClient);
801end;
802
803procedure TTntWinControlActionLink.SetCaption(const Value: string{TNT-ALLOW string});
804begin
805 TntActionLink_SetCaption(IsCaptionLinked, Action, FClient, Value);
806end;
807
808procedure TTntWinControlActionLink.SetHint(const Value: string{TNT-ALLOW string});
809begin
810 TntActionLink_SetHint(IsHintLinked, Action, FClient, Value);
811end;
812
813{ TTntControlActionLink }
814
815function TTntControlActionLink.IsCaptionLinked: Boolean;
816begin
817 Result := TntActionLink_IsCaptionLinked(inherited IsCaptionLinked, Action, FClient);
818end;
819
820function TTntControlActionLink.IsHintLinked: Boolean;
821begin
822 Result := TntActionLink_IsHintLinked(inherited IsHintLinked, Action, FClient);
823end;
824
825procedure TTntControlActionLink.SetCaption(const Value: string{TNT-ALLOW string});
826begin
827 TntActionLink_SetCaption(IsCaptionLinked, Action, FClient, Value);
828end;
829
830procedure TTntControlActionLink.SetHint(const Value: string{TNT-ALLOW string});
831begin
832 TntActionLink_SetHint(IsHintLinked, Action, FClient, Value);
833end;
834
835end.
Note: See TracBrowser for help on using the repository browser.