I'm trying to find the balance between PAYG and mimicking the HTML/JS/CSS
side on the SWF side.

Take HorizontalLayout for example. On the JS side, this layout waits for
"childrenAdded" and then changes each child's display style to
"inline-block". If you then programmatically change one child's width, the
browser automatically pushes the children apart to make room. Since the
Flash Player does not have that capability, the HorizontalLayout, SWF
version, must watch for changes in the size of the children and re-run the
layout. This is the mimicking part.

I put the children size watching into the LayoutBase, thinking it was a
common enough, frequent enough process that it could be done in the base
class. But that really is not the case. Each layout is different.

Plus, there is no provision in the base layout for watching for new
children or removed children. In the PAYG world, those feature would be
part of other layouts:

HorizontalLayoutWatchForAddChild
HorizontalLayoutWatchForRemoveChild
HorizontalLayoutWatchForAddAndRemoveChild

Here's the catch: going back to the HorizontalLayout, if you remove a
child, the browser will automatically reposition the children to close the
space left by the child removed. You do not need to write a specialty
layout to do. So for HorizontalLayout, do we including watching for
children added and removed because it mimics the browser or is it really a
specialty? 

Right now, the event listeners watching for changes in the children are
multi-platform. A better, more PAYG approach (I think), is to make those
event listeners SWF-side only and they should be part of the layouts that
actually need them to mimic what the browser can do.

So perhaps that best thing to do now is wait for FlexJS 0.9 and try this
out an another branch to determine what the procedure should be.

‹peter


On 5/2/17, 2:52 AM, "piotrz" <piotrzarzyck...@gmail.com> wrote:

>Understand. It is not bad changes in terms of complex layout.
>I think this changes need to be done on feature branch. I would like to
>test
>it and see how it affects current examples.
>
>Piotr
>
>
>
>-----
>Apache Flex PMC
>piotrzarzyck...@gmail.com
>--
>View this message in context:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-development.2333347.n4.nabble.com%2FFlexJS-Layout-Issue-Change-tp61440p6
>1459.html&data=02%7C01%7C%7Ce012b30ad5354126a6a908d491297b5e%7Cfa7b1b5a7b3
>4438794aed2c178decee1%7C0%7C0%7C636293054727198273&sdata=2NhFc2LDt8sTFE17K
>Ylnjms1oE6YvbWo6lFVcolThHk%3D&reserved=0
>Sent from the Apache Flex Development mailing list archive at Nabble.com.

Reply via email to