Revision: 7340 http://playerstage.svn.sourceforge.net/playerstage/?rev=7340&view=rev Author: rtv Date: 2009-02-17 08:39:45 +0000 (Tue, 17 Feb 2009)
Log Message: ----------- added help dialog Modified Paths: -------------- code/stage/trunk/libstage/stage.hh code/stage/trunk/libstage/worldgui.cc Modified: code/stage/trunk/libstage/stage.hh =================================================================== --- code/stage/trunk/libstage/stage.hh 2009-02-17 07:31:10 UTC (rev 7339) +++ code/stage/trunk/libstage/stage.hh 2009-02-17 08:39:45 UTC (rev 7340) @@ -1396,6 +1396,7 @@ static void realtimeCb( Fl_Widget* w, WorldGui* worldGui ); static void fasttimeCb( Fl_Widget* w, WorldGui* worldGui ); static void resetViewCb( Fl_Widget* w, WorldGui* worldGui ); + static void moreHelptCb( Fl_Widget* w, WorldGui* wg ); // GUI functions bool saveAsDialog(); Modified: code/stage/trunk/libstage/worldgui.cc =================================================================== --- code/stage/trunk/libstage/worldgui.cc 2009-02-17 07:31:10 UTC (rev 7339) +++ code/stage/trunk/libstage/worldgui.cc 2009-02-17 08:39:45 UTC (rev 7340) @@ -83,8 +83,7 @@ <h3>Saving the world</h3> <P>You can save the current pose of everything in the world, using the -File/Save menu item. <b>Warning: the saved poses overwrite the current -world file.</b> Make a copy of your world file before saving if you +File/Save menu item. <b>Warning: the saved poses overwrite the currentworld file.</b> Make a copy of your world file before saving if you want to keep the old poses. Alternatively the File/Save As menu item can be used to save to a new world file. @@ -156,6 +155,21 @@ "Distributed under the terms of the \n" "GNU General Public License v2"; +static const char* MoreHelpText = + "http://playerstage.org\n" + "\n" + "has these resources to help you:\n" + "\n" + "\t* A user manual including API documentation\n" + "\t* A bug and feature request tracking system\n" + "\t* Mailing lists for users and developers\n" + "\t* A Wiki" + "\n\n" + "The user manual is included with the Stage source code but\n" + "is not built by default. To build the manual, run \"make\"\n" + "in the directory \"docsrc\" to produce \"docsrc/stage/index.html\" .\n" + "(requires Doxygen and supporting programs to be installed first).\n"; + WorldGui::WorldGui(int W,int H,const char* L) : Fl_Window(W,H,L ), canvas( new Canvas( this,0,30,W,H-30 ) ), @@ -201,15 +215,15 @@ canvas->createMenuItems( mbar, "View" ); mbar->add( "Run", 0,0,0, FL_SUBMENU ); - mbar->add( "Run/Pause", 'p', (Fl_Callback*) WorldGui::pauseCb, this ); + mbar->add( "Run/Pause", 'p', (Fl_Callback*) WorldGui::pauseCb, this, FL_MENU_DIVIDER ); mbar->add( "Run/Faster", ']', (Fl_Callback*) WorldGui::fasterCb, this ); mbar->add( "Run/Slower", '[', (Fl_Callback*) WorldGui::slowerCb, this ); - mbar->add( "Run/Realtime", '{', (Fl_Callback*) WorldGui::realtimeCb, this ); + mbar->add( "Run/Realtime", '{', (Fl_Callback*) WorldGui::realtimeCb, this, FL_MENU_DIVIDER ); mbar->add( "Run/Fast", '}', (Fl_Callback*) WorldGui::fasttimeCb, this ); mbar->add( "&Help", 0, 0, 0, FL_SUBMENU ); - mbar->add( "Help/&About Stage...", 0, WorldGui::helpAboutCb, this ); - //mbar->add( "Help/HTML Documentation", FL_CTRL + 'g', (Fl_Callback *)dummy_cb ); + mbar->add( "Help/Getting help...", 0, (Fl_Callback*)WorldGui::moreHelptCb, this, FL_MENU_DIVIDER ); + mbar->add( "Help/&About Stage...", 0, (Fl_Callback*) WorldGui::helpAboutCb, this ); callback( WorldGui::windowCb, this ); @@ -271,8 +285,6 @@ } label( title.c_str() ); - //UpdateOptions(); - show(); } @@ -699,8 +711,6 @@ void WorldGui::helpAboutCb( Fl_Widget* w, void* p ) { - // WorldGui* worldGui = static_cast<WorldGui*>( p ); - fl_register_images(); const int Width = 420; @@ -745,6 +755,32 @@ win->show(); } +void WorldGui::moreHelptCb( Fl_Widget* w, WorldGui* wg ) +{ + const int Width = 500; + const int Height = 250; + const int Spc = 10; + + Fl_Window* win = new Fl_Window( Width, Height ); // make a window + win->label( "Getting help with Stage" ); + + Fl_Text_Display* textDisplay; + textDisplay = new Fl_Text_Display( Spc, Spc, + Width-2*Spc, Height-2*Spc ); + + win->resizable( textDisplay ); + textDisplay->box( FL_NO_BOX ); + textDisplay->color( win->color() ); + + Fl_Text_Buffer* tbuf = new Fl_Text_Buffer; + tbuf->append( MoreHelpText ); + // textDisplay->wrap_mode( true, 50 ); + textDisplay->buffer( tbuf ); + + win->show(); +} + + bool WorldGui::saveAsDialog() { const char* newFilename; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Playerstage-commit mailing list Playerstage-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-commit