Commit 12ce13df authored by VideoLAN's avatar VideoLAN

* Adding onmouseover and onmouseout events to button control
* Fixing window position at launch time
* Adding notification when mouse leaves a window
parent 86b811f6
...@@ -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.1 2003/03/18 02:21:47 ipkiss Exp $ * $Id: button.cpp,v 1.2 2003/03/19 02:09:56 videolan 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>
...@@ -42,20 +42,32 @@ ...@@ -42,20 +42,32 @@
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Control Button // Control Button
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
ControlButton::ControlButton( string id, bool visible, int x, int y, string Up, ControlButton::ControlButton(
string Down, string Disabled, string click, string tooltiptext, string help, string id,
bool visible,
int x, int y,
string Up, string Down, string Disabled,
string onclick, string onmouseover, string onmouseout,
string tooltiptext, string help,
Window *Parent ) : GenericControl( id, visible, help, Parent ) Window *Parent ) : GenericControl( id, visible, help, Parent )
{ {
// General
Left = x; Left = x;
Top = y; Top = y;
State = 1; // 1 = up - 0 = down State = 1; // 1 = up - 0 = down
Selected = false; Selected = false;
Enabled = true; Enabled = true;
ClickActionName = click; CursorIn = false;
this->Up = Up; this->Up = Up;
this->Down = Down; this->Down = Down;
this->Disabled = Disabled; this->Disabled = Disabled;
// Actions
ClickActionName = onclick;
MouseOverActionName = onmouseover;
MouseOutActionName = onmouseout;
// Texts
ToolTipText = tooltiptext; ToolTipText = tooltiptext;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -79,6 +91,8 @@ void ControlButton::Init() ...@@ -79,6 +91,8 @@ void ControlButton::Init()
// Create script // Create script
ClickAction = new Action( p_intf, ClickActionName ); ClickAction = new Action( p_intf, ClickActionName );
MouseOverAction = new Action( p_intf, MouseOverActionName );
MouseOutAction = new Action( p_intf, MouseOutActionName );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
bool ControlButton::ProcessEvent( Event *evt ) bool ControlButton::ProcessEvent( Event *evt )
...@@ -157,26 +171,41 @@ bool ControlButton::MouseDown( int x, int y, int button ) ...@@ -157,26 +171,41 @@ bool ControlButton::MouseDown( int x, int y, int button )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
bool ControlButton::MouseMove( int x, int y, int button ) bool ControlButton::MouseMove( int x, int y, int button )
{ {
if( !Enabled || !Selected || !button ) if( !Enabled )
return false; return false;
if( MouseOver( x, y ) )
if( MouseOver( x, y ) && !CursorIn )
{ {
if( State == 1 ) if( button == 1 && Selected )
{ {
State = 0; State = 0;
ParentWindow->Refresh( Left, Top, Width, Height ); ParentWindow->Refresh( Left, Top, Width, Height );
} }
if( MouseOverActionName != "none" )
MouseOverAction->SendEvent();
CursorIn = true;
return true;
} }
else else if( !MouseOver( x, y ) & CursorIn )
{ {
if( State == 0 )
if( button == 1 && Selected )
{ {
State = 1; State = 1;
ParentWindow->Refresh( Left, Top, Width, Height ); ParentWindow->Refresh( Left, Top, Width, Height );
} }
}
if( MouseOutActionName != "none" )
MouseOutAction->SendEvent();
CursorIn = false;
return true; return true;
}
return false;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
bool ControlButton::MouseOver( int x, int y ) bool ControlButton::MouseOver( int x, int y )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* button.h: Button control * button.h: Button control
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: button.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $ * $Id: button.h,v 1.2 2003/03/19 02:09:56 videolan Exp $
* *
* Authors: Olivier Teulière <ipkiss@via.ecp.fr> * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -48,19 +48,28 @@ class ControlButton : public GenericControl ...@@ -48,19 +48,28 @@ class ControlButton : public GenericControl
// Control behaviour // Control behaviour
bool Selected; bool Selected;
bool Enabled; bool Enabled;
bool CursorIn;
// List of actions to execute when clicking // List of actions to execute
Action *ClickAction; Action *ClickAction;
string ClickActionName; string ClickActionName;
Action *MouseOverAction;
string MouseOverActionName;
Action *MouseOutAction;
string MouseOutActionName;
// ToolTip text // ToolTip text
string ToolTipText; string ToolTipText;
public: public:
// Constructor // Constructor
ControlButton( string id, bool visible, int x, int y, string Up, ControlButton( string id,
string Down, string Disabled, string click, bool visible,
string tooltiptext, string help, Window *Parent ); int x, int y,
string Up, string Down, string Disabled,
string onclick, string onmousevoer, string onmouseout,
string tooltiptext, string help,
Window *Parent );
// Destructor // Destructor
virtual ~ControlButton(); virtual ~ControlButton();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* skin.act: FleXML actions file * skin.act: FleXML actions file
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: skin.act,v 1.1 2003/03/18 02:21:47 ipkiss Exp $ * $Id: skin.act,v 1.2 2003/03/19 02:09:56 videolan 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>
...@@ -93,8 +93,12 @@ ...@@ -93,8 +93,12 @@
</start> </start>
<start tag="ButtonControl"> <start tag="ButtonControl">
<![CDATA[ <![CDATA[
AddButton( {id}, {visible}, {x}, {y}, {up}, {down}, {disabled}, AddButton( {id},
{onclick}, {tooltiptext}, {help} ); {visible},
{x}, {y},
{up}, {down}, {disabled},
{onclick}, {onmouseover}, {onmouseout},
{tooltiptext}, {help} );
]]> ]]>
</start> </start>
<start tag="CheckBoxControl"> <start tag="CheckBoxControl">
......
/* XML application for skin.dtd (Id: skin.dtd,v 1.8 2003/03/17 22:14:47 karibu Exp). /* XML application for skin.dtd (Id: skin.dtd,v 1.8 2003/03/17 22:14:47 karibu Exp).
* Includes actions from skin.act. * Includes actions from skin.act.
* Generated 2003/03/18 03:18:31. * Generated 2003/03/19 02:59:06.
* *
* This program was generated with the FleXML XML processor generator, * This program was generated with the FleXML XML processor generator,
* (Id: flexml.pl,v 1.24 1999/12/13 16:18:30 krisrose Exp). * (Id: flexml.pl,v 1.24 1999/12/13 16:18:30 krisrose Exp).
...@@ -149,15 +149,19 @@ void STag_ButtonControl(void) ...@@ -149,15 +149,19 @@ void STag_ButtonControl(void)
#line 94 "skin.act" #line 94 "skin.act"
AddButton( A_ButtonControl_id, A_ButtonControl_visible, A_ButtonControl_x, A_ButtonControl_y, A_ButtonControl_up, A_ButtonControl_down, A_ButtonControl_disabled, AddButton( A_ButtonControl_id,
A_ButtonControl_onclick, A_ButtonControl_tooltiptext, A_ButtonControl_help ); A_ButtonControl_visible,
A_ButtonControl_x, A_ButtonControl_y,
A_ButtonControl_up, A_ButtonControl_down, A_ButtonControl_disabled,
A_ButtonControl_onclick, A_ButtonControl_onmouseover, A_ButtonControl_onmouseout,
A_ButtonControl_tooltiptext, A_ButtonControl_help );
} /* STag_ButtonControl */ } /* STag_ButtonControl */
void STag_CheckBoxControl(void) void STag_CheckBoxControl(void)
{ {
#line 100 "skin.act" #line 104 "skin.act"
AddCheckBox( A_CheckBoxControl_id, A_CheckBoxControl_visible, A_CheckBoxControl_x, A_CheckBoxControl_y, A_CheckBoxControl_img1, A_CheckBoxControl_img2, A_CheckBoxControl_clickimg1, AddCheckBox( A_CheckBoxControl_id, A_CheckBoxControl_visible, A_CheckBoxControl_x, A_CheckBoxControl_y, A_CheckBoxControl_img1, A_CheckBoxControl_img2, A_CheckBoxControl_clickimg1,
...@@ -169,7 +173,7 @@ void STag_CheckBoxControl(void) ...@@ -169,7 +173,7 @@ void STag_CheckBoxControl(void)
void STag_SliderControl(void) void STag_SliderControl(void)
{ {
#line 107 "skin.act" #line 111 "skin.act"
AddSlider( A_SliderControl_id, A_SliderControl_visible, A_SliderControl_x, A_SliderControl_y, A_SliderControl_type, A_SliderControl_up, A_SliderControl_down, A_SliderControl_abs, AddSlider( A_SliderControl_id, A_SliderControl_visible, A_SliderControl_x, A_SliderControl_y, A_SliderControl_type, A_SliderControl_up, A_SliderControl_down, A_SliderControl_abs,
...@@ -180,7 +184,7 @@ void STag_SliderControl(void) ...@@ -180,7 +184,7 @@ void STag_SliderControl(void)
void STag_TextControl(void) void STag_TextControl(void)
{ {
#line 113 "skin.act" #line 117 "skin.act"
AddText( A_TextControl_id, A_TextControl_visible, A_TextControl_x, A_TextControl_y, A_TextControl_text, A_TextControl_font, A_TextControl_align, AddText( A_TextControl_id, A_TextControl_visible, A_TextControl_x, A_TextControl_y, A_TextControl_text, A_TextControl_font, A_TextControl_align,
...@@ -192,7 +196,7 @@ void STag_TextControl(void) ...@@ -192,7 +196,7 @@ void STag_TextControl(void)
void STag_PlayListControl(void) void STag_PlayListControl(void)
{ {
#line 120 "skin.act" #line 124 "skin.act"
AddPlayList( A_PlayListControl_id, A_PlayListControl_visible, A_PlayListControl_x, A_PlayListControl_y, A_PlayListControl_width, A_PlayListControl_infowidth, AddPlayList( A_PlayListControl_id, A_PlayListControl_visible, A_PlayListControl_x, A_PlayListControl_y, A_PlayListControl_width, A_PlayListControl_infowidth,
...@@ -204,7 +208,7 @@ void STag_PlayListControl(void) ...@@ -204,7 +208,7 @@ void STag_PlayListControl(void)
void ETag_PlayListControl(void) void ETag_PlayListControl(void)
{ {
#line 127 "skin.act" #line 131 "skin.act"
AddPlayListEnd(); AddPlayListEnd();
...@@ -214,7 +218,7 @@ void ETag_PlayListControl(void) ...@@ -214,7 +218,7 @@ void ETag_PlayListControl(void)
void STag_Theme(void) void STag_Theme(void)
{ {
#line 132 "skin.act" #line 136 "skin.act"
StartTheme( A_Theme_log, A_Theme_magnet ); StartTheme( A_Theme_log, A_Theme_magnet );
...@@ -224,7 +228,7 @@ void STag_Theme(void) ...@@ -224,7 +228,7 @@ void STag_Theme(void)
void ETag_Theme(void) void ETag_Theme(void)
{ {
#line 137 "skin.act" #line 141 "skin.act"
EndTheme(); EndTheme();
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* skin.dtd: DTD for the VLC skins * skin.dtd: DTD for the VLC skins
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: skin.dtd,v 1.1 2003/03/18 02:21:47 ipkiss Exp $ * $Id: skin.dtd,v 1.2 2003/03/19 02:09:56 videolan 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>
...@@ -124,6 +124,8 @@ ...@@ -124,6 +124,8 @@
down CDATA #REQUIRED down CDATA #REQUIRED
disabled CDATA "none" disabled CDATA "none"
onclick CDATA "none" onclick CDATA "none"
onmouseover CDATA "none"
onmouseout CDATA "none"
tooltiptext CDATA "none" tooltiptext CDATA "none"
help CDATA "\0" help CDATA "\0"
> >
......
/* XML processor/application API for skin.dtd (Id: skin.dtd,v 1.8 2003/03/17 22:14:47 karibu Exp). /* XML processor/application API for skin.dtd (Id: skin.dtd,v 1.8 2003/03/17 22:14:47 karibu Exp).
* Generated 2003/03/18 03:18:31. * Generated 2003/03/19 02:59:06.
* *
* This program was generated with the FleXML XML processor generator, * This program was generated with the FleXML XML processor generator,
* (Id: flexml.pl,v 1.24 1999/12/13 16:18:30 krisrose Exp). * (Id: flexml.pl,v 1.24 1999/12/13 16:18:30 krisrose Exp).
...@@ -80,6 +80,8 @@ typedef char* AT_CheckBoxControl_disabled2; ...@@ -80,6 +80,8 @@ typedef char* AT_CheckBoxControl_disabled2;
#define AU_CheckBoxControl_disabled2 NULL #define AU_CheckBoxControl_disabled2 NULL
typedef char* AT_Font_underline; typedef char* AT_Font_underline;
#define AU_Font_underline NULL #define AU_Font_underline NULL
typedef char* AT_ButtonControl_onmouseover;
#define AU_ButtonControl_onmouseover NULL
typedef char* AT_ButtonControl_visible; typedef char* AT_ButtonControl_visible;
#define AU_ButtonControl_visible NULL #define AU_ButtonControl_visible NULL
typedef char* AT_TextControl_scroll; typedef char* AT_TextControl_scroll;
...@@ -228,6 +230,8 @@ typedef char* AT_RectangleControl_h; ...@@ -228,6 +230,8 @@ typedef char* AT_RectangleControl_h;
#define AU_RectangleControl_h NULL #define AU_RectangleControl_h NULL
typedef char* AT_ThemeInfo_webpage; typedef char* AT_ThemeInfo_webpage;
#define AU_ThemeInfo_webpage NULL #define AU_ThemeInfo_webpage NULL
typedef char* AT_ButtonControl_onmouseout;
#define AU_ButtonControl_onmouseout NULL
typedef char* AT_CheckBoxControl_tooltiptext1; typedef char* AT_CheckBoxControl_tooltiptext1;
#define AU_CheckBoxControl_tooltiptext1 NULL #define AU_CheckBoxControl_tooltiptext1 NULL
typedef char* AT_CheckBoxControl_tooltiptext2; typedef char* AT_CheckBoxControl_tooltiptext2;
...@@ -291,6 +295,7 @@ extern AT_ButtonControl_down A_ButtonControl_down; ...@@ -291,6 +295,7 @@ extern AT_ButtonControl_down A_ButtonControl_down;
extern AT_CheckBoxControl_disabled1 A_CheckBoxControl_disabled1; extern AT_CheckBoxControl_disabled1 A_CheckBoxControl_disabled1;
extern AT_CheckBoxControl_disabled2 A_CheckBoxControl_disabled2; extern AT_CheckBoxControl_disabled2 A_CheckBoxControl_disabled2;
extern AT_Font_underline A_Font_underline; extern AT_Font_underline A_Font_underline;
extern AT_ButtonControl_onmouseover A_ButtonControl_onmouseover;
extern AT_ButtonControl_visible A_ButtonControl_visible; extern AT_ButtonControl_visible A_ButtonControl_visible;
extern AT_TextControl_scroll A_TextControl_scroll; extern AT_TextControl_scroll A_TextControl_scroll;
extern AT_SliderControl_id A_SliderControl_id; extern AT_SliderControl_id A_SliderControl_id;
...@@ -365,6 +370,7 @@ extern AT_ButtonControl_tooltiptext A_ButtonControl_tooltiptext; ...@@ -365,6 +370,7 @@ extern AT_ButtonControl_tooltiptext A_ButtonControl_tooltiptext;
extern AT_Event_event A_Event_event; extern AT_Event_event A_Event_event;
extern AT_RectangleControl_h A_RectangleControl_h; extern AT_RectangleControl_h A_RectangleControl_h;
extern AT_ThemeInfo_webpage A_ThemeInfo_webpage; extern AT_ThemeInfo_webpage A_ThemeInfo_webpage;
extern AT_ButtonControl_onmouseout A_ButtonControl_onmouseout;
extern AT_CheckBoxControl_tooltiptext1 A_CheckBoxControl_tooltiptext1; extern AT_CheckBoxControl_tooltiptext1 A_CheckBoxControl_tooltiptext1;
extern AT_CheckBoxControl_tooltiptext2 A_CheckBoxControl_tooltiptext2; extern AT_CheckBoxControl_tooltiptext2 A_CheckBoxControl_tooltiptext2;
extern AT_ImageControl_id A_ImageControl_id; extern AT_ImageControl_id A_ImageControl_id;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wrappers.cpp: Wrappers around C++ objects * wrappers.cpp: Wrappers around C++ objects
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: wrappers.cpp,v 1.2 2003/03/18 04:08:45 ipkiss Exp $ * $Id: wrappers.cpp,v 1.3 2003/03/19 02:09:56 videolan 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>
...@@ -157,17 +157,27 @@ void AddRectangle( char *id, char *visible, char *x, char *y, char *w, char *h, ...@@ -157,17 +157,27 @@ void AddRectangle( char *id, char *visible, char *x, char *y, char *w, char *h,
atoi( w ), atoi( h ), ConvertColor( color ), event, help, vlcWin ) ); atoi( w ), atoi( h ), ConvertColor( color ), event, help, vlcWin ) );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void AddButton( char *id, char *visible, char *x, char *y, char *up, char *down, void AddButton(
char *disabled, char *click, char *tooltiptext, char *help ) char *id,
char *visible,
char *x, char *y,
char *up, char *down, char *disabled,
char *onclick, char *onmouseover, char *onmouseout,
char *tooltiptext, char *help )
{ {
int XOff, YOff; int XOff, YOff;
Window *vlcWin = g_pIntf->p_sys->p_theme->WindowList.back(); Window *vlcWin = g_pIntf->p_sys->p_theme->WindowList.back();
g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff ); g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff );
vlcWin->ControlList.push_back( new ControlButton( id, vlcWin->ControlList.push_back( new ControlButton(
ConvertBoolean( visible ), atoi( x ) + XOff, atoi( y ) + YOff, id,
up, down, disabled, click, tooltiptext, help, vlcWin ) ); ConvertBoolean( visible ),
atoi( x ) + XOff, atoi( y ) + YOff,
up, down, disabled,
onclick, onmouseover, onmouseout,
tooltiptext, help,
vlcWin ) );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void AddCheckBox( char *id, char *visible, char *x, char *y, char *img1, void AddCheckBox( char *id, char *visible, char *x, char *y, char *img1,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wrappers.h: Wrappers around C++ objects * wrappers.h: Wrappers around C++ objects
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: wrappers.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $ * $Id: wrappers.h,v 1.2 2003/03/19 02:09:56 videolan 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>
...@@ -66,13 +66,19 @@ extern "C" { ...@@ -66,13 +66,19 @@ extern "C" {
void AddRectangle( char *id, char *visible, char *x, char *y, char *w, void AddRectangle( char *id, char *visible, char *x, char *y, char *w,
char *h, char *color, char *event, char *help ); char *h, char *color, char *event, char *help );
void AddButton( char *id, char *visible, char *x, char *y, char *up, void AddButton( char *id,
char *down, char *disabled, char *click, char *visible,
char *x, char *y,
char *up, char *down, char *disabled,
char *onclick, char *onmouseover, char *onmouseout,
char *tooltiptext, char *help ); char *tooltiptext, char *help );
void AddCheckBox( char *id, char *visible, char *x, char *y, char *img1, void AddCheckBox( char *id,
char *img2, char *click1, char *click2, char *disabled1, char *visible,
char *disabled2, char *action1, char *action2, char *x, char *y,
char *img1, char *img2, char *click1, char *click2,
char *disabled1, char *disabled2,
char *action1, char *action2,
char *tooltiptext1, char *tooltiptext2, char *help ); char *tooltiptext1, char *tooltiptext2, char *help );
void AddSlider( char *id, char *visible, char *x, char *y, char *type, void AddSlider( char *id, char *visible, char *x, char *y, char *type,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* window.cpp: Window class * window.cpp: Window class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: window.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $ * $Id: window.cpp,v 1.2 2003/03/19 02:09:56 videolan 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>
...@@ -372,6 +372,9 @@ void Window::Init() ...@@ -372,6 +372,9 @@ void Window::Init()
// Refresh Image buffer // Refresh Image buffer
RefreshImage( 0, 0, Width, Height ); RefreshImage( 0, 0, Width, Height );
// Move window as it hasn't been moved yet
Move( Left, Top );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void Window::ReSize() void Window::ReSize()
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* win32_window.cpp: Win32 implementation of the Window class * win32_window.cpp: Win32 implementation of the Window class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: win32_window.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $ * $Id: win32_window.cpp,v 1.2 2003/03/19 02:09:56 videolan 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>
...@@ -144,7 +144,6 @@ void Win32Window::OSShow( bool show ) ...@@ -144,7 +144,6 @@ void Win32Window::OSShow( bool show )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
bool Win32Window::ProcessOSEvent( Event *evt ) bool Win32Window::ProcessOSEvent( Event *evt )
{ {
HDC DC;
unsigned int msg = evt->GetMessage(); unsigned int msg = evt->GetMessage();
unsigned int p1 = evt->GetParam1(); unsigned int p1 = evt->GetParam1();
int p2 = evt->GetParam2(); int p2 = evt->GetParam2();
...@@ -152,6 +151,7 @@ bool Win32Window::ProcessOSEvent( Event *evt ) ...@@ -152,6 +151,7 @@ bool Win32Window::ProcessOSEvent( Event *evt )
switch( msg ) switch( msg )
{ {
case WM_PAINT: case WM_PAINT:
HDC DC;
PAINTSTRUCT Infos; PAINTSTRUCT Infos;
DC = BeginPaint( hWnd , &Infos ); DC = BeginPaint( hWnd , &Infos );
EndPaint( hWnd , &Infos ); EndPaint( hWnd , &Infos );
...@@ -159,6 +159,12 @@ bool Win32Window::ProcessOSEvent( Event *evt ) ...@@ -159,6 +159,12 @@ bool Win32Window::ProcessOSEvent( Event *evt )
return true; return true;
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
TRACKMOUSEEVENT TrackEvent;
TrackEvent.cbSize = sizeof( TRACKMOUSEEVENT );
TrackEvent.dwFlags = TME_LEAVE;
TrackEvent.hwndTrack = hWnd;
TrackEvent.dwHoverTime = 1;
TrackMouseEvent( &TrackEvent );
if( p1 == MK_LBUTTON ) if( p1 == MK_LBUTTON )
MouseMove( LOWORD( p2 ), HIWORD( p2 ), 1 ); MouseMove( LOWORD( p2 ), HIWORD( p2 ), 1 );
else if( p1 == MK_RBUTTON ) else if( p1 == MK_RBUTTON )
...@@ -190,6 +196,10 @@ bool Win32Window::ProcessOSEvent( Event *evt ) ...@@ -190,6 +196,10 @@ bool Win32Window::ProcessOSEvent( Event *evt )
MouseDblClick( LOWORD( p2 ), HIWORD( p2 ), 1 ); MouseDblClick( LOWORD( p2 ), HIWORD( p2 ), 1 );
return true; return true;
case WM_MOUSELEAVE:
MouseMove( -1, -1, 0 );
return true;
default: default:
return false; return false;
} }
......
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