Give side-by-side group boxes on text import dialog the same width

This commit is contained in:
Ansgar Becker
2018-08-18 18:02:59 +02:00
parent 6196893ef3
commit 71dbb9ecb0
2 changed files with 20 additions and 0 deletions

View File

@ -17,6 +17,7 @@ object loaddataform: Tloaddataform
OnClose = FormClose
OnCreate = FormCreate
OnDestroy = FormDestroy
OnResize = FormResize
OnShow = FormShow
DesignSize = (
509

View File

@ -69,6 +69,7 @@ type
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure chklistColumnsClick(Sender: TObject);
procedure btnCheckAllClick(Sender: TObject);
procedure FormResize(Sender: TObject);
private
{ Private declarations }
Encoding: TEncoding;
@ -134,6 +135,24 @@ begin
end;
procedure Tloaddataform.FormResize(Sender: TObject);
var
HalfWidth, RightBoxX: Integer;
begin
// Rethink width of side-by-side group boxes
HalfWidth := (ClientWidth - 3 * grpFilename.Left) div 2;
RightBoxX := HalfWidth + 2 * grpFilename.Left;
grpOptions.Width := HalfWidth;
grpDuplicates.Width := HalfWidth;
grpParseMethod.Width := HalfWidth;
grpChars.Width := HalfWidth;
grpDestination.Width := HalfWidth;
// Move right boxes to the right position
grpChars.Left := RightBoxX;
grpDestination.Left := RightBoxX;
end;
procedure Tloaddataform.FormShow(Sender: TObject);
begin
FConnection := MainForm.ActiveConnection;