Changeset 16 for trunk/Application/UDataTypes.pas
- Timestamp:
- Jun 13, 2011, 12:43:29 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/UDataTypes.pas
r15 r16 20 20 procedure LoadDef(CustomType: Integer); virtual; 21 21 procedure SetDefault; virtual; 22 function GetStringValue: string; virtual; 22 23 end; 23 24 … … 74 75 TDataTypeRelationOne = class(TDataType) 75 76 ObjectId: Integer; 77 SelectedItemName: string; 78 function CreateControl(Owner: TComponent): TWinControl; override; 79 procedure SetupControl(Control: TWinControl); override; 80 procedure Load(CellValue: string); override; 81 end; 82 83 { TDataTypeRelationMany } 84 85 TDataTypeRelationMany = class(TDataType) 86 ObjectId: Integer; 87 PropertyID: Integer; 88 SelectedItemName: string; 76 89 function CreateControl(Owner: TComponent): TWinControl; override; 77 90 procedure SetupControl(Control: TWinControl); override; … … 143 156 if BaseType = Integer(vtBoolean) then begin 144 157 Result := TDataTypeBoolean.Create; 158 end else 159 if BaseType = Integer(vtRelationOne) then begin 160 Result := TDataTypeRelationOne.Create; 161 end else 162 if BaseType = Integer(vtRelationMany) then begin 163 Result := TDataTypeRelationMany.Create; 145 164 end else begin 146 165 Result := TDataTypeString.Create; … … 149 168 end; 150 169 170 { TDataTypeRelationMany } 171 172 function TDataTypeRelationMany.CreateControl(Owner: TComponent): TWinControl; 173 begin 174 Result:=inherited CreateControl(Owner); 175 end; 176 177 procedure TDataTypeRelationMany.SetupControl(Control: TWinControl); 178 begin 179 inherited SetupControl(Control); 180 end; 181 182 procedure TDataTypeRelationMany.Load(CellValue: string); 183 begin 184 inherited Load(CellValue); 185 end; 186 151 187 { TDataTypeRelationOne } 152 188 153 189 function TDataTypeRelationOne.CreateControl(Owner: TComponent): TWinControl; 154 190 begin 155 Result:=inherited CreateControl(Owner); 191 Result := TEdit.Create(Owner); 192 TEdit(Result).Enabled := False; 156 193 end; 157 194 158 195 procedure TDataTypeRelationOne.SetupControl(Control: TWinControl); 159 196 begin 160 inherited SetupControl(Control);197 TEdit(Control).Text := SelectedItemName; 161 198 end; 162 199 163 200 procedure TDataTypeRelationOne.Load(CellValue: string); 164 201 begin 165 inherited Load(CellValue);202 SelectedItemName := CellValue; 166 203 end; 167 204 … … 333 370 end; 334 371 372 function TDataType.GetStringValue: string; 373 begin 374 Result := ''; 375 end; 376 335 377 end. 336 378
Note:
See TracChangeset
for help on using the changeset viewer.