Re: Open ByteArray as file

2020-09-12 Thread Hugo Ferreira
FileReference fixed with a PR.
My only issue is that I assumed PDF as default file type but one should
gave a name any way or make the fileName mandatory.

Hugo Ferreira  escreveu no dia sexta, 11/09/2020
à(s) 14:54:

> Hi Maria,
>
> Of course.
> At the moment I can download a ByteArray that came from the server,
> without violating any of the browser rules.
> If I could open the file, it would be great.
>
> Maria Jose Esteve  escreveu no dia sexta, 11/09/2020
> à(s) 14:45:
>
>> Hello Hugo,
>> I don't know if this will help you ...
>>
>> I could send you an example of "image opening" with from FileReference
>> and its transfer to the backend as ByteArray by AMF3 ... Would it be useful?
>>
>> Hiedra
>>
>> -Mensaje original-
>> De: Hugo Ferreira 
>> Enviado el: jueves, 10 de septiembre de 2020 13:32
>> Para: Apache Royale Development 
>> Asunto: Re: Open ByteArray as file
>>
>> On my case I have a ByteArray returned from a AMF call to the server, so
>> it's not UI/MXML.
>> On my Flex/AIR application I convert this ByteArray on a temporary file
>> and open it.
>> Here I want to do the same (if I can avoid to create a temporary file on
>> the middle, would be a better way).
>> A AS util function that I can reuse and encapsulates the JS code, perhaps
>> the best approach ?
>>
>> Carlos Rovira  escreveu no dia quinta,
>> 10/09/2020
>> à(s) 11:12:
>>
>> > Hi,
>> >
>> > Since Royale is about encapsulating code that works through platforms
>> > (and in JS cross browser), I think it would be good to have a bead for
>> > that at Core or Basic level.
>> >
>> > just my 2...
>> >
>> > El jue., 10 sept. 2020 a las 11:45, Harbs ()
>> > escribió:
>> >
>> > > There is also a FileReference implementation in the mx package.
>> > > mx has a DownloadButton which does what you want.
>> > >
>> > > You also might want to know about URLUtils.
>> > >
>> > > HTH,
>> > > Harbs
>> > >
>> > > > On Sep 10, 2020, at 12:33 PM, Hugo Ferreira
>> > > > 
>> > > wrote:
>> > > >
>> > > > Sometimes it easy to forget that Royale at the end of the day IS
>> > > > JS :)
>> > > >
>> > > > Piotr Zarzycki  escreveu no dia quinta,
>> > > > 10/09/2020 à(s) 05:53:
>> > > >
>> > > >> Hi Hugo,
>> > > >>
>> > > >> I will just shot you with the tip - How would you do that in pure
>> JS ?
>> > > - I
>> > > >> think this maybe your answer ;)
>> > > >>
>> > > >> Thanks,
>> > > >> Piotr
>> > > >>
>> > > >> czw., 10 wrz 2020 o 01:59 Hugo Ferreira 
>> > > >> napisał(a):
>> > > >>
>> > > >>> I have a ByteArray to comes from the server side.
>> > > >>> I would like to open now the file.
>> > > >>> With Flex (AIR), I use FileStream.
>> > > >>> What's the equivalent here.
>> > > >>> I would like to open the file.
>> > > >>> If not possible (for security reasons since we are on web
>> > > >>> space), at
>> > > >> least
>> > > >>> download the file, so the user can click on it.
>> > > >>>
>> > > >>> What is the Royale approach/code, for that ?
>> > > >>>
>> > > >>
>> > > >>
>> > > >> --
>> > > >>
>> > > >> Piotr Zarzycki
>> > > >>
>> > >
>> > >
>> >
>> > --
>> > Carlos Rovira
>> > http://about.me/carlosrovira
>> >
>>
>


Re: Font bead and color

2020-09-12 Thread Hugo Ferreira
"people thinking they must use percentWidth."
It happens to me.

So at the end of the day percentWidth it's the "native way" and
width="100%" will be converted to percentWidth, correct ?
For a single way to implement, you recomend with="100%" instead of
percentWidth="100" ?

Carlos Rovira  escreveu no dia sábado, 12/09/2020
à(s) 17:47:

> Hi Hugo,
>
> I recommend you use the CSS file you probably have in your app instead of
> style object
> so you can override font at the level you want and still remain
> separating concerns.
>
> about percentWidth, I think some of us put something like that in some
> examples instead of width="100%"
> I tried to remove search and replace in what we have in the web to avoid
> people thinking they must use percentWidth.
> Although is valid, the other is a proxy for percentWidth (I mean is marked
> [
> PercentProxy("percentWidth")])
>
>
> El sáb., 12 sept. 2020 a las 17:10, Hugo Ferreira ( >)
> escribió:
>
> > I started my framework extending all Royale components that I need and
> > adding a lot of properties (Flex style).
> > Now I'm decoupling all this properties as beads (Royale style) on my own
> > framework and I identify a few ones that could be on the Royale Framework
> > because are so generic.
> > For example Position and DataGridSort are two beads that I don't need any
> > more to have on my own code and use directly from the Royale Framework.
> >
> > Yes, font style is on a very gray area.
> > Ususally defineded a css global level but there is a few use cases when
> we
> > need to override the global style behaviour.
> > On this place, I prefer to use a bead instead of working with style =
> 
> > But I understand and use my own bead.
> >
> > "finally nor related to this: for percentage width and height you don't
> > need
> > to write percentageWidth="100", you can do width="100%""
> > Humm. In Flex world I always did width="100%" but here I saw the
> > percentageWidth property and I thought that it's the right way.
> > Why we have this redundante property on the first place ?
> >
> >
> > Carlos Rovira  escreveu no dia sábado,
> 12/09/2020
> > à(s) 15:54:
> >
> > > Hi,
> > >
> > > ok, we don't have any bead for font styling, but while padding or
> > > positioning are things that is usual people tune in mxml or as3, font
> > > changes used to happen at CSS level most of the time. Also, as we
> > > separate MVC parts, we should try to separate views from styles (CSS)
> and
> > > maybe in some cases skin (as we did in Flex 4 days). So adding as3 code
> > to
> > > mix in mxml font styling (or other font things) seems to me not the way
> > to
> > > go when organizing code in a final app (other things are quick
> examples)
> > >
> > > finally nor related to this: for percentage width and height you don't
> > need
> > > to write percentageWidth="100", you can do width="100%"
> > >
> > > El sáb., 12 sept. 2020 a las 16:42, Hugo Ferreira (<
> > hferreira...@gmail.com
> > > >)
> > > escribió:
> > >
> > > > I'm talking in something like this:
> > > >
> > > > Bead:
> > > > package pt.solidsoft.framework.components.beads
> > > > {
> > > > import org.apache.royale.core.IBead;
> > > > import org.apache.royale.core.IStrand;
> > > > import org.apache.royale.core.UIBase;
> > > >
> > > > public class FontItalic implements IBead
> > > > {
> > > > public function set strand(value:IStrand):void
> > > > {
> > > > (value as UIBase).style = "font-style: italic";
> > > > }
> > > > }
> > > > }
> > > >
> > > > Usage:
> > > > ...
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > ...
> > > >
> > > > The same for bold and font size OR a font bead
> > > >
> > > > Carlos Rovira  escreveu no dia sexta,
> > > 11/09/2020
> > > > à(s) 19:08:
> > > >
> > > > > Ok, I thought you were talking about font-face and so on.
> > > > > You have SizeControl and TextAlign beads, but I must say I want to
> > > update
> > > > > Sizecontrol a bit since sizes have changed a bit and that need to
> be
> > > > > adjusted.
> > > > >
> > > > > El vie., 11 sept. 2020 a las 20:02, Hugo Ferreira (<
> > > > hferreira...@gmail.com
> > > > > >)
> > > > > escribió:
> > > > >
> > > > > > Usually, the application has a default style defined globally
> thus
> > > css,
> > > > > etc
> > > > > > ... but sometimes there are particular use cases where you need a
> > > bold,
> > > > > > italic or even different font size.
> > > > > > A bead should not be an opition ?
> > > > > >
> > > > > > Carlos Rovira  escreveu no dia sexta,
> > > > > 11/09/2020
> > > > > > à(s) 18:31:
> > > > > >
> > > > > > > No. that is usually done vía CSS or in AS3/MXML vía style
> > property
> > > or
> > > > > > > fx:Style tag.
> > > > > > >
> > > > > > >
> > > > > > > El vie., 11 sept. 2020 a las 18:29, Hugo Ferreira (<
> > > > > > hferreira...@gmail.com
> > > > > > > >)
> > > > > > > escribió:
> > > > > > >
> > > > > > > > There is already a bead for color, font size and font style ?
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > 

