Ignore:
Timestamp:
Jan 18, 2015, 11:41:05 PM (10 years ago)
Author:
chronos
Message:
  • Added: Support for float type.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormField.pas

    r4 r5  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ComCtrls, EditBtn, UDatabase;
     9  ComCtrls, EditBtn, Spin, UDatabase;
    1010
    1111type
     
    2323    EditTextBefore: TEdit;
    2424    EditTextAfter: TEdit;
     25    FloatSpinEditMin: TFloatSpinEdit;
     26    FloatSpinEditMax: TFloatSpinEdit;
    2527    Label1: TLabel;
     28    Label10: TLabel;
     29    Label11: TLabel;
    2630    Label2: TLabel;
    2731    Label3: TLabel;
     
    3034    Label6: TLabel;
    3135    Label7: TLabel;
     36    Label8: TLabel;
     37    Label9: TLabel;
    3238    PageControl1: TPageControl;
     39    SpinEditMin: TSpinEdit;
     40    SpinEditMax: TSpinEdit;
     41    TabSheetFloat: TTabSheet;
    3342    TabSheetDateTime: TTabSheet;
    3443    TabSheetInteger: TTabSheet;
     
    8897    DateEditMax.Date := TFieldDateTime(Field.TypeRelated).Max;
    8998  end;
     99  if Field.FieldType = ftInteger then begin
     100    SpinEditMin.Value := TFieldInteger(Field.TypeRelated).Min;
     101    SpinEditMax.Value := TFieldInteger(Field.TypeRelated).Max;
     102  end;
     103  if Field.FieldType = ftFloat then begin
     104    FloatSpinEditMin.Value := TFieldFloat(Field.TypeRelated).Min;
     105    FloatSpinEditMax.Value := TFieldFloat(Field.TypeRelated).Max;
     106  end;
    90107end;
    91108
     
    102119    TFieldDateTime(Field.TypeRelated).Max := DateEditMax.Date;
    103120  end;
     121  if Field.FieldType = ftInteger then begin
     122    TFieldInteger(Field.TypeRelated).Min := SpinEditMin.Value;
     123    TFieldInteger(Field.TypeRelated).Max := SpinEditMax.Value;
     124  end;
     125  if Field.FieldType = ftFloat then begin
     126    TFieldFloat(Field.TypeRelated).Min := FloatSpinEditMin.Value;
     127    TFieldFloat(Field.TypeRelated).Max := FloatSpinEditMax.Value;
     128  end;
    104129end;
    105130
Note: See TracChangeset for help on using the changeset viewer.