Adobe Dreamweaver Forums



Last 10 THreads :         pdf question (Last Post : Joseph Kunz - Replies : 0 - Views : 1 )           »          Can't upload selected pdf's to remote server (Last Post : sw2gtg - Replies : 4 - Views : 5 )           »          Video page not opening from link. (Last Post : Team Liquid Fire - Replies : 2 - Views : 3 )           »          Javahelp/Oracle Help (Last Post : cindys@ddms.com - Replies : 10 - Views : 11 )           »          Refreshing xml data in flex (Last Post : ntsiii - Replies : 1 - Views : 4 )           »          move tab with embedded image (Last Post : VPI MkIII - Replies : 1 - Views : 2 )           »          DataGrid CheckBox ItemRenderer (Last Post : fccobb - Replies : 0 - Views : 1 )           »          Passing variable between components (Last Post : ntsiii - Replies : 2 - Views : 3 )           »          CS3 - Export/Save as vector file??? (Last Post : JoshB20 - Replies : 8 - Views : 9 )           »          CF8 Help in Dreamweaver CS3 (Last Post : A.J.cfm - Replies : 2 - Views : 3 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 10-31-2008, 06:26 PM
kartikjayaraman
 
Posts: n/a
Diggs:
Default Legend control problems

We are using a Legend control (data provided by a Chart). When the use clicks
on an item in the legend, we need to capture this event. We are facing the
current problems:

1. The text in the Legend control needs to be underlined. We have set the
textDecoration="underline" as indicated by the API but the text is not
underlined.
2. We want to show a hand cursor when the user hovers on the item. To do this
we have set useHandCursor="true" mouseChildren="false" buttonMode="true"
The problems are (a) If mouseChildren is set to false, we cannot capture the
item click event. If its set to true, the hand cursor is shown on the
background, not the item text.

Please advise.



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-31-2008, 06:26 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Legend control problems


"kartikjayaraman" <webforumsuser@macromedia.com> wrote in message
news:gd2mns$b48$1@forums.macromedia.com...
> We are using a Legend control (data provided by a Chart). When the use
> clicks
> on an item in the legend, we need to capture this event. We are facing the
> current problems:
>
> 1. The text in the Legend control needs to be underlined. We have set the
> textDecoration="underline" as indicated by the API but the text is not
> underlined.


Could you post exactly what you tried?

> 2. We want to show a hand cursor when the user hovers on the item. To do
> this
> we have set useHandCursor="true" mouseChildren="false" buttonMode="true"
> The problems are (a) If mouseChildren is set to false, we cannot capture
> the
> item click event. If its set to true, the hand cursor is shown on the
> background, not the item text.


I think you'll need to subclass LegendItem to get this behavior.

HTH;

Amy


Reply With Quote
  #3 (permalink)  
Old 10-31-2008, 06:26 PM
kartikjayaraman
 
Posts: n/a
Diggs:
Default Re: Legend control problems

Thanks!

Can you please give me a quick example on how I do that?

I dont want to create Legend items as they are sourced by the chart.
Reply With Quote


  #4 (permalink)  
Old 10-31-2008, 06:26 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Legend control problems


"kartikjayaraman" <webforumsuser@macromedia.com> wrote in message
news:gd2uqp$kbb$1@forums.macromedia.com...
> Thanks!
>
> Can you please give me a quick example on how I do that?
>
> I dont want to create Legend items as they are sourced by the chart.


Here's an extended LegendItem I used to make the text wrap. You'd just
override the constructor to set the mouseChildren, etc. properties

package com.magnoliamultimedia.views
{
import flash.display.DisplayObject;

import mx.charts.LegendItem;
import mx.core.UITextField;

public class WrappingLegendItem extends LegendItem
{
public function WrappingLegendItem()
{
super();
}
override protected function createChildren():void{
super.createChildren();
for (var i:int=0;i<numChildren; i++){
var childisplayObject=getChildAt(i);
var txt:UITextField = child as UITextField;
if (!(txt==null)){
txt.wordWrap=true;
txt.invalidateSize();
}
}
}
}
}

It's used like this:

<mx:Legend dataProvider="{subjectAllAttempts}"
direction="horizontal" horizontalAlign="center"
labelPlacement="bottom" verticalAlign="middle"
legendItemClass="com.magnoliamultimedia.views.Wrap pingLegendItem"
/>


Reply With Quote
  #5 (permalink)  
Old 10-31-2008, 06:27 PM
kartikjayaraman
 
Posts: n/a
Diggs:
Default Re: Legend control problems

Ok, I'll try that. What about the textDecoration property set to underline. It doesn't show the text as underlined. Is this a Flex API bug or am I doing something wrong?
Reply With Quote
  #6 (permalink)  
Old 10-31-2008, 06:27 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Legend control problems


"kartikjayaraman" <webforumsuser@macromedia.com> wrote in message
news:gd314s$n0b$1@forums.macromedia.com...
> Ok, I'll try that. What about the textDecoration property set to
> underline. It doesn't show the text as underlined. Is this a Flex API bug
> or am I doing something wrong?


I don't know what you're doing, so I can't speculate about whether it is
wrong or right.


Reply With Quote


  #7 (permalink)  
Old 10-31-2008, 06:27 PM
kartikjayaraman
 
Posts: n/a
Diggs:
Default Re: Legend control problems

[q]Originally posted by: Newsgroup User

"kartikjayaraman" <webforumsuser@macromedia.com> wrote in message
news:gd314s$n0b$1@forums.macromedia.com...
> Ok, I'll try that. What about the textDecoration property set to
> underline. It doesn't show the text as underlined. Is this a Flex API bug
> or am I doing something wrong?


I don't know what you're doing, so I can't speculate about whether it is
wrong or right.


[/q]


All I am doing is setting textDecoration="underline" - shouldnt the items be
then underlined?

<mx:Legend verticalGap="1" horizontalAlign="left" markerHeight="8"
markerWidth="8"
width="780" dataProvider="{MyDataProvider}"
fontSize="10" id="ChartLegend" textDecoration="underline"
height="70" x="10" y="337"
useHandCursor="true" mouseChildren="false" buttonMode="true">
</mx:Legend>


Reply With Quote
  #8 (permalink)  
Old 10-31-2008, 06:27 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Legend control problems


"kartikjayaraman" <webforumsuser@macromedia.com> wrote in message
news:gd33gk$pn1$1@forums.macromedia.com...
> [q]Originally posted by: Newsgroup User
>
> "kartikjayaraman" <webforumsuser@macromedia.com> wrote in message
> news:gd314s$n0b$1@forums.macromedia.com...
> > Ok, I'll try that. What about the textDecoration property set to
> > underline. It doesn't show the text as underlined. Is this a Flex API
> > bug
> > or am I doing something wrong?

>
> I don't know what you're doing, so I can't speculate about whether it is
> wrong or right.
>
>
> [/q]
>
>
> All I am doing is setting textDecoration="underline" - shouldnt the items
> be
> then underlined?
>
> <mx:Legend verticalGap="1" horizontalAlign="left" markerHeight="8"
> markerWidth="8"
> width="780" dataProvider="{MyDataProvider}"
> fontSize="10" id="ChartLegend" textDecoration="underline"
> height="70" x="10" y="337"
> useHandCursor="true" mouseChildren="false" buttonMode="true">
> </mx:Legend>



Try:

<mx:Style>
LegendItem {
textDecoration:underline;
}
</mx:Style>


Reply With Quote
  #9 (permalink)  
Old 10-31-2008, 06:27 PM
kartikjayaraman
 
Posts: n/a
Diggs:
Default Re: Legend control problems

Thansk Amy, however that does not work too. I have tried almost everything and
cant get the text in the Legend item to be underlined.

Can you please try to add a Legend Control and see if it the
textDecoration="underline" works for you?

Reply With Quote


  #10 (permalink)  
Old 10-31-2008, 06:27 PM
kartikjayaraman
 
Posts: n/a
Diggs:
Default Re: Legend control problems

Anyone having a similar problem with the Legend control?
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 06:22 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk