CalendarCtrl, can I hide the "current" day ?

hello,

I'm using wx.calendar.CalendarCtrl in a wx.Dialog.
It starts at the current day, which is perfect.
Now if a increase or decrease the month,
the day number (20 is this case) still stays "highlighted/selected".
I can detect the change of month,
but is it possible to turn of the selection of the day number.
It makes it much clearer that another month is selected.

thanks,
Stef

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

···

On 18/05/2011 11:59 PM, Stef Mientki wrote:

hello,

I'm using wx.calendar.CalendarCtrl in a wx.Dialog.
It starts at the current day, which is perfect.
Now if a increase or decrease the month,
the day number (20 is this case) still stays "highlighted/selected".
I can detect the change of month,
but is it possible to turn of the selection of the day number.
It makes it much clearer that another month is selected.

thanks,
Stef

I suspect not as that would set the date to an invalid value, you
could try setting the day to the first of the month possibly.

Gadget/Steve

I think you can catch the EVT_CALENDAR_MONTH event, and, borrowing
from the approach in the page below, in the handler do:

foreground = wx.Colour(0, 0, 0, 0)
background = wx.Colour(255, 255, 255, 0)
yourCalendarCtrl.SetHighlightColours(foreground, background)

And put it back when the month is the current month.

See ShowHighlight and HideHighlight here:
https://svn.enthought.com/enthought/browser/TraitsBackendWX/trunk/enthought/traits/ui/wx/date_editor.py?rev=23085

Che

···

On Wed, May 18, 2011 at 6:59 PM, Stef Mientki <stef.mientki@gmail.com> wrote:

hello,

I'm using wx.calendar.CalendarCtrl in a wx.Dialog.
It starts at the current day, which is perfect.
Now if a increase or decrease the month,
the day number (20 is this case) still stays "highlighted/selected".
I can detect the change of month,
but is it possible to turn of the selection of the day number.
It makes it much clearer that another month is selected.

thanks Che,
works perfect !
cheers,
Stef

···

On 19-05-2011 08:24, C M wrote:

On Wed, May 18, 2011 at 6:59 PM, Stef Mientki <stef.mientki@gmail.com> wrote:

hello,

I'm using wx.calendar.CalendarCtrl in a wx.Dialog.
It starts at the current day, which is perfect.
Now if a increase or decrease the month,
the day number (20 is this case) still stays "highlighted/selected".
I can detect the change of month,
but is it possible to turn of the selection of the day number.
It makes it much clearer that another month is selected.

I think you can catch the EVT_CALENDAR_MONTH event, and, borrowing
from the approach in the page below, in the handler do:

foreground = wx.Colour(0, 0, 0, 0)
background = wx.Colour(255, 255, 255, 0)
yourCalendarCtrl.SetHighlightColours(foreground, background)

And put it back when the month is the current month.

See ShowHighlight and HideHighlight here:
https://svn.enthought.com/enthought/browser/TraitsBackendWX/trunk/enthought/traits/ui/wx/date_editor.py?rev=23085

Che