Ignore:
Timestamp:
Jun 3, 2010, 5:25:10 PM (14 years ago)
Author:
george
Message:
  • Přidáno: Knihovna pro uchování stavu rozevření stromu.
  • Přidáno: Ikonky stromu skupin.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UItemEdit.pas

    r3 r4  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
    9   StdCtrls, USqlDatabase;
     9  StdCtrls, Spin, EditBtn, USqlDatabase;
    1010
    1111type
     
    7070  Column: Integer;
    7171  ObjectInfo: TDbRows;
     72  ValueType: Integer;
    7273const
    7374  ColumnCount = 2;
     
    9596      TLabel(NewControl).Caption := Properties[I].Values['Name'] + ':';
    9697
    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;
    103131
    104132      Column := (Column + 1) mod 2;
Note: See TracChangeset for help on using the changeset viewer.