Browse Source

Mixer: Fix some button handling.

tags/non-daw-v1.2.0
Jonathan Moore Liles 12 years ago
parent
commit
5af9afdd8d
3 changed files with 29 additions and 32 deletions
  1. +10
    -19
      FL/Fl_Packscroller.H
  2. +1
    -0
      mixer/src/Mixer_Strip.C
  3. +18
    -13
      mixer/src/Module.C

+ 10
- 19
FL/Fl_Packscroller.H View File

@@ -155,13 +155,9 @@ public:
virtual int virtual int
handle ( int m ) handle ( int m )
{ {
static int _button;

switch ( m ) switch ( m )
{ {
case FL_PUSH: case FL_PUSH:
_button = Fl::event_button();

if ( top_sb_visible() && if ( top_sb_visible() &&
Fl::event_inside( x(), y(), w(), sbh ) ) Fl::event_inside( x(), y(), w(), sbh ) )
{ {
@@ -175,22 +171,17 @@ public:
break; break;
case FL_RELEASE: case FL_RELEASE:
{ {
int b = _button;
_button = 0;
if ( b == 1 )
if ( top_sb_visible() &&
Fl::event_inside( x(), y(), w(), sbh ) )
{
yposition( yposition() + ( h() / 4 ) );
return 1;
}
else if ( bottom_sb_visible() &&
Fl::event_inside( x(), y() + h() - sbh, w(), sbh ) )
{ {
if ( top_sb_visible() &&
Fl::event_inside( x(), y(), w(), sbh ) )
{
yposition( yposition() + ( h() / 4 ) );
return 1;
}
else if ( bottom_sb_visible() &&
Fl::event_inside( x(), y() + h() - sbh, w(), sbh ) )
{
yposition( yposition() - (h() / 4 ) );
return 1;
}
yposition( yposition() - (h() / 4 ) );
return 1;
} }
break; break;
} }


+ 1
- 0
mixer/src/Mixer_Strip.C View File

@@ -726,6 +726,7 @@ Mixer_Strip::handle ( int m )
} }
case FL_PUSH: case FL_PUSH:
_button = Fl::event_button(); _button = Fl::event_button();
break;
case FL_RELEASE: case FL_RELEASE:
{ {
int b = _button; int b = _button;


+ 18
- 13
mixer/src/Module.C View File

@@ -778,7 +778,9 @@ Module::handle_chain_name_changed ( )
int int
Module::handle ( int m ) Module::handle ( int m )
{ {
static int _button = 0;
static unsigned long _event_state = 0;

unsigned long evstate = Fl::event_state();


if ( Fl_Group::handle( m ) ) if ( Fl_Group::handle( m ) )
return 1; return 1;
@@ -797,33 +799,36 @@ Module::handle ( int m )
} }
case FL_PUSH: case FL_PUSH:
take_focus(); take_focus();
_button = Fl::event_button();
_event_state = evstate;
return 1; return 1;
// if ( Fl::visible_focus() && handle( FL_FOCUS )) Fl::focus(this); // if ( Fl::visible_focus() && handle( FL_FOCUS )) Fl::focus(this);
case FL_DRAG: case FL_DRAG:
_button = Fl::event_button();
_event_state = evstate;
return 1; return 1;
case FL_RELEASE: case FL_RELEASE:
{ {
int b = _button;
_button = 0;
DMESSAGE( "Button %i", b);
if ( 3 == b )
{
menu_popup( &menu() );
unsigned long e = _event_state;
_event_state = 0;

if ( ! Fl::event_inside( this ) )
return 1; return 1;
}
else if ( 1 == b )

if ( e & FL_BUTTON1 )
{ {
command_open_parameter_editor(); command_open_parameter_editor();
return 1; return 1;
} }
else if ( 3 == b && Fl::event_ctrl() )
else if ( e & FL_BUTTON3 && e & FL_CTRL )
{ {
command_remove(); command_remove();
return 1; return 1;
} }
else if ( 2 == b )
else if ( e & FL_BUTTON3 )
{
menu_popup( &menu() );
return 1;
}
else if ( e & FL_BUTTON2 )
{ {
if ( !bypassable() ) if ( !bypassable() )
{ {


Loading…
Cancel
Save