You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Kessler CTR Mark J <ma...@usmc.mil> on 2012/12/21 15:44:51 UTC
[Component] Spacer
Just curious if we could add a simple component that used to exist in MX but not in Spark. The spacer component was just a simple UI extension. We can do the exact same thing now with the s:Rect (primitive), but it doesn't have an intuitive name. I think it would be nice to add the spacer back in.
<s:Rect width="100%" />
--Same as--
<s:Spacer width="100%" />
Class:
//Declare package.
package spark.components
{
//Create child class of the Rect class.
public class Spacer extends Rect
{
//----------------------------------------
// Constructor
//----------------------------------------
public function Spacer()
{
super();
}
}
}
-Mark
RE: [Component] Spacer
Posted by Kessler CTR Mark J <ma...@usmc.mil>.
Good point besides the general sizing/measuring I am wasting the rest... it simplifies it a little too. I don't use the spacers often, but I do use them to solve quick layouts for clients who must have a things displayed in a certain way.
Class:
//Declare package.
package spark.components
{
import spark.primitives.supportClasses.GraphicElement;
//Create child class of the GraphicElement class.
public class Spacer extends GraphicElement
{
//----------------------------------------
// Constructor
//----------------------------------------
public function Spacer()
{
super();
}
}
}
-Mark
-----Original Message-----
From: Maxime Cowez [mailto:maxime.cowez@gmail.com]
Sent: Friday, December 21, 2012 10:50
To: flex-dev@incubator.apache.org
Subject: Re: [Component] Spacer
@Mark Instead of Rect, you'd better use GraphicElement directly (Rect
extends FilledElement extends StrokedElement extends GraphicElement). I
suppose the performance should be better than that of mx:Spacer because
that inherits from UIComponent and GraphicElement does not. Though I think
the gain would be marginal since you typically don't use Spacers all over
the place.
That said, I remember some discussion on this list on the topic of
composing behaviours into components rather than inheriting them. A Spacer
would in that case only have the measuring/sizing behaviour and nothing
more. Don't know whether anyone has made any progress in this field though.
@Jeffry I suppose that in time we may want to drop the mx components or at
least give a developer the option to only target the Spark component set.
In that case, you would require a complete Spark component set, containing
even such trivial components like a Spacer.
Re: [Component] Spacer
Posted by Maxime Cowez <ma...@gmail.com>.
@Mark Instead of Rect, you'd better use GraphicElement directly (Rect
extends FilledElement extends StrokedElement extends GraphicElement). I
suppose the performance should be better than that of mx:Spacer because
that inherits from UIComponent and GraphicElement does not. Though I think
the gain would be marginal since you typically don't use Spacers all over
the place.
That said, I remember some discussion on this list on the topic of
composing behaviours into components rather than inheriting them. A Spacer
would in that case only have the measuring/sizing behaviour and nothing
more. Don't know whether anyone has made any progress in this field though.
@Jeffry I suppose that in time we may want to drop the mx components or at
least give a developer the option to only target the Spark component set.
In that case, you would require a complete Spark component set, containing
even such trivial components like a Spacer.
On Fri, Dec 21, 2012 at 3:59 PM, Kessler CTR Mark J <
mark.kessler.ctr@usmc.mil> wrote:
> It's not really any different that the MX version, it just felt like it
> helped to complete the spark component set. That and it's only like half a
> dozen lines or so lol.
>
> -----Original Message-----
> From: Jeffry Houser [mailto:jeffry@dot-com-it.com]
> Sent: Friday, December 21, 2012 9:52
> To: flex-dev@incubator.apache.org
> Subject: Re: [Component] Spacer
>
>
> My personal opinion is that the MX Spacer does not need to be
> re-written as a Spark Component. It won't game any benefit from being
> implemented using the Spark Architecture as it has no visual display.
>
> Is there a reason the MX Spacer won't work for you? Would extending
> Rect be more efficient?
>
> On 12/21/2012 9:44 AM, Kessler CTR Mark J wrote:
> > Just curious if we could add a simple component that used to exist
> in MX but not in Spark. The spacer component was just a simple UI
> extension. We can do the exact same thing now with the s:Rect (primitive),
> but it doesn't have an intuitive name. I think it would be nice to add the
> spacer back in.
> >
> >
> >
> > <s:Rect width="100%" />
> >
> > --Same as--
> >
> > <s:Spacer width="100%" />
> >
> >
> > Class:
> >
> > //Declare package.
> > package spark.components
> > {
> > //Create child class of the Rect class.
> > public class Spacer extends Rect
> > {
> > //----------------------------------------
> > // Constructor
> > //----------------------------------------
> >
> > public function Spacer()
> > {
> > super();
> > }
> >
> > }
> >
> > }
> >
> >
> >
> > -Mark
>
>
> --
> Jeffry Houser
> Technical Entrepreneur
> 203-379-0773
> --
> http://www.flextras.com?c=104
> UI Flex Components: Tested! Supported! Ready!
> --
> http://www.theflexshow.com
> http://www.jeffryhouser.com
> http://www.asktheflexpert.com
> --
> Part of the DotComIt Brain Trust
>
>
RE: [Component] Spacer
Posted by Kessler CTR Mark J <ma...@usmc.mil>.
It's not really any different that the MX version, it just felt like it helped to complete the spark component set. That and it's only like half a dozen lines or so lol.
-----Original Message-----
From: Jeffry Houser [mailto:jeffry@dot-com-it.com]
Sent: Friday, December 21, 2012 9:52
To: flex-dev@incubator.apache.org
Subject: Re: [Component] Spacer
My personal opinion is that the MX Spacer does not need to be
re-written as a Spark Component. It won't game any benefit from being
implemented using the Spark Architecture as it has no visual display.
Is there a reason the MX Spacer won't work for you? Would extending
Rect be more efficient?
On 12/21/2012 9:44 AM, Kessler CTR Mark J wrote:
> Just curious if we could add a simple component that used to exist in MX but not in Spark. The spacer component was just a simple UI extension. We can do the exact same thing now with the s:Rect (primitive), but it doesn't have an intuitive name. I think it would be nice to add the spacer back in.
>
>
>
> <s:Rect width="100%" />
>
> --Same as--
>
> <s:Spacer width="100%" />
>
>
> Class:
>
> //Declare package.
> package spark.components
> {
> //Create child class of the Rect class.
> public class Spacer extends Rect
> {
> //----------------------------------------
> // Constructor
> //----------------------------------------
>
> public function Spacer()
> {
> super();
> }
>
> }
>
> }
>
>
>
> -Mark
--
Jeffry Houser
Technical Entrepreneur
203-379-0773
--
http://www.flextras.com?c=104
UI Flex Components: Tested! Supported! Ready!
--
http://www.theflexshow.com
http://www.jeffryhouser.com
http://www.asktheflexpert.com
--
Part of the DotComIt Brain Trust
Re: [Component] Spacer
Posted by Jeffry Houser <je...@dot-com-it.com>.
My personal opinion is that the MX Spacer does not need to be
re-written as a Spark Component. It won't game any benefit from being
implemented using the Spark Architecture as it has no visual display.
Is there a reason the MX Spacer won't work for you? Would extending
Rect be more efficient?
On 12/21/2012 9:44 AM, Kessler CTR Mark J wrote:
> Just curious if we could add a simple component that used to exist in MX but not in Spark. The spacer component was just a simple UI extension. We can do the exact same thing now with the s:Rect (primitive), but it doesn't have an intuitive name. I think it would be nice to add the spacer back in.
>
>
>
> <s:Rect width="100%" />
>
> --Same as--
>
> <s:Spacer width="100%" />
>
>
> Class:
>
> //Declare package.
> package spark.components
> {
> //Create child class of the Rect class.
> public class Spacer extends Rect
> {
> //----------------------------------------
> // Constructor
> //----------------------------------------
>
> public function Spacer()
> {
> super();
> }
>
> }
>
> }
>
>
>
> -Mark
--
Jeffry Houser
Technical Entrepreneur
203-379-0773
--
http://www.flextras.com?c=104
UI Flex Components: Tested! Supported! Ready!
--
http://www.theflexshow.com
http://www.jeffryhouser.com
http://www.asktheflexpert.com
--
Part of the DotComIt Brain Trust
Re: [Component] Spacer
Posted by Carol Frampton <cf...@adobe.com>.
On 12/21/12 12 :08PM, "Alex Harui" <ah...@adobe.com> wrote:
>Don't you still need a class to have the name Spacer in ActionScript? I
>think the manifest trick only works in MXML.
>
True.
Carol
>
>On 12/21/12 9:05 AM, "Carol Frampton" <cf...@adobe.com> wrote:
>
>> I'm not commenting on whether or not there should be a s:Spacer but you
>> don't need a new class - you just need a new manifest entry to do the
>> mapping. If you look in frameworks/spark-manifest.com you will see
>>others
>> there.
>>
>> Carol
>>
>> On 12/21/12 9 :44AM, "Kessler CTR Mark J" <ma...@usmc.mil>
>> wrote:
>>
>>> Just curious if we could add a simple component that used to exist in
>>> MX but not in Spark. The spacer component was just a simple UI
>>> extension. We can do the exact same thing now with the s:Rect
>>> (primitive), but it doesn't have an intuitive name. I think it would
>>>be
>>> nice to add the spacer back in.
>>>
>>>
>>>
>>> <s:Rect width="100%" />
>>>
>>> --Same as--
>>>
>>> <s:Spacer width="100%" />
>>>
>>>
>>> Class:
>>>
>>> //Declare package.
>>> package spark.components
>>> {
>>> //Create child class of the Rect class.
>>> public class Spacer extends Rect
>>> {
>>> //----------------------------------------
>>> // Constructor
>>> //----------------------------------------
>>>
>>> public function Spacer()
>>> {
>>> super();
>>> }
>>>
>>> }
>>>
>>> }
>>>
>>>
>>>
>>> -Mark
>>
>
>--
>Alex Harui
>Flex SDK Team
>Adobe Systems, Inc.
>http://blogs.adobe.com/aharui
>
Re: [Component] Spacer
Posted by Alex Harui <ah...@adobe.com>.
Don't you still need a class to have the name Spacer in ActionScript? I
think the manifest trick only works in MXML.
On 12/21/12 9:05 AM, "Carol Frampton" <cf...@adobe.com> wrote:
> I'm not commenting on whether or not there should be a s:Spacer but you
> don't need a new class - you just need a new manifest entry to do the
> mapping. If you look in frameworks/spark-manifest.com you will see others
> there.
>
> Carol
>
> On 12/21/12 9 :44AM, "Kessler CTR Mark J" <ma...@usmc.mil>
> wrote:
>
>> Just curious if we could add a simple component that used to exist in
>> MX but not in Spark. The spacer component was just a simple UI
>> extension. We can do the exact same thing now with the s:Rect
>> (primitive), but it doesn't have an intuitive name. I think it would be
>> nice to add the spacer back in.
>>
>>
>>
>> <s:Rect width="100%" />
>>
>> --Same as--
>>
>> <s:Spacer width="100%" />
>>
>>
>> Class:
>>
>> //Declare package.
>> package spark.components
>> {
>> //Create child class of the Rect class.
>> public class Spacer extends Rect
>> {
>> //----------------------------------------
>> // Constructor
>> //----------------------------------------
>>
>> public function Spacer()
>> {
>> super();
>> }
>>
>> }
>>
>> }
>>
>>
>>
>> -Mark
>
--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui
Re: [Component] Spacer
Posted by Carol Frampton <cf...@adobe.com>.
I'm not commenting on whether or not there should be a s:Spacer but you
don't need a new class - you just need a new manifest entry to do the
mapping. If you look in frameworks/spark-manifest.com you will see others
there.
Carol
On 12/21/12 9 :44AM, "Kessler CTR Mark J" <ma...@usmc.mil>
wrote:
> Just curious if we could add a simple component that used to exist in
>MX but not in Spark. The spacer component was just a simple UI
>extension. We can do the exact same thing now with the s:Rect
>(primitive), but it doesn't have an intuitive name. I think it would be
>nice to add the spacer back in.
>
>
>
><s:Rect width="100%" />
>
>--Same as--
>
><s:Spacer width="100%" />
>
>
>Class:
>
>//Declare package.
>package spark.components
>{
> //Create child class of the Rect class.
> public class Spacer extends Rect
> {
> //----------------------------------------
> // Constructor
> //----------------------------------------
>
> public function Spacer()
> {
> super();
> }
>
> }
>
>}
>
>
>
>-Mark