[flexcoders] Re: Flex 4 layout documentation for spark ActionScript components

2010-06-09 Thread Florian
Yeah kinda... although i'd like to see some good documentation. "Using ADOBE® 
FLEX® 4" is a good start, but regarding the advanced topics...

Although the api is pretty clear i think i am just confused about that topic 
because i posted quite often about the issue of having a problems with 
determining the size of the group.

There are now 3 ways of implementing the layout of a component:
- [DisplayObject] x, y, with and height
- [UIComponent] move, setAtualSize, getExplicitOrMeasuredWidth and 
getExplicitOrMeasuredHeight
- [ILayoutElement] getLayoutBoundX, getLayoutBoundY, getLayoutBoundWidth, 
getLayoutBoundHeight, ...

This is quite a lot and i wonder if there is some document explaining which is 
best suited for which case. Should i stick to the ILayoutElement interface for 
now when possible or only in spark components. What are the side effects 
popping up - respectively not popping up although expected. You might 
understand my confusion.

Thanx for taking the time.

--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> Maybe this? http://www.adobe.com/devnet/flex/articles/spark_layouts.html
> 
> 
> On 6/8/10 11:24 PM, "Florian"  wrote:
> 
> 
> 
> 
> 
> 
> Hey Alex, is there already a more detailed documentation already on layouts 
> and how to define and implement them properly?
> 
> By this, i don't talk about implementing custom layout classes, but some 
> deeper insight on how the layout api works.
> 
> Best regards
> 
> --- In flexcoders@yahoogroups.com  , 
> Alex Harui  wrote:
> >
> > I may not be understanding your issue.  I'm pretty sure our 
> > SkinnableContainers delegate their assigned layouts to the contentGroup 
> > because the contentGroup's measurements affect the size given to it by its 
> > parent and the eventual call to updateDisplayList.  If you subclass 
> > updateDisplayList in the SkinnableComponent I don't see how the assigned 
> > layout will know that its measurement is not right.
> >
> > One way to encapsulate the measurement and layout logic together is to 
> > create a custom layout.  I suppose you could also just override measure() 
> > in the component as well.
> >
> >
> > On 5/31/10 12:34 AM, "Florian"  wrote:
> >
> >
> >
> >
> >
> >
> > Hi Alex, usually i would agree right on spot but the fact that i am using a 
> > basic layout in for group and the layouting is done correctly, i don't 
> > really see the need for another class. There is just one update of the 
> > measuring missing, which i don't understand.
> >
> > When a Group is using a BasicLayout contentWidth and contentHeight should 
> > be equal with width and height, if clipping is not enabled and no values 
> > for width or height are set explicitly. Or am i mistaken in this point?
> >
> > Best regards and thanks for taking the time.
> >
> > --- In flexcoders@yahoogroups.com   
> >  , Alex Harui  wrote:
> > >
> > > I would create a new Layout class and properly measure and layout in its 
> > > measure() and updateDisplayList() methods and use that as the 
> > > contentGroup's layout, otherwise the Group's default layout class is 
> > > going to be arguing with your code.
> > >
> > >
> > > On 5/30/10 3:36 AM, "Florian"  wrote:
> > >
> > >
> > >
> > >
> > >
> > >
> > > Hi,
> > >
> > > i was and i am still running into problems with sizing and placing 
> > > components in skins programmatically for spark ActionScript and 
> > > MXML/ActionScript components.
> > >
> > > I want to initialize the components in MXML and size and position the 
> > > children in the component's (a component's skin) updateDisplayList, 
> > > although this might be a bit of an uncommon approach.
> > >
> > > I was implementing the positioning via UIComponent.move, which i realized 
> > > was the wrong approach. After just setting the x and y properties, i did 
> > > some research and stumbled across the ILayoutElement and its methods like 
> > > setLayoutBoundsPosition and corresponding methods to modify the skin's 
> > > display list. But somehow the group, which contains the children, does 
> > > not propagate its new size up to its parent. I use the updateComplete 
> > > event to invalidate the group's size and force the layout to be 
> > > calculated properly a last time. The view looks as expected. But i don't 
> > > think that invalidating a component "a last time" after an updateComplete 
> > > event was dispatched is wrong.
> > >
> > > Now, what is the right approach for the following task: implementing a 
> > > skinnable component and a corresponding skin. The skin creates the skin 
> > > parts in MXML in a Group (id="contentGroup") but the layout is calculated 
> > > within the skin's updateDisplayList method.
> > >
> > > I only found one useful article on the web, which is not really a lot of 
> > > information at all 
> > > (http://www.adobe.com/devnet/flex/articles/spark_layouts_print.html).
> > >
> > > Best

Re: [flexcoders] Re: Flex 4 layout documentation for spark ActionScript components

2010-06-09 Thread Alex Harui
Maybe this? http://www.adobe.com/devnet/flex/articles/spark_layouts.html


On 6/8/10 11:24 PM, "Florian"  wrote:






Hey Alex, is there already a more detailed documentation already on layouts and 
how to define and implement them properly?

By this, i don't talk about implementing custom layout classes, but some deeper 
insight on how the layout api works.

Best regards

--- In flexcoders@yahoogroups.com  , Alex 
Harui  wrote:
>
> I may not be understanding your issue.  I'm pretty sure our 
> SkinnableContainers delegate their assigned layouts to the contentGroup 
> because the contentGroup's measurements affect the size given to it by its 
> parent and the eventual call to updateDisplayList.  If you subclass 
> updateDisplayList in the SkinnableComponent I don't see how the assigned 
> layout will know that its measurement is not right.
>
> One way to encapsulate the measurement and layout logic together is to create 
> a custom layout.  I suppose you could also just override measure() in the 
> component as well.
>
>
> On 5/31/10 12:34 AM, "Florian"  wrote:
>
>
>
>
>
>
> Hi Alex, usually i would agree right on spot but the fact that i am using a 
> basic layout in for group and the layouting is done correctly, i don't really 
> see the need for another class. There is just one update of the measuring 
> missing, which i don't understand.
>
> When a Group is using a BasicLayout contentWidth and contentHeight should be 
> equal with width and height, if clipping is not enabled and no values for 
> width or height are set explicitly. Or am i mistaken in this point?
>
> Best regards and thanks for taking the time.
>
> --- In flexcoders@yahoogroups.com   
>  , Alex Harui  wrote:
> >
> > I would create a new Layout class and properly measure and layout in its 
> > measure() and updateDisplayList() methods and use that as the 
> > contentGroup's layout, otherwise the Group's default layout class is going 
> > to be arguing with your code.
> >
> >
> > On 5/30/10 3:36 AM, "Florian"  wrote:
> >
> >
> >
> >
> >
> >
> > Hi,
> >
> > i was and i am still running into problems with sizing and placing 
> > components in skins programmatically for spark ActionScript and 
> > MXML/ActionScript components.
> >
> > I want to initialize the components in MXML and size and position the 
> > children in the component's (a component's skin) updateDisplayList, 
> > although this might be a bit of an uncommon approach.
> >
> > I was implementing the positioning via UIComponent.move, which i realized 
> > was the wrong approach. After just setting the x and y properties, i did 
> > some research and stumbled across the ILayoutElement and its methods like 
> > setLayoutBoundsPosition and corresponding methods to modify the skin's 
> > display list. But somehow the group, which contains the children, does not 
> > propagate its new size up to its parent. I use the updateComplete event to 
> > invalidate the group's size and force the layout to be calculated properly 
> > a last time. The view looks as expected. But i don't think that 
> > invalidating a component "a last time" after an updateComplete event was 
> > dispatched is wrong.
> >
> > Now, what is the right approach for the following task: implementing a 
> > skinnable component and a corresponding skin. The skin creates the skin 
> > parts in MXML in a Group (id="contentGroup") but the layout is calculated 
> > within the skin's updateDisplayList method.
> >
> > I only found one useful article on the web, which is not really a lot of 
> > information at all 
> > (http://www.adobe.com/devnet/flex/articles/spark_layouts_print.html).
> >
> > Best regards.
> >
> >
> >
> >
> >
> >
> > --
> > Alex Harui
> > Flex SDK Team
> > Adobe System, Inc.
> > http://blogs.adobe.com/aharui
> >
>
>
>
>
>
>
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>






--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui


[flexcoders] Re: Flex 4 layout documentation for spark ActionScript components

2010-06-08 Thread Florian
Hey Alex, is there already a more detailed documentation already on layouts and 
how to define and implement them properly?

By this, i don't talk about implementing custom layout classes, but some deeper 
insight on how the layout api works.

Best regards

--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> I may not be understanding your issue.  I'm pretty sure our 
> SkinnableContainers delegate their assigned layouts to the contentGroup 
> because the contentGroup's measurements affect the size given to it by its 
> parent and the eventual call to updateDisplayList.  If you subclass 
> updateDisplayList in the SkinnableComponent I don't see how the assigned 
> layout will know that its measurement is not right.
> 
> One way to encapsulate the measurement and layout logic together is to create 
> a custom layout.  I suppose you could also just override measure() in the 
> component as well.
> 
> 
> On 5/31/10 12:34 AM, "Florian"  wrote:
> 
> 
> 
> 
> 
> 
> Hi Alex, usually i would agree right on spot but the fact that i am using a 
> basic layout in for group and the layouting is done correctly, i don't really 
> see the need for another class. There is just one update of the measuring 
> missing, which i don't understand.
> 
> When a Group is using a BasicLayout contentWidth and contentHeight should be 
> equal with width and height, if clipping is not enabled and no values for 
> width or height are set explicitly. Or am i mistaken in this point?
> 
> Best regards and thanks for taking the time.
> 
> --- In flexcoders@yahoogroups.com  , 
> Alex Harui  wrote:
> >
> > I would create a new Layout class and properly measure and layout in its 
> > measure() and updateDisplayList() methods and use that as the 
> > contentGroup's layout, otherwise the Group's default layout class is going 
> > to be arguing with your code.
> >
> >
> > On 5/30/10 3:36 AM, "Florian"  wrote:
> >
> >
> >
> >
> >
> >
> > Hi,
> >
> > i was and i am still running into problems with sizing and placing 
> > components in skins programmatically for spark ActionScript and 
> > MXML/ActionScript components.
> >
> > I want to initialize the components in MXML and size and position the 
> > children in the component's (a component's skin) updateDisplayList, 
> > although this might be a bit of an uncommon approach.
> >
> > I was implementing the positioning via UIComponent.move, which i realized 
> > was the wrong approach. After just setting the x and y properties, i did 
> > some research and stumbled across the ILayoutElement and its methods like 
> > setLayoutBoundsPosition and corresponding methods to modify the skin's 
> > display list. But somehow the group, which contains the children, does not 
> > propagate its new size up to its parent. I use the updateComplete event to 
> > invalidate the group's size and force the layout to be calculated properly 
> > a last time. The view looks as expected. But i don't think that 
> > invalidating a component "a last time" after an updateComplete event was 
> > dispatched is wrong.
> >
> > Now, what is the right approach for the following task: implementing a 
> > skinnable component and a corresponding skin. The skin creates the skin 
> > parts in MXML in a Group (id="contentGroup") but the layout is calculated 
> > within the skin's updateDisplayList method.
> >
> > I only found one useful article on the web, which is not really a lot of 
> > information at all 
> > (http://www.adobe.com/devnet/flex/articles/spark_layouts_print.html).
> >
> > Best regards.
> >
> >
> >
> >
> >
> >
> > --
> > Alex Harui
> > Flex SDK Team
> > Adobe System, Inc.
> > http://blogs.adobe.com/aharui
> >
> 
> 
> 
> 
> 
> 
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>




[flexcoders] Re: Flex 4 layout documentation for spark ActionScript components

2010-06-04 Thread Florian
I created a ticket at adobe's jira:

https://bugs.adobe.com/jira/browse/SDK-26621

Best regards

--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> I may not be understanding your issue.  I'm pretty sure our 
> SkinnableContainers delegate their assigned layouts to the contentGroup 
> because the contentGroup's measurements affect the size given to it by its 
> parent and the eventual call to updateDisplayList.  If you subclass 
> updateDisplayList in the SkinnableComponent I don't see how the assigned 
> layout will know that its measurement is not right.
> 
> One way to encapsulate the measurement and layout logic together is to create 
> a custom layout.  I suppose you could also just override measure() in the 
> component as well.
> 
> 
> On 5/31/10 12:34 AM, "Florian"  wrote:
> 
> 
> 
> 
> 
> 
> Hi Alex, usually i would agree right on spot but the fact that i am using a 
> basic layout in for group and the layouting is done correctly, i don't really 
> see the need for another class. There is just one update of the measuring 
> missing, which i don't understand.
> 
> When a Group is using a BasicLayout contentWidth and contentHeight should be 
> equal with width and height, if clipping is not enabled and no values for 
> width or height are set explicitly. Or am i mistaken in this point?
> 
> Best regards and thanks for taking the time.
> 
> --- In flexcoders@yahoogroups.com  , 
> Alex Harui  wrote:
> >
> > I would create a new Layout class and properly measure and layout in its 
> > measure() and updateDisplayList() methods and use that as the 
> > contentGroup's layout, otherwise the Group's default layout class is going 
> > to be arguing with your code.
> >
> >
> > On 5/30/10 3:36 AM, "Florian"  wrote:
> >
> >
> >
> >
> >
> >
> > Hi,
> >
> > i was and i am still running into problems with sizing and placing 
> > components in skins programmatically for spark ActionScript and 
> > MXML/ActionScript components.
> >
> > I want to initialize the components in MXML and size and position the 
> > children in the component's (a component's skin) updateDisplayList, 
> > although this might be a bit of an uncommon approach.
> >
> > I was implementing the positioning via UIComponent.move, which i realized 
> > was the wrong approach. After just setting the x and y properties, i did 
> > some research and stumbled across the ILayoutElement and its methods like 
> > setLayoutBoundsPosition and corresponding methods to modify the skin's 
> > display list. But somehow the group, which contains the children, does not 
> > propagate its new size up to its parent. I use the updateComplete event to 
> > invalidate the group's size and force the layout to be calculated properly 
> > a last time. The view looks as expected. But i don't think that 
> > invalidating a component "a last time" after an updateComplete event was 
> > dispatched is wrong.
> >
> > Now, what is the right approach for the following task: implementing a 
> > skinnable component and a corresponding skin. The skin creates the skin 
> > parts in MXML in a Group (id="contentGroup") but the layout is calculated 
> > within the skin's updateDisplayList method.
> >
> > I only found one useful article on the web, which is not really a lot of 
> > information at all 
> > (http://www.adobe.com/devnet/flex/articles/spark_layouts_print.html).
> >
> > Best regards.
> >
> >
> >
> >
> >
> >
> > --
> > Alex Harui
> > Flex SDK Team
> > Adobe System, Inc.
> > http://blogs.adobe.com/aharui
> >
> 
> 
> 
> 
> 
> 
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>




[flexcoders] Re: Flex 4 layout documentation for spark ActionScript components

2010-06-03 Thread Florian
Hi Alex, i coded a short example.

http://www.box.net/shared/knmjmazcvv

The zip file contains 3 files: HelloWorld.mxml (the application), 
MyComponent.as and MySkin.mxml. If you remove the comment in line 42 in 
MySkin.mxml, you'll notice that the measuring is done correctly, as far as i 
understand. Whereas the code without the additional invalidation call leads to 
missing calculations of the positioning.

What i don't understand: which values should i expect when dealing with groups 
and why does the result differ.

Best regards.

--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> I may not be understanding your issue.  I'm pretty sure our 
> SkinnableContainers delegate their assigned layouts to the contentGroup 
> because the contentGroup's measurements affect the size given to it by its 
> parent and the eventual call to updateDisplayList.  If you subclass 
> updateDisplayList in the SkinnableComponent I don't see how the assigned 
> layout will know that its measurement is not right.
> 
> One way to encapsulate the measurement and layout logic together is to create 
> a custom layout.  I suppose you could also just override measure() in the 
> component as well.
> 
> 
> On 5/31/10 12:34 AM, "Florian"  wrote:
> 
> 
> 
> 
> 
> 
> Hi Alex, usually i would agree right on spot but the fact that i am using a 
> basic layout in for group and the layouting is done correctly, i don't really 
> see the need for another class. There is just one update of the measuring 
> missing, which i don't understand.
> 
> When a Group is using a BasicLayout contentWidth and contentHeight should be 
> equal with width and height, if clipping is not enabled and no values for 
> width or height are set explicitly. Or am i mistaken in this point?
> 
> Best regards and thanks for taking the time.
> 
> --- In flexcoders@yahoogroups.com  , 
> Alex Harui  wrote:
> >
> > I would create a new Layout class and properly measure and layout in its 
> > measure() and updateDisplayList() methods and use that as the 
> > contentGroup's layout, otherwise the Group's default layout class is going 
> > to be arguing with your code.
> >
> >
> > On 5/30/10 3:36 AM, "Florian"  wrote:
> >
> >
> >
> >
> >
> >
> > Hi,
> >
> > i was and i am still running into problems with sizing and placing 
> > components in skins programmatically for spark ActionScript and 
> > MXML/ActionScript components.
> >
> > I want to initialize the components in MXML and size and position the 
> > children in the component's (a component's skin) updateDisplayList, 
> > although this might be a bit of an uncommon approach.
> >
> > I was implementing the positioning via UIComponent.move, which i realized 
> > was the wrong approach. After just setting the x and y properties, i did 
> > some research and stumbled across the ILayoutElement and its methods like 
> > setLayoutBoundsPosition and corresponding methods to modify the skin's 
> > display list. But somehow the group, which contains the children, does not 
> > propagate its new size up to its parent. I use the updateComplete event to 
> > invalidate the group's size and force the layout to be calculated properly 
> > a last time. The view looks as expected. But i don't think that 
> > invalidating a component "a last time" after an updateComplete event was 
> > dispatched is wrong.
> >
> > Now, what is the right approach for the following task: implementing a 
> > skinnable component and a corresponding skin. The skin creates the skin 
> > parts in MXML in a Group (id="contentGroup") but the layout is calculated 
> > within the skin's updateDisplayList method.
> >
> > I only found one useful article on the web, which is not really a lot of 
> > information at all 
> > (http://www.adobe.com/devnet/flex/articles/spark_layouts_print.html).
> >
> > Best regards.
> >
> >
> >
> >
> >
> >
> > --
> > Alex Harui
> > Flex SDK Team
> > Adobe System, Inc.
> > http://blogs.adobe.com/aharui
> >
> 
> 
> 
> 
> 
> 
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>




[flexcoders] Re: Flex 4 layout documentation for spark ActionScript components

2010-06-02 Thread Florian



Hi Alex,


the component hierarchy:


__

__




__

__


There is no specific layout applied, since an absolute positioning is required. 
Now when setting the positions of  elements programmatically with the 
API of the ILayoutElement interface, the width and height values are not set 
properly for the contentGroup. contentWidth and contentHeight have the right 
values. I have to register an event handler for FlexEvent.UPDATE_COMPLETE and 
invalidate the contentGroup again. After the additional invalidation cycle, 
width and height are set as expected.

I'll post an example tomorrow.

--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> I may not be understanding your issue.  I'm pretty sure our 
> SkinnableContainers delegate their assigned layouts to the contentGroup 
> because the contentGroup's measurements affect the size given to it by its 
> parent and the eventual call to updateDisplayList.  If you subclass 
> updateDisplayList in the SkinnableComponent I don't see how the assigned 
> layout will know that its measurement is not right.
> 
> One way to encapsulate the measurement and layout logic together is to create 
> a custom layout.  I suppose you could also just override measure() in the 
> component as well.
> 
> 
> On 5/31/10 12:34 AM, "Florian"  wrote:
> 
> 
> 
> 
> 
> 
> Hi Alex, usually i would agree right on spot but the fact that i am using a 
> basic layout in for group and the layouting is done correctly, i don't really 
> see the need for another class. There is just one update of the measuring 
> missing, which i don't understand.
> 
> When a Group is using a BasicLayout contentWidth and contentHeight should be 
> equal with width and height, if clipping is not enabled and no values for 
> width or height are set explicitly. Or am i mistaken in this point?
> 
> Best regards and thanks for taking the time.
> 
> --- In flexcoders@yahoogroups.com  , 
> Alex Harui  wrote:
> >
> > I would create a new Layout class and properly measure and layout in its 
> > measure() and updateDisplayList() methods and use that as the 
> > contentGroup's layout, otherwise the Group's default layout class is going 
> > to be arguing with your code.
> >
> >
> > On 5/30/10 3:36 AM, "Florian"  wrote:
> >
> >
> >
> >
> >
> >
> > Hi,
> >
> > i was and i am still running into problems with sizing and placing 
> > components in skins programmatically for spark ActionScript and 
> > MXML/ActionScript components.
> >
> > I want to initialize the components in MXML and size and position the 
> > children in the component's (a component's skin) updateDisplayList, 
> > although this might be a bit of an uncommon approach.
> >
> > I was implementing the positioning via UIComponent.move, which i realized 
> > was the wrong approach. After just setting the x and y properties, i did 
> > some research and stumbled across the ILayoutElement and its methods like 
> > setLayoutBoundsPosition and corresponding methods to modify the skin's 
> > display list. But somehow the group, which contains the children, does not 
> > propagate its new size up to its parent. I use the updateComplete event to 
> > invalidate the group's size and force the layout to be calculated properly 
> > a last time. The view looks as expected. But i don't think that 
> > invalidating a component "a last time" after an updateComplete event was 
> > dispatched is wrong.
> >
> > Now, what is the right approach for the following task: implementing a 
> > skinnable component and a corresponding skin. The skin creates the skin 
> > parts in MXML in a Group (id="contentGroup") but the layout is calculated 
> > within the skin's updateDisplayList method.
> >
> > I only found one useful article on the web, which is not really a lot of 
> > information at all 
> > (http://www.adobe.com/devnet/flex/articles/spark_layouts_print.html).
> >
> > Best regards.
> >
> >
> >
> >
> >
> >
> > --
> > Alex Harui
> > Flex SDK Team
> > Adobe System, Inc.
> > http://blogs.adobe.com/aharui
> >
> 
> 
> 
> 
> 
> 
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>



Re: [flexcoders] Re: Flex 4 layout documentation for spark ActionScript components

2010-05-31 Thread Alex Harui
I may not be understanding your issue.  I’m pretty sure our SkinnableContainers 
delegate their assigned layouts to the contentGroup because the contentGroup’s 
measurements affect the size given to it by its parent and the eventual call to 
updateDisplayList.  If you subclass updateDisplayList in the SkinnableComponent 
I don’t see how the assigned layout will know that its measurement is not right.

One way to encapsulate the measurement and layout logic together is to create a 
custom layout.  I suppose you could also just override measure() in the 
component as well.


On 5/31/10 12:34 AM, "Florian"  wrote:






Hi Alex, usually i would agree right on spot but the fact that i am using a 
basic layout in for group and the layouting is done correctly, i don't really 
see the need for another class. There is just one update of the measuring 
missing, which i don't understand.

When a Group is using a BasicLayout contentWidth and contentHeight should be 
equal with width and height, if clipping is not enabled and no values for width 
or height are set explicitly. Or am i mistaken in this point?

Best regards and thanks for taking the time.

--- In flexcoders@yahoogroups.com  , Alex 
Harui  wrote:
>
> I would create a new Layout class and properly measure and layout in its 
> measure() and updateDisplayList() methods and use that as the contentGroup's 
> layout, otherwise the Group's default layout class is going to be arguing 
> with your code.
>
>
> On 5/30/10 3:36 AM, "Florian"  wrote:
>
>
>
>
>
>
> Hi,
>
> i was and i am still running into problems with sizing and placing components 
> in skins programmatically for spark ActionScript and MXML/ActionScript 
> components.
>
> I want to initialize the components in MXML and size and position the 
> children in the component's (a component's skin) updateDisplayList, although 
> this might be a bit of an uncommon approach.
>
> I was implementing the positioning via UIComponent.move, which i realized was 
> the wrong approach. After just setting the x and y properties, i did some 
> research and stumbled across the ILayoutElement and its methods like 
> setLayoutBoundsPosition and corresponding methods to modify the skin's 
> display list. But somehow the group, which contains the children, does not 
> propagate its new size up to its parent. I use the updateComplete event to 
> invalidate the group's size and force the layout to be calculated properly a 
> last time. The view looks as expected. But i don't think that invalidating a 
> component "a last time" after an updateComplete event was dispatched is wrong.
>
> Now, what is the right approach for the following task: implementing a 
> skinnable component and a corresponding skin. The skin creates the skin parts 
> in MXML in a Group (id="contentGroup") but the layout is calculated within 
> the skin's updateDisplayList method.
>
> I only found one useful article on the web, which is not really a lot of 
> information at all 
> (http://www.adobe.com/devnet/flex/articles/spark_layouts_print.html).
>
> Best regards.
>
>
>
>
>
>
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>






--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui


[flexcoders] Re: Flex 4 layout documentation for spark ActionScript components

2010-05-31 Thread Florian
Hi Alex, usually i would agree right on spot but the fact that i am using a 
basic layout in for group and the layouting is done correctly, i don't really 
see the need for another class. There is just one update of the measuring 
missing, which i don't understand.

When a Group is using a BasicLayout contentWidth and contentHeight should be 
equal with width and height, if clipping is not enabled and no values for width 
or height are set explicitly. Or am i mistaken in this point?

Best regards and thanks for taking the time.

--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> I would create a new Layout class and properly measure and layout in its 
> measure() and updateDisplayList() methods and use that as the contentGroup's 
> layout, otherwise the Group's default layout class is going to be arguing 
> with your code.
> 
> 
> On 5/30/10 3:36 AM, "Florian"  wrote:
> 
> 
> 
> 
> 
> 
> Hi,
> 
> i was and i am still running into problems with sizing and placing components 
> in skins programmatically for spark ActionScript and MXML/ActionScript 
> components.
> 
> I want to initialize the components in MXML and size and position the 
> children in the component's (a component's skin) updateDisplayList, although 
> this might be a bit of an uncommon approach.
> 
> I was implementing the positioning via UIComponent.move, which i realized was 
> the wrong approach. After just setting the x and y properties, i did some 
> research and stumbled across the ILayoutElement and its methods like 
> setLayoutBoundsPosition and corresponding methods to modify the skin's 
> display list. But somehow the group, which contains the children, does not 
> propagate its new size up to its parent. I use the updateComplete event to 
> invalidate the group's size and force the layout to be calculated properly a 
> last time. The view looks as expected. But i don't think that invalidating a 
> component "a last time" after an updateComplete event was dispatched is wrong.
> 
> Now, what is the right approach for the following task: implementing a 
> skinnable component and a corresponding skin. The skin creates the skin parts 
> in MXML in a Group (id="contentGroup") but the layout is calculated within 
> the skin's updateDisplayList method.
> 
> I only found one useful article on the web, which is not really a lot of 
> information at all 
> (http://www.adobe.com/devnet/flex/articles/spark_layouts_print.html).
> 
> Best regards.
> 
> 
> 
> 
> 
> 
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>