scrolling with kbd generates scroll events too

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10910 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-07-09 12:23:53 +00:00
parent 05dcbb8e9e
commit 39c869a6cd
3 changed files with 113 additions and 50 deletions

View File

@@ -809,6 +809,9 @@ void wxScrollHelper::HandleOnChar(wxKeyEvent& event)
szy = -1;
}
int xScrollOld = m_xScrollPosition,
yScrollOld = m_yScrollPosition;
int dsty;
switch ( event.KeyCode() )
{
@@ -851,6 +854,22 @@ void wxScrollHelper::HandleOnChar(wxKeyEvent& event)
// not for us
event.Skip();
}
if ( m_xScrollPosition != xScrollOld )
{
wxScrollWinEvent event(wxEVT_SCROLLWIN_THUMBTRACK, m_xScrollPosition,
wxHORIZONTAL);
event.SetEventObject(m_win);
m_win->GetEventHandler()->ProcessEvent(event);
}
if ( m_yScrollPosition != yScrollOld )
{
wxScrollWinEvent event(wxEVT_SCROLLWIN_THUMBTRACK, m_yScrollPosition,
wxVERTICAL);
event.SetEventObject(m_win);
m_win->GetEventHandler()->ProcessEvent(event);
}
}
// ----------------------------------------------------------------------------

View File

@@ -732,6 +732,9 @@ void wxScrolledWindow::OnChar(wxKeyEvent& event)
szy = -1;
}
int xScrollOld = GetScrollPos(wxHORIZONTAL),
yScrollOld = GetScrollPos(wxVERTICAL);
int dsty;
switch ( event.KeyCode() )
{
@@ -773,6 +776,25 @@ void wxScrolledWindow::OnChar(wxKeyEvent& event)
default:
// not for us
event.Skip();
return;
}
int xScroll = GetScrollPos(wxHORIZONTAL);
if ( xScroll != xScrollOld )
{
wxScrollWinEvent event(wxEVT_SCROLLWIN_THUMBTRACK, xScroll,
wxHORIZONTAL);
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
}
int yScroll = GetScrollPos(wxVERTICAL);
if ( yScroll != yScrollOld )
{
wxScrollWinEvent event(wxEVT_SCROLLWIN_THUMBTRACK, yScroll,
wxVERTICAL);
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
}
}

View File

@@ -732,6 +732,9 @@ void wxScrolledWindow::OnChar(wxKeyEvent& event)
szy = -1;
}
int xScrollOld = GetScrollPos(wxHORIZONTAL),
yScrollOld = GetScrollPos(wxVERTICAL);
int dsty;
switch ( event.KeyCode() )
{
@@ -773,6 +776,25 @@ void wxScrolledWindow::OnChar(wxKeyEvent& event)
default:
// not for us
event.Skip();
return;
}
int xScroll = GetScrollPos(wxHORIZONTAL);
if ( xScroll != xScrollOld )
{
wxScrollWinEvent event(wxEVT_SCROLLWIN_THUMBTRACK, xScroll,
wxHORIZONTAL);
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
}
int yScroll = GetScrollPos(wxVERTICAL);
if ( yScroll != yScrollOld )
{
wxScrollWinEvent event(wxEVT_SCROLLWIN_THUMBTRACK, yScroll,
wxVERTICAL);
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
}
}