- // clicking on the item selects it, clicking on the checkmark toggles
- if ( event.GetX() <= wxOwnerDrawn::GetDefaultMarginWidth() ) {
- int nItem = HitTest(event.GetX(), event.GetY());
-
- if ( nItem != wxNOT_FOUND ) {
- wxCheckListBoxItem *item = GetItem(nItem);
- item->Toggle();
- item->SendEvent();
+ // clicking on the item selects it, clicking on the checkmark toggles
+ if ( event.GetX() <= wxOwnerDrawn::GetDefaultMarginWidth() )
+ {
+ int nItem = HitTest(event.GetX(), event.GetY());
+
+ if ( nItem != wxNOT_FOUND )
+ {
+ wxCheckListBoxItem *item = GetItem(nItem);
+ item->Toggle();
+ item->SendEvent();
+ }
+ //else: it's not an error, just click outside of client zone
+ }
+ else
+ {
+ // implement default behaviour: clicking on the item selects it
+ event.Skip();