Changeset 4 for trunk/Forms/UItemEdit.pas
- Timestamp:
- Jun 3, 2010, 5:25:10 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UItemEdit.pas
r3 r4 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, 9 StdCtrls, USqlDatabase;9 StdCtrls, Spin, EditBtn, USqlDatabase; 10 10 11 11 type … … 70 70 Column: Integer; 71 71 ObjectInfo: TDbRows; 72 ValueType: Integer; 72 73 const 73 74 ColumnCount = 2; … … 95 96 TLabel(NewControl).Caption := Properties[I].Values['Name'] + ':'; 96 97 97 NewControl := TEdit.Create(Panel1); 98 NewControl.Parent := Panel1; 99 NewControl.Top := LastTop; 100 NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2; 101 TEdit(NewControl).Text := Values[0].Values[Properties[I].Values['ColumnName']]; 102 TEdit(NewControl).Width := (Width div ColumnCount) div 2 - 20; 98 ValueType := StrToInt(Properties[I].Values['Type']); 99 if ValueType = Integer(vtInteger) then begin 100 NewControl := TSpinEdit.Create(Panel1); 101 NewControl.Parent := Panel1; 102 NewControl.Top := LastTop; 103 NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2; 104 TSpinEdit(NewControl).Value := StrToInt(Values[0].Values[Properties[I].Values['ColumnName']]); 105 TSpinEdit(NewControl).Width := (Width div ColumnCount) div 2 - 20; 106 end else 107 if ValueType = Integer(vtDate) then begin 108 NewControl := TDateEdit.Create(Panel1); 109 NewControl.Parent := Panel1; 110 NewControl.Top := LastTop; 111 NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2; 112 TDateEdit(NewControl).Date := StrToDate(Values[0].Values[Properties[I].Values['ColumnName']]); 113 TDateEdit(NewControl).Width := (Width div ColumnCount) div 2 - 20; 114 end else 115 if ValueType = Integer(vtFloat) then begin 116 NewControl := TFloatSpinEdit.Create(Panel1); 117 NewControl.Parent := Panel1; 118 NewControl.Top := LastTop; 119 NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2; 120 TFloatSpinEdit(NewControl).Value := StrToFloat(Values[0].Values[Properties[I].Values['ColumnName']]); 121 TFloatSpinEdit(NewControl).Width := (Width div ColumnCount) div 2 - 20; 122 end else 123 if ValueType = Integer(vtString) then begin 124 NewControl := TEdit.Create(Panel1); 125 NewControl.Parent := Panel1; 126 NewControl.Top := LastTop; 127 NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2; 128 TEdit(NewControl).Text := Values[0].Values[Properties[I].Values['ColumnName']]; 129 TEdit(NewControl).Width := (Width div ColumnCount) div 2 - 20; 130 end; 103 131 104 132 Column := (Column + 1) mod 2;
Note:
See TracChangeset
for help on using the changeset viewer.