ahh well thats good, as i'm now not alone in doing this! :)

Q. How do you subclass control tags, as at the moment I tried to do a
DataGrid before but when i use <mx:columns> it spat an error.

inside the custom xml all i did was 

com/inco/CustomTags/DataGrid.mxml
----
<mx:DataGrid initialize="initLayout()"><mx:Script
source="myLayout.as"/> </mx:DataGrid>


-- index.mxml

<inco:DataGrid>
<mx:columns>
<mx:Array>
// columns here...
</mx:Array>
</mx:columns>
</inco:DataGrid>

On Tue, 22 Mar 2005 13:55:49 +1200, Chris Reynolds
<[EMAIL PROTECTED]> wrote:
>  
> Hi scott, 
>   
> as a matter of course, I have subclassed all the tags. 
> That way, when any defaults or behaviours irritate me, I have a place to fix
> them. 
>  
>  
>  ________________________________
>  From: Scott Barnes [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, March 22, 2005 1:49 PM
> To: [email protected]
> Subject: [flexcoders] AutoWidth/AutoHeight?
> 
>  
> I've found that i've been constantly typing width="100%" height="100%"
> and so on for containers within containers and what not, and have
> found it to be tedious task.
> 
> The thing is though, sometimes i want width="100%" but height to be
> default (ie whatever the height of the movieclip in question)
> 
> but most of the time i've wanted 100% for both metrics for a typical
> container.
> 
> To combat this i put together a buch of custom MXML components that
> simply use the MX built-in ones, but on initialize they simply setup
> some default settings (margins, width/height etc)
> 
> At the same time i have an attribute like autoHeight=false|true which
> will set the height to 100% or don't automatically define the height
> 
> so the code looks like:
> 
> public var autoHeight:Boolean = true;
> 
> function autoLayout() {
>         if(autoHeight) {
>             height = height || "100%";
>         }
> 
> }
> 
> then when i want to use an autoLayout container i would do this:
> 
> <inco:VBox>
> //... Stuff here.
> 
> </inco:VBox>
> 
> Now, does anyone else do something similiar? or have found it a
> repetitive task? have i overlooked an attribute setting somewhere - (I
> had thought of using CSS but thats not as agile as my autoLayout
> capabilities)
> 
> 
> 
> -- 
> Regards,
> Scott Barnes
> http://www.mossyblog.com
> http://www.flexcoder.com (Coming Soon)
> 
>  
>  
>  Yahoo! Groups Sponsor 
>  
>  ADVERTISEMENT
>  
>  
>  ________________________________
>  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. 


-- 
Regards,
Scott Barnes
http://www.mossyblog.com
http://www.flexcoder.com (Coming Soon)


 
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:
    http://docs.yahoo.com/info/terms/
 



Reply via email to