Page 1 of 1
Date Picker
Posted: Wed Dec 26, 2007 6:14 pm
by TimStone
Consider:
REDEFINE DTPICKER cDate ID 1001 OF oDlg
This control calls the windows API and displays a date icon in the edit field. When clicking on the date icon, a window control pops up that allows me to navigate, and select, a date. It returns the date value.
So here is my question. Is there a way to call a calendar control. which I can display on a dialog, and which does not use the edit field. I want the control to simply return the selected date.
Posted: Wed Dec 26, 2007 7:04 pm
by MOISES
Just put a button that calls a calendar, for example, via open or fivewin´s internal, next to the field you want.
regards,
Calendar
Posted: Thu Dec 27, 2007 12:39 am
by TimStone
I don't want a button to call a calendar. FWH does that with its DTPICKER option. I want the calendar to display, ie. Outlook, and when I click a date, it provides that date to the function ( a static variable which it changes ) and I can then display data on my dialog screen.
DTPICKER allows a calendar to be displayed, but once you select a date, it goes into an edit control and the calendar disappears. I want the calendar on constant display for quick movement between dates.
I had this ability previously with a function from Grumpfish, but I wanted to clean it up a bit with a 32 bit look and feel.
Posted: Mon Dec 31, 2007 3:24 am
by Roger Seiler
Probably not what you want, but here it is anyway. This is a highly modified version of the old FiveCald.prg with a Schedule.rc dialog resource to go with it. This does basically the same as datepicker, with a few refinements and with a bit larger dialog for better readability. However, here you have all the source so you can probably make it do whatever you want. Download the two files in a zip file named fivecald.zip from...
http://www.leadersoft.com/software/fivecald.zip
Good luck. - Roger
Posted: Tue Jan 01, 2008 8:17 am
by Otto
Hello Tim,
is it that what you are looking for?
if yes, than try this:
Posted: Tue Jan 01, 2008 9:24 am
by nageswaragunupudi
Yes. Atleast thats what I am looking for. It is calendar control. FWH does not yet have it.
Posted: Tue Jan 01, 2008 3:15 pm
by Roger Seiler
Here is FiveCald available from URL on my prior post. Features:
- Name of date field is included on titlebar to avoid confusion when more than one date field used on a screen
- current date highlighted in bold & italic
- can navigate forward/backward by month or year
- click on a day to select it and auto-insert it into date field
- automatic correct calculation of calendar for any year, including leap years
- click <Cancel> to abort date selection
- complete source provided plus .RC for calendar dialog
Calendar
Posted: Wed Jan 02, 2008 4:55 pm
by TimStone
Otto & Roger,
Otto,
That is a control that pretty well matches the 32 bit environment. Yes, it is what I would work.
Roger,
That is an older style calendar. I have been using that but wanted to replace it.
The control must be OK for a dialog ... using it only on a window doesn't work out because some of the other controls need a dialog and won't work properly on a window. I've tried both approaches. I have everything working perfectly on the dialog EXCEPT for a viable calendar control. I need the calendar to display all of the time, not just as a date field popup ( DTPICKER ).
Posted: Wed Jan 02, 2008 7:21 pm
by Otto
Hello Tim,
I saw that in the res-file
SysMonthCal32 is used.
Fivewin uses in DTPicker
::Create( "SysDateTimePick32" )
Maybe if you make a new class like the one tDTPicker it should work. Not tested.
Regards,
Otto
Def CreateMonthCal(7) Control("SysMonthCal32" ,"",&(7),%(2),%(3),%(4),%(5),&(1),%(6),%hinstance)
Def CreateDateTimePicker(7) Control("SysDateTimePick32","",&(7),%(2),%(3),%(4),%(5),&(1),%(6),%hinstance)