Ah, ok.  So if you want to clip 20 pixels, then you need to make sure that button2 is always 20 pixels wider than the enclosing canvas.  You can make use of binding:

<mx:HBox width="100%" height="100%" backgroundColor="yellow">
    <mx:Button label="number1" width="75%"/>
    <mx:Canvas id="mycanvas" width="25%" horizontalScrollPolicy="off">
        <mx:Button width="{mycanvas.width+20}" label="number2"/>
    </mx:Canvas>
</mx:HBox>

Yes, it's quite a pain when the HBox/VBox just won't clip their content.  I always thought it was a bug.


On 6/20/06, bhaq1972 <[EMAIL PROTECTED]> wrote:
sorry, the width of button2 should have been 100% (i only want to
specify percentage widths).

> I'm not sure exactly what effect you want.  Do you always want a
part of
> button2 to be clipped off the right?  If so, by how much?
>

Thats correct. i want to have part of the button clipped off to the
right.

i'm only using a button as an example (could be any gui control).

Essentially i want to clip the right edge of the following example.

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
        <mx:HBox width="100%" height="100" backgroundColor="yellow"
paddingRight="-20" clipContent="true">
            <mx:Button label="number1" width="75%"/>
            <mx:Canvas width="25%" horizontalScrollPolicy="off">
                <mx:Button width="100%" label="number2"/>
            </mx:Canvas>
        </mx:HBox>
</mx:Application>

if i was using a Canvas instead of an HBox in the above example. it
works.....but then i'll have to position the children.