Re: Font bead and color

2020-09-12 Thread Carlos Rovira
Hi Hugo,

I recommend you use the CSS file you probably have in your app instead of
style object
so you can override font at the level you want and still remain
separating concerns.

about percentWidth, I think some of us put something like that in some
examples instead of width="100%"
I tried to remove search and replace in what we have in the web to avoid
people thinking they must use percentWidth.
Although is valid, the other is a proxy for percentWidth (I mean is marked [
PercentProxy("percentWidth")])


El sáb., 12 sept. 2020 a las 17:10, Hugo Ferreira ()
escribió:

> I started my framework extending all Royale components that I need and
> adding a lot of properties (Flex style).
> Now I'm decoupling all this properties as beads (Royale style) on my own
> framework and I identify a few ones that could be on the Royale Framework
> because are so generic.
> For example Position and DataGridSort are two beads that I don't need any
> more to have on my own code and use directly from the Royale Framework.
>
> Yes, font style is on a very gray area.
> Ususally defineded a css global level but there is a few use cases when we
> need to override the global style behaviour.
> On this place, I prefer to use a bead instead of working with style = 
> But I understand and use my own bead.
>
> "finally nor related to this: for percentage width and height you don't
> need
> to write percentageWidth="100", you can do width="100%""
> Humm. In Flex world I always did width="100%" but here I saw the
> percentageWidth property and I thought that it's the right way.
> Why we have this redundante property on the first place ?
>
>
> Carlos Rovira  escreveu no dia sábado, 12/09/2020
> à(s) 15:54:
>
> > Hi,
> >
> > ok, we don't have any bead for font styling, but while padding or
> > positioning are things that is usual people tune in mxml or as3, font
> > changes used to happen at CSS level most of the time. Also, as we
> > separate MVC parts, we should try to separate views from styles (CSS) and
> > maybe in some cases skin (as we did in Flex 4 days). So adding as3 code
> to
> > mix in mxml font styling (or other font things) seems to me not the way
> to
> > go when organizing code in a final app (other things are quick examples)
> >
> > finally nor related to this: for percentage width and height you don't
> need
> > to write percentageWidth="100", you can do width="100%"
> >
> > El sáb., 12 sept. 2020 a las 16:42, Hugo Ferreira (<
> hferreira...@gmail.com
> > >)
> > escribió:
> >
> > > I'm talking in something like this:
> > >
> > > Bead:
> > > package pt.solidsoft.framework.components.beads
> > > {
> > > import org.apache.royale.core.IBead;
> > > import org.apache.royale.core.IStrand;
> > > import org.apache.royale.core.UIBase;
> > >
> > > public class FontItalic implements IBead
> > > {
> > > public function set strand(value:IStrand):void
> > > {
> > > (value as UIBase).style = "font-style: italic";
> > > }
> > > }
> > > }
> > >
> > > Usage:
> > > ...
> > > 
> > > 
> > > 
> > > 
> > > 
> > > ...
> > >
> > > The same for bold and font size OR a font bead
> > >
> > > Carlos Rovira  escreveu no dia sexta,
> > 11/09/2020
> > > à(s) 19:08:
> > >
> > > > Ok, I thought you were talking about font-face and so on.
> > > > You have SizeControl and TextAlign beads, but I must say I want to
> > update
> > > > Sizecontrol a bit since sizes have changed a bit and that need to be
> > > > adjusted.
> > > >
> > > > El vie., 11 sept. 2020 a las 20:02, Hugo Ferreira (<
> > > hferreira...@gmail.com
> > > > >)
> > > > escribió:
> > > >
> > > > > Usually, the application has a default style defined globally thus
> > css,
> > > > etc
> > > > > ... but sometimes there are particular use cases where you need a
> > bold,
> > > > > italic or even different font size.
> > > > > A bead should not be an opition ?
> > > > >
> > > > > Carlos Rovira  escreveu no dia sexta,
> > > > 11/09/2020
> > > > > à(s) 18:31:
> > > > >
> > > > > > No. that is usually done vía CSS or in AS3/MXML vía style
> property
> > or
> > > > > > fx:Style tag.
> > > > > >
> > > > > >
> > > > > > El vie., 11 sept. 2020 a las 18:29, Hugo Ferreira (<
> > > > > hferreira...@gmail.com
> > > > > > >)
> > > > > > escribió:
> > > > > >
> > > > > > > There is already a bead for color, font size and font style ?
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Carlos Rovira
> > > > > > http://about.me/carlosrovira
> > > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Carlos Rovira
> > > > http://about.me/carlosrovira
> > > >
> > >
> >
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira
> >
>


-- 
Carlos Rovira
http://about.me/carlosrovira


Re: Font bead and color

2020-09-12 Thread Hugo Ferreira
I started my framework extending all Royale components that I need and
adding a lot of properties (Flex style).
Now I'm decoupling all this properties as beads (Royale style) on my own
framework and I identify a few ones that could be on the Royale Framework
because are so generic.
For example Position and DataGridSort are two beads that I don't need any
more to have on my own code and use directly from the Royale Framework.

Yes, font style is on a very gray area.
Ususally defineded a css global level but there is a few use cases when we
need to override the global style behaviour.
On this place, I prefer to use a bead instead of working with style = 
But I understand and use my own bead.

"finally nor related to this: for percentage width and height you don't need
to write percentageWidth="100", you can do width="100%""
Humm. In Flex world I always did width="100%" but here I saw the
percentageWidth property and I thought that it's the right way.
Why we have this redundante property on the first place ?


Carlos Rovira  escreveu no dia sábado, 12/09/2020
à(s) 15:54:

