disable days in a wxCalendarCtrl

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Experienced Solver
Experienced Solver
Posts: 75
Joined: Fri Jan 21, 2005 11:51 am
Location: Spain

disable days in a wxCalendarCtrl

Post by irkaltza » Mon Apr 04, 2005 9:57 am


How can you disable days in a wxCalendarCtrl? I'm working with historic data, so i can't show future data(it doesn't exist yet). I show a wxCalendarCtrl with the actual day marked. When the user double click in a date, the application shows the file for the selected date. But if the user double click on a future date, no files will appear, and a wxMessageDialog will popup; it would be very good to disable future days; how can i do it?


Earned some good credits
Earned some good credits
Posts: 120
Joined: Sun Aug 29, 2004 3:09 pm
Location: Grenoble, France

Post by Cursor » Mon Apr 04, 2005 10:12 am

You can intercept the EVT_CALENDAR (or other changement)
event and prevent it to change. The wxCalendarEvent is derived from wxCommandEvent so you can intercept to prevent changements.
Moreover, you can change the aspect of a day with wxCalendarCtrl::GetAttr.
What is little and green, witch go up and down ??
Yoda playing with the force.

Post Reply