Column pos and editing ListCtrl items

Gary,

The ListCtrl only has built in editing for the 0th column in a multi-column
ListCtrl. You can determine the column of a mouse click by catching the raw
x coordinate and relating that to the positions of the various columns.
You'll need to launch a separate dialog to edit the content. Even for
editing the 0th column I found EditLabel to be flaky under Windows and so I
launch a separate dialog.

Steve

···

-----Original Message-----
From: gary.h.merrill@gsk.com [mailto:gary.h.merrill@gsk.com]
Sent: Monday, May 12, 2003 11:31 AM
To: wxPython-users@lists.wxwindows.org
Subject: [wxPython-users] Column pos and editing ListCtrl items

Well, I've spent a couple of hours piecing through the doc and
experimenting with the demo programs, and I'm stumped.

I have a ListCtrl (Report mode) with three columns, and I'd like the user
to be able to edit any of the "cells" in this. In the callback for
EVT_LIST_ITEM_SELECTED I can call the EditLabel() method on the ListCtrl,
passing it event.m_itemIndex. This allows editing of the first (0-th)
column for the selected item. But how do I edit the other columns?

EditLabel() seems to take only an item index parameter instead of a
wxListItem. And I can't even seem to get the column that is clicked in.
No matter what I do in attempting to extract column information from the
event, m_col seems to be 0.

And if I could get it, how could I use it to make that "cell" editable?
Are labels editable only in column 0?

--------------------------------------
Gary H. Merrill
Director and Principal Scientist, New Applications
Data Exploration Sciences
GlaxoSmithKline Inc.
(919) 483-8456

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