exctrls/exquestiondlg: Parameterize some distances and make them high-dpi aware.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8156 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2021-11-23 18:09:36 +00:00
parent 007e6e7dc9
commit 5e350b0270

View File

@ -67,10 +67,13 @@ uses
TypInfo, Math; TypInfo, Math;
const const
DEFAULT_IMAGE_SIZE = 32;
DEFAULT_IMAGE_BORDER_X = 10; DEFAULT_IMAGE_BORDER_X = 10;
DEFAULT_IMAGE_BORDER_Y = 5; DEFAULT_IMAGE_BORDER_Y = 5;
DEFAULT_TEXT_BORDER_X = 10; DEFAULT_TEXT_BORDER_X = 10;
DEFAULT_TEXT_BORDER_Y = 10; DEFAULT_TEXT_BORDER_Y = 10;
BUTTON_MIN_WIDTH = 75;
BUTTON_SPACING = 6;
function GetBKType(str:string):TBitBtnKind; function GetBKType(str:string):TBitBtnKind;
var var
@ -192,12 +195,12 @@ begin
btn.OnClick := @HelpClickHandler; btn.OnClick := @HelpClickHandler;
if trim(btnParams[i].Caption) <> '' then if trim(btnParams[i].Caption) <> '' then
btn.Caption := btnParams[i].Caption; btn.Caption := btnParams[i].Caption;
btn.Constraints.MinWidth := 75; btn.Constraints.MinWidth := Scale96ToFont(BUTTON_MIN_WIDTH);
btn.Cancel := (btnParams[i].IsDefaultOrCancel = 2); btn.Cancel := (btnParams[i].IsDefaultOrCancel = 2);
btn.Default := (btnParams[i].IsDefaultOrCancel = 1); btn.Default := (btnParams[i].IsDefaultOrCancel = 1);
if btn.Default then ActiveControl := btn; if btn.Default then ActiveControl := btn;
btn.AutoSize := true; btn.AutoSize := true;
btn.BorderSpacing.Around := 6; btn.BorderSpacing.Around := Scale96ToFont(BUTTON_SPACING);
if i = 0 then if i = 0 then
btn.AnchorSideLeft.Control := FInnerButtonPanel btn.AnchorSideLeft.Control := FInnerButtonPanel
else else
@ -358,7 +361,7 @@ begin
if Assigned(FImage) then if Assigned(FImage) then
imgHeight := FImage.Height imgHeight := FImage.Height
else else
imgHeight := 32; imgHeight := Scale96ToFont(DEFAULT_IMAGE_SIZE);
if (AHeight < 2*FImageBorder.CY + imgHeight) then if (AHeight < 2*FImageBorder.CY + imgHeight) then
AHeight := 2*FImageBorder.CY + imgHeight; AHeight := 2*FImageBorder.CY + imgHeight;
if AHeight < QuestionDlgEx_MinHeight then if AHeight < QuestionDlgEx_MinHeight then