Numbered CheckBox

Cool. I started this, but I'm having a bit of trouble with one small thing.
I'm using the EVT_CHECKLISTBOX event, but I can't figure out how to
determine which index of the item the event is saying got checked/unchecked.

I can get the event.EventObject(), which returns to me the checkboxlist
instance, but how do I determine what got clicked? It's not the same as the
selection, because in the checkboxlist you can check/uncheck boxes
independent of which item is actually selected.

Do I have to do some hittest() call to find out which item index is the one
the event was raised from?

Thanks for all your help.

Tim

···

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Friday, October 03, 2003 10:54 AM
To: wxPython-users@lists.wxwindows.org
Subject: Re: [wxPython-users] Numbered CheckBox

Tim Royal wrote:

My inclination is to create a class derived from the standard
checkboxlist, and then override the click methods to keep a hidden
ordered list of items clicked, reordering them as items were
unclicked. Probably I'd modify the text string of the listed items
with some sort of visual indicator of order ("Item1 (1), Item2, Item3
(2)"), etc.

That sounds like a good approach.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

_________________________________________________
Scanned on 03 Oct 2003 18:55:47
Scanning by http://erado.com

Tim Royal wrote:

Cool. I started this, but I'm having a bit of trouble with one small thing.
I'm using the EVT_CHECKLISTBOX event, but I can't figure out how to
determine which index of the item the event is saying got checked/unchecked.

I can get the event.EventObject(), which returns to me the checkboxlist
instance, but how do I determine what got clicked? It's not the same as the
selection, because in the checkboxlist you can check/uncheck boxes
independent of which item is actually selected.

Do I have to do some hittest() call to find out which item index is the one
the event was raised from?

Yes. Catch the EVT_LEFT_DOWN event and save the mouse position and then call event.Skip(), then when you get your checklistbox event use that position with HitTest to find out which item was clicked.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!