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

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
andyh1234
Posts: 442
Joined: Mon Aug 13, 2007 4:44 pm
Location: Eccles UK
Contact:

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

Post by andyh1234 » Mon Aug 14, 2023 12:56 pm

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?

stam
Posts: 2686
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

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

Post by stam » Mon Aug 14, 2023 2:17 pm

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

andyh1234
Posts: 442
Joined: Mon Aug 13, 2007 4:44 pm
Location: Eccles UK
Contact:

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

Post by andyh1234 » Mon Aug 14, 2023 3:52 pm

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.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7238
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

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

Post by jacque » Tue Aug 15, 2023 9:16 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “iOS Deployment”