> Hi,
>
> ok, we don't have any bead for font styling, but while padding or
> positioning are things that is usual people tune in mxml or as3, font
> changes used to happen at CSS level most of the time. Also, as we
> separate MVC parts, we should try to separate views from styles (CSS) and
> maybe in some cases skin (as we did in Flex 4 days). So adding as3 code to
> mix in mxml font styling (or other font things) seems to me not the way to
> go when organizing code in a final app (other things are quick examples)
>
> finally nor related to this: for percentage width and height you don't need
> to write percentageWidth="100", you can do width="100%"
>
> El sáb., 12 sept. 2020 a las 16:42, Hugo Ferreira ( >)
> escribió:
>
> > I'm talking in something like this:
> >
> > Bead:
> > package pt.solidsoft.framework.components.beads
> > {
> > import org.apache.royale.core.IBead;
> > import org.apache.royale.core.IStrand;
> > import org.apache.royale.core.UIBase;
> >
> > public class FontItalic implements IBead
> > {
> > public function set strand(value:IStrand):void
> > {
> > (value as UIBase).style = "font-style: italic";
> > }
> > }
> > }
> >
> > Usage:
> > ...
> > 
> > 
> > 
> > 
> > 
> > ...
> >
> > The same for bold and font size OR a font bead
> >
> > Carlos Rovira  escreveu no dia sexta,
> 11/09/2020
> > à(s) 19:08:
> >
> > > Ok, I thought you were talking about font-face and so on.
> > > You have SizeControl and TextAlign beads, but I must say I want to
> update
> > > Sizecontrol a bit since sizes have changed a bit and that need to be
> > > adjusted.
> > >
> > > El vie., 11 sept. 2020 a las 20:02, Hugo Ferreira (<
> > hferreira...@gmail.com
> > > >)
> > > escribió:
> > >
> > > > Usually, the application has a default style defined globally thus
> css,
> > > etc
> > > > ... but sometimes there are particular use cases where you need a
> bold,
> > > > italic or even different font size.
> > > > A bead should not be an opition ?
> > > >
> > > > Carlos Rovira  escreveu no dia sexta,
> > > 11/09/2020
> > > > à(s) 18:31:
> > > >
> > > > > No. that is usually done vía CSS or in AS3/MXML vía style property
> or
> > > > > fx:Style tag.
> > > > >
> > > > >
> > > > > El vie., 11 sept. 2020 a las 18:29, Hugo Ferreira (<
> > > > hferreira...@gmail.com
> > > > > >)
> > > > > escribió:
> > > > >
> > > > > > There is already a bead for color, font size and font style ?
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Carlos Rovira
> > > > > http://about.me/carlosrovira
> > > > >
> > > >
> > >
> > >
> > > --
> > > Carlos Rovira
> > > http://about.me/carlosrovira
> > >
> >
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>


Re: Font bead and color

2020-09-12 Thread Carlos Rovira
Hi,

ok, we don't have any bead for font styling, but while padding or
positioning are things that is usual people tune in mxml or as3, font
changes used to happen at CSS level most of the time. Also, as we
separate MVC parts, we should try to separate views from styles (CSS) and
maybe in some cases skin (as we did in Flex 4 days). So adding as3 code to
mix in mxml font styling (or other font things) seems to me not the way to
go when organizing code in a final app (other things are quick examples)

finally nor related to this: for percentage width and height you don't need
to write percentageWidth="100", you can do width="100%"

El sáb., 12 sept. 2020 a las 16:42, Hugo Ferreira ()
escribió:

> I'm talking in something like this:
>
> Bead:
> package pt.solidsoft.framework.components.beads
> {
> import org.apache.royale.core.IBead;
> import org.apache.royale.core.IStrand;
> import org.apache.royale.core.UIBase;
>
> public class FontItalic implements IBead
> {
> public function set strand(value:IStrand):void
> {
> (value as UIBase).style = "font-style: italic";
> }
> }
> }
>
> Usage:
> ...
> 
> 
> 
> 
> 
> ...
>
> The same for bold and font size OR a font bead
>
> Carlos Rovira  escreveu no dia sexta, 11/09/2020
> à(s) 19:08:
>
> > Ok, I thought you were talking about font-face and so on.
> > You have SizeControl and TextAlign beads, but I must say I want to update
> > Sizecontrol a bit since sizes have changed a bit and that need to be
> > adjusted.
> >
> > El vie., 11 sept. 2020 a las 20:02, Hugo Ferreira (<
> hferreira...@gmail.com
> > >)
> > escribió:
> >
> > > Usually, the application has a default style defined globally thus css,
> > etc
> > > ... but sometimes there are particular use cases where you need a bold,
> > > italic or even different font size.
> > > A bead should not be an opition ?
> > >
> > > Carlos Rovira  escreveu no dia sexta,
> > 11/09/2020
> > > à(s) 18:31:
> > >
> > > > No. that is usually done vía CSS or in AS3/MXML vía style property or
> > > > fx:Style tag.
> > > >
> > > >
> > > > El vie., 11 sept. 2020 a las 18:29, Hugo Ferreira (<
> > > hferreira...@gmail.com
> > > > >)
> > > > escribió:
> > > >
> > > > > There is already a bead for color, font size and font style ?
> > > > >
> > > >
> > > >
> > > > --
> > > > Carlos Rovira
> > > > http://about.me/carlosrovira
> > > >
> > >
> >
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira
> >
>


-- 
Carlos Rovira
http://about.me/carlosrovira


Re: Sort Jewel DataGrid by column click

2020-09-12 Thread Hugo Ferreira
That makes sense, not tied only a one kind of component.

Carlos Rovira  escreveu no dia sábado, 12/09/2020
à(s) 15:48:

