Matt Gemmell

My new book CHANGER is out now!

An action-thriller novel — book 1 in the KESTREL series.

★★★★★ — Amazon

iCalendar

source 1 min read

I've been working on a new Cocoa control (NSControl/NSActionCell subclass pair), which I've 
provisionally named iCalendar, for obvious reasons:
 



Currently, it supports customising the colours for the background, month header, day headers, day numbers, 
"today" background colour, "selected" background colour, "today" number colour, "selected" number colour, 
week background colour and week border colour. You can also tell it whether to draw the week 
backgrounds and/or borders (i.e. to fill and/or stroke the round-ended bars behind each week), whether to 
highlight today, whether to highlight the selected cell, and whether to draw the overall background. Oh, 
and you can set a background image for the calendar too, which will be sized and positioned appropriately.



 



I defy anyone (except Apple folk with access to the iCal source, obviously) to create a control which more 
precisely mimics the appearance and behaviour of the mini-month calendar in iCal. I have lots of work still 
to do on the control (including several very cool things which iCal's version <em>doesn't</em> do), but it's 
coming along nicely - I've only been working on it since yesterday (god bless NSCalendarDate and NSBezierPath).



What else can I say about it? Um... well, it automatically uses localised names of the days of the week to draw 
the day headers, and it's even (gasp!) <a href="http://mattgemmell.com/images/icalendar/icalendar_large.gif">resizable too</a>. 
Why does no-one create calendar widgets that are resizable? Well, this one is.



&nbsp;



I'm toying with the idea of actually selling this control, for some small (shareware-like) fee. Not sure if that would 
work or not; I've certainly never before tried to earn money from my <a href="http://mattgemmell.com/products/source/">Cocoa source code</a>. 
Anyone have any thoughts as to whether or not fellow Cocoa developers would be willing to pay a small fee to get hold 
of a full-featured, well-documented, and rather pretty calendar widget?



Anyway, more info (and screenshots of customised iCalendars) soon.