initial commit
[rofl0r-TntUnicode.git] / Source / TntListActns.pas
blob00601c044929656e53dc65fd94d0469fa76d1741
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 {*****************************************************************************}
12 unit TntListActns;
14 {$INCLUDE TntCompilers.inc}
16 interface
18 uses
19 Classes, TntActnList, ListActns;
21 type
22 {TNT-WARN TCustomListAction}
23 TTntCustomListAction = class(TCustomListAction{TNT-ALLOW TCustomListAction}, ITntAction)
24 private
25 function GetCaption: WideString;
26 procedure SetCaption(const Value: WideString);
27 function GetHint: WideString;
28 procedure SetHint(const Value: WideString);
29 protected
30 procedure DefineProperties(Filer: TFiler); override;
31 public
32 procedure Assign(Source: TPersistent); override;
33 public
34 property Caption: WideString read GetCaption write SetCaption;
35 property Hint: WideString read GetHint write SetHint;
36 end;
38 {TNT-WARN TStaticListAction}
39 TTntStaticListAction = class(TStaticListAction{TNT-ALLOW TStaticListAction}, ITntAction)
40 private
41 function GetCaption: WideString;
42 procedure SetCaption(const Value: WideString);
43 function GetHint: WideString;
44 procedure SetHint(const Value: WideString);
45 protected
46 procedure DefineProperties(Filer: TFiler); override;
47 public
48 procedure Assign(Source: TPersistent); override;
49 published
50 property Caption: WideString read GetCaption write SetCaption;
51 property Hint: WideString read GetHint write SetHint;
52 end;
54 {TNT-WARN TVirtualListAction}
55 TTntVirtualListAction = class(TVirtualListAction{TNT-ALLOW TVirtualListAction}, ITntAction)
56 private
57 function GetCaption: WideString;
58 procedure SetCaption(const Value: WideString);
59 function GetHint: WideString;
60 procedure SetHint(const Value: WideString);
61 protected
62 procedure DefineProperties(Filer: TFiler); override;
63 public
64 procedure Assign(Source: TPersistent); override;
65 published
66 property Caption: WideString read GetCaption write SetCaption;
67 property Hint: WideString read GetHint write SetHint;
68 end;
70 implementation
72 uses
73 ActnList, TntClasses;
75 {TNT-IGNORE-UNIT}
77 type TAccessCustomListAction = class(TCustomListAction);
79 procedure TntListActn_AfterInherited_Assign(Action: TCustomAction{TNT-ALLOW TCustomAction}; Source: TPersistent);
80 begin
81 TntAction_AfterInherited_Assign(Action, Source);
82 // TCustomListAction
83 if (Action is TCustomListAction) and (Source is TCustomListAction) then begin
84 TAccessCustomListAction(Action).Images := TAccessCustomListAction(Source).Images;
85 TAccessCustomListAction(Action).OnGetItemCount := TAccessCustomListAction(Source).OnGetItemCount;
86 TAccessCustomListAction(Action).OnItemSelected := TAccessCustomListAction(Source).OnItemSelected;
87 TAccessCustomListAction(Action).Active := TAccessCustomListAction(Source).Active;
88 TAccessCustomListAction(Action).ItemIndex := TAccessCustomListAction(Source).ItemIndex;
89 end;
90 // TStaticListAction
91 if (Action is TStaticListAction) and (Source is TStaticListAction) then begin
92 TStaticListAction(Action).Items := TStaticListAction(Source).Items;
93 TStaticListAction(Action).OnGetItem := TStaticListAction(Source).OnGetItem;
94 end;
95 // TVirtualListAction
96 if (Action is TVirtualListAction) and (Source is TVirtualListAction) then begin
97 TVirtualListAction(Action).OnGetItem := TVirtualListAction(Source).OnGetItem;
98 end;
99 end;
101 //-------------------------
102 // TNT LIST ACTNS
103 //-------------------------
105 { TTntCustomListAction }
107 procedure TTntCustomListAction.Assign(Source: TPersistent);
108 begin
109 inherited;
110 TntListActn_AfterInherited_Assign(Self, Source);
111 end;
113 procedure TTntCustomListAction.DefineProperties(Filer: TFiler);
114 begin
115 inherited;
116 TntPersistent_AfterInherited_DefineProperties(Filer, Self);
117 end;
119 function TTntCustomListAction.GetCaption: WideString;
120 begin
121 Result := TntAction_GetCaption(Self);
122 end;
124 procedure TTntCustomListAction.SetCaption(const Value: WideString);
125 begin
126 TntAction_SetCaption(Self, Value);
127 end;
129 function TTntCustomListAction.GetHint: WideString;
130 begin
131 Result := TntAction_GetHint(Self);
132 end;
134 procedure TTntCustomListAction.SetHint(const Value: WideString);
135 begin
136 TntAction_SetHint(Self, Value);
137 end;
139 { TTntStaticListAction }
141 procedure TTntStaticListAction.Assign(Source: TPersistent);
142 begin
143 inherited;
144 TntListActn_AfterInherited_Assign(Self, Source);
145 end;
147 procedure TTntStaticListAction.DefineProperties(Filer: TFiler);
148 begin
149 inherited;
150 TntPersistent_AfterInherited_DefineProperties(Filer, Self);
151 end;
153 function TTntStaticListAction.GetCaption: WideString;
154 begin
155 Result := TntAction_GetCaption(Self);
156 end;
158 procedure TTntStaticListAction.SetCaption(const Value: WideString);
159 begin
160 TntAction_SetCaption(Self, Value);
161 end;
163 function TTntStaticListAction.GetHint: WideString;
164 begin
165 Result := TntAction_GetHint(Self);
166 end;
168 procedure TTntStaticListAction.SetHint(const Value: WideString);
169 begin
170 TntAction_SetHint(Self, Value);
171 end;
173 { TTntVirtualListAction }
175 procedure TTntVirtualListAction.Assign(Source: TPersistent);
176 begin
177 inherited;
178 TntListActn_AfterInherited_Assign(Self, Source);
179 end;
181 procedure TTntVirtualListAction.DefineProperties(Filer: TFiler);
182 begin
183 inherited;
184 TntPersistent_AfterInherited_DefineProperties(Filer, Self);
185 end;
187 function TTntVirtualListAction.GetCaption: WideString;
188 begin
189 Result := TntAction_GetCaption(Self);
190 end;
192 procedure TTntVirtualListAction.SetCaption(const Value: WideString);
193 begin
194 TntAction_SetCaption(Self, Value);
195 end;
197 function TTntVirtualListAction.GetHint: WideString;
198 begin
199 Result := TntAction_GetHint(Self);
200 end;
202 procedure TTntVirtualListAction.SetHint(const Value: WideString);
203 begin
204 TntAction_SetHint(Self, Value);
205 end;
207 end.