Re: [flexcoders] Re: Folder-style dragOver highlight on tree
I would use a custom renderer. On 5/12/10 9:50 AM, Richard Rodseth rrods...@gmail.com wrote: I'm now aware of dropIndicatorSkin and found an example that customized the skin to do this: g.beginFill(0xa1bde2, 0.5); g.drawRect(-5, -1, w, 23); which is obviously a bit, er, hard-coded. The location and height for the skin appear to be set for drawing a line between nodes. Recall that I just want to highlight the node itself, as though it were being selected. Tree.showDropFeedback and ListBase.showDropFeedback are quite large methods (with side-effects) to be overriding. Is that my best option, or can I have my skin access the tree node? Recommendations or examples appreciated.I feel sure someone must have used a tree to represent a folder hierarchy. Thanks. On Tue, May 11, 2010 at 3:40 PM, Richard Rodseth rrods...@gmail.com mailto:rrodseth%40gmail.com wrote: I'm maintaining some code which has a dragEnter handler which sets selectedIndex in order to highlight the destination tree node Can anyone point me at some sample code to do this, or a public method to highlight the item without selecting it? The showDropFeedback method draws a line between items, which is not the desired effect. Thanks. -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
Re: [flexcoders] Re: Folder-style dragOver highlight on tree
Could you elaborate a bit, please? The component is already used with a custom renderer. Are you suggesting that the dragEnter method should just do the highlighting directly? Makes sense, I suppose. On Wed, May 12, 2010 at 10:24 AM, Alex Harui aha...@adobe.com wrote: I would use a custom renderer. On 5/12/10 9:50 AM, Richard Rodseth rrods...@gmail.com wrote: I'm now aware of dropIndicatorSkin and found an example that customized the skin to do this: g.beginFill(0xa1bde2, 0.5); g.drawRect(-5, -1, w, 23); which is obviously a bit, er, hard-coded. The location and height for the skin appear to be set for drawing a line between nodes. Recall that I just want to highlight the node itself, as though it were being selected. Tree.showDropFeedback and ListBase.showDropFeedback are quite large methods (with side-effects) to be overriding. Is that my best option, or can I have my skin access the tree node? Recommendations or examples appreciated.I feel sure someone must have used a tree to represent a folder hierarchy. Thanks. On Tue, May 11, 2010 at 3:40 PM, Richard Rodseth rrods...@gmail.com mailto:rrodseth%40gmail.com rrodseth%40gmail.com wrote: I'm maintaining some code which has a dragEnter handler which sets selectedIndex in order to highlight the destination tree node Can anyone point me at some sample code to do this, or a public method to highlight the item without selecting it? The showDropFeedback method draws a line between items, which is not the desired effect. Thanks. -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
Re: [flexcoders] Re: Folder-style dragOver highlight on tree
Doesn't the node already highlight because you are rolling over it?
Re: [flexcoders] Re: Folder-style dragOver highlight on tree
No, this is dragging items from a datagrid to a tree. On Wed, May 12, 2010 at 10:43 AM, Baz li...@thinkloop.com wrote: Doesn't the node already highlight because you are rolling over it?
Re: [flexcoders] Re: Folder-style dragOver highlight on tree
Though I strive to avoid subclassing the standard components, the code I inherited already has a Tree subclass, so I added the following: public function highlightItem(item:IListItemRenderer, highlighted:Boolean):void { this.drawItem(item, false, highlighted); } And call it from the renderer's dragEnter handler: MyTreeSubclass(this.listData.owner).highlightItem(this, true); Seems to be working OK. On Wed, May 12, 2010 at 10:56 AM, Richard Rodseth rrods...@gmail.comwrote: No, this is dragging items from a datagrid to a tree. On Wed, May 12, 2010 at 10:43 AM, Baz li...@thinkloop.com wrote: Doesn't the node already highlight because you are rolling over it?
Re: [flexcoders] Re: Folder-style dragOver highlight on tree
And of course I had to add to my renderers dragExit: MyTreeSubclass(this.listData. owner).highlightItem(this,false ); On Wed, May 12, 2010 at 11:10 AM, Richard Rodseth rrods...@gmail.comwrote: Though I strive to avoid subclassing the standard components, the code I inherited already has a Tree subclass, so I added the following: public function highlightItem(item:IListItemRenderer, highlighted:Boolean):void { this.drawItem(item, false, highlighted); } And call it from the renderer's dragEnter handler: MyTreeSubclass(this.listData.owner).highlightItem(this, true); Seems to be working OK. On Wed, May 12, 2010 at 10:56 AM, Richard Rodseth rrods...@gmail.comwrote: No, this is dragging items from a datagrid to a tree. On Wed, May 12, 2010 at 10:43 AM, Baz li...@thinkloop.com wrote: Doesn't the node already highlight because you are rolling over it?