set focus to the control when it's clicked

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53014 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-04-04 23:07:55 +00:00
parent d6f04127fe
commit 3ccd1b4987
3 changed files with 16 additions and 0 deletions

View File

@@ -97,6 +97,8 @@ wxCalendarCtrl::Create(wxWindow *parent,
UpdateMarks();
Connect(wxEVT_LEFT_DOWN,
wxMouseEventHandler(wxCalendarCtrl::MSWOnClick));
Connect(wxEVT_LEFT_DCLICK,
wxMouseEventHandler(wxCalendarCtrl::MSWOnDoubleClick));
@@ -400,4 +402,13 @@ void wxCalendarCtrl::MSWOnDoubleClick(wxMouseEvent& event)
event.Skip();
}
void wxCalendarCtrl::MSWOnClick(wxMouseEvent& event)
{
// for some reason, the control doesn't get focus on its own when the user
// clicks in it
SetFocus();
event.Skip();
}
#endif // wxUSE_CALENDARCTRL