tvplanit: Fix button widths in wavdlg for higher dpi

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5023 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-07-21 23:02:08 +00:00
parent 9e7605f4f6
commit 4f4b878e17
2 changed files with 15 additions and 3 deletions

View File

@ -56,7 +56,7 @@ object FrmSoundDialog: TFrmSoundDialog
TabOrder = 0
end
end
object Panel2: TPanel
object ButtonPanel: TPanel
Left = 0
Height = 38
Top = 408

View File

@ -51,7 +51,7 @@ type
Label3: TLabel;
PageControl1: TPageControl;
Panel1: TPanel;
Panel2: TPanel;
ButtonPanel: TPanel;
Panel3: TPanel;
Panel4: TPanel;
RightPanel: TPanel;
@ -86,7 +86,8 @@ type
implementation
uses
VpSR;
Math,
VpSR, VpMisc;
{$IFDEF LCL}
{$R *.lfm}
@ -156,6 +157,9 @@ begin
end;
procedure TFrmSoundDialog.Populate;
var
DIST: Integer = 8;
HBORDER: Integer = 8;
begin
TabSheet1.Caption := RSSelectASound;
Self.Caption := RSSoundFinder;
@ -164,6 +168,14 @@ begin
CancelBtn.Caption := RSCancelBtn;
Label3.Caption := RSNothingToSelectFrom;
Label4.Caption := RSNothingToSelectFrom;
DIST := ScaleX(DIST, DesignTimeDPI);
HBORDER := ScaleX(HBORDER, DesignTimeDPI);
OKBtn.Width := Max(GetButtonWidth(OKBtn), GetButtonWidth(CancelBtn));
CancelBtn.Width := OKBtn.Width;
CancelBtn.Left := ButtonPanel.ClientWidth - HBORDER - CancelBtn.Width;
OKBtn.Left := CancelBtn.Left - DIST - OKBtn.Width;
if DingPath = '' then begin
CBDefault.Checked := true;
if (MediaFolder <> '') and DirectoryExists(MediaFolder) then