From c8fb7ae1e8e669d6fbe2bc8a149e4d5685750ddf Mon Sep 17 00:00:00 2001 From: alexs75 Date: Fri, 17 Apr 2020 11:14:55 +0000 Subject: [PATCH] RxFPC: TRxPopupNotifier - fix update message text git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7387 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../rx/trunk/rxcontrols/rxpopupnotifier.pas | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/components/rx/trunk/rxcontrols/rxpopupnotifier.pas b/components/rx/trunk/rxcontrols/rxpopupnotifier.pas index 7f1f31168..25c7e21b2 100644 --- a/components/rx/trunk/rxcontrols/rxpopupnotifier.pas +++ b/components/rx/trunk/rxcontrols/rxpopupnotifier.pas @@ -65,6 +65,7 @@ type protected public constructor CreateNotifierForm(AOwnerItem:TRxPopupNotifierItem); + procedure SetMessage(AMessage:string); end; { TCloseButtonItem } @@ -112,6 +113,7 @@ type procedure SetAlphaBlendValue(AValue: Byte); procedure SetCloseButton(AValue: TCloseButtonItem); procedure SetColor(AValue: TColor); + procedure SetMessage(AValue: string); procedure SetShowCloseButton(AValue: boolean); procedure SetShowCloseTimer(AValue: boolean); procedure UpdateCloseLabel; @@ -134,7 +136,7 @@ type property ShowCloseTimer:boolean read FShowCloseTimer write SetShowCloseTimer default true; property ShowCloseButton:boolean read GetShowCloseButton write SetShowCloseButton default true; property Caption:string read FCaption write FCaption; - property Message:string read FMessage write FMessage; + property Message:string read FMessage write SetMessage; property CloseButton:TCloseButtonItem read FCloseButton write SetCloseButton; end; @@ -360,6 +362,17 @@ begin ShowHint:=true; end; +procedure TRxNotifierForm.SetMessage(AMessage: string); +begin + if not Assigned(FMessageLabel) then + CreateMessage(AMessage) + else + begin + FMessageLabel.Caption:=AMessage; + DoUpdateControls; + end; +end; + { TNotifierCollection } function TNotifierCollection.GetItems(AIndex: Integer): TRxPopupNotifierItem; @@ -454,6 +467,14 @@ begin FNotifyForm.Color:=FColor; end; +procedure TRxPopupNotifierItem.SetMessage(AValue: string); +begin + if FMessage=AValue then Exit; + FMessage:=AValue; + if Assigned(FNotifyForm) then + FNotifyForm.SetMessage(AValue); +end; + procedure TRxPopupNotifierItem.SetShowCloseButton(AValue: boolean); begin FCloseButton.Visible:=AValue;