February 21, 2009
@ 05:36 PM

I just posted a new release of my calendar controls that includes a bunch of new functionality, some more documentation (courtesy of HTML Help Builder from West Wind), along with a few more samples of how this is all supposed to work.

A Bit of History

This all initially started with a small calendar. I initially planned on using Microsoft's ActiveX calendar but realized I needed to be able to select multiple days. Their control really didn't quite work the way I needed it to, so I created my own. I created three different sizes (normal, smaller, and smallest) just because it was easy to do (they're all the same control) and I thought I might need it. Like any project the "hey, wouldn't it be cool if..." features started to grow. In some cases, I needed this functionality for an application anyway, so I went ahead and improved them.

Calendar

The first thing I ended up needing was a drop-down calendar. I already had the calendar portion, so all I needed to do was show and hide it when you clicked on a button next to a text box. So that's basically what I did. It worked well enough, but if the control happened to be at the bottom of a form it was clipped - the initial control was based on a container. I moved this into a form and adjusted the code a bit so it would be able to bleed off the form.

I needed to be able to bind to a date/time field but only display the date portion for data coming from SQL Server, so I named it "rcsDatetimePicker". In hindsight, not a great name. It gives you the impression it lets you view/edit both the date and time portion when in fact it doesn't. At this point I've got a bunch of code which depends on it so it's not being renamed (sorry).

DatePicker

A common use-case for dropdown calendars is to pick a date range. I took an idea from a previous job where you could link two date controls to keep the start date and the end dates from overlapping (ex. the start date can be after the end date). So this was added.

I worked on another project which needed a time control (hours/minutes) so I created one. It seemed like a natural fit to this calendar library so it's been added in. The next logical idea is, "hey, I need a date/time dropdown calendar". The better name for this was already taken, so this was was named rcsCtrDateTimePicker. Yeah, not great, but I didn't have any other ideas.

DateTimePicker

Finally, I just worked on an application which needed an Outlook-style calendar (month view). It seemed like I already had most of the work done from my other calendar, so (I optimistically though) it wouldn't be a big deal to re-purpose it. It actually required a number of changes so it could be nicely resized, display events, etc.

That's basically where the library is today: 3 different sized "static" calendars, a drop-down date w/calendar, a drop-down date/time w/calendar, a time control, plus a large resizable calendar that can have events displayed on it.

LargeCalendar

LargeCalendarMoreEvents

I've tried to provide a few more examples of how these controls can be used along with a help file. It's not as comprehensive as I'd like, but it's a decent start.

Misc. Notes

One thing that's not really covered in the help yet is related to performance of the large calendar when you have a lot of events on it. I ran into this during testing - as you add more events, the calendar navigation became slower and slower. I attempted to optimize this a bit but ultimately ended up modifying my application code to only populate events for the current month plus one month prior and one month following. The calendar shows days from the previous and following months, so if I didn't populate them they'd be missing from the calendar.

You can hook in populating events via the RefreshEvents() event. It fires anytime the calendar needs to be refreshed. I'd suggest just using BINDEVENT to call a form-level method for this event:

BINDEVENT(This.ctrCalendar, "RefreshEvents", This, "RefreshEvents") 

You can determine the current month by looking at the iCurrentYear/iCurrentMonth properties.

Getting Started

I'd suggest playing around with the samples and digging through the help file to get started. The examples cover most of the basic functionality (try clicking on everything and hovering over things, resizing, etc.) and the help file explains some of the class structure.

Let me know what you think.

Links

http://www.west-wind.com/wwHelp/
http://www.rcs-solutions.com/downloads.aspx


 
Sunday, February 22, 2009 4:26:42 AM (Eastern Standard Time, UTC-05:00)
Thnks for giving about file ..its great..
thanks
Friday, March 06, 2009 3:42:52 AM (Eastern Standard Time, UTC-05:00)
Great work, nice :)
Vasim
Tuesday, March 24, 2009 4:44:50 PM (Eastern Standard Time, UTC-05:00)
I've a problem, if i use the calendar in a form with property : Alwaysontop=.t., ShowWindow=2, called bye a form with property : Alwaysontop=.t., ShowWindow=2, using the rcsdatetimepicker class, the calendar isn't showed when i click on the button. can u help me?.
sorry for my english i'm italian. Thank you for help, bye
Raffaele
Raffaele Viglione
Tuesday, March 24, 2009 5:58:00 PM (Eastern Standard Time, UTC-05:00)
I'm not sure what you can do. You've basically said your form is always on top. That means the pop-up window that appears w/the calendar can't be on top of it.
Wednesday, March 25, 2009 8:01:54 PM (Eastern Standard Time, UTC-05:00)
Sorry i can't speak well, i try again, i've a principal form with a button wich call an other form where is the calendar, the secondary form is placed above the first, when i click the button of calendar the pop-up don't appears. I've tryed to set Alwaysontop and ShowWindow property of both form in all possible combination ,but only if the form with calendar button is under the first form the pop-up is visible. can u help me.
Thank you very much for your help.

Raffaele
Raffaele Viglione
Thursday, March 26, 2009 2:49:59 AM (Eastern Standard Time, UTC-05:00)
Hello again, i've resolved the problem, i had set desktop=.t. in both form's. Now all ok.
Bye
Raffaele Viglione
Saturday, March 28, 2009 1:02:03 PM (Eastern Standard Time, UTC-05:00)
Thanks for posting your solution.
Tuesday, April 07, 2009 1:59:49 AM (Eastern Standard Time, UTC-05:00)
Hello again,
I've an other problem using your class, i'm Italian, ouw time format is 24H es. 15:30:00, i've found in your helo the Nmode Value, i've tryied to set to 4 but the time format don't change. How can i set time formato to 24H without AM PM suffix.
Thanks for your help.

Raffaele
Raffaele Viglione
Tuesday, April 21, 2009 5:28:21 PM (Eastern Standard Time, UTC-05:00)
Sorry, that was one of the things on the "to-do" list that I never got around to actually doing.
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, i, strike) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview