Page 1 of 1

Mobile Native Essentials Widget Pack - Activating the date picker with code

Posted: Mon Aug 14, 2023 12:56 pm
by andyh1234
I am trying to work with the Mobile Native Essentials Widget Pack date picker.

It works, but I would like to change the appearance of the date, I can set up a custom field to do this but when I click on the field I would like it to pass the mouseup to the widget, but whatever I try it does not activate the widget.

I have tried send "mouseup" to widget, send "touchend" to widget etc but nothing seems to activate the widget.

Is there a magic command to activate it?

Re: Mobile Native Essentials Widget Pack - Activating the date picker with code

Posted: Mon Aug 14, 2023 2:17 pm
by stam
If it's a non-editable field (eg a label) then mouseEvents will work - but this requires the lockText property of the field to be true.

if it's an editable field, it won't respond to mouseEvents (or, I guess touch events).
Instead, use the openField handler (more info in the dictionary).


HTH
Stam

Re: Mobile Native Essentials Widget Pack - Activating the date picker with code

Posted: Mon Aug 14, 2023 3:52 pm
by andyh1234
Thanks,

Im afraid neither worked with the widget. I am guessing it is just not set up that way, it would be nice if it was developed further to accept font settings, as it is it is quite small for my use which is a shame as when it is clicked the calendar selection tool is very neat and well done.

Re: Mobile Native Essentials Widget Pack - Activating the date picker with code

Posted: Tue Aug 15, 2023 9:16 pm
by jacque
I am able to set the text size and font in the date picker widget. It's in the "A" pane of its property inspector. I can also get/set it by script with "textsize" and "textfont" properties.

Most of the widgets don't support many mouse events (but they certainly should.) If the reason you want to send a mouseUp is to set the datepicker to display a particular date, you can use the selectedDate property.

Code: Select all

set the selectedDate of widget "date picker" to "2023-08-24"
set the textfont of widget "date picker" to "Arial"
set the textsize of widget "date picker" to 24
Note that on mobile you are restricted to the default fonts unless you supply your own. So if the font isn't changing, you may be trying to use one that isn't installed.

Edit: There is also an "auto-resize font" option in the property inspector. That changes the text size dynamically depending on the size of the widget. That may be another option.