Commit 268c70ea authored by Cyril Deguet's avatar Cyril Deguet

* now selection method in the playlist depends on the state of the

  CTRL button (as expected in a normal playlist !)
  TODO: - do the same under windows
        - replace all button constants 1/2 by MOUSE_LEFT/MOUSE_RIGHT
parent 66181839
......@@ -2,7 +2,7 @@
* playlist.cpp: Playlist control
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: playlist.cpp,v 1.13 2003/06/09 12:33:16 asmax Exp $
* $Id: playlist.cpp,v 1.14 2003/06/09 14:04:20 asmax Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
......@@ -433,9 +433,20 @@ bool ControlPlayList::MouseDown( int x, int y, int button )
{
for( j = 0; j < NumOfItems; j++ )
{
if( button & KEY_CTRL )
{
// CTRL is pressed
if( j == i + StartIndex )
{
Select[j] = !Select[j];
}
}
else
{
// CTRL is not pressed
Select[j] = ( j == i + StartIndex );
}
}
RefreshAll();
return true;
}
......
......@@ -2,7 +2,7 @@
* skin_common.h: Private Skin interface description
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: skin_common.h,v 1.16 2003/06/09 12:33:16 asmax Exp $
* $Id: skin_common.h,v 1.17 2003/06/09 14:04:20 asmax Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
......@@ -39,6 +39,12 @@ class wxIcon;
#include <X11/Xlib.h>
#endif
// For mouse events FIXME: should be elsewhere?
#define MOUSE_LEFT (1<<0)
#define MOUSE_RIGHT (1<<1)
#define KEY_CTRL (1<<2)
//---------------------------------------------------------------------------
// intf_sys_t: description and status of skin interface
//---------------------------------------------------------------------------
......
......@@ -2,7 +2,7 @@
* window.cpp: Window class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: window.cpp,v 1.27 2003/06/09 12:33:16 asmax Exp $
* $Id: window.cpp,v 1.28 2003/06/09 14:04:20 asmax Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
......@@ -425,7 +425,7 @@ void SkinWindow::MouseUp( int x, int y, int button )
}
#ifndef BASIC_SKINS
if( i < 0 && button == 2 )
if( i < 0 && button == MOUSE_RIGHT )
{
p_intf->p_sys->p_dialogs->ShowPopup();
}
......
......@@ -2,7 +2,7 @@
* x11_window.cpp: X11 implementation of the Window class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: x11_window.cpp,v 1.19 2003/06/09 12:33:17 asmax Exp $
* $Id: x11_window.cpp,v 1.20 2003/06/09 14:04:20 asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
......@@ -226,6 +226,8 @@ bool X11Window::ProcessOSEvent( Event *evt )
int p2 = evt->GetParam2();
int time;
int posX, posY;
string type;
int button;
switch( msg )
{
......@@ -257,10 +259,18 @@ bool X11Window::ProcessOSEvent( Event *evt )
XUNLOCK;
}
button = 0;
if( ((XButtonEvent *)p2 )->state & ControlMask )
{
// Control key pressed
button |= KEY_CTRL;
}
switch( ( (XButtonEvent *)p2 )->button )
{
case 1:
// Left button
button |= MOUSE_LEFT;
time = OSAPI_GetTime();
OSAPI_GetMousePos( posX, posY );
if( time - ClickedTime < DblClickDelay &&
......@@ -269,7 +279,7 @@ bool X11Window::ProcessOSEvent( Event *evt )
// Double-click
ClickedTime = 0;
MouseDblClick( (int)( (XButtonEvent *)p2 )->x,
(int)( (XButtonEvent *)p2 )->y, 1 );
(int)( (XButtonEvent *)p2 )->y, button );
}
else
{
......@@ -278,15 +288,16 @@ bool X11Window::ProcessOSEvent( Event *evt )
ClickedY = posY;
LButtonDown = true;
MouseDown( (int)( (XButtonEvent *)p2 )->x,
(int)( (XButtonEvent *)p2 )->y, 1 );
(int)( (XButtonEvent *)p2 )->y, button );
}
break;
case 3:
// Right button
button |= MOUSE_RIGHT;
RButtonDown = true;
MouseDown( (int)( (XButtonEvent *)p2 )->x,
(int)( (XButtonEvent *)p2 )->y, 2 );
(int)( (XButtonEvent *)p2 )->y, button );
break;
default:
......@@ -295,20 +306,28 @@ bool X11Window::ProcessOSEvent( Event *evt )
return true;
case ButtonRelease:
button = 0;
if( ((XButtonEvent *)p2 )->state & ControlMask )
{
// Control key pressed
button |= KEY_CTRL;
}
switch( ( (XButtonEvent *)p2 )->button )
{
case 1:
// Left button
button |= MOUSE_LEFT;
LButtonDown = false;
MouseUp( (int)( (XButtonEvent *)p2 )->x,
(int)( (XButtonEvent *)p2 )->y, 1 );
(int)( (XButtonEvent *)p2 )->y, button );
break;
case 3:
button |= MOUSE_RIGHT;
// Right button
RButtonDown = false;
MouseUp( (int)( (XButtonEvent *)p2 )->x,
(int)( (XButtonEvent *)p2 )->y, 2 );
(int)( (XButtonEvent *)p2 )->y, button );
break;
case 4:
......@@ -335,9 +354,8 @@ bool X11Window::ProcessOSEvent( Event *evt )
return true;
case ClientMessage:
{
XLOCK;
string type = XGetAtomName( display, ( (XClientMessageEvent*)
type = XGetAtomName( display, ( (XClientMessageEvent*)
p2 )->message_type );
XUNLOCK;
if( type == "XdndEnter" )
......@@ -360,7 +378,6 @@ bool X11Window::ProcessOSEvent( Event *evt )
DropObject->DndDrop( ((XClientMessageEvent*)p2)->data.l );
return true;
}
}
return false;
default:
......
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