Date Picker

Date Picker

Postby TimStone » Wed Dec 26, 2007 6:14 pm

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
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Postby MOISES » Wed Dec 26, 2007 7:04 pm

Just put a button that calls a calendar, for example, via open or fivewin´s internal, next to the field you want.

regards,
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Calendar

Postby TimStone » Thu Dec 27, 2007 12:39 am

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
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Postby Roger Seiler » Mon Dec 31, 2007 3:24 am

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
Roger Seiler
 
Posts: 223
Joined: Thu Dec 01, 2005 3:34 pm
Location: Nyack, New York, USA

Postby Otto » Tue Jan 01, 2008 8:17 am

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

if yes, than try this:

Image
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Postby nageswaragunupudi » Tue Jan 01, 2008 9:24 am

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
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Roger Seiler » Tue Jan 01, 2008 3:15 pm

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
Roger Seiler
 
Posts: 223
Joined: Thu Dec 01, 2005 3:34 pm
Location: Nyack, New York, USA

Calendar

Postby TimStone » Wed Jan 02, 2008 4:55 pm

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
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Postby Otto » Wed Jan 02, 2008 7:21 pm

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 59 guests