Changeset 20 for trunk/Application/UDataTypes.pas
- Timestamp:
- Jun 15, 2011, 11:11:59 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/UDataTypes.pas
r17 r20 107 107 end; 108 108 109 TDataTypeDateTime = class(TDataType) 110 Value: TDateTime; 111 Default: TDateTime; 112 Min: TDateTime; 113 Max: TDateTime; 114 function CreateControl(Owner: TComponent): TWinControl; override; 115 function GetControlValue(Control: TWinControl): string; override; 116 procedure SetupControl(Control: TWinControl); override; 117 procedure Load(CellValue: string); override; 118 end; 119 109 120 { TDataTypeFloat } 110 121 … … 147 158 Result := TDataTypeDate.Create; 148 159 end else 160 if BaseType = Integer(vtDateTime) then begin 161 Result := TDataTypeDateTime.Create; 162 end else 149 163 if BaseType = Integer(vtFloat) then begin 150 164 Result := TDataTypeFloat.Create; … … 168 182 end; 169 183 Result.CustomType := ACustomType; 184 end; 185 186 { TDataTypeDateTime } 187 188 function TDataTypeDateTime.CreateControl(Owner: TComponent): TWinControl; 189 begin 190 Result := TDateEdit.Create(Owner); 191 end; 192 193 function TDataTypeDateTime.GetControlValue(Control: TWinControl): string; 194 begin 195 Result := DateTimeToSQL(TDateEdit(Control).Date); 196 end; 197 198 procedure TDataTypeDateTime.SetupControl(Control: TWinControl); 199 begin 200 TDateEdit(Control).Date := Value; 201 end; 202 203 procedure TDataTypeDateTime.Load(CellValue: string); 204 begin 205 Value := SQLToDateTime(CellValue); 170 206 end; 171 207
Note:
See TracChangeset
for help on using the changeset viewer.