Tracy,
Container::getScrollableRect():Rectangle

uses usePadding,

Dumb answer on my part. I had to subclass canvas where I actually wanted the
padding to count in the scrollRect.

Sorry for the noise, I'm thinking to much these days. I agree, from a design
perspective there is no need to do what I said.

But for the sake of an explanation, usePadding has to do with the
contentPane and how it gets shifted when there is scrollable content, so
overriding that would give you padding even though your component is at 0,0
in the contentPane.

Mike

On Fri, Oct 17, 2008 at 1:36 PM, Tracy Spratt <[EMAIL PROTECTED]> wrote:

>    Hold on a minute.  Canvas uses absolute positioning.  So "padding"
> would only affect percentage resizing?  And 0,0 would still be top left
> corner, regardless of the padding?
>
>
>
> This seems kind of confusing.  I'm with Tim, and think this would be better
> solved with constraints.  I suppose you could declare Spacers of
> height="100%" and whatever width you wanted, and position them with
> constraints.
>
>
>
> Tracy
>
>
>  ------------------------------
>
> *From:* [email protected] [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Tim Hoff
> *Sent:* Friday, October 17, 2008 12:01 PM
> *To:* [email protected]
> *Subject:* [flexcoders] Re: how to add internal padding in canvas?
>
>
>
>
> Another alternative, if you have to use a Canvas and don't want to
> subclass, is to use constraints (top, bottom, left, right) on the
> children.
>
> -TH
>
> --- In [email protected] <flexcoders%40yahoogroups.com>,
> "markflex2007" <[EMAIL PROTECTED]>
> wrote:
> >
> > Hi,Mike
> >
> > Please let me know this in detail.
> >
> > I can extends Canvas and create a new class (like samrtcavas).
> >
> > I confuse how to use the class in mxml and how to set left/right
> paddings
> >
> > Thanks for your help
> >
> > Mark
> >
> >
> >
> > --- In [email protected] <flexcoders%40yahoogroups.com>,
> "Michael Schmalle"
> > teoti.graphix@ wrote:
> > >
> > > A hack that can be done if you really want Canvas is;
> > > Create a subclass of Canvas and override the usePadding property.
> > >
> > > override mx_internal get usePadding():Boolean
> > > {
> > > return true;
> > > }
> > >
> > > This will turn the padding back on when the
> > > layout calculates viewMetricsAndPadding.
> > >
> > > Mike
> > >
> >
>
>  
>



-- 
Teoti Graphix, LLC
http://www.teotigraphix.com

Teoti Graphix Blog
http://www.blog.teotigraphix.com

You can find more by solving the problem then by 'asking the question'.

Reply via email to