Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Switching from VCL to Firemonkey (TTreeView)...


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Oct 31, 2016 11:44 AM Last Post By: John Marinuzzi
John Marinuzzi

Posts: 12
Registered: 3/2/07
Switching from VCL to Firemonkey (TTreeView)...  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 27, 2016 12:22 PM
With VCL there was a means of determining if you clicked on the image of a TTreeNode (HitTest). I do not see the same function in the FireMonkey TreeViews (TTreeViewItem). Outside of checking the position of the click relative to the rectangle, does the same type of functionality exist in FM?

Thank You,

John
John Marinuzzi

Posts: 12
Registered: 3/2/07
Re: Switching from VCL to Firemonkey (TTreeView)...  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 31, 2016 10:20 AM   in response to: John Marinuzzi in response to: John Marinuzzi
This is even hairier than I originally expected. I have a tried a host of the available TRectFs like AbsoluteClipRect, AbsoluteRect, BoundsRect, ClipRect, LocalRect, and UpdateRect and various points relative to these rects (AbsoluteToLocal, etc.) and there seems to be no consistency. It is variable based on where the TreeView is place on the form and the level of the node.

What I am trying to do is take the position of the MouseDown of the TreeView, translate it to the TTreeViewItem (all with a 16x16 state image) to see if the image was clicked on. This is for a multiple state checkbox scenario. It also surprising that there is no semi-check state for a TreeviewItem. This was also true with VCL, though.

John Marinuzzi wrote:
With VCL there was a means of determining if you clicked on the image of a TTreeNode (HitTest). I do not see the same function in the FireMonkey TreeViews (TTreeViewItem). Outside of checking the position of the click relative to the rectangle, does the same type of functionality exist in FM?

Thank You,

John
John Marinuzzi

Posts: 12
Registered: 3/2/07
Re: Switching from VCL to Firemonkey (TTreeView)...  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 31, 2016 10:56 AM   in response to: John Marinuzzi in response to: John Marinuzzi
These are dynamically created TReeViewItems. Maybe my mistake is relying the mousdown from the containing TreeView. I will assign and implement mousedown in the items themselves and see how that goes.

John Marinuzzi wrote:
This is even hairier than I originally expected. I have a tried a host of the available TRectFs like AbsoluteClipRect, AbsoluteRect, BoundsRect, ClipRect, LocalRect, and UpdateRect and various points relative to these rects (AbsoluteToLocal, etc.) and there seems to be no consistency. It is variable based on where the TreeView is place on the form and the level of the node.

What I am trying to do is take the position of the MouseDown of the TreeView, translate it to the TTreeViewItem (all with a 16x16 state image) to see if the image was clicked on. This is for a multiple state checkbox scenario. It also surprising that there is no semi-check state for a TreeviewItem. This was also true with VCL, though.

John Marinuzzi wrote:
With VCL there was a means of determining if you clicked on the image of a TTreeNode (HitTest). I do not see the same function in the FireMonkey TreeViews (TTreeViewItem). Outside of checking the position of the click relative to the rectangle, does the same type of functionality exist in FM?

Thank You,

John
John Marinuzzi

Posts: 12
Registered: 3/2/07
Re: Switching from VCL to Firemonkey (TTreeView)...  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 31, 2016 11:44 AM   in response to: John Marinuzzi in response to: John Marinuzzi
Using the TTreeViewItem Mousedown I managed to create some consistent, predictable results. So, if you are switching from VCL having trouble with TreeViews, hopefully this can help you.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02