* button.cpp: Button control
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: button.cpp,v 1.9 2003/04/16 21:40:07 ipkiss Exp $
+ * $Id: button.cpp,v 1.10 2003/04/17 13:08:02 karibu Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
bool ControlButton::MouseUp( int x, int y, int button )
{
// If hit in the button
+
+
if( Img[1]->Hit( x - Left, y - Top ) )
{
if( !Enabled )
* text.cpp: Text control
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: text.cpp,v 1.3 2003/04/16 21:40:07 ipkiss Exp $
+ * $Id: text.cpp,v 1.4 2003/04/17 13:08:02 karibu Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
//-----------------------------------------------------------------------
#else
+
//-----------------------------------------------------------------------
// Gtk2 methods
//-----------------------------------------------------------------------
+ gboolean ScrollingTextTimer( gpointer data )
+ {
+ if( (ControlText *)data != NULL )
+ {
+ if( !( (ControlText *)data )->IsScrolling() )
+ return false;
+
+ /* FIXME
+ if( !( (ControlText *)data )->GetSelected() )
+ ( (ControlText *)data )->DoScroll();
+ */
+
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ //-----------------------------------------------------------------------
void ControlText::StartScrolling()
{
-/* FIXME: kluge */
- /* SetTimer( ( (Win32Window *)ParentWindow )->GetHandle(), (UINT_PTR)this,
- 100, (TIMERPROC)ScrollingTextTimer );*/
+ g_timeout_add( 100, (GSourceFunc)ScrollingTextTimer, (gpointer)this );
}
//-----------------------------------------------------------------------
void ControlText::StopScrolling()
{
-/* KillTimer( ( (Win32Window *)ParentWindow )->GetHandle(),
- (UINT_PTR)this );*/
}
//-----------------------------------------------------------------------
}
else if( Scroll && TextWidth <= Width )
{
- StopScrolling();
Scroll = false;
+ StopScrolling();
}
}
//---------------------------------------------------------------------------
* text.h: Text control
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: text.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ * $Id: text.h,v 1.2 2003/04/17 13:08:02 karibu Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
// Keep on scrolling
void DoScroll();
- // To avoid auto scrolling when manual scrolling
+ // Getters
bool GetSelected() { return Selected; };
+ bool IsScrolling() { return Scroll; };
};
//---------------------------------------------------------------------------
* gtk2_run.cpp:
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: gtk2_run.cpp,v 1.11 2003/04/16 21:40:07 ipkiss Exp $
+ * $Id: gtk2_run.cpp,v 1.12 2003/04/17 13:08:02 karibu Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
//---------------------------------------------------------------------------
// REFRESH TIMER CALLBACK
//---------------------------------------------------------------------------
-/*void CALLBACK RefreshTimer( HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime )
+gboolean RefreshTimer( gpointer data )
{
- intf_thread_t *p_intf = (intf_thread_t *)GetWindowLongPtr( hwnd,
- GWLP_USERDATA );
+ intf_thread_t *p_intf = (intf_thread_t *)data;
SkinManage( p_intf );
-}*/
+ return true;
+}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
-
//---------------------------------------------------------------------------
// GTK2 interface
//---------------------------------------------------------------------------
// Set event callback
gdk_event_handler_set( GTK2Proc, (gpointer)callbackobj, NULL );
+ // Add timer
+ g_timeout_add( 200, (GSourceFunc)RefreshTimer, (gpointer)p_intf );
+
// Main event loop
g_main_loop_run( callbackobj->Loop );