Date Picker

Post Reply
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Date Picker

Post 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.
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
MOISES
Posts: 824
Joined: Wed Aug 22, 2007 10:09 am

Post 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,
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Calendar

Post 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.
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
Roger Seiler
Posts: 223
Joined: Thu Dec 01, 2005 3:34 pm
Location: Nyack, New York, USA
Contact:

Post 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
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Hello Tim,
is it that what you are looking for?
Image

if yes, than try this:

Image
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

Yes. Atleast thats what I am looking for. It is calendar control. FWH does not yet have it.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Roger Seiler
Posts: 223
Joined: Thu Dec 01, 2005 3:34 pm
Location: Nyack, New York, USA
Contact:

Post by Roger Seiler »

Image

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
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Calendar

Post 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 ).
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post 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)
Post Reply