From: Aleksander on
Hello,

I use wxCalendarCtrl (wxWidgets 2.6.3 - wxALL under MS Windows XP) which I
create in this way:

mCalendarCtrl = new wxCalendarCtrl(c_panel, ID_CALENDAR, wxDefaultDateTime,
wxDefaultPosition, wxDefaultSize, wxCAL_MONDAY_FIRST | wxCAL_SHOW_HOLIDAYS |
wxCAL_SHOW_SURROUNDING_WEEKS | wxCAL_SEQUENTIAL_MONTH_SELECTION);

and put into sizer:

cbox_sizer->Add(mCalendarCtrl, 0, wxALIGN_CENTER | wxEXPAND);

I noticed that buttons for changing months don't work. IMHO lines in
calctrl.cpp (method wxCalendarCtrl::HitTest) are wrong:

if ( wxRegion(m_leftArrowRect).Contains(pos_corr) == wxInRegion )

and

if ( wxRegion(m_rightArrowRect).Contains(pos_corr) == wxInRegion )

I think that this code should look like this:

if ( wxRegion(m_leftArrowRect).Contains(pos) == wxInRegion )

and

if ( wxRegion(m_rightArrowRect).Contains(pos) == wxInRegion )

I have tested it and it work.

Best regards,
Alexander



From: Vadim Zeitlin on
On Fri, 24 Nov 2006 09:21:13 +0100 Aleksander <olek(a)none.pl> wrote:

A> mCalendarCtrl = new wxCalendarCtrl(c_panel, ID_CALENDAR, wxDefaultDateTime,
A> wxDefaultPosition, wxDefaultSize, wxCAL_MONDAY_FIRST | wxCAL_SHOW_HOLIDAYS |
A> wxCAL_SHOW_SURROUNDING_WEEKS | wxCAL_SEQUENTIAL_MONTH_SELECTION);
A>
A> and put into sizer:
A>
A> cbox_sizer->Add(mCalendarCtrl, 0, wxALIGN_CENTER | wxEXPAND);
A>
A> I noticed that buttons for changing months don't work. IMHO lines in
A> calctrl.cpp (method wxCalendarCtrl::HitTest) are wrong:
A>
A> if ( wxRegion(m_leftArrowRect).Contains(pos_corr) == wxInRegion )
A>
A> and
A>
A> if ( wxRegion(m_rightArrowRect).Contains(pos_corr) == wxInRegion )
A>
A> I think that this code should look like this:
A>
A> if ( wxRegion(m_leftArrowRect).Contains(pos) == wxInRegion )
A>
A> and
A>
A> if ( wxRegion(m_rightArrowRect).Contains(pos) == wxInRegion )
A>
A> I have tested it and it work.

Yes, you're correct and there is indeed a bug and your changes do fix it.
I've applied a slightly different fix (using m_arrowRect.Contains()
directly, no need for wxRegion here) to the cvs and it will be part of
2.8.0.

Thanks,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org