mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 14:19:19 +02:00
Refactoring TTaskDialog: remove hack of exposing TCustomTaskDialog.FWidth. It was unneccessary to begin with...
This commit is contained in:
parent
b7cc27d3a5
commit
e1d2db658f
@ -634,6 +634,7 @@ type
|
|||||||
FText: TTranslateString;
|
FText: TTranslateString;
|
||||||
FTitle: TTranslateString;
|
FTitle: TTranslateString;
|
||||||
FVerificationText: TTranslateString;
|
FVerificationText: TTranslateString;
|
||||||
|
FWidth: Integer;
|
||||||
FOnButtonClicked: TTaskDlgClickEvent;
|
FOnButtonClicked: TTaskDlgClickEvent;
|
||||||
//procedure DoOnButtonClickedHandler(Sender: PTaskDialog; AButtonID: Integer;
|
//procedure DoOnButtonClickedHandler(Sender: PTaskDialog; AButtonID: Integer;
|
||||||
// var ACanClose: Boolean);
|
// var ACanClose: Boolean);
|
||||||
@ -644,8 +645,6 @@ type
|
|||||||
function DoExecute(ParentWnd: HWND): Boolean; dynamic;
|
function DoExecute(ParentWnd: HWND): Boolean; dynamic;
|
||||||
procedure DoOnButtonClicked(AModalResult: Integer; var ACanClose: Boolean); dynamic;
|
procedure DoOnButtonClicked(AModalResult: Integer; var ACanClose: Boolean); dynamic;
|
||||||
public
|
public
|
||||||
FWidth: Integer; //ToDo: make this a readonly property, so we can use it in the TaskDlgEmulation unit.
|
|
||||||
|
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function ButtonIDToModalResult(const AButtonID: Integer): TModalResult;
|
function ButtonIDToModalResult(const AButtonID: Integer): TModalResult;
|
||||||
|
@ -1856,7 +1856,7 @@ var
|
|||||||
Config.nDefaultRadioButton := DefRB + TaskDialogFirstRadioButtonIndex;
|
Config.nDefaultRadioButton := DefRB + TaskDialogFirstRadioButtonIndex;
|
||||||
//writeln('PrepareTaskDialogConfig O');
|
//writeln('PrepareTaskDialogConfig O');
|
||||||
|
|
||||||
Config.cxWidth := MulDiv(ADlg.FWidth, 4, DialogBaseUnits); // cxWidth needed in "dialog units"
|
Config.cxWidth := MulDiv(ADlg.Width, 4, DialogBaseUnits); // cxWidth needed in "dialog units"
|
||||||
//writeln('PrepareTaskDialogConfig P');
|
//writeln('PrepareTaskDialogConfig P');
|
||||||
|
|
||||||
Config.pfCallback := @TaskDialogCallbackProc;
|
Config.pfCallback := @TaskDialogCallbackProc;
|
||||||
|
@ -695,7 +695,7 @@ begin
|
|||||||
if (FontHeight = 0) then
|
if (FontHeight = 0) then
|
||||||
FontHeight := Screen.SystemFont.Height;
|
FontHeight := Screen.SystemFont.Height;
|
||||||
|
|
||||||
aWidth := FDlg.FWidth;
|
aWidth := FDlg.Width;
|
||||||
if (aWidth <= 0) then
|
if (aWidth <= 0) then
|
||||||
begin
|
begin
|
||||||
aWidth := Canvas.TextWidth(DlgTitle);
|
aWidth := Canvas.TextWidth(DlgTitle);
|
||||||
|
Loading…
Reference in New Issue
Block a user