> Just refactored the header to IDataGridHeader as a first step to allow
> other kind ButtonBars (IconButtonBar or ToggleButtonBar).
> So I think we could have some css for additional DG configuration that add
> the sort bead and a toggle button bar with the right icons. Still have to
> think more about it...
>
> El sáb., 12 sept. 2020 a las 16:16, Hugo Ferreira ( >)
> escribió:
>
> > Hi Carlos,
> >
> > Yes, I think that if someone needs to extend this bead, it's more likely
> to
> > create a complete new one instead of override a mouse click function.
> > Just my 2 cents.
> > But it's not a big issue for me.
> >
> > - I miss some icon indicators. That probably could be solved changing
> > ButtonBar to ToggleButtonBar and setting up the up/down icons
> > Yes. I notice that. Probably the next DataGrid update. Maybe I can do
> > myself.
> >
> > Carlos Rovira  escreveu no dia sábado,
> 12/09/2020
> > à(s) 08:24:
> >
> > > Hi Hugo,
> > >
> > > The change from private to protected was thinking on extensibility,
> > > although probably in this case since it only implies that function
> people
> > > probably will create a completely new bead if they need to do something
> > > more.
> > >
> > > Two more things:
> > >
> > > - The actual way of reassigning the collection completely has 2
> problems:
> > > remove the current selection (if it has some) and reset the
> scrollToIndex
> > > (scrollbar goes to the start). I add here @Greg Dove <
> > greg.d...@gmail.com>
> > > to
> > > notice this.
> > > - I miss some icon indicators. That probably could be solved changing
> > > ButtonBar to ToggleButtonBar and setting up the up/down icons
> > >
> > >
> > > El vie., 11 sept. 2020 a las 20:14, Hugo Ferreira (<
> > hferreira...@gmail.com
> > > >)
> > > escribió:
> > >
> > > > OK, I saw.
> > > > Thank you.
> > > >
> > > > I have one question:
> > > > Why did you changed "private function mouseClickHandler" to
> "protected
> > > > function mouseClickHandler" ?
> > > >
> > > > Carlos Rovira  escreveu no dia sexta,
> > > 11/09/2020
> > > > à(s) 18:26:
> > > >
> > > > > Hi Hugo,
> > > > > I committed some changes that would like you to check:
> > > > >
> > > > > * docs
> > > > > * imports (DataGrid and Event imports was missed so jewel was not
> > > > > compiling)
> > > > >
> > > > > also about this lines I was exposing in review comments:
> > > > >
> > > > > dg.dataProvider = null;
> > > > > dg.dataProvider = collection;
> > > > >
> > > > > I was thinking in do instead this:
> > > > >
> > > > > dg.model.dispatchEvent(new Event("dataProviderChanged"));
> > > > >
> > > > > But this is not working since
> "ArrayListSelectionModel.dataProvider"
> > > for
> > > > > each column List has:
> > > > >
> > > > > if (value == _dataProvider) return;
> > > > >
> > > > > and since the dataProvider is the same (although order changed) it
> > > > returns
> > > > > without refreshing it
> > > > > for that reason you need to do a null and then reassign the
> provider.
> > > > >
> > > > > I'll see what we can do in that kind of cases.
> > > > >
> > > > > @Greg Dove  , what do you think about this?
> > > looking
> > > > > at
> > > > > IArrayListView API talks about calling just refresh() in the
> > collection
> > > > > should update the view, but we are not doing this, so making things
> > > > > more complicated when using the API.
> > > > >
> > > > >
> > > > >
> > > > > El vie., 11 sept. 2020 a las 19:14, Carlos Rovira (<
> > > > > carlosrov...@apache.org>)
> > > > > escribió:
> > > > >
> > > > > > Hi Hugo,
> > > > > >
> > > > > > it's less difficult than you could think. For example in Jewel
> > List:
> > > > > > dataProvider, selectedIndex, selectedItem, labelField are
> probably
> > > the
> > > > > real
> > > > > > needs always. But other than that will be used in some cases and
> > not
> > > in
> > > > > > others, so that probably means carry that code to a bead.
> > > > > >
> > > > > > For example, I left things in that case like rowHeight that I
> > should
> > > > > > remove, since now presentation models are working fine, and
> people
> > > > always
> > > > > > can change rowHeight (or other things in PM) setting the bead.
> I'll
> > > be
> > > > > > proposing this soon to be coherent with the rest of the
> > > > implementations.
> > > > > >
> > > > > > El vie., 11 sept. 2020 a las 18:22, Hugo Ferreira (<
> > > > > hferreira...@gmail.com>)
> > > > > > escribió:
> > > > > >
> > > > > >> Hi Carlos,
> > > > > >>
> > > > > >> Great news :)
> > > > > >>
> > > > > >> Makes sense what you say.
> > > > > >> The difficult part is to decide what is used all the time to be
> > part
> > > > of
> > > > > >> the
> > > > > >> component and what is accessory to be built as a bead.
> > > > > >>
> > > > > >>
> > > > > >> In that case I don't think we need to add that API in front of
> > > > DataGrid,
> > > > > >> since the dataProvider is 

Re: Sort Jewel DataGrid by column click

2020-09-12 Thread Carlos Rovira
Just refactored the header to IDataGridHeader as a first step to allow
other kind ButtonBars (IconButtonBar or ToggleButtonBar).
So I think we could have some css for additional DG configuration that add
the sort bead and a toggle button bar with the right icons. Still have to
think more about it...

El sáb., 12 sept. 2020 a las 16:16, Hugo Ferreira ()
escribió:

> Hi Carlos,
>
> Yes, I think that if someone needs to extend this bead, it's more likely to
> create a complete new one instead of override a mouse click function.
> Just my 2 cents.
> But it's not a big issue for me.
>
> - I miss some icon indicators. That probably could be solved changing
> ButtonBar to ToggleButtonBar and setting up the up/down icons
> Yes. I notice that. Probably the next DataGrid update. Maybe I can do
> myself.
>
> Carlos Rovira  escreveu no dia sábado, 12/09/2020
> à(s) 08:24:
>
> > Hi Hugo,
> >
> > The change from private to protected was thinking on extensibility,
> > although probably in this case since it only implies that function people
> > probably will create a completely new bead if they need to do something
> > more.
> >
> > Two more things:
> >
> > - The actual way of reassigning the collection completely has 2 problems:
> > remove the current selection (if it has some) and reset the scrollToIndex
> > (scrollbar goes to the start). I add here @Greg Dove <
> greg.d...@gmail.com>
> > to
> > notice this.
> > - I miss some icon indicators. That probably could be solved changing
> > ButtonBar to ToggleButtonBar and setting up the up/down icons
> >
> >
> > El vie., 11 sept. 2020 a las 20:14, Hugo Ferreira (<
> hferreira...@gmail.com
> > >)
> > escribió:
> >
> > > OK, I saw.
> > > Thank you.
> > >
> > > I have one question:
> > > Why did you changed "private function mouseClickHandler" to "protected
> > > function mouseClickHandler" ?
> > >
> > > Carlos Rovira  escreveu no dia sexta,
> > 11/09/2020
> > > à(s) 18:26:
> > >
> > > > Hi Hugo,
> > > > I committed some changes that would like you to check:
> > > >
> > > > * docs
> > > > * imports (DataGrid and Event imports was missed so jewel was not
> > > > compiling)
> > > >
> > > > also about this lines I was exposing in review comments:
> > > >
> > > > dg.dataProvider = null;
> > > > dg.dataProvider = collection;
> > > >
> > > > I was thinking in do instead this:
> > > >
> > > > dg.model.dispatchEvent(new Event("dataProviderChanged"));
> > > >
> > > > But this is not working since "ArrayListSelectionModel.dataProvider"
> > for
> > > > each column List has:
> > > >
> > > > if (value == _dataProvider) return;
> > > >
> > > > and since the dataProvider is the same (although order changed) it
> > > returns
> > > > without refreshing it
> > > > for that reason you need to do a null and then reassign the provider.
> > > >
> > > > I'll see what we can do in that kind of cases.
> > > >
> > > > @Greg Dove  , what do you think about this?
> > looking
> > > > at
> > > > IArrayListView API talks about calling just refresh() in the
> collection
> > > > should update the view, but we are not doing this, so making things
> > > > more complicated when using the API.
> > > >
> > > >
> > > >
> > > > El vie., 11 sept. 2020 a las 19:14, Carlos Rovira (<
> > > > carlosrov...@apache.org>)
> > > > escribió:
> > > >
> > > > > Hi Hugo,
> > > > >
> > > > > it's less difficult than you could think. For example in Jewel
> List:
> > > > > dataProvider, selectedIndex, selectedItem, labelField are probably
> > the
> > > > real
> > > > > needs always. But other than that will be used in some cases and
> not
> > in
> > > > > others, so that probably means carry that code to a bead.
> > > > >
> > > > > For example, I left things in that case like rowHeight that I
> should
> > > > > remove, since now presentation models are working fine, and people
> > > always
> > > > > can change rowHeight (or other things in PM) setting the bead. I'll
> > be
> > > > > proposing this soon to be coherent with the rest of the
> > > implementations.
> > > > >
> > > > > El vie., 11 sept. 2020 a las 18:22, Hugo Ferreira (<
> > > > hferreira...@gmail.com>)
> > > > > escribió:
> > > > >
> > > > >> Hi Carlos,
> > > > >>
> > > > >> Great news :)
> > > > >>
> > > > >> Makes sense what you say.
> > > > >> The difficult part is to decide what is used all the time to be
> part
> > > of
> > > > >> the
> > > > >> component and what is accessory to be built as a bead.
> > > > >>
> > > > >>
> > > > >> In that case I don't think we need to add that API in front of
> > > DataGrid,
> > > > >> since the dataProvider is something managed internally. We can
> > always
> > > > add
> > > > >> a
> > > > >> bead (like the one you did) to do something similar. In Fact, it
> is
> > > part
> > > > >> of
> > > > >> what you did in this concrete bead, so that shows that adding that
> > > king
> > > > of
> > > > >> APIs is not what we try to do. That was one of the Flex problems,
> > that
> > > > the
> > > > >> components was very bloated with code 

Re: Font bead and color

2020-09-12 Thread Hugo Ferreira
I'm talking in something like this:

Bead:
package pt.solidsoft.framework.components.beads
{
import org.apache.royale.core.IBead;
import org.apache.royale.core.IStrand;
import org.apache.royale.core.UIBase;

public class FontItalic implements IBead
{
public function set strand(value:IStrand):void
{
(value as UIBase).style = "font-style: italic";
}
}
}

Usage:
...





...

The same for bold and font size OR a font bead

Carlos Rovira  escreveu no dia sexta, 11/09/2020
à(s) 19:08:

> Ok, I thought you were talking about font-face and so on.
> You have SizeControl and TextAlign beads, but I must say I want to update
> Sizecontrol a bit since sizes have changed a bit and that need to be
> adjusted.
>
> El vie., 11 sept. 2020 a las 20:02, Hugo Ferreira ( >)
> escribió:
>
> > Usually, the application has a default style defined globally thus css,
> etc
> > ... but sometimes there are particular use cases where you need a bold,
> > italic or even different font size.
> > A bead should not be an opition ?
> >
> > Carlos Rovira  escreveu no dia sexta,
> 11/09/2020
> > à(s) 18:31:
> >
> > > No. that is usually done vía CSS or in AS3/MXML vía style property or
> > > fx:Style tag.
> > >
> > >
> > > El vie., 11 sept. 2020 a las 18:29, Hugo Ferreira (<
> > hferreira...@gmail.com
> > > >)
> > > escribió:
> > >
> > > > There is already a bead for color, font size and font style ?
> > > >
> > >
> > >
> > > --
> > > Carlos Rovira
> > > http://about.me/carlosrovira
> > >
> >
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>


Re: Sort Jewel DataGrid by column click

2020-09-12 Thread Hugo Ferreira
Hi Carlos,

Yes, I think that if someone needs to extend this bead, it's more likely to
create a complete new one instead of override a mouse click function.
Just my 2 cents.
But it's not a big issue for me.

- I miss some icon indicators. That probably could be solved changing
ButtonBar to ToggleButtonBar and setting up the up/down icons
Yes. I notice that. Probably the next DataGrid update. Maybe I can do
myself.

Carlos Rovira  escreveu no dia sábado, 12/09/2020
à(s) 08:24:

> Hi Hugo,
>
> The change from private to protected was thinking on extensibility,
> although probably in this case since it only implies that function people
> probably will create a completely new bead if they need to do something
> more.
>
> Two more things:
>
> - The actual way of reassigning the collection completely has 2 problems:
> remove the current selection (if it has some) and reset the scrollToIndex
> (scrollbar goes to the start). I add here @Greg Dove 
> to
> notice this.
> - I miss some icon indicators. That probably could be solved changing
> ButtonBar to ToggleButtonBar and setting up the up/down icons
>
>
> El vie., 11 sept. 2020 a las 20:14, Hugo Ferreira ( >)
> escribió:
>
> > OK, I saw.
> > Thank you.
> >
> > I have one question:
> > Why did you changed "private function mouseClickHandler" to "protected
> > function mouseClickHandler" ?
> >
> > Carlos Rovira  escreveu no dia sexta,
> 11/09/2020
> > à(s) 18:26:
> >
> > > Hi Hugo,
> > > I committed some changes that would like you to check:
> > >
> > > * docs
> > > * imports (DataGrid and Event imports was missed so jewel was not
> > > compiling)
> > >
> > > also about this lines I was exposing in review comments:
> > >
> > > dg.dataProvider = null;
> > > dg.dataProvider = collection;
> > >
> > > I was thinking in do instead this:
> > >
> > > dg.model.dispatchEvent(new Event("dataProviderChanged"));
> > >
> > > But this is not working since "ArrayListSelectionModel.dataProvider"
> for
> > > each column List has:
> > >
> > > if (value == _dataProvider) return;
> > >
> > > and since the dataProvider is the same (although order changed) it
> > returns
> > > without refreshing it
> > > for that reason you need to do a null and then reassign the provider.
> > >
> > > I'll see what we can do in that kind of cases.
> > >
> > > @Greg Dove  , what do you think about this?
> looking
> > > at
> > > IArrayListView API talks about calling just refresh() in the collection
> > > should update the view, but we are not doing this, so making things
> > > more complicated when using the API.
> > >
> > >
> > >
> > > El vie., 11 sept. 2020 a las 19:14, Carlos Rovira (<
> > > carlosrov...@apache.org>)
> > > escribió:
> > >
> > > > Hi Hugo,
> > > >
> > > > it's less difficult than you could think. For example in Jewel List:
> > > > dataProvider, selectedIndex, selectedItem, labelField are probably
> the
> > > real
> > > > needs always. But other than that will be used in some cases and not
> in
> > > > others, so that probably means carry that code to a bead.
> > > >
> > > > For example, I left things in that case like rowHeight that I should
> > > > remove, since now presentation models are working fine, and people
> > always
> > > > can change rowHeight (or other things in PM) setting the bead. I'll
> be
> > > > proposing this soon to be coherent with the rest of the
> > implementations.
> > > >
> > > > El vie., 11 sept. 2020 a las 18:22, Hugo Ferreira (<
> > > hferreira...@gmail.com>)
> > > > escribió:
> > > >
> > > >> Hi Carlos,
> > > >>
> > > >> Great news :)
> > > >>
> > > >> Makes sense what you say.
> > > >> The difficult part is to decide what is used all the time to be part
> > of
> > > >> the
> > > >> component and what is accessory to be built as a bead.
> > > >>
> > > >>
> > > >> In that case I don't think we need to add that API in front of
> > DataGrid,
> > > >> since the dataProvider is something managed internally. We can
> always
> > > add
> > > >> a
> > > >> bead (like the one you did) to do something similar. In Fact, it is
> > part
> > > >> of
> > > >> what you did in this concrete bead, so that shows that adding that
> > king
> > > of
> > > >> APIs is not what we try to do. That was one of the Flex problems,
> that
> > > the
> > > >> components was very bloated with code for many side cases.
> > > >> APIs in components should have what's really important and always
> used
> > > and
> > > >> then left other things that "could be used" for beads.
> > > >> Being said that, I don't try to be PAYG in a "nonsense way", and
> > always
> > > >> try
> > > >> to ponder if the APIs will be used a lot or just sporadically.
> > > >>
> > > >>
> > > >>
> > > >> Carlos Rovira  escreveu no dia sexta,
> > > 11/09/2020
> > > >> à(s) 16:57:
> > > >>
> > > >> > Hi Hugo,
> > > >> >
> > > >> > just merged the PR :)
> > > >> >
> > > >> > going to try and see if what I had in mind made sense.
> > > >> > About refreshing: In Royale PAYG is what rules all the framework
> and
> > > we
> > > 

Re: RightBead or PositionBead or something else

2020-09-12 Thread Hugo Ferreira
Hi Carlos,

