In calendar's sample from wxWidgets 3.0.4
file: calendar.cpp
Code: Select all
wxCalendarCtrlBase *MyPanel::DoCreateCalendar(const wxDateTime& dt, long style)
{
wxCalendarCtrlBase *calendar;
#ifdef wxHAS_NATIVE_CALENDARCTRL
if (m_usingGeneric)
calendar = new wxGenericCalendarCtrl(this, Calendar_CalCtrl,
dt,
wxDefaultPosition,
wxDefaultSize,
style);
I changed to:
Code: Select all
wxCalendarCtrlBase *MyPanel::DoCreateCalendar(const wxDateTime& dt, long style)
{
wxCalendarCtrlBase *calendar;
#ifdef wxHAS_NATIVE_CALENDARCTRL
if (m_usingGeneric)
{
wxLocale locale;
locale.Init(wxLANGUAGE_ENGLISH);
calendar = new wxGenericCalendarCtrl(this, Calendar_CalCtrl,
dt,
wxDefaultPosition,
wxDefaultSize,
style);
}
In terms of the wxCustomDateTimePicker it's just enough to add mentioned lines of code before creating the control (wxCustomDateTimePicker) in any place of the dialog (I tried in constructor) which is use wxCustomDateTimePicker control.
The problem occurs only with wxGenericCalendarCtrl while with simple wxCalendarCtrl everything is OK.
By "slow" I mean, that I see the process of drawing (redrawing).
I attached .gif file with the process of drawing.
In this case I placed wxCustomDateTimePicker inside of one of the dialogs from dialogs sample from wxWidgets 3.0.4 and add these strings before the dialog creation:
Code: Select all
void MyFrame::MessageBoxDialog(wxCommandEvent& WXUNUSED(event))
{
wxLocale locale; // added
locale.Init(wxLANGUAGE_ENGLISH); // added
TestMessageBoxDialog dlg(this); // original string from the sample
dlg.Create(); // original string from the sample
dlg.ShowModal(); // original string from the sample
}