void Module::draw_box ( int tx, int ty, int tw, int th ) { fl_color( fl_contrast( FL_FOREGROUND_COLOR, color() ) ); fl_push_clip( tx, ty, tw, th ); Fl_Color c = color(); if ( ! active_r() ) c = fl_inactive( c ); int spacing = w() / instances(); for ( int i = instances(); i--; ) { fl_draw_box( box(), tx + (spacing * i), ty, tw / instances(), th, c ); } if ( audio_input.size() && audio_output.size() ) { /* maybe draw control indicators */ if ( control_input.size() ) { fl_draw_box( FL_ROUNDED_BOX, tx + 4, ty + 4, 5, 5, is_being_controlled() ? FL_YELLOW : fl_inactive( FL_YELLOW ) ); /* fl_draw_box( FL_ROUNDED_BOX, tx + 4, ty + th - 8, 5, 5, is_being_controlled_osc() ? FL_YELLOW : fl_inactive( FL_YELLOW ) ); */ } if ( control_output.size() ) fl_draw_box( FL_ROUNDED_BOX, tx + tw - 8, ty + 4, 5, 5, is_controlling() ? FL_YELLOW : fl_inactive( FL_YELLOW ) ); } fl_push_clip( tx + Fl::box_dx(box()), ty + Fl::box_dy(box()), tw - Fl::box_dw(box()), th - Fl::box_dh(box()) ); Fl_Group::draw_children(); fl_pop_clip(); if ( focused_r( this ) ) draw_focus_frame( tx,ty,tw,th, selection_color() ); fl_pop_clip(); }
void Module::draw_box ( void ) { fl_color( fl_contrast( FL_FOREGROUND_COLOR, color() ) ); int tw, th, tx, ty; tw = w(); th = h(); ty = y(); tx = x(); fl_push_clip( tx, ty, tw, th ); Fl_Color c = is_default() ? FL_BLACK : color(); c = active() && ! bypass() ? c : fl_inactive( c ); int spacing = w() / instances(); for ( int i = instances(); i--; ) { fl_draw_box( box(), tx + (spacing * i), ty, tw / instances(), th, Fl::belowmouse() == this ? fl_lighter( c ) : c ); } if ( this == Fl::focus() ) { fl_draw_box( FL_UP_FRAME, x(), y(), w(), h(), selection_color() ); } if ( audio_input.size() && audio_output.size() ) { /* maybe draw control indicators */ if ( control_input.size() ) fl_draw_box( FL_ROUNDED_BOX, tx + 4, ty + 4, 5, 5, is_being_controlled() ? FL_YELLOW : fl_inactive( FL_YELLOW ) ); if ( control_output.size() ) fl_draw_box( FL_ROUNDED_BOX, tx + tw - 8, ty + 4, 5, 5, is_controlling() ? FL_YELLOW : fl_inactive( FL_YELLOW ) ); } Fl_Group::draw_children(); fl_pop_clip(); }