"One more thing. I prefer to not add "Bead" to bead's name, since the
implementation indicates already that it is a IBead so we can be less
verbose (I didn't notice that in DataGridSortBead, and will be removing the
Bead now)."
I Agree. Bead name on a bead it's redundant. I just followed other examples
but my feeling tells me absolutely that it's wrong. I just respected other
implementations.

"just added Position bead. It's showcased in TDJ.
Before we had:



now:





"

Perfect implementation and name. Using Position bead it's much, much better
than working around with style strings or hardcoded properties.


Carlos Rovira  escreveu no dia sábado, 12/09/2020
à(s) 11:37:

> Hi Hugo,
> just added Position bead. It's showcased in TDJ.
> Before we had:
>
> 
>
> now:
>
> 
> 
> 
> 
> 
>
> El sáb., 12 sept. 2020 a las 10:31, Carlos Rovira (<
> carlosrov...@apache.org>)
> escribió:
>
> > Hi Hugo,
> >
> > ok you're talking about setting absolute constraints (top, left, right,
> > bottom) right?
> > I was thinking of adding to StyledUIBase, but since it is something used
> > only when positioned in an absolute way, maybe a Bead will be better.
> >
> > For example "PositionAbsolute" could be the name and have "top", "left",
> > "right", "bottom" properties?
> > that should go to Basic since it could be used cross UI sets.
> >
> > One more thing. I prefer to not add "Bead" to bead's name, since the
> > implementation indicates already that it is a IBead so we can be less
> > verbose (I didn't notice that in DataGridSortBead, and will be removing
> the
> > Bead now).
> >
> >
> > El vie., 11 sept. 2020 a las 20:32, Hugo Ferreira (<
> hferreira...@gmail.com>)
> > escribió:
> >
> >> Sure.
> >> I created this bead right now.
> >> I was a component property repeated on several components that I will
> >> convert all in a bead.
> >> I have other use cases that will convert all in beads and end up with a
> >> very light and clean component (Royale way) ;)
> >>
> >> package pt.solidsoft.framework.components
> >> {
> >> import org.apache.royale.core.IBead;
> >> import org.apache.royale.core.IStrand;
> >> import org.apache.royale.core.UIBase;
> >>
> >> public class RightPositionBead implements IBead
> >> {
> >> public var right:int = 0;
> >>
> >> public function set strand(value:IStrand):void
> >> {
> >> if (right > 0)
> >> (value as UIBase).style = "right: " + right + "px";
> >> }
> >> }
> >> }
> >>
> >> Use case:
> >> ...
> >>  >> percentHeight="100">
> >>  >> percentHeight="100"/>
> >>  >> y="80"
> >> width="400"
> >> height="360"
> >> hasShadow="true"
> >> borderRadius="5"
> >> backgroundColor="#5c7bb0">
> >> 
> >> 
> >> 
> >> ...
> >>
> >>
> >> Carlos Rovira  escreveu no dia sexta,
> 11/09/2020
> >> à(s) 19:04:
> >>
> >> > Can you post a snippet of code to understand what you mean?
> >> >
> >> > El vie., 11 sept. 2020 a las 20:00, Hugo Ferreira (<
> >> hferreira...@gmail.com
> >> > >)
> >> > escribió:
> >> >
> >> > > But if you have a Group and set the right style in a component, then
> >> this
> >> > > component is right aligned with a space.
> >> > > It works.
> >> > > I have a property for that, so I thought that a bead could make
> sense.
> >> > >
> >> > > Carlos Rovira  escreveu no dia sexta,
> >> > 11/09/2020
> >> > > à(s) 18:29:
> >> > >
> >> > > > Hi Hugo,
> >> > > >
> >> > > > Group does not have that APIs, since they are all positioned
> >> > absolutely.
> >> > > > Instead HGroup and VGroup has what you want, since "all items" can
> >> be
> >> > > > aligned left, center, right horizontally and top, center, bottom
> >> > > > vertically:
> >> > > >
> >> > > >  /**
> >> > > > * Distribute all items horizontally
> >> > > > * Possible values are:
> >> > > > * - itemsLeft
> >> > > > * - itemsCenter
> >> > > > * - itemsRight
> >> > > > * - itemsSpaceBetween
> >> > > > * - itemsSpaceAround
> >> > > > *
> >> > > > * @langversion 3.0
> >> > > > * @playerversion Flash 10.2
> >> > > > * @playerversion AIR 2.6
> >> > > > * @productversion Royale 0.9.4
> >> > > > */
> >> > > > public function get itemsHorizontalAlign():String
> >> > > >
> >> > > > and
> >> > > >
> >> > > > /**
> >> > > > * Distribute all items vertically
> >> > > > * Possible values are:
> >> > > > * - itemsSameHeight
> >> > > > * - itemsCenter
> >> > > > * - itemsTop
> >> > > > * - itemsBottom
> >> > > > *
> >> > > > * @langversion 3.0
> >> > > > * @playerversion Flash 10.2
> >> > > > * @playerversion AIR 2.6
> >> > > > * @productversion Royale 0.9.4
> >> > > > */
> >> > > > public function get itemsVerticalAlign():String
> >> > > >
> >> > > > also
> >> > > >
> >> > > > /**
> >> > > > * A boolean flag to activate "itemsExpand" effect selector.
> >> > > > * Make items resize to the fill all container space
> >> > > > *
> >> > > > * @langversion 3.0
> >> > > > * @playerversion Flash 10.2
> >> > > > * @playerversion AIR 2.6
> >> > > > * @productversion Royale 0.9.4
> >> > > > */
> >> > > > public function get 

Re: Jewel Presentation Model properties proxied in TLC classes

2020-09-12 Thread Hugo Ferreira
Hi,

I use row Height and yes, it's very strange not to be a bead.
For me go ahead. I will ajuste the code on my side after upgrade with the
new change.

Carlos Rovira  escreveu no dia sábado, 12/09/2020
à(s) 11:52:

> Hi,
>
> While working on a fix for Presentation Models in Jewel I noticed that we
> have many PM variables that are not used most of the time in component's
> TLC. This happens in List, DataGrid, DataGridColumnList and TabBar
>
> For example, we should do:
>
> 
> 
> 
> 
> 
>
> instead of
>
> 
>
> to keep with PAYG.
>
> Also we have just some variables, but not all exposed
>
> variables exposed in TLCs are:
>
>- rowHeight
>- variableRowHeight
>
> This even makes it inconsistent since we probably want to add more PM
> particularities in the future, and doesn't have sense to me to have just
> some in TLC.
>
> If there's no opposition I'll be removing those jewel vars in the next
> days.
>
> Thanks
>
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>


Jewel Presentation Model properties proxied in TLC classes

2020-09-12 Thread Carlos Rovira
Hi,

While working on a fix for Presentation Models in Jewel I noticed that we
have many PM variables that are not used most of the time in component's
TLC. This happens in List, DataGrid, DataGridColumnList and TabBar

For example, we should do:







instead of



to keep with PAYG.

Also we have just some variables, but not all exposed

variables exposed in TLCs are:

   - rowHeight
   - variableRowHeight

This even makes it inconsistent since we probably want to add more PM
particularities in the future, and doesn't have sense to me to have just
some in TLC.

If there's no opposition I'll be removing those jewel vars in the next days.

Thanks



-- 
Carlos Rovira
http://about.me/carlosrovira


Re: RightBead or PositionBead or something else

2020-09-12 Thread Carlos Rovira
Hi Hugo,
just added Position bead. It's showcased in TDJ.
Before we had:



now:







El sáb., 12 sept. 2020 a las 10:31, Carlos Rovira ()
escribió:

