Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » CalendarCtrl » Update to CalendarCtrl / TimeDateCtrl
Update to CalendarCtrl / TimeDateCtrl [message #10123] Thu, 21 June 2007 14:20 Go to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
While trying to fix a problem I had with these controls I have made some modifications (and hopefully improvements) to the functionality and design (no offense intended unodgs, most of the code was lovely Smile).

The problems I've tried to fix are:
Only being able to use the popup functionality with an EditDate control (my app requires a custom date format)
SetDate not actually setting the date.
No support for SetData/GetData

Interface changes:
SetDate - now sets the selected date and moves the calendar view to display the selection
GetDate - return the currently selected date
Added: SetView - moves the calendar view without changing the selection
Added: SetData/GetData same as Set/GetDate
Added: GetView - returns the view (day will always be 1)
Added: HasCursor - return true if the mouse is over a date
Added: GetCursor - returns the mouseover date (day will be 0 if HasCursor == false)
(Has/GetCursor are to support possible future improvements, perhaps a WhenBar callback)

Other changes:
Added chameleon support (this needs some more work)
Simplified internal structure (inc. removing some redundant members)
Can now be used as pop-up by any control (TimeDateCtrl modified to support this)

I believe I've kept the interface working as it did before (with the exception of SetDate, which didn't work properly IMO) so this should not break any existing apps. When I've got some more time I'll put together an example and add some more stuff.

Thanks to unodgs for the ctrl, I'm very glad he wrote all complicated code Smile.

James
Re: Update to CalendarCtrl / TimeDateCtrl [message #10125 is a reply to message #10123] Thu, 21 June 2007 14:27 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

That's great. Thank you! I'll move your changes to uvs today.
In my sources I also have some modifications to DateTimeCtrl like ability to edit time, but I'll merge them later. Thanks again for corrections.
Re: Update to CalendarCtrl / TimeDateCtrl [message #10137 is a reply to message #10125] Thu, 21 June 2007 23:13 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

I merged your patch. However you must fix one thing that was broken by this patch. Click on drop button - callendar will apear, click again on it - instad of closing calendar the calendar is hidden for a very short time and then is popuped again. This was controled by IgnoreMouseClick().
Re: Update to CalendarCtrl / TimeDateCtrl [message #10215 is a reply to message #10137] Mon, 25 June 2007 14:20 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Ah yes, interesting. The window was being closed on the mouse-down event (change of focus) and reopened on the mouse up. Adding the IgnoreMouseClick() to Calendar::Deactivate fixes this (and correctly matches other normal DropList behaviour):
		WhenPopDown();
		IgnoreMouseClick();
		Close();

Also: You might want to change the WhenPopDown callback, I'm not sure what I was thinking when I named that. WhenCancel/WhenSelect would be clearer and match PopUpTable better. I'll happily do this myself when I've got a more up-to-date source.

Let me know if there is anything else I can do.

James

[Updated on: Mon, 25 June 2007 14:26]

Report message to a moderator

Re: Update to CalendarCtrl / TimeDateCtrl [message #10520 is a reply to message #10215] Fri, 13 July 2007 21:01 Go to previous message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Thanks. Patch appiled.
Previous Topic: Problem assigning a date to CalendarCtrl
Next Topic: New SetDate for DateTimeCtrl
Goto Forum:
  


Current Time: Wed Apr 24 13:22:14 CEST 2024

Total time taken to generate the page: 0.02139 seconds