Changeset 3 for trunk/Forms/UFormField.pas
- Timestamp:
- Jan 18, 2015, 5:25:37 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 3 3 MyData.lps 4 4 data.xml 5 Config.xml
-
- Property svn:ignore
-
trunk/Forms/UFormField.pas
r2 r3 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 UDatabase;9 ComCtrls, EditBtn, UDatabase; 10 10 11 11 type … … 17 17 ButtonCancel: TButton; 18 18 ComboBoxType: TComboBox; 19 DateEditMin: TDateEdit; 20 DateEditMax: TDateEdit; 19 21 EditName: TEdit; 22 EditStringDefault: TEdit; 20 23 EditTextBefore: TEdit; 21 24 EditTextAfter: TEdit; … … 24 27 Label3: TLabel; 25 28 Label4: TLabel; 29 Label5: TLabel; 30 Label6: TLabel; 31 Label7: TLabel; 32 PageControl1: TPageControl; 33 TabSheetDateTime: TTabSheet; 34 TabSheetInteger: TTabSheet; 35 TabSheetString: TTabSheet; 36 TabSheetBoolean: TTabSheet; 37 procedure ComboBoxTypeChange(Sender: TObject); 26 38 procedure FormCreate(Sender: TObject); 27 39 procedure FormShow(Sender: TObject); … … 55 67 end; 56 68 69 procedure TFormField.ComboBoxTypeChange(Sender: TObject); 70 begin 71 PageControl1.TabIndex := ComboBoxType.ItemIndex; 72 end; 73 57 74 procedure TFormField.Load(Field: TField); 58 75 begin … … 61 78 EditTextBefore.Text := Field.TextBefore; 62 79 ComboBoxType.ItemIndex := Integer(Field.FieldType); 80 ComboBoxTypeChange(Self); 81 if Field.FieldType = ftString then 82 EditStringDefault.Text := TFieldString(Field.TypeRelated).DefaultValue; 83 if Field.FieldType = ftDateTime then begin 84 DateEditMin.Date := TFieldDateTime(Field.TypeRelated).Min; 85 DateEditMax.Date := TFieldDateTime(Field.TypeRelated).Max; 86 end; 63 87 end; 64 88 … … 69 93 Field.TextAfter := EditTextAfter.Text; 70 94 Field.FieldType := TFieldType(ComboBoxType.ItemIndex); 95 if Field.FieldType = ftString then 96 TFieldString(Field.TypeRelated).DefaultValue := EditStringDefault.Text; 97 if Field.FieldType = ftDateTime then begin 98 TFieldDateTime(Field.TypeRelated).Min := DateEditMin.Date; 99 TFieldDateTime(Field.TypeRelated).Max := DateEditMax.Date; 100 end; 71 101 end; 72 102
Note:
See TracChangeset
for help on using the changeset viewer.