From ba45c07b040e776fd0e8872c58866dc973594b70 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sat, 3 Mar 2012 13:21:18 -0800 Subject: [PATCH] Mixer: Restore display of module name in Module Parameter Editor. --- mixer/src/Module_Parameter_Editor.C | 20 +++++++++++++++----- mixer/src/Module_Parameter_Editor.H | 3 ++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/mixer/src/Module_Parameter_Editor.C b/mixer/src/Module_Parameter_Editor.C index 4be207b..e6c3830 100644 --- a/mixer/src/Module_Parameter_Editor.C +++ b/mixer/src/Module_Parameter_Editor.C @@ -47,6 +47,7 @@ Module_Parameter_Editor::Module_Parameter_Editor ( Module *module ) : Fl_Double_ { _module = module; _resized = false; + _min_width = 100; char lab[256]; if ( strcmp( module->name(), module->label() ) ) @@ -61,12 +62,17 @@ Module_Parameter_Editor::Module_Parameter_Editor ( Module *module ) : Fl_Double_ copy_label( title ); - { Fl_Pack *o = main_pack = new Fl_Pack( 0, y(), w(), h() - 10 ); + fl_font( FL_HELVETICA, 14 ); + + _min_width = 30 + fl_width( module->label() ); + + { Fl_Pack *o = main_pack = new Fl_Pack( 0, 0, w(), h() - 10 ); o->type( FL_VERTICAL ); -/* o->label( strdup( lab ) ); */ -/* o->labeltype( FL_SHADOW_LABEL ); */ -/* o->labelsize( 18 ); */ -/* o->align( FL_ALIGN_TOP | FL_ALIGN_RIGHT | FL_ALIGN_INSIDE ); */ + o->label( module->label() ); + o->labelfont( 2 ); + o->labeltype( FL_SHADOW_LABEL ); + o->labelsize( 14 ); + o->align( FL_ALIGN_TOP | FL_ALIGN_RIGHT | FL_ALIGN_INSIDE ); { Fl_Pack *o = new Fl_Pack( 0, 0, 50, 25 ); @@ -322,8 +328,12 @@ Module_Parameter_Editor::make_controls ( void ) int width = control_pack->max_width() + 100; int height = control_pack->h() + 50; + if ( width < _min_width ) + width = _min_width; + main_pack->size( width, height ); size( width, height ); + size_range( width, height, width, height ); } void diff --git a/mixer/src/Module_Parameter_Editor.H b/mixer/src/Module_Parameter_Editor.H index c82b61d..8b49fe0 100644 --- a/mixer/src/Module_Parameter_Editor.H +++ b/mixer/src/Module_Parameter_Editor.H @@ -68,10 +68,11 @@ class Module_Parameter_Editor : public Fl_Double_Window Fl_Flowpack *control_pack; Fl_Menu_Button *mode_choice; bool _resized; + int _min_width; int azimuth_port_number; int elevation_port_number; - + std::vector controls_by_port; public: