I'm left wondering why these aren't there. They seem obvious to me.
NxFlipPanel - OnExpand / OnCollapse
Started by FourWhey, Jul 09 2014 09:41 PM
4 replies to this topic
#1
Posted 09 July 2014 - 09:41 PM
#2
Posted 10 July 2014 - 04:56 PM
I added the necessary changes to implement the published properties for the events. However, the events are not visible in the IDE object inspector. Do I need to reinstall the control for it to register in the IDE?
TNxFlipPanel = class(TNxCollectionControl) private FOnCollapse: TCollapseEvent; FOnExpand: TCollapseEvent; procedure DoCollapse(var Accept: Boolean); dynamic; procedure DoExpand(var Accept: Boolean); dynamic; ... published property OnCollapse: TCollapseEvent read FOnCollapse write FOnCollapse; property OnExpand: TCollapseEvent read FOnExpand write FOnExpand; ... procedure TNxFlipPanel.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var AcceptChange: Boolean; begin inherited; FMouseDown := False; if Button = mbLeft then case FFlipKind of fkButton: if (PtInRect(GetButtonRect, Point(X, Y)) and ShowButtons) then begin Expanded := not Expanded; end; fkHeaderAndButton: if (PtInRect(GetHeaderRect, Point(X, Y))) then begin Expanded := not Expanded; end; end; if Expanded then begin AcceptChange := True; DoCollapse(AcceptChange); if AcceptChange then Expanded := False; end else begin AcceptChange := True; DoExpand(AcceptChange); if AcceptChange then Expanded := True; SetFocus; end; end; procedure TNxFlipPanel.DoCollapse(var Accept: Boolean); begin if Assigned(FOnCollapse) then FOnCollapse(Self, Accept); end; procedure TNxFlipPanel.DoExpand(var Accept: Boolean); begin if Assigned(FOnExpand) then FOnExpand(Self, Accept); end;
#3
Posted 13 July 2014 - 07:12 AM
Hi,
There is a onchange event. Maybe you want to use it instead?
But, if you want to continue with your code, you only need to recompile NxCollectionRun_dx package.
Btw. I think that it is better to put this events inside SetExpanded procedure.
There is a onchange event. Maybe you want to use it instead?
But, if you want to continue with your code, you only need to recompile NxCollectionRun_dx package.
Btw. I think that it is better to put this events inside SetExpanded procedure.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#4
Posted 14 July 2014 - 03:24 PM
Hi,
There is a onchange event. Maybe you want to use it instead?
But, if you want to continue with your code, you only need to recompile NxCollectionRun_dx package.
Btw. I think that it is better to put this events inside SetExpanded procedure.
Yeah I may not keep it. Thanks for your input, I'll see if onchange will do what I want.
#5
Posted 16 July 2014 - 08:02 PM
But maybe I can add them anyway. Maybe somebody find them useful beside onchange.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users