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 OnClose = FormClose
OnCreate = FormCreate OnCreate = FormCreate
OnDestroy = FormDestroy OnDestroy = FormDestroy
OnResize = FormResize
OnShow = FormShow OnShow = FormShow
DesignSize = ( DesignSize = (
509 509

View File

@ -69,6 +69,7 @@ type
procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure chklistColumnsClick(Sender: TObject); procedure chklistColumnsClick(Sender: TObject);
procedure btnCheckAllClick(Sender: TObject); procedure btnCheckAllClick(Sender: TObject);
procedure FormResize(Sender: TObject);
private private
{ Private declarations } { Private declarations }
Encoding: TEncoding; Encoding: TEncoding;
@ -134,6 +135,24 @@ begin
end; 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); procedure Tloaddataform.FormShow(Sender: TObject);
begin begin
FConnection := MainForm.ActiveConnection; FConnection := MainForm.ActiveConnection;