Changeset 5 for trunk


Ignore:
Timestamp:
Jan 18, 2015, 11:41:05 PM (9 years ago)
Author:
chronos
Message:
  • Added: Support for float type.
Location:
trunk/Forms
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormField.lfm

    r3 r5  
    99  OnCreate = FormCreate
    1010  OnShow = FormShow
     11  Position = poMainFormCenter
    1112  LCLVersion = '1.3'
    1213  object EditName: TEdit
     
    9899    Top = 184
    99100    Width = 936
    100     ActivePage = TabSheetDateTime
     101    ActivePage = TabSheetFloat
    101102    Anchors = [akTop, akLeft, akRight, akBottom]
    102103    ShowTabs = False
    103     TabIndex = 2
     104    TabIndex = 4
    104105    TabOrder = 6
    105106    object TabSheetString: TTabSheet
     
    125126    object TabSheetInteger: TTabSheet
    126127      Caption = 'TabSheetInteger'
     128      ClientHeight = 194
     129      ClientWidth = 930
     130      object Label10: TLabel
     131        Left = 12
     132        Height = 25
     133        Top = 21
     134        Width = 96
     135        Caption = 'Minimum:'
     136        ParentColor = False
     137      end
     138      object SpinEditMin: TSpinEdit
     139        Left = 153
     140        Height = 35
     141        Top = 19
     142        Width = 255
     143        MaxValue = 10000000
     144        TabOrder = 0
     145      end
     146      object SpinEditMax: TSpinEdit
     147        Left = 153
     148        Height = 35
     149        Top = 56
     150        Width = 255
     151        TabOrder = 1
     152      end
     153      object Label11: TLabel
     154        Left = 12
     155        Height = 25
     156        Top = 58
     157        Width = 100
     158        Caption = 'Maximum:'
     159        ParentColor = False
     160      end
    127161    end
    128162    object TabSheetDateTime: TTabSheet
     
    178212      Caption = 'TabSheetBoolean'
    179213    end
     214    object TabSheetFloat: TTabSheet
     215      Caption = 'TabSheetFloat'
     216      ClientHeight = 194
     217      ClientWidth = 930
     218      object FloatSpinEditMin: TFloatSpinEdit
     219        Left = 144
     220        Height = 35
     221        Top = 16
     222        Width = 266
     223        Increment = 1
     224        MaxValue = 100000000
     225        MinValue = 0
     226        TabOrder = 0
     227        Value = 0
     228      end
     229      object Label8: TLabel
     230        Left = 8
     231        Height = 25
     232        Top = 25
     233        Width = 96
     234        Caption = 'Minimum:'
     235        ParentColor = False
     236      end
     237      object FloatSpinEditMax: TFloatSpinEdit
     238        Left = 144
     239        Height = 35
     240        Top = 64
     241        Width = 266
     242        Increment = 1
     243        MaxValue = 100
     244        MinValue = 0
     245        TabOrder = 1
     246        Value = 0
     247      end
     248      object Label9: TLabel
     249        Left = 8
     250        Height = 25
     251        Top = 73
     252        Width = 100
     253        Caption = 'Maximum:'
     254        ParentColor = False
     255      end
     256    end
    180257  end
    181258end
  • 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
  • trunk/Forms/UFormFields.lfm

    r4 r5  
    88  ClientWidth = 940
    99  OnShow = FormShow
     10  Position = poMainFormCenter
    1011  LCLVersion = '1.3'
    1112  object ToolBar1: TToolBar
  • trunk/Forms/UFormRecord.lfm

    r4 r5  
    1010  OnDestroy = FormDestroy
    1111  OnShow = FormShow
     12  Position = poMainFormCenter
    1213  LCLVersion = '1.3'
    1314  object Panel1: TPanel
  • trunk/Forms/UFormRecord.pas

    r4 r5  
    141141        Controls.Add(NewControl);
    142142      end;
     143      ftFloat: begin
     144        NewControl := TFloatSpinEdit.Create(Panel1);
     145        NewControl.Parent := Panel1;
     146        NewControl.Left := CellRect.Left;
     147        NewControl.Top := CellRect.Top + NewLabel.Height + 6;
     148        NewControl.Width := CellRect.Right - CellRect.Left;
     149        NewControl.Visible := True;
     150        TFloatSpinEdit(NewControl).Value := TValueFloat(Row.Values[I]).Value;
     151        Controls.Add(NewControl);
     152      end;
    143153    end;
    144154  end;
     
    155165      ftDateTime: TValueDateTime(Row.Values[I]).Value := TDateEdit(Controls[I]).Date;
    156166      ftBoolean: TValueBoolean(Row.Values[I]).Value := TCheckBox(Controls[I]).Checked;
     167      ftFloat: TValueFloat(Row.Values[I]).Value := TFloatSpinEdit(Controls[I]).Value;
    157168    end;
    158169  end;
  • trunk/Forms/UFormRecords.lfm

    r4 r5  
    88  ClientWidth = 859
    99  OnShow = FormShow
     10  Position = poMainFormCenter
    1011  LCLVersion = '1.3'
    1112  object ListView1: TListView
  • trunk/Forms/UFormTable.lfm

    r4 r5  
    77  ClientHeight = 351
    88  ClientWidth = 725
     9  Position = poMainFormCenter
    910  LCLVersion = '1.3'
    1011  object EditName: TEdit
Note: See TracChangeset for help on using the changeset viewer.