Associating data with wxListCtrl in virtual mode

Lloyd lloyd at cdactvm.in
Tue Dec 12 01:47:47 PST 2006


I am using a vector to store the data, which has to be returned when the
wxListCtrl::OnGetItemText() call is made. I would like to add a feature
to my application like, when the user clicks on the list's column
header, to sort the list data based on the header (So I will be sorting
my vector). 

When the mouse click event occurs on a specific raw, how can I retrieve
the data? 

When I checked wxListEvent class I saw three functions appropriate 

GetIndex() - It is irrelevant for me, though the position of data in
vector continuously changes

GetData()
GetItem() - I these two cases I have not set any data (I could not set
data,though it is virtual), so retrieval is invalid!

Thanks,
  Lloyd 



On Tue, 2006-12-12 at 10:22 +0100, Vadim Zeitlin wrote:
> On Tue, 12 Dec 2006 10:10:58 +0530 Lloyd <lloyd at cdactvm.in> wrote:
> 
> L>  I am using the wxListCtrl in wxLC_REPORT|wxLC_VIRTUAL mode to insert
> L> the data. Is there any way for me to assign some kind of hidden data
> L> with each raw?
> 
>  It doesn't make much sense to do this. If you use wxLC_VIRTUAL mode you
> already have the data shown in the control somewhere else, why don't you
> just add whatever "hidden" data you have to the same place?
> 
>  Regards,
> VZ
> 


______________________________________
Scanned and protected by Email scanner




More information about the wx-users mailing list