Node textShift syntax

This is a forum focused on providing support for rTree

Moderators: heatherlaine, kevinmiller, robinmiller, wilstrand

Post Reply
Clarkey
Posts: 103
Joined: Fri Jun 11, 2010 11:10 am
Location: UK

Node textShift syntax

Post by Clarkey » Tue May 31, 2011 8:42 pm

Hi Mats,
Please can you confirm the syntax needed for textShift to adjust node text relative to the node icons? I'm using large icons and want to have the node text aligned with the icon's centre-line. The following line seems to have no effect?

set the textShift_of_node_ID_[it] of control "Tree" to -4
Best,
Keith..

wilstrand
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 114
Joined: Mon Jan 03, 2011 3:02 pm
Contact:

Re: Node textShift syntax

Post by wilstrand » Tue May 31, 2011 9:37 pm

Hi Keith!

I assume you are uing the latest version of rTree wich is 1.5.1.

I have just tested the textShift feature with the following script in a button:

Code: Select all

on mouseUp
   dispatch "new_node" to control "Tree"
   get the lastNodeID of control "Tree"
   set the textShift_of_node_ID_[it] of control "Tree" to - 4
   dispatch "renderTree" to control "Tree"
end mouseUp
I confirm that this is working as intended. The text (name) of the node is shifted 4 pixels up relative to the icon/icons.
Please let me know if you still have problems or if you have got it working!

With my best regards,
Mats
http:www.tapirsoft.on-rev.com
Open Source LiveCode Plugins - rIDE, rGrid, rTree
LiveCode projects

Clarkey
Posts: 103
Joined: Fri Jun 11, 2010 11:10 am
Location: UK

Re: Node textShift syntax

Post by Clarkey » Wed Jun 01, 2011 7:10 am

Hi Mats,
wilstrand wrote:I assume you are uing the latest version of rTree wich is 1.5.1.
Aha! That'll be it then, as I was still on v 1.5 - right code, wrong version!

This brings a couple of follow-up questions:
1. Is there any way to adjust the relative vertical placement of icons 1 & 2 - so that a small disclosure triangle firstIcon can be aligned with the centre-line of a larger node-specific secondIcon?

2. Is there a smarter and/or less manual way to upgrade than the process I used?
• Delete rTree Engine SubStack from project MainStack
• Open new rTree Workbench 1.5.1 stackfile
• Change the MainStack of it's rTree Engine SubStack to the project MainStack
• Close and remove from memory the rTree Workbench stackfile

Best,
Keith..

wilstrand
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 114
Joined: Mon Jan 03, 2011 3:02 pm
Contact:

Re: Node textShift syntax

Post by wilstrand » Wed Jun 01, 2011 8:52 am

Hi Keith!
1. Is there any way to adjust the relative vertical placement of icons 1 & 2 - so that a small disclosure triangle firstIcon can be aligned with the centre-line of a larger node-specific secondIcon?
Ther is no specific rTree 1.5 property for this. This is a planned feature of rTree 2.0.
2. Is there a smarter and/or less manual way to upgrade than the process I used?
• Delete rTree Engine SubStack from project MainStack
• Open new rTree Workbench 1.5.1 stackfile
• Change the MainStack of it's rTree Engine SubStack to the project MainStack
• Close and remove from memory the rTree Workbench stackfile
I agree that this is a little awkward but this is the way you have to do it. Some users prefer to do this from the message box also.

With my best regards
Mats
http:www.tapirsoft.on-rev.com
Open Source LiveCode Plugins - rIDE, rGrid, rTree
LiveCode projects

Clarkey
Posts: 103
Joined: Fri Jun 11, 2010 11:10 am
Location: UK

Re: Node textShift syntax

Post by Clarkey » Wed Jun 01, 2011 9:06 am

Hi Mats,
Thanks for the clarifications.
Best,
Keith..

Post Reply

Return to “rTree”