View previous topic :: View next topic |
Author |
Message |
Trass3r
Joined: 29 Feb 2008 Posts: 66 Location: Germany
|
Posted: Fri Feb 29, 2008 5:15 am Post subject: Badly need onItemClicked or onItemChanged for the ListView |
|
|
I want to output the content of the currently selected item in a textbox, thus I need an event like onItemChanged or onItemClicked or something like that.
Doesn't seem to be done yet.
Quote: | // TODO:
// itemActivate, itemDrag
//EventHandler selectedIndexChanged;
//CancelEventHandler selectedIndexChanging; // ?
|
Any ideas to accomplish this nevertheless? |
|
Back to top |
|
|
Trass3r
Joined: 29 Feb 2008 Posts: 66 Location: Germany
|
Posted: Mon Mar 03, 2008 9:08 am Post subject: |
|
|
Tried a workaround with the mouseclick event, but it doesn't work.
Code: | void listView_mouseUp(Control control, MouseEventArgs ea)
{
debug msgBox("listView_mouseUp");
textBox.text=listView.selectedItems[0].subItems[1].text;
} |
|
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Mon Mar 03, 2008 9:40 am Post subject: |
|
|
I added some code for it but didn't test it or put up a snapshot yet, but you can try it out: http://dsource.org/projects/dfl/browser/trunk/win32/dfl - perhaps simply just copy over the listview.d and recompile dfl (if using dfl command, include -dfl-build) |
|
Back to top |
|
|
Trass3r
Joined: 29 Feb 2008 Posts: 66 Location: Germany
|
Posted: Mon Mar 03, 2008 4:00 pm Post subject: |
|
|
Thank you very much, works great!
Code: | void listView_selectedIndexChanged(Control control, EventArgs ea)
{
// if(listView.selectedItems.length)
// textBox.text=listView.selectedItems[0].subItems[0].text;
textBox.text = listView.focusedItem.subItems[0].text;
} |
|
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Mon Mar 03, 2008 4:18 pm Post subject: |
|
|
Great; I just put up this snapshot. |
|
Back to top |
|
|
|