royale-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Ent <p...@adobe.com>
Subject Re: Convert s:DateChooser to js:DateChooser
Date Wed, 25 Oct 2017 14:29:14 GMT
Hi Doug,

I'll try and answer your questions in-line, below. In Royale, a "bead" add
functionality or a visual component to another component. Some components
are actually composites made from other components. DateChooser is like
that: the DateChooserHeader and DateChooserList are themselves components
with beads. A bead would be more like the Password bead that you can add
to a TextInput component which intercepts your keystrokes and replaces
them with "*".

As you'll see from my answers in-line, I have a couple of things to check
for you. But the Royale DateChooser should be serviceable for you right
now and it needs a little more work to come up to par with the Flex
DateChooser.

Regards,
Peter Ent
Adobe Systems/Apache Royale Project

On 10/25/17, 4:19 AM, "doug777" <doug777twn@gmail.com> wrote:

>I have a DateChooser that looks like this
>
><s:DateChooser id="dcCal1"
>		headerColors="[0xdee7f6, 0xacc9f6]"
>		showToday="false"
>		contentBackgroundColor="0xffe189"
>		selectionColor="0x83fc61"
>		change="dateChangeEventHandler(event)"
>		valueCommit="cbChangeEventHandler(event)"
>		scroll="dateFieldScrollHandler(event)"/>
>
>Taking the attributes one by one
>
>headerColours - Do I set the CSS background-color style on the
>DateChooserHeader bead? Is there now any easy way to set a color gradient
>or
>do I have to create and set a background-image?

You are correct that you need to set the style on the DateChooserHeader
(it is not a bead, but a component in its own right). Right now we do not
have a gradient background bead. We also do not support a background image
yet on the SWF platform; it should work for the HTML platform although I
have not tried that. If you can set gradient colors in CSS (not an expert
in this, I'm afraid), then that might work, too.
>
>showToday - Presumably this is not set in flexjs so I can omit this, but
>when I want to set it later in actionscript, is there an easy way to do
>it?

We haven't written any way to distinguish "today" from any other
selection. This, to me, is a gray area in terms of pay-as-you-go.
Presumably, most DateChoosers would want to show "today" and if that's the
case, the functionality would be built in. But if most DateChoosers would
not do that, then the pay-as-you-go philosophy would have it as a bead
that would make it happen just for those DateChooser instances that
require it.
>
>contentBackgroundColor - Do I set the CSS background-color style on the
>DateChooserList bead?

Yes - set the background color for DateChooserList (also, not a bead but a
component). 
>
>selectionColor - How do I set this?

Not sure - its been awhile since I looked at that code and will have to
get back to you. 
>
>change - I guess I just set this in the main tag or do I have to set it on
>the DateChooserList bead?

You put the change event handler on the DateChooser itself, just like with
Flex. In general, events that sub-components or beads issue are dispatched
by the main component (strand) itself so there is one central place to
listen for events. Sometimes events internal to the function of the
component are dispatched on some other part and then transformed and
dispatched off the strand.
>
>valueCommit - Previously the change event fired only on user changes.
>valueCommit event was needed for programmatic changes. If the js change
>event works the same way as before, how do I set a valueCommit event?

I don't think we are issuing valueCommit events in Royale; I'll have to
check on that, too.
>
>scroll - I only want this event to fire when the Next/Previous Month
>buttons
>are clicked. Do I set the click event on the DateChooserButton bead to
>achieve this? Presumably the click event on the main tag affects the whole
>calendar, but it looks as though the DateChooserButton is just for the
>header buttons - is that right?

I'm pretty sure no events are being dispatched when the month changes. I
think it should and this would be a bug, IMO.
>
>Can anyone say whether I'm right or wrong on each point and give some
>pointer as to which direction I should take to solve the issues.
>
>Thanks,
>Doug
>
>
>
>--
>Sent from: 
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-roy
>ale-users.20374.n8.nabble.com%2F&data=02%7C01%7C%7C82c7a329566f48cda6a708d
>51b811474%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636445163578601369&
>sdata=CzM9UtTY5E7uG3iCdfMmeVn9I9wbHyaC4MwIYdkrdXc%3D&reserved=0


Mime
View raw message