Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 9 of 9 total |
ComponentAt(X, Y) |
Thu, Dec 5 2013 8:46 AM | Permanent Link |
Matthew Jones | Is there a way to take arbitrary coordinates and get a component at that position?
/Matthew Jones/ |
Thu, Dec 5 2013 9:23 AM | Permanent Link |
E.B | Using component.Left and component.Top ....
(as first approximation !) Eric (Matthew Jones) wrote: Is there a way to take arbitrary coordinates and get a component at that position? /Matthew Jones/ |
Thu, Dec 5 2013 11:16 AM | Permanent Link |
Matthew Jones | Indeed, I presume it would have to walk the tree of components, but I wonder if it
is already done in the framework. As it happens, I realised that the items I wanted are on a particular panel, and all the same height, so, taking into consideration ScrollTop, I can do a simple division to find out which one. I'd still like to know for the future though. /Matthew Jones/ |
Sat, Dec 7 2013 8:32 AM | Permanent Link |
E.B | Well ... With Delphi I used component[i] and componentcount to explore my form's components. But I don't know if the same function exists with EWB. I don't thinck.
(Matthew Jones) wrote: Indeed, I presume it would have to walk the tree of components, but I wonder if it is already done in the framework. As it happens, I realised that the items I wanted are on a particular panel, and all the same height, so, taking into consideration ScrollTop, I can do a simple division to find out which one. I'd still like to know for the future though. /Matthew Jones/ |
Mon, Dec 9 2013 6:23 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Eric,
<< Well ... With Delphi I used component[i] and componentcount to explore my form's components. But I don't know if the same function exists with EWB. I don't thinck. >> These properties are also available, but will include non-visual components also. A better option are the Controls and ControlCount properties, which are based upon parentage, not ownership: http://www.elevatesoft.com/manual?action=viewcomp&id=ewb1&comp=TContainerControl Tim Young Elevate Software www.elevatesoft.com |
Mon, Dec 9 2013 6:40 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Matthew,
<< Is there a way to take arbitrary coordinates and get a component at that position? >> Are you doing so in response to a mouse event, or something else ??? Tim Young Elevate Software www.elevatesoft.com |
Tue, Dec 10 2013 7:29 AM | Permanent Link |
Matthew Jones | "Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote:
> Are you doing so in response to a mouse event, or something else ??? Mainly mouse, but not always. Depends how deep I am. I have code to traverse the local sender to parents, but a more generic routine that is efficient may be better. Of course generic and efficient are probably opposed. -- Matthew Jones |
Wed, Dec 18 2013 8:17 AM | Permanent Link |
Matthew Jones | It is worth saying that Tim is a genius, and he provided a much better way to do
what I was wanting. My code has an array of TPanels that contain a number of other components. From any of those components I may have an event, and need to work out which of my internal data objects it relates to. Thus I was having a MyPanel.MouseMove, and working out that this was the third panel in the list, and thereby know that it is the third in my object list. Fiddly, and perhaps slow. The better way of course is to use the EWB TComponent "Data" property, to store a reference to the internal data object for each of the panels etc. Thus the MouseMove is able to go straight to the relevant object, no lookup needed, and do the work. How I missed this before I don't know. Probably still stuck in the Delphi mindset where all you have is Tag. /Matthew Jones/ |
Thu, Dec 19 2013 2:33 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Matthew,
<< It is worth saying that Tim is a genius, and he provided a much better way to do what I was wanting. >> I like where you're going there.... << The better way of course is to use the EWB TComponent "Data" property, to store a reference to the internal data object for each of the panels etc. Thus the MouseMove is able to go straight to the relevant object, no lookup needed, and do the work. >> Nicely done. Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |