wxTreeListCtrl: page up and page down

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
Post Reply
damir
Earned a small fee
Earned a small fee
Posts: 19
Joined: Thu Jan 12, 2006 11:59 am

wxTreeListCtrl: page up and page down

Post by damir »

Hi!
Page up and page down keys don't behave like man expect. Maybe you could put something like following in wxTreeListMainWindow::OnChar function:

Code: Select all

        // I don't know why is WXK_PAGEDOWN 359
        case 313: {
        	// show on top selected item
        	wxTreeItemId item = m_curItem;
        	ShowOnTop(m_curItem);
        	// find last visible item
        	while (item.IsOk() && IsVisible(item, false))
        	{
        		item = GetNext(item, false);
        	}
        	newItem = GetPrev(item);
        }break;
		
		// PAGE UP
        case 312: {
        	// show in bottom selected item
        	wxTreeItemId item = m_curItem;
        	ShowOnBottom(m_curItem);
        	// find last visible item
        	while (item.IsOk() && IsVisible(item, false))
        	{
        		item = GetPrev(item, false);
        	}
        	newItem = GetNext(item);
        }break;
Functions: ShowOnTop and ShowOnBottom are copy of ScrollTo but I commented the parts which decide where will be the item.
My solution has also bug because it don't know how to handle first and last item and it has some refreshing issues when the button is holded. I'm too tired to fix it now.

all the best,
Damir[/code]
gururamnath
Super wx Problem Solver
Super wx Problem Solver
Posts: 466
Joined: Sat Sep 18, 2004 2:49 am
Location: California, USA

Re: wxTreeListCtrl: page up and page down

Post by gururamnath »

Hi,
I have included the native header support for the wxTreeListCtrl. I'll add your patch along with it and we'll try to make it available in the main source base.

You can look at my update at :

http://wxdsgn.sf.net/guru_s_stuff/treelist.zip


-Guru Kathiresan
Post Reply