IonicWind Software

Aurora Compiler => General Discussion => Topic started by: Rock Ridge Farm (Larry) on January 12, 2006, 06:24:08 PM

Title: Listview row selected question.
Post by: Rock Ridge Farm (Larry) on January 12, 2006, 06:24:08 PM
In my almost completd first program I need to return the data from the row I mouse click on. I found how to do a column but have not found how to return the data in
a single cell.
Also is there a way to clear a list of data so that it can be reused for other data?
Title: Re: Listview row selected question.
Post by: Zen on January 13, 2006, 09:48:19 AM
Here you go. As promised...


if(code = 0xFFFFFFFE)
{
MessageBox(this,pList->GetItemText(*(NMLISTVIEW)pnmhdr.iItem,1),pList->GetItemText(*(NMLISTVIEW)pnmhdr.iItem,0));
}


This basicly listens for the NMCLICK message which has not yet been added to the GUI library so just use 0xFFFFFFFE for now or #define NMCLICK 0xFFFFFFFE.

The function then returns the item you clicked on, then gets the text of the item and the text of the sub item as you can see from the message box.

Hope this helps.
Lewis
Title: Re: Listview row selected question.
Post by: Zen on January 13, 2006, 09:49:56 AM
The code above was taken from where i added it in the listview.src program in the aurora examples folder. Simply put it in the OnNotify section if you cant figure out how to get it working.

Lewis
Title: Re: Listview row selected question.
Post by: Rock Ridge Farm (Larry) on January 13, 2006, 11:33:16 AM
That worked fine - thanks.
Title: Re: Listview row selected question.
Post by: Rock Ridge Farm (Larry) on January 13, 2006, 03:59:37 PM
Now for my next question - I have 3 listviews open - how can I tell which one the
mouse event was in?
Title: Re: Listview row selected question.
Post by: Zen on January 13, 2006, 04:02:15 PM
nID holds the controls ID.

Lewis