--- In flexcoders@yahoogroups.com, "Jason Y. Kwong" <[EMAIL PROTECTED]>
wrote:
>
> I'm not sure exactly what effect you want.  Do you always want a
part of
> button2 to be clipped off the right?  If so, by how much?
>
> What's happening in my example is that the nested Canvas gives
button2 only
> 25% of the available horizontal space.  When the HBox was 300
pixels wide,
> that gave it 75 pixels.  Since I set button2 to be 100 pixels
wide, the
> right 25 pixels are cut off.
>
> But if you set the HBox's width to be 100%, then that 25% space
could be a
> lot wider than 75 pixels.  If it goes over 100 pixels, then of
course all of
> button2 would be shown.  You'll have to play with the numbers to
get a
> specific effect.
>
>
> On 6/20/06, bhaq1972 <[EMAIL PROTECTED]> wrote:
> >
> > hi Jason
> >
> > How can I keep this effect if i modify your example to become
> >
> > <mx:HBox width="100%" height="100" backgroundColor="yellow">
> >      <mx:Button label="number1" width="75%"/>
> >      <mx:Canvas width="25%" horizontalScrollPolicy="off">
> >          <mx:Button width="100" label="number2"/>
> >      </mx:Canvas>
> > </mx:HBox>
> >
> > thanks
> > bod
> >
> > --- In flexcoders@yahoogroups.com, "Jason Y. Kwong" <inlineblue@>
> > wrote:
> > >
> > > Have a nested container do the clipping for you. eg:
> > >
> > > <mx:HBox width="300" height="100" backgroundColor="yellow">
> > >     <mx:Button label="number1" width="75%"/>
> > >     <mx:Canvas width="25%" horizontalScrollPolicy="off">
> > >         <mx:Button width="100" label="number2"/>
> > >     </mx:Canvas>
> > > </mx:HBox>
> > >
> > >
> > > On 6/16/06, bhaq1972 <mbhaque@> wrote:
> > > >
> > > > Mike and Tom thanks for the input.
> > > >
> > > > firstly, I tried using clipContent before but doesn't work.
> > > >
> > > > if i was dealing with fixed widths and set the
> > > > horizonatalScrollPolicy 'off', i can achieve the effect i was
> > > > looking for eg
> > > >
> > > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
> > xmlns="*" >
> > > >         <mx:HBox width="300" height="100"
> > backgroundColor="yellow"
> > > > horizontalScrollPolicy="off">
> > > >         <mx:Button label="number1" width="225"/>
> > > >         <mx:Button label="number2" width="85"/>
> > > >     </mx:HBox>
> > > > </mx:Application>
> > > >
> > > > But as i'm not dealing with fixed button widths, i had to
think
> > of
> > > > another way to get this effect....hence paddingRight=-15 and
some
> > > > kind of contentClip.
> > > >
> > > > As i'm only dealing with layout, i would have thought
something
> > > > would work out of the box. Adobe???
> > > >
> > > > I'm willing to try your suggestion of a mask, if you can
gives
> > us a
> > > > few ideas on how to do that thanks.
> > > >
> > > >
> > > > regrds
> > > > bod
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > --- In flexcoders@yahoogroups.com, "Michael Schmalle"
> > > > <teoti.graphix@> wrote:
> > > > >
> > > > > > I don't think the layout algorithm  takes negetives into
> > account.
> > > > >
> > > > > I didn't mean it doesn't use the negetive padding, just it
> > doesn't
> > > > calculate
> > > > > the 'measured width' right when laying out the mask for the
> > > > container using
> > > > > a negetive padding with a percentage.
> > > > >
> > > > > Ah, to hard to explain right.
> > > > >
> > > > > Peace, Mike
> > > > >
> > > > > On 6/15/06, Michael Schmalle <teoti.graphix@> wrote:
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > For you to understand the problem you need to understand
how
> > the
> > > > HBox lays
> > > > > > it's children out and uses viewMetrics.
> > > > > >
> > > > > > The reason this is not working is because since you
specified
> > > > 75% width,
> > > > > > the container will calc the .75 of the width minus
anything
> > that
> > > > is static
> > > > > > IE your button 2.
> > > > > >
> > > > > > When you say paddingRight = -15, this kind defines the
logic
> > of
> > > > the
> > > > > > layout.
> > > > > >
> > > > > > For some reason, when you specify -15 for paddingLeft,
the
> > > > content on both
> > > > > > sides then get clipped.
> > > > > >
> > > > > > I am not Adobe, but I would venture to guess this cannot
be
> > done
> > > > right
> > > > > > now. Not saying this is a bug but, I don't think the
layout
> > > > algorithm  takes
> > > > > > negetives into account.
> > > > > >
> > > > > > You could always subclass HBox and create a mask over it
and
> > use
> > > > > > borderMetrics to size the mask.
> > > > > >
> > > > > > Peace, Mike
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 6/15/06, Tom Chiverton <tom.chiverton @> wrote:
> > > > > > >
> > > > > > >    On Thursday 15 June 2006 12:09, bhaq1972 wrote:
> > > > > > > > how do i achieve this ?
> > > > > > >
> > > > > > > clipContent ?
> > > > > > >
> > > > > > > --
> > > > > > > Tom Chiverton
> > > > > > >
> > > > > > > ****************************************************
> > > > > > >
> > > > > > > This email is sent for and on behalf of Halliwells LLP.
> > > > > > >
> > > > > > > Halliwells LLP is a limited liability partnership
> > registered
> > > > in England
> > > > > > > and Wales under registered number OC307980 whose
registered
> > > > office address
> > > > > > > is at St James's Court Brown Street Manchester M2 2JF.
A
> > list
> > > > of members is
> > > > > > > available for inspection at the registered office. Any
> > > > reference to a
> > > > > > > partner in relation to Halliwells LLP means a member of
> > > > Halliwells LLP.
> > > > > > > Regulated by the Law Society.
> > > > > > >
> > > > > > > CONFIDENTIALITY
> > > > > > >
> > > > > > > This email is intended only for the use of the
addressee
> > named
> > > > above and
> > > > > > > may be confidential or legally privileged. If you are
not
> > the
> > > > addressee you
> > > > > > > must not read it and must not use any information
> > contained in
> > > > nor copy it
> > > > > > > nor inform any person other than Halliwells LLP or the
> > > > addressee of its
> > > > > > > existence or contents. If you have received this email
in
> > > > error please
> > > > > > > delete it and notify Halliwells LLP IT Department on
0870
> > 365
> > > > 8008.
> > > > > > >
> > > > > > > For more information about Halliwells LLP visit
> > > > www.halliwells.com.
> > > > > > >
> > > > > > > We are pleased to announce that Halliwells LLP has been
> > voted
> > > > AIM Lawyer
> > > > > > > of the Year at the 2005 Growth Company Awards
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > What goes up, does come down.
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > What goes up, does come down.
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Flexcoders Mailing List
> > > > FAQ:
> > http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > > > Search Archives: http://www.mail-archive.com/flexcoders%
> > 40yahoogroups.com
> > > > Yahoo! Groups Links
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> >
> >
> >
> >
> >
> >
> >
> >
> > --
> > Flexcoders Mailing List
> > FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives: http://www.mail-archive.com/flexcoders%
40yahoogroups.com
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
>






------------------------ Yahoo! Groups Sponsor --------------------~-->
Check out the new improvements in Yahoo! Groups email.
http://us.click.yahoo.com/6pRQfA/fOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~->

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
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/





__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to