Search the web
Sign In
New User? Sign Up
flexcoders · RIA Development with Adobe Flex
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Really complex buttons (aka what WPF got right)   Message List  
Reply | Forward Message #76219 of 150903 |
Hi, I'm still learning Flex and during the last few hours, I've been
struggling with some button-related problems.

I am trying to create a button which contains not only label and icon
but any arbitrary contents. If Flex was WPF, you could do something like

<mx:Button>
<mx:VBox>
<mx:Label ... />
<mx:Image ... />
<custom:Component ... />
</mx:VBox>
</mx:Button>

This approach really saves a lot of time and hassle but unfortunately
is not implemented in Flex (this would be great for future versions).
What I did in Flex was that I created a custom component based on
Canvas (say MyButton) and designed it however I wanted. I've set the
buttonMode property to true so I now have the nice hand cursor. Click
event is automatically there...

So far so good. But the ultimate goal is to have something like
TabNavigator, except that the tabs are pretty complicated MyButtons.
No again, because the TabBar is based on buttons, you can only set
label and icon. I don't think I can help myself creating a new class
based on TabBar because the Button limitation would be still there.

As far as I can see it, to have a custom button is fairly common
scenario and I can't believe that Flex makes it so hard for me as a
developer. There must be some way that I have simply missed.

Could anyone more experienced please advise me, or generally comment
on Flex composability of more advanced controls?

Thanks,
Borek




Fri Jun 1, 2007 4:31 pm

borekbe
Offline Offline
Send Email Send Email

Forward
Message #76219 of 150903 |
Expand Messages Author Sort by Date

Hi, I'm still learning Flex and during the last few hours, I've been struggling with some button-related problems. I am trying to create a button which...
borekbe
Offline Send Email
Jun 1, 2007
5:31 pm

Hi Borek. I can give you the short answer, which is that composition is an important goal of the flex framework. But we have two design goals which WPF...
Ely Greenfield
flattomato
Offline Send Email
Jun 1, 2007
6:00 pm

How about this: http://dougmccune.com/blog/2007/06/01/new-component-canvasbutton-added-to-flexlib/ Doug ... How about this:...
Doug McCune
dougmccune
Online Now Send Email
Jun 1, 2007
8:42 pm

Doug, this is extremely cool. It looks like this is exactly what I'm after. I hope this will solve the issues with TabNavigator (or TabBar) as well -- I will...
borekbe
Offline Send Email
Jun 1, 2007
10:16 pm

Hi Ely It's great to hear directly from a Flex developer! I would like to take a chance and share my views while you listen :) I must stress again that I'm...
borekbe
Offline Send Email
Jun 2, 2007
3:36 pm

I've been learning/doing a bit of WPF, Silverlight and Flex. Agree with alot of points discussed so far. I think Adobe (IMHO) should take some ideas from XAML...
pk_wasp
Offline Send Email
Jun 4, 2007
9:28 am

Hi Borek. Thanks for your thoughts. They are very much appreciated. And for what it's worth, on a purely technical level, I agree with you, Microsoft has done...
Ely Greenfield
flattomato
Offline Send Email
Jun 4, 2007
5:24 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help