Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 2 of 2 total |
Notification on focus change of controls |
Tue, Oct 6 2015 2:32 AM | Permanent Link |
Christian Kaufmann | I want to create a subclass of TBasicPanel where I have a method, that will be called when the
focus moves from one control on the panel to the next. Do I have to catch OnEnter/OnExit of each control on my panel or is there a simpler way to do it in the panel class directly? cu Christian |
Tue, Oct 6 2015 11:20 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Christian,
<< I want to create a subclass of TBasicPanel where I have a method, that will be called when the focus moves from one control on the panel to the next. >> Now is where you start to realize that creating a custom control has its advantages. Doing things like this are trivial when the outer container control has complete control over the sub-controls (and creates them). With such a scenario, it's simply a matter of creating descendant classes for the child controls that forward all/some of their events on to their parent/owner control. The grid cells, for example, use this technique for mouse/touch events: function TGridCell.DispatchEvent(ID: Integer; AElement: TElement): Boolean; begin if ((ID >= cdMouseDown) and (ID <= cdMouseWheel) or (ID >= cdTouchStart) and (ID <= cdTouchCancel)) then Result:=ForwardEvent(ParentGrid.Element,ID,AElement) else Result:=inherited DispatchEvent(ID,AElement); end; The ForwardEvent method is a protected method of the base TInterfaceController class (ancestor of TControl that provides basic element-to-control functionality). However, if you don't want to create descendant controls for the sub-controls, then you'll need to do the OnEnter/OnExit tracking instead. Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Friday, December 6, 2024 at 05:39 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |