Ignore:
Timestamp:
Jun 25, 2024, 1:00:56 AM (4 months ago)
Author:
chronos
Message:
  • Added: Create FormItem controls inside scrollbox.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormItem.pas

    r318 r321  
    1414    ButtonOk: TButton;
    1515    ButtonCancel: TButton;
     16    ScrollBox1: TScrollBox;
    1617    procedure ButtonOkClick(Sender: TObject);
    1718    procedure FormCreate(Sender: TObject);
     
    8485  Fields := Item.GetFields;
    8586  for I := 0 to Fields.Count - 1 do
    86   with TItemField(Fields[I]) do begin
     87  with Fields[I] do begin
    8788    Control := DataControls[I];
    8889    if DataType = dtInteger then TSpinEdit(Control).Value := Item.GetValueInteger(Index)
     
    129130  Fields := Item.GetFields;
    130131  for I := 0 to Fields.Count - 1 do
    131   with TItemField(Fields[I]) do begin
     132  with Fields[I] do begin
    132133    Control := DataControls[I];
    133134    if DataType = dtInteger then Item.SetValueInteger(Index, TSpinEdit(Control).Value)
     
    159160  Fields := Item.GetFields;
    160161  for I := 0 to Fields.Count - 1 do
    161   with TItemField(Fields[I]) do begin
    162     NewLabel := TLabel.Create(Self);
     162  with Fields[I] do begin
     163    NewLabel := TLabel.Create(ScrollBox1);
    163164    NewLabel.Left := Scale96ToScreen(8);
    164165    NewLabel.Top := Y;
    165     NewLabel.Parent := Self;
     166    NewLabel.Parent := ScrollBox1;
    166167    NewLabel.Caption := Name + ':';
    167168    NewLabel.Visible := True;
     
    200201    NewControl.Left := Scale96ToScreen(150);
    201202    NewControl.Top := Y;
    202     NewControl.Parent := Self;
     203    NewControl.Parent := ScrollBox1;
    203204    TFormEx.Translator.TranslateComponent(NewControl);
    204205    TFormEx.ThemeManager.ApplyTheme(NewControl);
     
    219220  try
    220221    for I := 0 to Fields.Count - 1 do
    221     with TItemField(Fields[I]) do begin
     222    with Fields[I] do begin
    222223      if VisibleIfIndex > 0 then begin
    223         if TItemField(Fields[VisibleIfIndex]).DataType = dtEnumeration then begin
     224        if Fields[VisibleIfIndex].DataType = dtEnumeration then begin
    224225          Condition := TComboBox(DataControls[VisibleIfIndex]).ItemIndex > 0;
    225226        end else Condition := False;
Note: See TracChangeset for help on using the changeset viewer.