How to scroll the wxListBox one page ?
How to scroll the wxListBox one page ?
I'm using the MSW version of wxWidgets and the function GetScrollPageSize is not available. How to scroll manually by one page on MSW ?
I've a wxPanel with a wxTextCtrl and a wxListBox. The user can search the values in the wxListBox by typing in the wxTextCtrl.
I'm trying to make it intercat like the index search in CHM files.
I'm trying to make it intercat like the index search in CHM files.
Code: Select all
void ClientListPanel::OnClientTextCtrlKeyDown(wxKeyEvent& event)
{
int nSel = m_clientList->GetSelection();
wxString strSel;
if (nSel == wxNOT_FOUND)
{
return;
}
if (event.GetKeyCode() == WXK_UP)
{
if (nSel > 0) nSel--;
m_clientTextCtrl->SetEvtHandlerEnabled(false);
strSel = m_clientList->GetString(nSel);
m_clientList->SetSelection(nSel);
m_clientTextCtrl->SetValue(strSel);
m_clientTextCtrl->SetSelection(strSel.Len(), -1);
m_clientTextCtrl->SetEvtHandlerEnabled(true);
}
else if (event.GetKeyCode() == WXK_DOWN)
{
if (nSel < m_clientList->GetCount()) nSel++;
m_clientTextCtrl->SetEvtHandlerEnabled(false);
strSel = m_clientList->GetString(nSel);
m_clientList->SetSelection(nSel);
m_clientTextCtrl->SetValue(strSel);
m_clientTextCtrl->SetSelection(strSel.Len(), -1);
m_clientTextCtrl->SetEvtHandlerEnabled(true);
}
else if (event.GetKeyCode() == WXK_PAGEUP)
{
// don't know how to handle it
}
else if (event.GetKeyCode() == WXK_PAGEDOWN)
{
// don't know how to handle it
}
else if (event.GetKeyCode() == WXK_RETURN)
{
NotifyUserSelected(nSel);
}
}