Mixer: Fix focus issues with new sliders.
This commit is contained in:
parent
5ab7d7c410
commit
423a8428e1
|
@ -42,6 +42,17 @@ void Fl_Value_SliderX::input_cb(Fl_Widget*, void* v) {
|
|||
{
|
||||
t.value_damage();
|
||||
t.do_callback();
|
||||
|
||||
// Fl::focus(NULL);
|
||||
for ( Fl_Widget *p = t.parent(); p; p = p->parent() )
|
||||
{
|
||||
if ( p->visible_focus() )
|
||||
{
|
||||
p->take_focus();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -75,9 +86,9 @@ Fl_Value_SliderX::Fl_Value_SliderX(int X, int Y, int W, int H, const char*l)
|
|||
input.parent((Fl_Group *)this); // kludge!
|
||||
input.callback(input_cb, this);
|
||||
input.when(FL_WHEN_ENTER_KEY);
|
||||
box(input.box());
|
||||
color(input.color());
|
||||
selection_color(input.selection_color());
|
||||
/* box(input.box()); */
|
||||
/* color(input.color()); */
|
||||
/* selection_color(input.selection_color()); */
|
||||
align(FL_ALIGN_LEFT);
|
||||
value_damage();
|
||||
textsize(9);
|
||||
|
|
|
@ -52,6 +52,20 @@ bool Controller_Module::learn_by_number = false;
|
|||
bool Controller_Module::_learn_mode = false;
|
||||
|
||||
|
||||
void
|
||||
Controller_Module::take_focus ( void )
|
||||
{
|
||||
bool v = visible_focus();
|
||||
|
||||
if ( ! v )
|
||||
set_visible_focus();
|
||||
|
||||
Fl_Widget::take_focus();
|
||||
|
||||
if ( ! v )
|
||||
clear_visible_focus();
|
||||
}
|
||||
|
||||
Controller_Module::Controller_Module ( bool is_default ) : Module( is_default, 50, 100, name() )
|
||||
{
|
||||
// label( "" );
|
||||
|
@ -72,6 +86,7 @@ Controller_Module::Controller_Module ( bool is_default ) : Module( is_default, 5
|
|||
|
||||
end();
|
||||
|
||||
// clear_visible_focus();
|
||||
log_create();
|
||||
}
|
||||
|
||||
|
@ -310,6 +325,7 @@ Controller_Module::maybe_create_panner ( void )
|
|||
}
|
||||
else
|
||||
{
|
||||
// o->clear_visible_focus();
|
||||
o->resize( x(), y(), w(), h() );
|
||||
add( o );
|
||||
resizable( o );
|
||||
|
@ -496,7 +512,7 @@ Controller_Module::connect_to ( Port *p )
|
|||
|
||||
control_value = p->control_value();
|
||||
|
||||
w->set_visible_focus();
|
||||
w->clear_visible_focus();
|
||||
w->align(FL_ALIGN_TOP);
|
||||
w->labelsize( 10 );
|
||||
w->callback( cb_handle, this );
|
||||
|
|
|
@ -105,6 +105,7 @@ public:
|
|||
|
||||
int handle ( int m );
|
||||
|
||||
void take_focus ( void );
|
||||
// void set_control_value ( float f ) { control_value = f; }
|
||||
|
||||
protected:
|
||||
|
|
|
@ -650,6 +650,7 @@ Mixer_Strip::init ( )
|
|||
o->type( Fl_Scalepack::HORIZONTAL );
|
||||
{ Controller_Module *o = gain_controller = new Controller_Module( true );
|
||||
o->horizontal(false);
|
||||
o->clear_visible_focus();
|
||||
o->pad( false );
|
||||
o->size( 33, 100 );
|
||||
}
|
||||
|
@ -872,6 +873,16 @@ Mixer_Strip::menu_cb ( const Fl_Menu_ *m )
|
|||
if ( Fl::event_shift() || 1 == fl_choice( "Are you sure you want to remove this strip?\n\n(this action cannot be undone)", "Cancel", "Remove", NULL ) )
|
||||
command_close();
|
||||
}
|
||||
else if ( ! strcmp( picked, "/Gain" ) )
|
||||
{
|
||||
gain_controller->take_focus();
|
||||
}
|
||||
else if ( ! strcmp( picked, "/Mute" ) )
|
||||
{
|
||||
((Fl_Button*)mute_controller->child(0))->value( !
|
||||
((Fl_Button*)mute_controller->child(0))->value());
|
||||
|
||||
}
|
||||
else if ( ! strcmp( picked, "Auto Output/On" ) )
|
||||
{
|
||||
manual_connection( false );
|
||||
|
@ -1079,6 +1090,9 @@ Mixer_Strip::menu ( void ) const
|
|||
m.add( "Width/Wide", 'w', 0, 0, FL_MENU_RADIO | ( width_button->value() ? FL_MENU_VALUE : 0 ) );
|
||||
m.add( "View/Fader", 'f', 0, 0, FL_MENU_RADIO | ( 0 == tab_button->value() ? FL_MENU_VALUE : 0 ) );
|
||||
m.add( "View/Signal", 's', 0, 0, FL_MENU_RADIO | ( 1 == tab_button->value() ? FL_MENU_VALUE : 0 ) );
|
||||
m.add( "Mute", 'm', 0, 0, 0 );
|
||||
// ( 1 == mute_controller->control_output[0].connected_port()->control_value() ? FL_MENU_VALUE : 0 ) );
|
||||
m.add( "Gain", 'g', 0, 0 );
|
||||
m.add( "Move Left", '[', 0, 0 );
|
||||
m.add( "Move Right", ']', 0, 0 );
|
||||
m.add( "Color", 0, 0, 0 );
|
||||
|
|
Loading…
Reference in New Issue