Exemplo n.º 1
0
/*----------------------------------------------------------------------
 *       Class:  AmayaScrollBar
 *      Method:  OnScroll
 * Description:  
  -----------------------------------------------------------------------*/
void AmayaScrollBar::OnScroll( wxScrollEvent& event )
{
  /* this flag is necessary because 2 events occure when up/down button
     is pressed (it's an optimisation)
     this hack works because OnLineDown is called before OnScroll,
     but becareful the events orders could change in future wxWidgets
     releases or can be platform specific
  */
  if (m_IgnoreNextScrollEvent)
    {
      m_IgnoreNextScrollEvent = FALSE;
      event.Skip();
      return;
    }
  
  if (event.GetOrientation() == wxHORIZONTAL)
    {
      TTALOGDEBUG_3( TTA_LOG_DIALOG, _T("AmayaScrollBar::OnScroll [wxHORIZONTAL][frameid=%d][pos=%d][pagesize=%d]"), m_ParentFrameID, event.GetPosition(), GetPageSize() );
      FrameHScrolledCallback( m_ParentFrameID,
                              event.GetPosition(),
                              GetPageSize() );
    }
  else if (event.GetOrientation() == wxVERTICAL)
    {
      TTALOGDEBUG_3( TTA_LOG_DIALOG, _T("AmayaScrollBar::OnScroll [wxVERTICAL][frameid=%d][pos=%d][pagesize=%d]"), m_ParentFrameID, event.GetPosition(), GetPageSize() );
      FrameVScrolledCallback( m_ParentFrameID,
                              event.GetPosition() );
    }
}
Exemplo n.º 2
0
void bmImage::OnScrollChanged(wxScrollEvent& event) {
	bmImageFrame* p = ((bmImageFrame*)GetParent());
	if (event.GetOrientation() == wxHORIZONTAL) {
		p->setScroll(cv::Vec2f(event.GetPosition(), p->getScroll()[1]));
	}
	else if (event.GetOrientation() == wxVERTICAL) {
		p->setScroll(cv::Vec2f(p->getScroll()[1], event.GetPosition()));
	}
}
Exemplo n.º 3
0
// Handle event from scrollbars
void wxWindowQt::QtOnScrollBarEvent( wxScrollEvent& event )
{
    wxEventType windowEventType = 0;

    // Map the scroll bar event to the corresponding scroll window event:

    wxEventType scrollBarEventType = event.GetEventType();
    if ( scrollBarEventType == wxEVT_SCROLL_TOP )
        windowEventType = wxEVT_SCROLLWIN_TOP;
    else if ( scrollBarEventType == wxEVT_SCROLL_BOTTOM )
        windowEventType = wxEVT_SCROLLWIN_BOTTOM;
    else if ( scrollBarEventType == wxEVT_SCROLL_PAGEUP )
        windowEventType = wxEVT_SCROLLWIN_PAGEUP;
    else if ( scrollBarEventType == wxEVT_SCROLL_PAGEDOWN )
        windowEventType = wxEVT_SCROLLWIN_PAGEDOWN;
    else if ( scrollBarEventType == wxEVT_SCROLL_LINEUP )
        windowEventType = wxEVT_SCROLLWIN_LINEUP;
    else if ( scrollBarEventType == wxEVT_SCROLL_LINEDOWN )
        windowEventType = wxEVT_SCROLLWIN_LINEDOWN;
    else if ( scrollBarEventType == wxEVT_SCROLL_THUMBTRACK )
        windowEventType = wxEVT_SCROLLWIN_THUMBTRACK;
    else if ( scrollBarEventType == wxEVT_SCROLL_THUMBRELEASE )
        windowEventType = wxEVT_SCROLLWIN_THUMBRELEASE;

    if ( windowEventType != 0 )
    {
        wxScrollWinEvent e( windowEventType, event.GetPosition(), event.GetOrientation() );
        ProcessWindowEvent( e );
    }
}
Exemplo n.º 4
0
void MapWindow::OnScrollPageUp(wxScrollEvent& event) 
{
	if(event.GetOrientation() == wxHORIZONTAL)
		ScrollRelative(-5*96,0);
	else
		ScrollRelative(0,-5*96);
	Refresh();
}
Exemplo n.º 5
0
void MapWindow::OnScrollLineDown(wxScrollEvent& event) 
{
	if(event.GetOrientation() == wxHORIZONTAL)
		ScrollRelative(96,0);
	else
		ScrollRelative(0,96);
	Refresh();
}
Exemplo n.º 6
0
/*----------------------------------------------------------------------
 *       Class:  AmayaScrollBar
 *      Method:  OnTop
 * Description:  
  -----------------------------------------------------------------------*/
void AmayaScrollBar::OnTop( wxScrollEvent& event )
{
  TTALOGDEBUG_0( TTA_LOG_DIALOG, _T("AmayaScrollBar::OnTop") );

  if (event.GetOrientation() == wxVERTICAL)
    {
      JumpIntoView (m_ParentFrameID, 0);
    }
}
Exemplo n.º 7
0
/*----------------------------------------------------------------------
 *       Class:  AmayaScrollBar
 *      Method:  OnScrollDown
 * Description:  
  -----------------------------------------------------------------------*/
void AmayaScrollBar::OnScrollDown( wxScrollEvent& event )
{
  Document doc; 
  View     view;

  FrameToView (m_ParentFrameID, &doc, &view);
  if (event.GetOrientation() == wxVERTICAL)
    {
      TtcPageDown (doc, view);
      /* this flag is necessary because 2 events occure when up/down button
         is pressed (it's an optimisation)
         this hack works because OnLineDown is called before OnScroll,
         but becareful the events orders could change in future wxWidgets
         releases or can be platform specific
      */
      m_IgnoreNextScrollEvent = TRUE;
    }
  else if (event.GetOrientation() == wxVERTICAL)
    OnScroll (event);
}
Exemplo n.º 8
0
// Explicitly call default scroll behaviour
void wxMDIClientWindow::OnScroll(wxScrollEvent& event)
{
    // Note: for client windows, the scroll position is not set in
    // WM_HSCROLL, WM_VSCROLL, so we can't easily determine what
    // scroll position we're at.
    // This makes it hard to paint patterns or bitmaps in the background,
    // and have the client area scrollable as well.

    if ( event.GetOrientation() == wxHORIZONTAL )
        m_scrollX = event.GetPosition(); // Always returns zero!
    else
        m_scrollY = event.GetPosition(); // Always returns zero!

    event.Skip();
}