> Hi Hugo,
>
> ok you're talking about setting absolute constraints (top, left, right,
> bottom) right?
> I was thinking of adding to StyledUIBase, but since it is something used
> only when positioned in an absolute way, maybe a Bead will be better.
>
> For example "PositionAbsolute" could be the name and have "top", "left",
> "right", "bottom" properties?
> that should go to Basic since it could be used cross UI sets.
>
> One more thing. I prefer to not add "Bead" to bead's name, since the
> implementation indicates already that it is a IBead so we can be less
> verbose (I didn't notice that in DataGridSortBead, and will be removing the
> Bead now).
>
>
> El vie., 11 sept. 2020 a las 20:32, Hugo Ferreira ()
> escribió:
>
>> Sure.
>> I created this bead right now.
>> I was a component property repeated on several components that I will
>> convert all in a bead.
>> I have other use cases that will convert all in beads and end up with a
>> very light and clean component (Royale way) ;)
>>
>> package pt.solidsoft.framework.components
>> {
>> import org.apache.royale.core.IBead;
>> import org.apache.royale.core.IStrand;
>> import org.apache.royale.core.UIBase;
>>
>> public class RightPositionBead implements IBead
>> {
>> public var right:int = 0;
>>
>> public function set strand(value:IStrand):void
>> {
>> if (right > 0)
>> (value as UIBase).style = "right: " + right + "px";
>> }
>> }
>> }
>>
>> Use case:
>> ...
>> > percentHeight="100">
>> > percentHeight="100"/>
>> > y="80"
>> width="400"
>> height="360"
>> hasShadow="true"
>> borderRadius="5"
>> backgroundColor="#5c7bb0">
>> 
>> 
>> 
>> ...
>>
>>
>> Carlos Rovira  escreveu no dia sexta, 11/09/2020
>> à(s) 19:04:
>>
>> > Can you post a snippet of code to understand what you mean?
>> >
>> > El vie., 11 sept. 2020 a las 20:00, Hugo Ferreira (<
>> hferreira...@gmail.com
>> > >)
>> > escribió:
>> >
>> > > But if you have a Group and set the right style in a component, then
>> this
>> > > component is right aligned with a space.
>> > > It works.
>> > > I have a property for that, so I thought that a bead could make sense.
>> > >
>> > > Carlos Rovira  escreveu no dia sexta,
>> > 11/09/2020
>> > > à(s) 18:29:
>> > >
>> > > > Hi Hugo,
>> > > >
>> > > > Group does not have that APIs, since they are all positioned
>> > absolutely.
>> > > > Instead HGroup and VGroup has what you want, since "all items" can
>> be
>> > > > aligned left, center, right horizontally and top, center, bottom
>> > > > vertically:
>> > > >
>> > > >  /**
>> > > > * Distribute all items horizontally
>> > > > * Possible values are:
>> > > > * - itemsLeft
>> > > > * - itemsCenter
>> > > > * - itemsRight
>> > > > * - itemsSpaceBetween
>> > > > * - itemsSpaceAround
>> > > > *
>> > > > * @langversion 3.0
>> > > > * @playerversion Flash 10.2
>> > > > * @playerversion AIR 2.6
>> > > > * @productversion Royale 0.9.4
>> > > > */
>> > > > public function get itemsHorizontalAlign():String
>> > > >
>> > > > and
>> > > >
>> > > > /**
>> > > > * Distribute all items vertically
>> > > > * Possible values are:
>> > > > * - itemsSameHeight
>> > > > * - itemsCenter
>> > > > * - itemsTop
>> > > > * - itemsBottom
>> > > > *
>> > > > * @langversion 3.0
>> > > > * @playerversion Flash 10.2
>> > > > * @playerversion AIR 2.6
>> > > > * @productversion Royale 0.9.4
>> > > > */
>> > > > public function get itemsVerticalAlign():String
>> > > >
>> > > > also
>> > > >
>> > > > /**
>> > > > * A boolean flag to activate "itemsExpand" effect selector.
>> > > > * Make items resize to the fill all container space
>> > > > *
>> > > > * @langversion 3.0
>> > > > * @playerversion Flash 10.2
>> > > > * @playerversion AIR 2.6
>> > > > * @productversion Royale 0.9.4
>> > > > */
>> > > > public function get itemsExpand():Boolean
>> > > >
>> > > > El vie., 11 sept. 2020 a las 18:28, Hugo Ferreira (<
>> > > hferreira...@gmail.com
>> > > > >)
>> > > > escribió:
>> > > >
>> > > > > I really don'' know what is the better name for this:
>> > > > > RightBead
>> > > > > PositionBead with a right property
>> > > > >
>> > > > > I have components that are inside a Group and I position the
>> > > components x
>> > > > > pixels from the right, so, they use a right style.
>> > > > >
>> > > > > This could be a bead that can work on any component.
>> > > > > Makes sense what I'm saying ?
>> > > > > Or this already exists in some form ?
>> > > > >
>> > > >
>> > > >
>> > > > --
>> > > > Carlos Rovira
>> > > > http://about.me/carlosrovira
>> > > >
>> > >
>> >
>> >
>> > --
>> > Carlos Rovira
>> > http://about.me/carlosrovira
>> >
>>
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira


Re: RightBead or PositionBead or something else

2020-09-12 Thread Carlos Rovira
Hi Hugo,

ok you're talking about setting absolute constraints (top, left, right,
bottom) right?
I was thinking of adding to StyledUIBase, but since it is something used
only when positioned in an absolute way, maybe a Bead will be better.

For example "PositionAbsolute" could be the name and have "top", "left",
"right", "bottom" properties?
that should go to Basic since it could be used cross UI sets.

One more thing. I prefer to not add "Bead" to bead's name, since the
implementation indicates already that it is a IBead so we can be less
verbose (I didn't notice that in DataGridSortBead, and will be removing the
Bead now).


El vie., 11 sept. 2020 a las 20:32, Hugo Ferreira ()
escribió:

