Page 1 of 1

Date and Time Picker Control

Posted: Wed Jan 05, 2011 7:14 pm
by xor
Is it just me or does LiveCode not have a standard DTP Control based on a Combo Box?

Re: Date and Time Picker Control

Posted: Sun Jan 09, 2011 2:49 pm
by xor
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

Re: Date and Time Picker Control

Posted: Sun Jan 09, 2011 2:55 pm
by Dixie
Hi...

attached a stack for you to look at..

be well

Dixie

Re: Date and Time Picker Control

Posted: Sun Jan 09, 2011 3:13 pm
by xor
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?

Re: Date and Time Picker Control

Posted: Sun Jan 09, 2011 3:36 pm
by Dixie
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

Re: Date and Time Picker Control

Posted: Wed Jan 12, 2011 9:05 pm
by xor
@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?

Re: Date and Time Picker Control

Posted: Wed Jan 12, 2011 11:05 pm
by Dixie
xor...

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

Dixie

Re: Date and Time Picker Control

Posted: Wed Jan 12, 2011 11:42 pm
by kray
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...

Re: Date and Time Picker Control

Posted: Fri Jan 28, 2011 10:09 pm
by xor
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.

Re: Date and Time Picker Control

Posted: Sun Jan 30, 2011 8:31 pm
by richh
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

Re: Date and Time Picker Control

Posted: Sun Sep 06, 2020 2:45 pm
by fritzdekatt
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.