--- In [email protected], "ilikeflex" <ilikef...@...> wrote:
>
> Hi
> 
> I have customized Tree Control using TreeItemRenderer. I want to 
show 
> disclosureClosedIcon and disclosureOpenIcon after the label. By 
> default these icons are displayed before the label. In the 
> updateDisplayList method of TreeItemRenderer i have the code below. 
> Using this code disclosureClosedIcon and disclosureOpenIcon are 
> displayed after label.
> 
> override protected function updateDisplayList(unscaledWidth:Number, 
> unscaledHeight:Number):void{
>       super.updateDisplayList(unscaledWidth, unscaledHeight);
>       if (disclosureIcon)
>       {
>         disclosureIcon.x = (label.x+label.textWidth+20);
>       } 
> }
> 
> 
> 
> Now the problem i am facing is that when i put the mouse over the 
> tree control then the portion where the deafult icons were is also 
> selected( shows blue ). I do not want to have that portion blue. I 
> just want label,disclosureClosedIcon and disclosureOpenIcon to be 
> highlighted blue. 

You can draw something opaque there, but the problem would be in 
figuring out what color to make it.  Personally, I'd add a 
backgroundColor style property to the renderer and then use a CSS 
style declaration to set it if it's not the same as the component's 
background.  That backgroundColor will drive the color of your opaque 
shape.  If you have code like this:

http://flexdiary.blogspot.com/2008/06/using-css-typeselector-with.html

Then when you use a CSS typeSelector, you'll get the color from that--
otherwise, you'll get the color from the parent Tree.

Your other choice is to extend Tree to change how it draws the 
rollovers.  I'm not sure how practical that is, given that the tree 
would have to look into your renderers and see how they're laid out.

HTH;

Amy

Reply via email to