Skip to content

Commit

Permalink
Anchor controls to each other.
Browse files Browse the repository at this point in the history
  • Loading branch information
wp-xyz committed Nov 3, 2024
1 parent 85ced84 commit 0cce7c1
Show file tree
Hide file tree
Showing 10 changed files with 237 additions and 80 deletions.
2 changes: 1 addition & 1 deletion source/dlListViewDialog.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ object ListViewForm: TListViewForm
Caption = 'ListViewForm'
ClientHeight = 327
ClientWidth = 413
LCLVersion = '4.99.0.0'
OnShow = FormShow
LCLVersion = '2.3.0.0'
object Panel_ListView: TPanel
Left = 0
Height = 289
Expand Down
8 changes: 4 additions & 4 deletions source/dlSerialPortSettings.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ object SerPortForm: TSerPortForm
Caption = 'Device and serial port settings'
ClientHeight = 362
ClientWidth = 326
Position = poMainFormCenter
LCLVersion = '4.99.0.0'
OnActivate = FormActivate
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
OnDestroy = FormDestroy
Position = poMainFormCenter
LCLVersion = '2.3.0.0'
object MainPanel: TPanel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
Expand Down Expand Up @@ -260,9 +260,9 @@ object SerPortForm: TSerPortForm
Items.Strings = (
''
)
OnChange = CbDeviceChange
Style = csDropDownList
TabOrder = 1
OnChange = CbDeviceChange
end
object RgHandshake: TRadioGroup
AnchorSideLeft.Control = CbDevice
Expand Down Expand Up @@ -345,7 +345,7 @@ object SerPortForm: TSerPortForm
Left = 156
Height = 23
Top = 217
Width = 73
Width = 84
Alignment = taRightJustify
BorderSpacing.Top = 2
MaxValue = 6
Expand Down
7 changes: 6 additions & 1 deletion source/dlSerialPortSettings.pas
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ TSerPortForm = class(TForm)
procedure FormDestroy(Sender: TObject);
private
{ private declarations }
FActivated: Boolean;
FPresets: TSerPresetList;
FPrevPresetItem: TSerPresetItem;
FPrevIndex: integer;
Expand Down Expand Up @@ -278,7 +279,11 @@ procedure TSerPortForm.CbDeviceChange(Sender: TObject);

procedure TSerPortForm.FormActivate(Sender: TObject);
begin
Constraints.MinHeight := MainPanel.Height + ButtonPanel.Height;
if not FActivated then
begin
FActivated := true;
Constraints.MinHeight := MainPanel.Height + ButtonPanel.Height;
end;
end;

procedure TSerPortForm.FormCloseQuery(Sender: TObject; var CanClose: boolean);
Expand Down
4 changes: 3 additions & 1 deletion source/dlTimeOffsetDialog.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ inherited TimeOffsetForm: TTimeOffsetForm
inherited BtnOK: TBitBtn
Left = 272
Default = False
TabOrder = 1
end
inherited BtnCancel: TBitBtn
Left = 344
Cancel = False
TabOrder = 2
end
object EdOffset: TFloatSpinEdit[2]
AnchorSideLeft.Control = LblTimeOffset
Expand All @@ -54,8 +56,8 @@ inherited TimeOffsetForm: TTimeOffsetForm
BorderSpacing.Right = 8
MaxValue = 1E308
MinValue = -1E308
TabOrder = 0
OnChange = EdOffsetChange
TabOrder = 2
end
object LblTimeOffset: TLabel[3]
AnchorSideLeft.Control = Panel_Buttons
Expand Down
Loading

0 comments on commit 0cce7c1

Please sign in to comment.