> Sure.
> I created this bead right now.
> I was a component property repeated on several components that I will
> convert all in a bead.
> I have other use cases that will convert all in beads and end up with a
> very light and clean component (Royale way) ;)
>
> package pt.solidsoft.framework.components
> {
> import org.apache.royale.core.IBead;
> import org.apache.royale.core.IStrand;
> import org.apache.royale.core.UIBase;
>
> public class RightPositionBead implements IBead
> {
> public var right:int = 0;
>
> public function set strand(value:IStrand):void
> {
> if (right > 0)
> (value as UIBase).style = "right: " + right + "px";
> }
> }
> }
>
> Use case:
> ...
>  percentHeight="100">
>  percentHeight="100"/>
>  y="80"
> width="400"
> height="360"
> hasShadow="true"
> borderRadius="5"
> backgroundColor="#5c7bb0">
> 
> 
> 
> ...
>
>
> Carlos Rovira  escreveu no dia sexta, 11/09/2020
> à(s) 19:04:
>
> > Can you post a snippet of code to understand what you mean?
> >
> > El vie., 11 sept. 2020 a las 20:00, Hugo Ferreira (<
> hferreira...@gmail.com
> > >)
> > escribió:
> >
> > > But if you have a Group and set the right style in a component, then
> this
> > > component is right aligned with a space.
> > > It works.
> > > I have a property for that, so I thought that a bead could make sense.
> > >
> > > Carlos Rovira  escreveu no dia sexta,
> > 11/09/2020
> > > à(s) 18:29:
> > >
> > > > Hi Hugo,
> > > >
> > > > Group does not have that APIs, since they are all positioned
> > absolutely.
> > > > Instead HGroup and VGroup has what you want, since "all items" can be
> > > > aligned left, center, right horizontally and top, center, bottom
> > > > vertically:
> > > >
> > > >  /**
> > > > * Distribute all items horizontally
> > > > * Possible values are:
> > > > * - itemsLeft
> > > > * - itemsCenter
> > > > * - itemsRight
> > > > * - itemsSpaceBetween
> > > > * - itemsSpaceAround
> > > > *
> > > > * @langversion 3.0
> > > > * @playerversion Flash 10.2
> > > > * @playerversion AIR 2.6
> > > > * @productversion Royale 0.9.4
> > > > */
> > > > public function get itemsHorizontalAlign():String
> > > >
> > > > and
> > > >
> > > > /**
> > > > * Distribute all items vertically
> > > > * Possible values are:
> > > > * - itemsSameHeight
> > > > * - itemsCenter
> > > > * - itemsTop
> > > > * - itemsBottom
> > > > *
> > > > * @langversion 3.0
> > > > * @playerversion Flash 10.2
> > > > * @playerversion AIR 2.6
> > > > * @productversion Royale 0.9.4
> > > > */
> > > > public function get itemsVerticalAlign():String
> > > >
> > > > also
> > > >
> > > > /**
> > > > * A boolean flag to activate "itemsExpand" effect selector.
> > > > * Make items resize to the fill all container space
> > > > *
> > > > * @langversion 3.0
> > > > * @playerversion Flash 10.2
> > > > * @playerversion AIR 2.6
> > > > * @productversion Royale 0.9.4
> > > > */
> > > > public function get itemsExpand():Boolean
> > > >
> > > > El vie., 11 sept. 2020 a las 18:28, Hugo Ferreira (<
> > > hferreira...@gmail.com
> > > > >)
> > > > escribió:
> > > >
> > > > > I really don'' know what is the better name for this:
> > > > > RightBead
> > > > > PositionBead with a right property
> > > > >
> > > > > I have components that are inside a Group and I position the
> > > components x
> > > > > pixels from the right, so, they use a right style.
> > > > >
> > > > > This could be a bead that can work on any component.
> > > > > Makes sense what I'm saying ?
> > > > > Or this already exists in some form ?
> > > > >
> > > >
> > > >
> > > > --
> > > > Carlos Rovira
> > > > http://about.me/carlosrovira
> > > >
> > >
> >
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira
> >
>


-- 
Carlos Rovira
http://about.me/carlosrovira


Re: Sort Jewel DataGrid by column click

2020-09-12 Thread Carlos Rovira
Hi Hugo,

The change from private to protected was thinking on extensibility,
although probably in this case since it only implies that function people
probably will create a completely new bead if they need to do something
more.

Two more things:

- The actual way of reassigning the collection completely has 2 problems:
remove the current selection (if it has some) and reset the scrollToIndex
(scrollbar goes to the start). I add here @Greg Dove  to
notice this.
- I miss some icon indicators. That probably could be solved changing
ButtonBar to ToggleButtonBar and setting up the up/down icons


El vie., 11 sept. 2020 a las 20:14, Hugo Ferreira ()
escribió:

> OK, I saw.
> Thank you.
>
> I have one question:
> Why did you changed "private function mouseClickHandler" to "protected
> function mouseClickHandler" ?
>
> Carlos Rovira  escreveu no dia sexta, 11/09/2020
> à(s) 18:26:
>
> > Hi Hugo,
> > I committed some changes that would like you to check:
> >
> > * docs
> > * imports (DataGrid and Event imports was missed so jewel was not
> > compiling)
> >
> > also about this lines I was exposing in review comments:
> >
> > dg.dataProvider = null;
> > dg.dataProvider = collection;
> >
> > I was thinking in do instead this:
> >
> > dg.model.dispatchEvent(new Event("dataProviderChanged"));
> >
> > But this is not working since "ArrayListSelectionModel.dataProvider" for
> > each column List has:
> >
> > if (value == _dataProvider) return;
> >
> > and since the dataProvider is the same (although order changed) it
> returns
> > without refreshing it
> > for that reason you need to do a null and then reassign the provider.
> >
> > I'll see what we can do in that kind of cases.
> >
> > @Greg Dove  , what do you think about this? looking
> > at
> > IArrayListView API talks about calling just refresh() in the collection
> > should update the view, but we are not doing this, so making things
> > more complicated when using the API.
> >
> >
> >
> > El vie., 11 sept. 2020 a las 19:14, Carlos Rovira (<
> > carlosrov...@apache.org>)
> > escribió:
> >
> > > Hi Hugo,
> > >
> > > it's less difficult than you could think. For example in Jewel List:
> > > dataProvider, selectedIndex, selectedItem, labelField are probably the
> > real
> > > needs always. But other than that will be used in some cases and not in
> > > others, so that probably means carry that code to a bead.
> > >
> > > For example, I left things in that case like rowHeight that I should
> > > remove, since now presentation models are working fine, and people
> always
> > > can change rowHeight (or other things in PM) setting the bead. I'll be
> > > proposing this soon to be coherent with the rest of the
> implementations.
> > >
> > > El vie., 11 sept. 2020 a las 18:22, Hugo Ferreira (<
> > hferreira...@gmail.com>)
> > > escribió:
> > >
> > >> Hi Carlos,
> > >>
> > >> Great news :)
> > >>
> > >> Makes sense what you say.
> > >> The difficult part is to decide what is used all the time to be part
> of
> > >> the
> > >> component and what is accessory to be built as a bead.
> > >>
> > >>
> > >> In that case I don't think we need to add that API in front of
> DataGrid,
> > >> since the dataProvider is something managed internally. We can always
> > add
> > >> a
> > >> bead (like the one you did) to do something similar. In Fact, it is
> part
> > >> of
> > >> what you did in this concrete bead, so that shows that adding that
> king
> > of
> > >> APIs is not what we try to do. That was one of the Flex problems, that
> > the
> > >> components was very bloated with code for many side cases.
> > >> APIs in components should have what's really important and always used
> > and
> > >> then left other things that "could be used" for beads.
> > >> Being said that, I don't try to be PAYG in a "nonsense way", and
> always
> > >> try
> > >> to ponder if the APIs will be used a lot or just sporadically.
> > >>
> > >>
> > >>
> > >> Carlos Rovira  escreveu no dia sexta,
> > 11/09/2020
> > >> à(s) 16:57:
> > >>
> > >> > Hi Hugo,
> > >> >
> > >> > just merged the PR :)
> > >> >
> > >> > going to try and see if what I had in mind made sense.
> > >> > About refreshing: In Royale PAYG is what rules all the framework and
> > we
> > >> try
> > >> > to keep things as simple as possible.
> > >> > In that case I don't think we need to add that API in front of
> > DataGrid,
> > >> > since the dataProvider is something managed internally. We can
> always
> > >> add a
> > >> > bead (like the one you did) to do something similar. In Fact, it is
> > >> part of
> > >> > what you did in this concrete bead, so that shows that adding that
> > king
> > >> of
> > >> > APIs is not what we try to do. That was one of the Flex problems,
> that
> > >> the
> > >> > components was very bloated with code for many side cases.
> > >> > APIs in components should have what's really important and always
> used
> > >> and
> > >> > then left other things that "could be used" for beads.
> > >> > Being said that, I don't