I am not sure but I believe that Today being always marked is a default style of the native control on Windows. Common controls version 4.70 (Vista+) supports MCS_NOTODAYCIRCLE but wxWidgets do not expose this option.
Unless you want to mess with the native control then perhahps the only solution would be using wxGenericCalendarCtrl instead of wxCalendarCtrl.
Edit
FWIW, here is the code to "fix" the issue on MSW (the bottom calendar has the MCS_NOTODAYCIRCLE style):
- calendar.png (11.15 KiB) Viewed 1474 times
Code: Select all
#include <wx/wx.h>
#include <wx/calctrl.h>
#ifdef __WXMSW__
#include <wx/msw/wrapcctl.h>
#include <wx/platinfo.h>
#endif;
bool RemoveTodayCircle(wxCalendarCtrl* calendar)
{
#ifdef __WXMSW__
if ( !wxPlatformInfo().CheckOSVersion(6, 0) )
return false; // older than Vista
HWND hWnd = calendar->GetHWND();
wxCHECK(hWnd, false);
LONG style = ::GetWindowLong(hWnd, GWL_STYLE);
if ( style == 0 )
return false;
style |= MCS_NOTODAYCIRCLE;
if ( ::SetWindowLong(hWnd, GWL_STYLE, style) == 0 )
return false;
calendar->Refresh(); calendar->Update();
return true;
#else
return false;
#endif // #ifdef __WXMSW__
}
class MyFrame : public wxFrame
{
public:
MyFrame() : wxFrame(NULL, wxID_ANY, "Test")
{
wxBoxSizer* bSizer = new wxBoxSizer(wxVERTICAL);
wxCalendarCtrl* calendar = NULL;
wxDateTime dt(wxDateTime::Today());
short day = dt.GetDay();
if ( day == 1 )
day++;
else
day--;
dt.SetDay(day);
bSizer->Add(new wxCalendarCtrl(this, wxID_ANY, dt), 0, wxALL, 5);
calendar = new wxCalendarCtrl(this, wxID_ANY, dt);
RemoveTodayCircle(calendar);
bSizer->Add(calendar, 0, wxALL, 5);
SetSizerAndFit(bSizer);
}
};
class MyApp : public wxApp
{
public:
bool OnInit()
{
(new MyFrame())->Show();
return true;
}
}; wxIMPLEMENT_APP(MyApp);