mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-08 23:58:27 +02:00
TaskDialog: left-align main icon, footer icon and checkbox in emulated taskdialog.
This commit is contained in:
parent
a46e62000d
commit
9ff95ce2a6
@ -50,8 +50,9 @@ type
|
|||||||
procedure AddPanel;
|
procedure AddPanel;
|
||||||
procedure AddRadios(ARadioOffSet, AWidth, ARadioDef, AFontHeight: Integer; var X,Y: Integer; AParent: TWinControl);
|
procedure AddRadios(ARadioOffSet, AWidth, ARadioDef, AFontHeight: Integer; var X,Y: Integer; AParent: TWinControl);
|
||||||
procedure AddCommandLinkButtons(var X, Y: Integer; AWidth, AButtonDef, AFontHeight: Integer; AParent: TWinControl);
|
procedure AddCommandLinkButtons(var X, Y: Integer; AWidth, AButtonDef, AFontHeight: Integer; AParent: TWinControl);
|
||||||
procedure AddButtonsAndCheckBox(var X,Y, XB: Integer; AWidth, AButtonDef: Integer; APArent: TWinControl);
|
procedure AddButtons(var X,Y, XB: Integer; AWidth, AButtonDef: Integer; APArent: TWinControl);
|
||||||
procedure AddFooter(var X, Y, XB: Integer; AFontHeight, AWidth: Integer; APArent: TWinControl);
|
procedure AddCheckBox(var X,Y, XB: Integer; AWidth, ALeftMargin: Integer; APArent: TWinControl);
|
||||||
|
procedure AddFooter(var X, Y, XB: Integer; AFontHeight, AWidth, AIconBorder: Integer; APArent: TWinControl);
|
||||||
function AddLabel(const AText: string; BigFont: boolean; var X, Y: Integer; AFontHeight, AWidth: Integer; APArent: TWinControl): TLabel;
|
function AddLabel(const AText: string; BigFont: boolean; var X, Y: Integer; AFontHeight, AWidth: Integer; APArent: TWinControl): TLabel;
|
||||||
procedure AddQueryCombo(var X,Y: Integer; AWidth: Integer; AParent: TWinControl);
|
procedure AddQueryCombo(var X,Y: Integer; AWidth: Integer; AParent: TWinControl);
|
||||||
procedure AddQueryEdit(var X,Y: Integer; AWidth: Integer; AParent: TWinControl);
|
procedure AddQueryEdit(var X,Y: Integer; AWidth: Integer; AParent: TWinControl);
|
||||||
@ -460,7 +461,7 @@ begin
|
|||||||
inc(Y,24);
|
inc(Y,24);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TLCLTaskDialog.AddButtonsAndCheckBox(var X, Y, XB: Integer; AWidth, AButtonDef: Integer; APArent: TWinControl);
|
procedure TLCLTaskDialog.AddButtons(var X, Y, XB: Integer; AWidth, AButtonDef: Integer; APArent: TWinControl);
|
||||||
var
|
var
|
||||||
CurrTabOrder, i: Integer;
|
CurrTabOrder, i: Integer;
|
||||||
Btn: TTaskDialogCommonButton;
|
Btn: TTaskDialogCommonButton;
|
||||||
@ -523,12 +524,16 @@ begin
|
|||||||
if (Btn in CommonButtons) then
|
if (Btn in CommonButtons) then
|
||||||
AddButton(TD_Trans(LoadResString(TD_BTNS(Btn))), TD_BTNMOD[Btn],-1);
|
AddButton(TD_Trans(LoadResString(TD_BTNS(Btn))), TD_BTNMOD[Btn],-1);
|
||||||
end;
|
end;
|
||||||
if (VerificationText <> '') then
|
end;
|
||||||
|
|
||||||
|
procedure TLCLTaskDialog.AddCheckBox(var X, Y, XB: Integer; AWidth, ALeftMargin: Integer; APArent: TWinControl);
|
||||||
begin
|
begin
|
||||||
VerifyCheckBox := TCheckBox.Create(Self);
|
VerifyCheckBox := TCheckBox.Create(Self);
|
||||||
with VerifyCheckBox do
|
with VerifyCheckBox do
|
||||||
begin
|
begin
|
||||||
Parent := AParent;
|
Parent := AParent;
|
||||||
|
if (X > ALeftMargin) then
|
||||||
|
X := ALeftMargin;
|
||||||
if (X+16+Canvas.TextWidth(VerificationText) > XB) then begin
|
if (X+16+Canvas.TextWidth(VerificationText) > XB) then begin
|
||||||
inc(Y,32);
|
inc(Y,32);
|
||||||
XB := aWidth;
|
XB := aWidth;
|
||||||
@ -539,10 +544,8 @@ begin
|
|||||||
OnClick := @OnVerifyClicked;
|
OnClick := @OnVerifyClicked;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
inc(Y,36);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TLCLTaskDialog.AddFooter(var X, Y, XB: Integer; AFontHeight, AWidth: Integer; APArent: TWinControl);
|
procedure TLCLTaskDialog.AddFooter(var X, Y, XB: Integer; AFontHeight, AWidth, AIconBorder: Integer; APArent: TWinControl);
|
||||||
procedure AddBevel;
|
procedure AddBevel;
|
||||||
var
|
var
|
||||||
BX: integer;
|
BX: integer;
|
||||||
@ -573,7 +576,7 @@ begin
|
|||||||
Image.StretchOutEnabled := False;
|
Image.StretchOutEnabled := False;
|
||||||
Image.Proportional := True;
|
Image.Proportional := True;
|
||||||
Image.Center := True;
|
Image.Center := True;
|
||||||
Image.SetBounds(24,Y,16,16);
|
Image.SetBounds(AIconBorder,Y,16,16);
|
||||||
X := 40+Image.Width;
|
X := 40+Image.Width;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -888,12 +891,16 @@ begin
|
|||||||
if (CommonButtons <> []) or (VerificationText<>'') or
|
if (CommonButtons <> []) or (VerificationText<>'') or
|
||||||
((FDlg.Buttons.Count<>0) and not (tfUseCommandLinks in FDlg.Flags)) then
|
((FDlg.Buttons.Count<>0) and not (tfUseCommandLinks in FDlg.Flags)) then
|
||||||
begin
|
begin
|
||||||
AddButtonsAndCheckBox(X, Y, XB, aWidth, aButtonDef, CurrParent);
|
AddButtons(X, Y, XB, aWidth, aButtonDef, CurrParent);
|
||||||
end;
|
end;
|
||||||
|
if (VerificationText <> '') then
|
||||||
|
AddCheckBox(X, Y, XB, aWidth, IconBorder, CurrParent);
|
||||||
|
inc(Y,36);
|
||||||
|
|
||||||
|
|
||||||
// add FooterText text with optional icon
|
// add FooterText text with optional icon
|
||||||
if (FooterText <> '') then
|
if (FooterText <> '') then
|
||||||
AddFooter(X, Y, XB, FontHeight, aWidth, CurrParent);
|
AddFooter(X, Y, XB, FontHeight, aWidth, IconBorder, CurrParent);
|
||||||
|
|
||||||
ClientHeight := Y;
|
ClientHeight := Y;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user