mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 20:39:09 +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;
|
property ToPage: Integer read FToPage write FToPage default 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
const
|
||||||
|
MinimumDialogButtonWidth: integer = 90;
|
||||||
|
MinimumDialogButtonHeight: integer = 25;
|
||||||
|
|
||||||
{ MessageDlg }
|
{ MessageDlg }
|
||||||
|
|
||||||
|
@ -275,8 +275,8 @@ begin
|
|||||||
TextBox, DT_WORDBREAK or DT_INTERNAL or DT_CALCRECT);
|
TextBox, DT_WORDBREAK or DT_INTERNAL or DT_CALCRECT);
|
||||||
|
|
||||||
// calculate the width we need to display the buttons
|
// calculate the width we need to display the buttons
|
||||||
MinBtnWidth:=75;
|
MinBtnWidth:=Max(25,MinimumDialogButtonWidth);
|
||||||
MinBtnHeight:=25;
|
MinBtnHeight:=Max(15,MinimumDialogButtonHeight);
|
||||||
reqBtnWidth := 0;
|
reqBtnWidth := 0;
|
||||||
|
|
||||||
// create the buttons, without positioning
|
// create the buttons, without positioning
|
||||||
@ -562,11 +562,9 @@ procedure TQuestionDlg.CalcButtonSize(AButton: TBitBtn; var w, h: Integer);
|
|||||||
var
|
var
|
||||||
TxtSize: TSize;
|
TxtSize: TSize;
|
||||||
begin
|
begin
|
||||||
w:=length(AButton.Caption)*10;
|
|
||||||
h:=25;
|
|
||||||
TxtSize:=Canvas.TextExtent(AButton.Caption);
|
TxtSize:=Canvas.TextExtent(AButton.Caption);
|
||||||
w:=TxtSize.cx;
|
w:=Max(TxtSize.cx,MinimumDialogButtonWidth);
|
||||||
h:=TxtSize.cy;
|
h:=Max(TxtSize.cy,MinimumDialogButtonHeight);
|
||||||
if AButton.Kind<>bkCustom then begin
|
if AButton.Kind<>bkCustom then begin
|
||||||
inc(w,22); // icon
|
inc(w,22); // icon
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user