From: Marco T. <wx...@so...> - 2002-05-04 21:30:55
|
$listctrl->GetItem($item, 1)->GetText; hope it helps. greeting Marco >I have a Wx::ListCtrl displaying rows of information in report view. I >populate this control with InsertStringItem() and SetItem() to set the >column information. How do I get the data out?! > >for example, I intercept a EVT_LIST_BEGIN_DRAG and get an event >parameter. from this, I can do my $listitem = $event->GetItem() which >returns a wxListItem. the wxWindows documentation seems to stop at this >point without a reference page for wxListItem. I've tried >$listitem->GetText() which returns nothing, and $listitem->GetText(0) >which dies. > >environment: >wxPerl 0.10 >wxWindows 2.2.9 >Win2K Prof > >regards, >/dave |
From: Mattia B. <mb...@ds...> - 2002-05-05 19:14:14
|
> point without a reference page for wxListItem. I've tried wxListCtrl::SetItem ( not the most obvious place... ) Regards Mattia |
From: Dave R. <dav...@ma...> - 2002-05-05 21:53:39
|
yes, I saw this. it makes perfect sense in a C++ world, but not completely for wxPerl. for example, how do you select an item in a Wx::ListCtrl? I'd assume you would mess with ITEM_STATE somehow. the wxWindows examples speak of setting an id prior to calling SetInfo() (the id specifies which list entry) - how do you do this? in fact, if anyone has 10 or so lines of Perl code which shows from start to finish how to select an item, I'd really appreciate it. thanks, /dave On Sunday, May 5, 2002, at 12:13 , Mattia Barbon wrote: >> point without a reference page for wxListItem. I've tried > wxListCtrl::SetItem ( not the most obvious place... ) > > Regards > Mattia > > _______________________________________________________________ > > Have big pipes? SourceForge.net is looking for download mirrors. We > supply > the hardware. You get the recognition. Email Us: > ban...@so... > _______________________________________________ > wxperl-users mailing list > wxp...@li... > https://lists.sourceforge.net/lists/listinfo/wxperl-users > > -------------------------------- 8< -------------------------------- pls note - new contact details: email: dav...@ma... phone: (650) 906 3497 dav...@em... is still a valid email address |
From: Mattia B. <mb...@ds...> - 2002-05-06 17:39:17
|
> yes, I saw this. it makes perfect sense in a C++ world, but not > completely for wxPerl. I agree... I'll add a note. > for example, how do you select an item in a Wx::ListCtrl? I'd assume you You don't need wxListItem :-) my $index = $event->GetIndex(); # or whatever # select # value mask $list->SetItemState( $index, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED ); # deselect $list->SetItemState( $index, 0, wxLIST_STATE_SELECTED ); # set the focus, clear selection $list->SetItemState( $index, wxLIST_STATE_FOCUSED, wxLIST_STATE_SELECTED|wxLIST_STATE_FOCUSED ); > would mess with ITEM_STATE somehow. the wxWindows examples speak of > setting an id prior to calling SetInfo() (the id specifies which list > entry) - how do you do this? in fact, if anyone has 10 or so lines of > Perl code which shows from start to finish how to select an item, I'd > really appreciate it. HTH Mattia P.S.: there is a ( perhaps clearer ) explanation about SetItemState somewhere in the archives |
From: Dave R. <dav...@ma...> - 2002-05-05 01:35:48
|
$event->GetItem() returns a Wx::ListItem, not the numeric index of the item, so $listctrl->GetItem($listitem,1) always fails. $listctrl->GetItem(1,1) will give me the second column of the second item. do I have to manually get the selected items from the ListCtrl rather than from the event? thanks, /dave On Saturday, May 4, 2002, at 03:32 , Marco Trudel wrote: > $listctrl->GetItem($item, 1)->GetText; > > hope it helps. > > greeting > Marco > >> I have a Wx::ListCtrl displaying rows of information in report view. I >> populate this control with InsertStringItem() and SetItem() to set the >> column information. How do I get the data out?! >> >> for example, I intercept a EVT_LIST_BEGIN_DRAG and get an event >> parameter. from this, I can do my $listitem = $event->GetItem() which >> returns a wxListItem. the wxWindows documentation seems to stop at this >> point without a reference page for wxListItem. I've tried >> $listitem->GetText() which returns nothing, and $listitem->GetText(0) >> which dies. >> >> environment: >> wxPerl 0.10 >> wxWindows 2.2.9 >> Win2K Prof >> >> regards, >> /dave > > -------------------------------- 8< -------------------------------- pls note - new contact details: email: dav...@ma... phone: (650) 906 3497 dav...@em... is still a valid email address |
From: Mattia B. <mb...@ds...> - 2002-05-05 19:14:14
|
> $event->GetItem() returns a Wx::ListItem, not the numeric index of the > item, so $listctrl->GetItem($listitem,1) always fails. $listctrl->GetItem( $event->GetIndex(), 1 ); will work > $listctrl->GetItem(1,1) will give me the second column of the second > item. > > do I have to manually get the selected items from the ListCtrl rather > than from the event? HTH Mattia |
From: Dave R. <dav...@ma...> - 2002-05-05 21:50:42
|
ok, sounds good. how would you handle it if multiple items are selected? /dave On Sunday, May 5, 2002, at 12:13 , Mattia Barbon wrote: >> $event->GetItem() returns a Wx::ListItem, not the numeric index of the >> item, so $listctrl->GetItem($listitem,1) always fails. > $listctrl->GetItem( $event->GetIndex(), 1 ); will work > >> $listctrl->GetItem(1,1) will give me the second column of the second >> item. >> >> do I have to manually get the selected items from the ListCtrl rather >> than from the event? > > HTH > Mattia > > _______________________________________________________________ > > Have big pipes? SourceForge.net is looking for download mirrors. We > supply > the hardware. You get the recognition. Email Us: > ban...@so... > _______________________________________________ > wxperl-users mailing list > wxp...@li... > https://lists.sourceforge.net/lists/listinfo/wxperl-users > > -------------------------------- 8< -------------------------------- pls note - new contact details: email: dav...@ma... phone: (650) 906 3497 dav...@em... is still a valid email address |
From: Mattia B. <mb...@ds...> - 2002-05-06 17:39:17
|
> ok, sounds good. > > how would you handle it if multiple items are selected? You'll get one event for each selected item, so what proposed will still work. Regards Mattia |
From: Dave R. <dav...@ma...> - 2002-05-21 22:12:40
|
what about if you are not responding to an event, so you do not have $event->GetIndex() to use? how would you (a) get the index of the currently selected item? and (b) the same for a multi-selection listctrl? rgds, /dave On Monday, May 6, 2002, at 10:38 , Mattia Barbon wrote: >> ok, sounds good. >> >> how would you handle it if multiple items are selected? > You'll get one event for each selected item, so what proposed will > still work. > > Regards > Mattia > > _______________________________________________________________ > > Have big pipes? SourceForge.net is looking for download mirrors. We > supply > the hardware. You get the recognition. Email Us: > ban...@so... > _______________________________________________ > wxperl-users mailing list > wxp...@li... > https://lists.sourceforge.net/lists/listinfo/wxperl-users > > -------------------------------- 8< -------------------------------- pls note - new contact details: email: dav...@ma... phone: (650) 906 3497 dav...@em... is still a valid email address |
From: Mattia B. <mb...@ds...> - 2002-05-23 19:33:44
|
> what about if you are not responding to an event, so you do not have > $event->GetIndex() to use? > how would you > (a) get the index of the currently selected item? my $item = $this->{LISTCTRL}->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); > and > (b) the same for a multi-selection listctrl? repeat the above replacing the "-1" with the $item you just obtained. HTH Mattia |