Changeset 132 for trunk/Application
- Timestamp:
- Mar 18, 2022, 3:47:27 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/UWebObjects.pas
r130 r132 6 6 7 7 uses 8 Classes, SysUtils, UHtmlClasses, UXmlClasses, Specialized List, SpecializedDictionary;8 Classes, SysUtils, UHtmlClasses, UXmlClasses, SpecializedDictionary, fgl; 9 9 10 10 type 11 TListView = class12 13 end;14 15 11 TQueryFormItemType = (fitText, fitComboBox, fitRadioButton, fitSelect, fitPassword, 16 12 fitSubmit, fitReset, fitHidden, fitFileSelect, fitButton, fitCheckBox, fitTextArea); … … 38 34 { TQueryFormItemList } 39 35 40 TQueryFormItemList = class(T ListObject)36 TQueryFormItemList = class(TFPGObjectList<TQueryFormItem>) 41 37 function FindByName(AValue: string): TQueryFormItem; 42 38 end; … … 53 49 end; 54 50 51 TQueryFormGroups = class(TFPGObjectList<TQueryFormGroup>) 52 end; 53 55 54 TQueryAction = class 56 55 Caption: string; 57 56 Action: string; 57 end; 58 59 TQueryActions = class(TFPGObjectList<TQueryAction>) 58 60 end; 59 61 … … 63 65 public 64 66 Title: string; 65 Groups: T ListObject; // TListObject<TQueryFormGroup>66 Actions: T ListObject; // TListObject<TQueryAction>67 Groups: TQueryFormGroups; 68 Actions: TQueryActions; 67 69 ClassId: string; 68 70 function AddNewGroup: TQueryFormGroup; … … 72 74 destructor Destroy; override; 73 75 end; 76 74 77 75 78 implementation … … 122 125 destructor TQueryFormItem.Destroy; 123 126 begin 124 Value.Free;125 inherited Destroy;127 FreeAndNil(Value); 128 inherited; 126 129 end; 127 130 … … 189 192 function TQueryForm.AddNewGroup: TQueryFormGroup; 190 193 begin 191 Result := TQueryFormGroup(Groups.AddNew(TQueryFormGroup.Create)); 194 Result := TQueryFormGroup.Create; 195 Groups.Add(Result); 192 196 end; 193 197 194 198 function TQueryForm.AddNewAction(Caption, Action: string): TQueryAction; 195 199 begin 196 Result := TQueryAction (Actions.AddNew(TQueryAction.Create));200 Result := TQueryAction.Create; 197 201 Result.Caption := Caption; 198 202 Result.Action := Action; 203 Actions.Add(Result); 199 204 end; 200 205 … … 210 215 begin 211 216 inherited; 212 Actions := T ListObject.Create;213 Groups := T ListObject.Create;217 Actions := TQueryActions.Create; 218 Groups := TQueryFormGroups.Create; 214 219 Method := 'post'; 215 220 Action.AsString := ''; … … 218 223 destructor TQueryForm.Destroy; 219 224 begin 220 Actions.Free;221 Groups.Free;222 inherited Destroy;225 FreeAndNil(Actions); 226 FreeAndNil(Groups); 227 inherited; 223 228 end; 224 229 … … 238 243 function TQueryFormGroup.AddNewItem: TQueryFormItem; 239 244 begin 240 Result := TQueryFormItem(Rows.AddNew(TQueryFormItem.Create)); 245 Result := TQueryFormItem.Create; 246 Rows.Add(Result); 241 247 end; 242 248 … … 248 254 destructor TQueryFormGroup.Destroy; 249 255 begin 250 Rows.Free;251 inherited Destroy;256 FreeAndNil(Rows); 257 inherited; 252 258 end; 253 259
Note:
See TracChangeset
for help on using the changeset viewer.