FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Badly need onItemClicked or onItemChanged for the ListView

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
Trass3r



Joined: 29 Feb 2008
Posts: 66
Location: Germany

PostPosted: Fri Feb 29, 2008 5:15 am    Post subject: Badly need onItemClicked or onItemChanged for the ListView Reply with quote

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. Sad
Quote:
// TODO:
// itemActivate, itemDrag
//EventHandler selectedIndexChanged;
//CancelEventHandler selectedIndexChanging; // ?


Any ideas to accomplish this nevertheless?
Back to top
View user's profile Send private message
Trass3r



Joined: 29 Feb 2008
Posts: 66
Location: Germany

PostPosted: Mon Mar 03, 2008 9:08 am    Post subject: Reply with quote

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
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Mon Mar 03, 2008 9:40 am    Post subject: Reply with quote

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
View user's profile Send private message
Trass3r



Joined: 29 Feb 2008
Posts: 66
Location: Germany

PostPosted: Mon Mar 03, 2008 4:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Mon Mar 03, 2008 4:18 pm    Post subject: Reply with quote

Great; I just put up this snapshot.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group