Date and Time Picker Control

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
xor
Posts: 9
Joined: Mon Dec 13, 2010 9:24 pm
Location: Almere, The Netherlands

Date and Time Picker Control

Post by xor » Wed Jan 05, 2011 7:14 pm

Is it just me or does LiveCode not have a standard DTP Control based on a Combo Box?

xor
Posts: 9
Joined: Mon Dec 13, 2010 9:24 pm
Location: Almere, The Netherlands

Re: Date and Time Picker Control

Post by xor » Sun Jan 09, 2011 2:49 pm

I noticed a lack of response, so I presume that my question was not obvious enough. ;)

I would like to know if it is possible to use a default date picker (as in MS Visual Studio).
I've tried a few things, but without success. Can anyone help me further away?

Thanks,
Mark
Attachments
Example.png
Example.png (5.75 KiB) Viewed 8779 times
Last edited by xor on Sun Jan 09, 2011 3:00 pm, edited 2 times in total.

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: Date and Time Picker Control

Post by Dixie » Sun Jan 09, 2011 2:55 pm

Hi...

attached a stack for you to look at..

be well

Dixie
Attachments
Calendar.zip
(5.35 KiB) Downloaded 481 times

xor
Posts: 9
Joined: Mon Dec 13, 2010 9:24 pm
Location: Almere, The Netherlands

Re: Date and Time Picker Control

Post by xor » Sun Jan 09, 2011 3:13 pm

Hi Dixie,

Thanks for your response.

I tried to open the calendar stack using a combo box and the “Use stack panel” property. When I press the combo box the calendar appears. Perfect.
When I try to select a day nothing happens. Or when I try to switch through the months and years the calendar closes.

Do you know how the solve this issues?

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: Date and Time Picker Control

Post by Dixie » Sun Jan 09, 2011 3:36 pm

Mark...

The calendar is a group.. you can't put it into the comboBox, but you can call it from within the menuItems that are listed in the comboBox.
In the example that I have sent, if you select 'calendar' then the group 'cal' will appear, choose 'toolbox' the vis of the group 'cal' will be set to false...

Hope it gives you some ideas about how to sort out your problem...

be well

Dixie
Attachments
cal2.zip
(3.83 KiB) Downloaded 411 times

xor
Posts: 9
Joined: Mon Dec 13, 2010 9:24 pm
Location: Almere, The Netherlands

Re: Date and Time Picker Control

Post by xor » Wed Jan 12, 2011 9:05 pm

@Dixie: thanks for the example, but it is not exactly what I had in mind. :oops:

Maybe it is not possible to create a date picker based on a combo box.
Can a date picker can be made through a custom control?

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: Date and Time Picker Control

Post by Dixie » Wed Jan 12, 2011 11:05 pm

xor...

Can you say what exactly you want to do ?... I'm a little confused ...

Dixie

kray
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 56
Joined: Sat Apr 08, 2006 5:28 pm
Location: Eau Claire, WI
Contact:

Re: Date and Time Picker Control

Post by kray » Wed Jan 12, 2011 11:42 pm

Here's dixie's group, stuck into a substack and popped up using the "popup" command. It doesn't actually do the whole thing; I just wanted to show you how to approach solving this. Basically I cleared out the contents of the combo box so there's nothing to pop up, then changed the menuPick handler to a mouseDown handler. I copied dixie's group into a substack, named it "DatePicker" and then set the mouseDown handler in the combo box to pop up the stack at a specific place.

You'd have to modify the code of the actual datepicker stack to do what you want, but at least this should give you some direction...
Attachments
Cal2pop.zip
(3.63 KiB) Downloaded 390 times
Ken Ray
Sons of Thunder Software
Email: kray@sonsothunder.com
Web site: http://www.sonsothunder.com

xor
Posts: 9
Joined: Mon Dec 13, 2010 9:24 pm
Location: Almere, The Netherlands

Re: Date and Time Picker Control

Post by xor » Fri Jan 28, 2011 10:09 pm

Dixie: I want to find out if it is possible to have a Date Picker Control based on a Combo Box. Please look at the image that I have attached (second post). Are you still confused?

Ken: Thanks for your example. :D I need some time to look at and I will let you know a.s.a.p.

richh
Posts: 41
Joined: Tue Jan 25, 2011 8:48 pm
Location: New Jersey

Re: Date and Time Picker Control

Post by richh » Sun Jan 30, 2011 8:31 pm

Ironically, I have been looking for the same thing as xor.

I started to play around with the date time picker on BvG's web site and modified it.

All credit of the date time picker goes to BvG. :)

HTH
Attachments
modifiedBvGDatePicker.zip
(6.9 KiB) Downloaded 546 times
- Rich

LiveCode 4.6.4
Dell Latitude E6400 running Windows XP SP3 / Mac Pro, Macbook Pro & Mac Mini running OS X 10.6.4

fritzdekatt
Posts: 57
Joined: Fri Feb 09, 2018 2:28 am

Re: Date and Time Picker Control

Post by fritzdekatt » Sun Sep 06, 2020 2:45 pm

Huge thanks to BvG for hitting the nail on the head. This is one of those 'must-have' controls you would figure everyone would want to have added to the LiveCode toolbox. Big thanks to Richh for going out of his way to find the exact right hammer for this particular nail. Even though you posted this an awfully long time ago, it's a gift that keeps on giving, because I'm going to use it today.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”