[EMAIL PROTECTED] Thu Apr 08 13:15:40 2004
Return-Path: <[EMAIL PROTECTED]>
X-Sender: [EMAIL PROTECTED]
X-Apparently-To: [email protected]
Received: (qmail 79594 invoked from network); 8 Apr 2004 11:09:54 -0000
Received: from unknown (66.218.66.166)
  by m13.grp.scd.yahoo.com with QMQP; 8 Apr 2004 11:09:53 -0000
Received: from unknown (HELO mail.plhosting.com) (65.39.254.10)
  by mta5.grp.scd.yahoo.com with SMTP; 8 Apr 2004 11:09:52 -0000
Received: (qmail 70412 invoked from network); 8 Apr 2004 11:08:49 -0000
Received: from d207-6-16-32.bchsia.telus.net (HELO JONATHAN) ([EMAIL 
PROTECTED]@207.6.16.32)
  by 192.168.100.102 with SMTP; 8 Apr 2004 11:08:49 -0000
To: <[email protected]>
Date: Thu, 8 Apr 2004 04:08:13 -0700
MIME-Version: 1.0
Content-Type: text/plain;
  charset="Windows-1252"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook, Build 11.0.5207
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
In-Reply-To: <[EMAIL PROTECTED]>
Thread-Index: AcQcuZW9Nw+sg8xsTI2H3pmOLrgYSwAoCD1g
X-eGroups-Remote-IP: 65.39.254.10
From: "Jonathan Bezuidenhout" <[EMAIL PROTECTED]>
Subject: RE: [flexcoders] combobox with graphics and text
X-Yahoo-Group-Post: member; u=181222631

Hi Ali,

Thank you very much for the code. I did notice the relationship between
ComboBox and List - but did not know how to turn that into something I could
use - now I know.

Thanks

Jonathan 

-----Original Message-----
From: Alistair McLeod [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 07, 2004 8:27 AM
To: [email protected]
Subject: RE: [flexcoders] combobox with graphics and text

Hi,

I've thrown together a blog entry about creating a combo box with icons,
including a couple of screenshots. It can be found here:

http://www.richinternetapps.com/archives/000048.html

Cheers,

Ali


On Wed, 2004-04-07 at 11:08, Alistair McLeod wrote:
> Hi,
> 
> Yes, custom Cell Renderers can be a better solution if we want more 
> control over what is being shown. Here is one i created to show a 
> debit or credit icon in a control (based heavily on an example that 
> ships with Flex). It could be extended to create both an image and a 
> Label as the cells for a combo box.
> 
> import mx.core.UIComponent
> import mx.controls.Image
>

> class com.iterationtwo.components.ImageCellRenderer extends 
> UIComponent {
> [Embed(source="debit.png")]
> var debitSymbol:String;
> [Embed(source="credit.png")]
> var creditSymbol:String;
>

> var image : MovieClip;
> var listOwner : MovieClip; // the reference we receive to the 
> list
> var getCellIndex : Function; // the function we receive from 
> the list
> var getDataLabel : Function; // the function we receive from 
> the list
>

> function ImageCellRenderer()
> {
> }
>

> function createChildren(Void) : Void
> {
> image = createClassObject( Image, "image", 1, 
> {styleName:this, owner:this});
> size();
> }
>

> function size(Void) : Void
> {
> image._x = (layoutWidth-20)/2;
> image._y = (layoutHeight-16)/2;
> }
>

> function setValue( str:String, item:Object, sel:Boolean ) :
> Void
> {
> var currentImage:String = image.source;
> var newImage:String = "";
>

> if ( item.type == "CDT" )
> newImage = creditSymbol;
> else if ( item.type == "DBT" )
> newImage = debitSymbol;
>

> if ( newImage != currentImage )
> image.source = newImage;
> }
>

> function getPreferredHeight(Void) : Number
> {
> return 16;
> }
>

> function getPreferredWidth(Void) : Number
> {
> return 20;
> }
>

> }
> 
> 
> On Wed, 2004-04-07 at 10:58, Waldo Smeets wrote: 
> > ..and if you want more control over the look and feel of each item 
> > and image, you might want to concider to use a custom CellRenderer.
> > 
> > Waldo
> 
> 
> Yahoo! Groups Sponsor
> ADVERTISEMENT
> click here
> 
> 
> ______________________________________________________________________
> Yahoo! Groups Links
> * To visit your group on the web, go to:
> http://groups.yahoo.com/group/flexcoders/
> 
> * To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
> 
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service.
* -- 
Alistair McLeod
Development Director
iteration::two



------------------------ Yahoo! Groups Sponsor ---------------------~--> Buy
Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark Printer
at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/nhFolB/TM
---------------------------------------------------------------------~->


Yahoo! Groups Links





---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.654 / Virus Database: 419 - Release Date: 4/6/2004


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.654 / Virus Database: 419 - Release Date: 4/6/2004



Reply via email to