Patch for wxCheckListBoxItem

Luca Cappa luca.cappa at sequoia.it
Fri Jul 13 06:35:01 PDT 2007


Hello,

here attached there is a very small patch to the wxCheckListBoxItem class.  =

The reason of this patch is that when I received the  =

wxEVT_COMMAND_CHECKLISTBOX_TOGGLED event I tryed to:

1) retrieve the string of the toggled entry with  =

wxCommandEvent::GetString(), and it did not worked: in fact an empty  =

string is always returned. The attached patch makes this possible fixing  =

this problem.

2) check whether the state of the checkbox is "on" or "off" with  =

wxCommandEvent::IsChecked (), but since the wxCommandEvent::m_commandInt  =

variable member contains the index of the toggled entry and since the  =

wxCommandEvent::isChecked() is simply a "return m_commandInt !=3D 0;", then=
  =

clearly m_commandInt cannot hold at the same time the index (of the  =

toggled entry) and the "on/off" state. The IsChecked() is pretty useless  =

in the case of a wxEVT_COMMAND_CHECKLISTBOX_TOGGLED command event, as it  =

just returns true when the toggled entry is not the first one, false when  =

it is. I think it would be possible (and easy) to give a meaning to  =

wxCommandEvent::IsChecked() also with the  =

wxEVT_COMMAND_CHECKLISTBOX_TOGGLED event, maybe I will make a patch in the  =

future for this problem if anyone think it is useful.

Best regards,
Luca
-------------- next part --------------
A non-text attachment was scrubbed...
Name: checklst.cpp.patch
Type: application/octet-stream
Size: 427 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wx-users/attachments/20070713/0d=
158d43/checklst.cpp.obj


More information about the wx-users mailing list