From 9ef39260e085b5254fe29a8940d7c9ce029c1f3c Mon Sep 17 00:00:00 2001 From: alexs75 Date: Wed, 25 Apr 2018 07:17:31 +0000 Subject: [PATCH] RxFPC: restore close button in TRxPopupNotifier window git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6351 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../rx/trunk/rxcontrols/rxpopupnotifier.pas | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/components/rx/trunk/rxcontrols/rxpopupnotifier.pas b/components/rx/trunk/rxcontrols/rxpopupnotifier.pas index 305a71147..6cfcf8c68 100644 --- a/components/rx/trunk/rxcontrols/rxpopupnotifier.pas +++ b/components/rx/trunk/rxcontrols/rxpopupnotifier.pas @@ -36,7 +36,7 @@ unit RxPopupNotifier; interface uses - Classes, SysUtils, ExtCtrls, Forms, Graphics, Controls, StdCtrls; + Classes, SysUtils, ExtCtrls, Forms, Graphics, Controls, StdCtrls, Buttons; type TRxPopupNotifierItem = class; @@ -48,8 +48,9 @@ type { TRxNotifierForm } - TRxNotifierForm = class(THintWindow) + TRxNotifierForm = class(TCustomForm) private + //FCloseButton:TSpeedButton; FCloseButton:TButton; FCaptionLabel:TLabel; FMessageLabel:TLabel; @@ -61,7 +62,7 @@ type procedure CreateTimerLabel; procedure ButtonCloseClick(Sender: TObject); protected - procedure DoShowWindow; override; + //procedure DoShowWindow; override; public constructor CreateNotifierForm(AOwnerItem:TRxPopupNotifierItem); end; @@ -161,18 +162,23 @@ uses rxconst, LCLType; procedure TRxNotifierForm.CreateCloseButton; begin begin -{ FCloseButton:=TButton.Create(Self); + //FCloseButton:=TSpeedButton.Create(Self); + FCloseButton:=TButton.Create(Self); FCloseButton.Parent:=Self; - FCloseButton.Caption:=sClose; FCloseButton.AutoSize:=true; + FCloseButton.Caption:=' X '; //sClose; + FCloseButton.Top:=6; + //FCloseButton.Flat:=true; + //FCloseButton.Left:=Width - Canvas.TextWidth(FCloseButton.Caption) - 6; + FCloseButton.Left:=Width - FCloseButton.Width - 6; +{ FCloseButton.BorderSpacing.Around:=6; - FCloseButton.Left:=Width - FCloseButton.Width; FCloseButton.AnchorSideLeft.Control:=nil; FCloseButton.AnchorSideRight.Control:=Self; FCloseButton.AnchorSideRight.Side:=asrRight; - FCloseButton.AnchorSideTop.Control:=Self; + FCloseButton.AnchorSideTop.Control:=Self;} - FCloseButton.OnClick:=@ButtonCloseClick; } + FCloseButton.OnClick:=@ButtonCloseClick; end; end; @@ -214,7 +220,7 @@ procedure TRxNotifierForm.ButtonCloseClick(Sender: TObject); begin Close; end; - +(* procedure TRxNotifierForm.DoShowWindow; begin if (ActiveControl = nil) and (not (csDesigning in ComponentState)) and (Parent=nil) then @@ -226,13 +232,13 @@ begin ActiveControl := FindNextControl(nil, True, True, False); //FindDefaultForActiveControl; end; end; - +*) constructor TRxNotifierForm.CreateNotifierForm(AOwnerItem: TRxPopupNotifierItem ); begin inherited CreateNew(Application); FOwnerItem:=AOwnerItem; - fCompStyle := csHintWindow; + //fCompStyle := csHintWindow; end; { TNotifierCollection }