Commit beacf908 authored by Emmanuel Puig's avatar Emmanuel Puig

* SkinManage is called by a timer

* Timer for text control are working badly but it's the first step
parent 5e99f4d4
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* button.cpp: Button control * button.cpp: Button control
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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 Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -135,6 +135,8 @@ void ControlButton::Draw( int x, int y, int w, int h, Graphics *dest ) ...@@ -135,6 +135,8 @@ void ControlButton::Draw( int x, int y, int w, int h, Graphics *dest )
bool ControlButton::MouseUp( int x, int y, int button ) bool ControlButton::MouseUp( int x, int y, int button )
{ {
// If hit in the button // If hit in the button
if( Img[1]->Hit( x - Left, y - Top ) ) if( Img[1]->Hit( x - Left, y - Top ) )
{ {
if( !Enabled ) if( !Enabled )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* text.cpp: Text control * text.cpp: Text control
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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 Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -77,20 +77,37 @@ ...@@ -77,20 +77,37 @@
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
#else #else
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// Gtk2 methods // 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() void ControlText::StartScrolling()
{ {
/* FIXME: kluge */ g_timeout_add( 100, (GSourceFunc)ScrollingTextTimer, (gpointer)this );
/* SetTimer( ( (Win32Window *)ParentWindow )->GetHandle(), (UINT_PTR)this,
100, (TIMERPROC)ScrollingTextTimer );*/
} }
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
void ControlText::StopScrolling() void ControlText::StopScrolling()
{ {
/* KillTimer( ( (Win32Window *)ParentWindow )->GetHandle(),
(UINT_PTR)this );*/
} }
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
...@@ -173,8 +190,8 @@ void ControlText::SetScrolling() ...@@ -173,8 +190,8 @@ void ControlText::SetScrolling()
} }
else if( Scroll && TextWidth <= Width ) else if( Scroll && TextWidth <= Width )
{ {
StopScrolling();
Scroll = false; Scroll = false;
StopScrolling();
} }
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* text.h: Text control * text.h: Text control
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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 Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -106,8 +106,9 @@ class ControlText : public GenericControl ...@@ -106,8 +106,9 @@ class ControlText : public GenericControl
// Keep on scrolling // Keep on scrolling
void DoScroll(); void DoScroll();
// To avoid auto scrolling when manual scrolling // Getters
bool GetSelected() { return Selected; }; bool GetSelected() { return Selected; };
bool IsScrolling() { return Scroll; };
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_run.cpp: * gtk2_run.cpp:
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -63,12 +63,12 @@ int SkinManage( intf_thread_t *p_intf ); ...@@ -63,12 +63,12 @@ int SkinManage( intf_thread_t *p_intf );
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// REFRESH TIMER CALLBACK // 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, intf_thread_t *p_intf = (intf_thread_t *)data;
GWLP_USERDATA );
SkinManage( p_intf ); SkinManage( p_intf );
}*/ return true;
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -191,7 +191,6 @@ void GTK2Proc( GdkEvent *event, gpointer data ) ...@@ -191,7 +191,6 @@ void GTK2Proc( GdkEvent *event, gpointer data )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// GTK2 interface // GTK2 interface
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -205,6 +204,9 @@ void OSRun( intf_thread_t *p_intf ) ...@@ -205,6 +204,9 @@ void OSRun( intf_thread_t *p_intf )
// Set event callback // Set event callback
gdk_event_handler_set( GTK2Proc, (gpointer)callbackobj, NULL ); gdk_event_handler_set( GTK2Proc, (gpointer)callbackobj, NULL );
// Add timer
g_timeout_add( 200, (GSourceFunc)RefreshTimer, (gpointer)p_intf );
// Main event loop // Main event loop
g_main_loop_run( callbackobj->Loop ); g_main_loop_run( callbackobj->Loop );
......
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