Scroll to listitem index

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
Knows some wx things
Knows some wx things
Posts: 31
Joined: Fri Nov 05, 2004 1:35 pm
Location: NC, USA

Scroll to listitem index

Post by radez » Mon Mar 07, 2005 6:16 pm

I may just have syntactical errors here...

I'm trying to use wxListCtrl::ScrollList() to scroll to a particular index. as it asks for the pixles and not the index I was going to try and dynamically pull the height of the list items in the box.

First: do I need to do this or will the list item object always be the same height regardless of resoution.

Second: if I do need to dynamically pull the wxListItem height what is going wrong with this code:

assume event is a wxListEvent passed from clicking on a listctrl item.
int theHeight = event.GetItem().GetSize().GetHeight();

A wxListItem is a wxObject which posesses the GetSize Funtion right?
I have used th GetSize on the ListCtrl itself in other places and it worked like a charm.


VC++ 7.1.3088 on XP Tablet
as of Dec 2004 - wx2.5.3
as of Nov 2004 - wx2.4.2
as of May 2005 - wx2.6.0
as of June 2005 - wx2.6.1

Post Reply