ExCtrls/QuestionDlgEx: Add variable for text background color.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8158 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2021-11-24 20:28:10 +00:00
parent 17a5b7035b
commit cb744ff5de
3 changed files with 100 additions and 55 deletions

View File

@@ -56,6 +56,7 @@ var
QuestionDlgEx_MinHeight: Integer = 50; // Text part only
QuestionDlgEx_ButtonAlignment: TAlignment = taCenter;
QuestionDlgEx_TextAlignment: TAlignment = taLeftJustify;
QuestionDlgEx_TextBkColor: TColor = clWindow;
QuestionDlgEx_TextLayout: TTextLayout = tlCenter;
QuestionDlgEx_FontName: String = ''; // the same as "default"
QuestionDlgEx_FontSize: Integer = 0;
@@ -110,12 +111,12 @@ type
FText: String;
FTextBorder: TSize;
FTextAlignment: TAlignment;
FTextBkColor: TColor;
FTextLayout: TTextLayout;
FTextPanel: TPanel;
FXPos, FYPos: Integer;
procedure SetDialogType(AValue: TMsgDlgType);
protected
// procedure Activate; override;
procedure AdjustForm;
procedure ApplyButtonAlignment;
procedure CreateButtonPanel;
@@ -137,6 +138,7 @@ type
property DialogType: TMsgDlgType read FDialogType write SetDialogType;
property Msg: String read FText write FText;
property TextAlignment: TAlignment read FTextAlignment write FTextAlignment;
property TextBkColor: TColor read FTextBkColor write FTextBkColor;
property TextLayout: TTextLayout read FTextLayout write FTextLayout;
property XPos: Integer read FXPos write FXPos;
property YPos: Integer read FYPos write FYPos;
@@ -146,7 +148,6 @@ constructor TQForm.CreateNew(AOwner: TComponent; Num: Integer = 0);
begin
inherited;
BorderStyle := bsDialog;
Color := clWindow;
PopupMode := pmAuto;
FImageBorder.CX := Scale96ToFont(DEFAULT_IMAGE_BORDER_X);
@@ -165,14 +166,6 @@ begin
inherited;
end;
{
procedure TQForm.Activate;
begin
AdjustForm;
SetFormPosition(FXPos, FYPos);
inherited;
end;
}
procedure TQForm.AddButtons(const AButtons: array of const);
const
MsgDlgBtnStr : array [0..11] of string = (
@@ -294,8 +287,6 @@ begin
begin
AnchorSideLeft.Control := FButtonPanel;
AnchorSideTop.Control := FButtonPanel;
// AnchorSideRight.Control := FButtonPanel;
// AnchorSideRight.Side := asrBottom;
BevelOuter := bvNone;
BorderSpacing.Top := Scale96ToFont(BUTTON_SPACING);
BorderSpacing.Bottom := Scale96ToFont(BUTTON_SPACING);
@@ -312,7 +303,7 @@ begin
begin
BevelOuter := bvNone;
Caption := '';
Color := clWindow;
Color := QuestionDlgEx_TextBkColor;
Parent := Self;
OnPaint := @PaintTextPanelHandler;
end;
@@ -521,6 +512,7 @@ begin
QForm.Font.Size := QuestionDlgEx_FontSize;
QForm.ButtonAlignment := QuestionDlgEx_ButtonAlignment;
QForm.TextAlignment := QuestionDlgEx_TextAlignment;
QForm.TextBkColor := QuestionDlgEx_TextBkColor;
QForm.TextLayout := QuestionDlgEx_TextLayout;
QForm.Caption := ACaption;
QForm.DialogType := ADlgtype;