Changeset 321


Ignore:
Timestamp:
Jun 25, 2024, 1:00:56 AM (6 months ago)
Author:
chronos
Message:
  • Added: Create FormItem controls inside scrollbox.
Location:
trunk/Forms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormItem.lfm

    r317 r321  
    11object FormItem: TFormItem
    22  Left = 1040
    3   Height = 360
     3  Height = 397
    44  Top = 540
    5   Width = 480
     5  Width = 469
    66  Caption = 'Item'
    7   ClientHeight = 360
    8   ClientWidth = 480
     7  ClientHeight = 397
     8  ClientWidth = 469
    99  DesignTimePPI = 144
    1010  OnCreate = FormCreate
     
    1212  LCLVersion = '3.4.0.0'
    1313  object ButtonOk: TButton
    14     Left = 89
     14    Left = 344
    1515    Height = 38
    16     Top = 312
     16    Top = 353
    1717    Width = 113
    18     Anchors = [akLeft, akBottom]
     18    Anchors = [akRight, akBottom]
    1919    Caption = 'OK'
    2020    ModalResult = 1
     
    2424  end
    2525  object ButtonCancel: TButton
    26     Left = 264
     26    Left = 208
    2727    Height = 38
    28     Top = 312
     28    Top = 353
    2929    Width = 113
    30     Anchors = [akLeft, akBottom]
     30    Anchors = [akRight, akBottom]
    3131    Caption = 'Cancel'
    3232    ModalResult = 2
     
    3434    TabOrder = 1
    3535  end
     36  object ScrollBox1: TScrollBox
     37    Left = 8
     38    Height = 334
     39    Top = 8
     40    Width = 453
     41    HorzScrollBar.Page = 1
     42    VertScrollBar.Page = 1
     43    Anchors = [akTop, akLeft, akRight, akBottom]
     44    TabOrder = 2
     45  end
    3646end
  • 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.