Commit e9c0cc59 authored by Emmanuel Puig's avatar Emmanuel Puig

* Fixed support of wheel for playlist with GTK2

* Added support of whell for slider with GTK2
parent c52797f6
......@@ -2,7 +2,7 @@
* playlist.cpp: Playlist control
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: playlist.cpp,v 1.4 2003/04/20 13:14:14 asmax Exp $
* $Id: playlist.cpp,v 1.5 2003/04/20 15:00:19 karibu Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
......@@ -456,6 +456,9 @@ bool ControlPlayList::MouseScroll( int x, int y, int direction )
if( !Enabled )
return false;
if( !TextClipRgn->Hit( x - Left, y - Top ) && !Slider->MouseOver( x, y ) )
return false;
//long pos = Slider->GetCursorPosition();
long pos = StartIndex;
fprintf(stderr," scroll %d %d\n", pos, StartIndex);
......
......@@ -2,7 +2,7 @@
* slider.cpp: Slider control
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: slider.cpp,v 1.5 2003/04/17 10:53:00 karibu Exp $
* $Id: slider.cpp,v 1.6 2003/04/20 15:00:19 karibu Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
......@@ -315,6 +315,28 @@ bool ControlSlider::MouseOver( int x, int y )
return false;
}
//---------------------------------------------------------------------------
bool ControlSlider::MouseScroll( int x, int y, int direction )
{
if( !Enabled || !MouseOver( x, y ) )
return false;
int val = Value;
switch( direction )
{
case MOUSE_SCROLL_DOWN:
if( val > 0 ) val--;
break;
case MOUSE_SCROLL_UP:
if( val < MaxValue ) val++;
break;
}
MoveCursor( val );
return true;
}
//---------------------------------------------------------------------------
bool ControlSlider::ToolTipTest( int x, int y )
{
if( MouseOver( x, y ) )
......
......@@ -2,7 +2,7 @@
* slider.h: Slider control
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: slider.h,v 1.2 2003/04/20 13:14:14 asmax Exp $
* $Id: slider.h,v 1.3 2003/04/20 15:00:19 karibu Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
......@@ -95,6 +95,7 @@ class ControlSlider : public GenericControl
virtual bool MouseMove( int x, int y, int button );
virtual bool MouseOver( int x, int y );
virtual bool ToolTipTest( int x, int y );
virtual bool MouseScroll( int x, int y, int direction );
// Slider calls
void SetCursorPosition( long Pos );
......
......@@ -2,7 +2,7 @@
* gtk2_window.cpp: GTK2 implementation of the Window class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_window.cpp,v 1.23 2003/04/20 13:14:14 asmax Exp $
* $Id: gtk2_window.cpp,v 1.24 2003/04/20 15:00:19 karibu Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
......@@ -240,7 +240,7 @@ bool GTK2Window::ProcessOSEvent( Event *evt )
case GDK_DROP_START:
DropObject->HandleDropStart( ( (GdkEventDND *)p2 )->context );
return true;
case GDK_SCROLL:
switch( ( (GdkEventScroll *)p2 )->direction )
{
......@@ -256,7 +256,7 @@ bool GTK2Window::ProcessOSEvent( Event *evt )
break;
}
return true;
default:
return false;
}
......
......@@ -2,7 +2,7 @@
* window.cpp: Window class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: window.cpp,v 1.17 2003/04/20 13:14:14 asmax Exp $
* $Id: window.cpp,v 1.18 2003/04/20 15:00:19 karibu Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
......@@ -405,7 +405,7 @@ void Window::MouseDblClick( int x, int y, int button )
}
//---------------------------------------------------------------------------
void Window::MouseScroll( int x, int y, int direction )
{
{
// Checking event in controls
for( int i = ControlList.size() - 1; i >= 0 ; i-- )
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment