Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 8 of 8 total |
Visibility Funny |
Tue, Feb 16 2016 12:43 PM | Permanent Link |
Mark Brooks Slikware | All
I have a scenario where I allow a user to click a label in order to do something. In some cases, the label is hidden via the Hide method when it's not applicable. However, clicking in it's location (even though t's not visible) still fires the OnClick event as if it was visible! Anybody else come across this? |
Tue, Feb 16 2016 12:45 PM | Permanent Link |
Matthew Jones | <Mark Brooks> wrote:
> All > > I have a scenario where I allow a user to click a label in order to do > something. In some cases, the label is hidden via the Hide method when > it's not applicable. However, clicking in it's location (even though t's > not visible) still fires the OnClick event as if it was visible! > > Anybody else come across this? > > Just like Delphi- you have to set enabled to false too. -- Matthew Jones |
Tue, Feb 16 2016 2:18 PM | Permanent Link |
Mark Brooks Slikware | Potentially hanging head in shame ..... I may be triggering the bloody thing myself with another bit of code that doesn't take the visibility into account (this is all happening inside a custom component). Will check.
|
Tue, Feb 16 2016 2:40 PM | Permanent Link |
Mark Brooks Slikware | Yup. My bad. Apologies.
Basically, I have elements within a visual component that hide themselves if not relevant. I also have a click-handler for the component that works out what element was clicked based on the X and Y coords. However, it wasn't taking into account the element's visibility. Maybe there's a better way to handle this? |
Thu, Feb 18 2016 11:53 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Mark,
<< Basically, I have elements within a visual component that hide themselves if not relevant. I also have a click-handler for the component that works out what element was clicked based on the X and Y coords. However, it wasn't taking into account the element's visibility. Maybe there's a better way to handle this? >> Is this a custom control/component ? If so, then you should look at this method for intercepting events for a given sub-element: (WebCtrls unit - TControl class) function DispatchEvent(ID: Integer; AElement: TElement): Boolean; override; It will allow you intercept all key, mouse, and touch events for any elements that are nested within the current control's base UI element. Tim Young Elevate Software www.elevatesoft.com |
Sat, Feb 20 2016 6:37 AM | Permanent Link |
Mark Brooks Slikware | Tim Young [Elevate Software] wrote:
>Is this a custom control/component ? If so, then you should look at this method for intercepting events for a given >sub-element: >(WebCtrls unit - TControl class) >function DispatchEvent(ID: Integer; AElement: TElement): Boolean; override; >It will allow you intercept all key, mouse, and touch events for any elements that are nested within the current >control's base UI element. Hey Tim Yup, I think this is likely much preferable. The scenario is indeed a custom component that has a number of child elements that show / hide themselves based on status. I was using the X,Y coordinates of the parent at the point of click / touch to work out which child had actually been clicked / touched. My code did not check to see if the child was visible. I imagine that using DispatchEvent removes that issue immediately, since no event would be triggered for an invisible child! I've attached a grab from a section of the app view and highlighted the actual component. It has a thumbnail of a document, some textual details and some buttons. I arrange the parent within a scroller using overflow to handle screen sizes. Hope this makes sense. Regards Mark Attachments: Portal Grab.png |
Mon, Feb 22 2016 2:36 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Mark,
<< I imagine that using DispatchEvent removes that issue immediately, since no event would be triggered for an invisible child! >> I can't commit to that. If the browser triggers the event on the element, then it will get dispatched, period. So, this aspect is up to the browser. << I've attached a grab from a section of the app view and highlighted the actual component. It has a thumbnail of a document, some textual details and some buttons. I arrange the parent within a scroller using overflow to handle screen sizes. >> Yep, that's basically what I imagined. Nice UI. Look at those crisp icons. Tim Young Elevate Software www.elevatesoft.com |
Mon, Feb 22 2016 5:08 PM | Permanent Link |
Mark Brooks Slikware | Tim Young [Elevate Software] wrote:.
>>Nice UI. Look at those crisp icons. Thanks. Took me literally hours to "craft" them ...... |
This web page was last updated on Friday, November 1, 2024 at 07:01 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |