NSM: Minor GUI enhancements.

This commit is contained in:
Jonathan Moore Liles 2012-02-26 16:59:51 -08:00
parent e8cc16eff1
commit cdcc61d75b
1 changed files with 26 additions and 4 deletions

View File

@ -33,6 +33,7 @@
#include "debug.h" #include "debug.h"
#include <FL/Fl_Browser.H> #include <FL/Fl_Browser.H>
#include <FL/Fl_Select_Browser.H> #include <FL/Fl_Select_Browser.H>
#include <FL/Fl_Hold_Browser.H>
#include <FL/Fl_Tile.H> #include <FL/Fl_Tile.H>
#include "FL/Fl_Packscroller.H" #include "FL/Fl_Packscroller.H"
@ -272,7 +273,7 @@ public:
Fl_Button *add_button; Fl_Button *add_button;
Fl_Button *duplicate_button; Fl_Button *duplicate_button;
Fl_Select_Browser *session_browser; Fl_Hold_Browser *session_browser;
static void cb_handle ( Fl_Widget *w, void *v ) static void cb_handle ( Fl_Widget *w, void *v )
{ {
@ -469,6 +470,23 @@ public:
clients_pack->parent()->label( strdup( name ) ); clients_pack->parent()->label( strdup( name ) );
if ( strlen( name ) )
{
save_button->activate();
add_button->activate();
duplicate_button->activate();
abort_button->activate();
close_button->activate();
}
else
{
save_button->deactivate();
add_button->deactivate();
duplicate_button->deactivate();
abort_button->deactivate();
close_button->deactivate();
}
redraw(); redraw();
} }
@ -606,9 +624,10 @@ public:
} }
{ Fl_Tile *o = new Fl_Tile( X, Y + 50, W, H - 50 ); { Fl_Tile *o = new Fl_Tile( X, Y + 50, W, H - 50 );
{ {
Fl_Select_Browser *o = session_browser = new Fl_Select_Browser( X, Y + 50, W / 3, H - 50 ); Fl_Hold_Browser *o = session_browser = new Fl_Hold_Browser( X, Y + 50, W / 3, H - 50 );
o->callback( cb_handle, (void *)this ); o->callback( cb_handle, (void *)this );
o->color( fl_darker( FL_GRAY ) ); o->color( fl_darker( FL_GRAY ) );
o->selection_color( fl_darker( FL_GREEN ) );
o->box( FL_ROUNDED_BOX ); o->box( FL_ROUNDED_BOX );
o->label( "Sessions" ); o->label( "Sessions" );
} }
@ -621,14 +640,15 @@ public:
o->align( FL_ALIGN_TOP ); o->align( FL_ALIGN_TOP );
o->type( Fl_Pack::VERTICAL ); o->type( Fl_Pack::VERTICAL );
o->end(); o->end();
Fl_Group::current()->resizable( o );
} }
Fl_Group::current()->resizable( o );
o->end(); o->end();
} }
resizable( o );
o->end(); o->end();
} }
Fl_Group::current()->resizable( this ); // Fl_Group::current()->resizable( this );
end(); end();
@ -863,6 +883,8 @@ main (int argc, char **argv )
main_window->xclass( APP_NAME ); main_window->xclass( APP_NAME );
Fl_Widget *o = controller = new NSM_Controller( 0, 0, main_window->w(), main_window->h(), NULL ); Fl_Widget *o = controller = new NSM_Controller( 0, 0, main_window->w(), main_window->h(), NULL );
controller->session_name( "" );
Fl_Group::current()->resizable(o); Fl_Group::current()->resizable(o);
} }
o->end(); o->end();