mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 01:39:31 +02:00
added MinimumDialogButtonWidth/Height
git-svn-id: trunk@8924 -
This commit is contained in:
parent
b2be114279
commit
6b1811689a
@ -342,6 +342,9 @@ type
|
||||
property ToPage: Integer read FToPage write FToPage default 0;
|
||||
end;
|
||||
|
||||
const
|
||||
MinimumDialogButtonWidth: integer = 90;
|
||||
MinimumDialogButtonHeight: integer = 25;
|
||||
|
||||
{ MessageDlg }
|
||||
|
||||
|
@ -275,8 +275,8 @@ begin
|
||||
TextBox, DT_WORDBREAK or DT_INTERNAL or DT_CALCRECT);
|
||||
|
||||
// calculate the width we need to display the buttons
|
||||
MinBtnWidth:=75;
|
||||
MinBtnHeight:=25;
|
||||
MinBtnWidth:=Max(25,MinimumDialogButtonWidth);
|
||||
MinBtnHeight:=Max(15,MinimumDialogButtonHeight);
|
||||
reqBtnWidth := 0;
|
||||
|
||||
// create the buttons, without positioning
|
||||
@ -562,11 +562,9 @@ procedure TQuestionDlg.CalcButtonSize(AButton: TBitBtn; var w, h: Integer);
|
||||
var
|
||||
TxtSize: TSize;
|
||||
begin
|
||||
w:=length(AButton.Caption)*10;
|
||||
h:=25;
|
||||
TxtSize:=Canvas.TextExtent(AButton.Caption);
|
||||
w:=TxtSize.cx;
|
||||
h:=TxtSize.cy;
|
||||
w:=Max(TxtSize.cx,MinimumDialogButtonWidth);
|
||||
h:=Max(TxtSize.cy,MinimumDialogButtonHeight);
|
||||
if AButton.Kind<>bkCustom then begin
|
||||
inc(w,22); // icon
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user