Revision: 6645 http://playerstage.svn.sourceforge.net/playerstage/?rev=6645&view=rev Author: jeremy_asher Date: 2008-06-18 15:55:33 -0700 (Wed, 18 Jun 2008)
Log Message: ----------- Added options dialog skeleton Modified Paths: -------------- code/stage/trunk/libstage/CMakeLists.txt code/stage/trunk/libstage/gl.cc code/stage/trunk/libstage/stage.hh code/stage/trunk/libstage/worldgui.cc Added Paths: ----------- code/stage/trunk/libstage/options_dlg.cc code/stage/trunk/libstage/options_dlg.hh Modified: code/stage/trunk/libstage/CMakeLists.txt =================================================================== --- code/stage/trunk/libstage/CMakeLists.txt 2008-06-18 21:56:47 UTC (rev 6644) +++ code/stage/trunk/libstage/CMakeLists.txt 2008-06-18 22:55:33 UTC (rev 6645) @@ -1,32 +1,34 @@ -add_library( stage SHARED - world.cc - worldgui.cc - worldfile.cc - stage.cc - typetable.cc - stage.hh # get headers into IDE projects - file_manager.hh - file_manager.cc - ancestor.cc - block.cc - canvas.cc - camera.cc - gl.cc - glcolorstack.cc - model.cc - model_blinkenlight.cc - model_blobfinder.cc - model_callbacks.cc - model_camera.cc - model_fiducial.cc - model_laser.cc - model_load.cc - model_position.cc - model_props.cc - model_ranger.cc - resource.cc - texture_manager.cc +add_library(stage SHARED + world.cc + worldgui.cc + worldfile.cc + stage.cc + typetable.cc + stage.hh + file_manager.hh + file_manager.cc + ancestor.cc + block.cc + canvas.cc + camera.cc + gl.cc + glcolorstack.cc + model.cc + model_blinkenlight.cc + model_blobfinder.cc + model_callbacks.cc + model_camera.cc + model_fiducial.cc + model_laser.cc + model_load.cc + model_position.cc + model_props.cc + model_ranger.cc + resource.cc + texture_manager.cc + options_dlg.cc + options_dlg.hh ) target_link_libraries( stage Modified: code/stage/trunk/libstage/gl.cc =================================================================== --- code/stage/trunk/libstage/gl.cc 2008-06-18 21:56:47 UTC (rev 6644) +++ code/stage/trunk/libstage/gl.cc 2008-06-18 22:55:33 UTC (rev 6645) @@ -17,10 +17,11 @@ // TODO - this could be faster, but we don't draw a lot of text void Stg::gl_draw_string( float x, float y, float z, const char *str ) { - const char *c; - glRasterPos3f(x, y,z); - for (c=str; *c != '\0'; c++) - glutBitmapCharacter( GLUT_BITMAP_HELVETICA_12, *c); + //const char *c; + glRasterPos3f( x, y, z ); + gl_draw(str); +// for (c=str; *c != '\0'; c++) +// glutBitmapCharacter( GLUT_BITMAP_HELVETICA_12, *c); } void Stg::gl_speech_bubble( float x, float y, float z, const char* str ) Added: code/stage/trunk/libstage/options_dlg.cc =================================================================== --- code/stage/trunk/libstage/options_dlg.cc (rev 0) +++ code/stage/trunk/libstage/options_dlg.cc 2008-06-18 22:55:33 UTC (rev 6645) @@ -0,0 +1,12 @@ +#include "options_dlg.hh" +#include <FL/Fl.H> + +OptionsDlg::OptionsDlg( std::vector<Option> options ) : Fl_Window( 180, 250, "Options" ) { + end(); +} + +void OptionsDlg::display() { + Fl_Window::show(); + while ( shown() ) + Fl::wait(); +} Added: code/stage/trunk/libstage/options_dlg.hh =================================================================== --- code/stage/trunk/libstage/options_dlg.hh (rev 0) +++ code/stage/trunk/libstage/options_dlg.hh 2008-06-18 22:55:33 UTC (rev 6645) @@ -0,0 +1,29 @@ +#ifndef _OPTIONS_DLG_H_ +#define _OPTIONS_DLG_H_ + +#include <FL/Fl_Window.H> + +#include <string> +#include <vector> + + +class Option { +private: + std::string name; + bool value; +public: + Option( std::string n, bool v ) : name(n), value(v) { } + inline const bool get() const { return value; } + inline void set( bool val ) { value = val; } +}; + + +class OptionsDlg : private Fl_Window { +private: +public: + OptionsDlg( std::vector<Option> options ); + + void display(); +}; + +#endif \ No newline at end of file Modified: code/stage/trunk/libstage/stage.hh =================================================================== --- code/stage/trunk/libstage/stage.hh 2008-06-18 21:56:47 UTC (rev 6644) +++ code/stage/trunk/libstage/stage.hh 2008-06-18 22:55:33 UTC (rev 6645) @@ -67,7 +67,7 @@ #include <FL/Fl_Window.H> #include <FL/fl_draw.H> #include <FL/gl.h> // FLTK takes care of platform-specific GL stuff -#include <FL/glut.H> +//#include <FL/glut.H> #ifdef __APPLE__ #include <OpenGL/glu.h> @@ -2037,6 +2037,7 @@ static void HelpAboutCallback( Fl_Widget* wid ); static void view_toggle_cb( Fl_Menu_Bar* menubar, StgCanvas* canvas ); static void WindowCallback( Fl_Widget* wid, StgWorldGui* world ); + static void optionsDlgCb( Fl_Widget*, StgCanvas* canvas ); bool SaveAsDialog(); bool CloseWindowQuery(); Modified: code/stage/trunk/libstage/worldgui.cc =================================================================== --- code/stage/trunk/libstage/worldgui.cc 2008-06-18 21:56:47 UTC (rev 6644) +++ code/stage/trunk/libstage/worldgui.cc 2008-06-18 22:55:33 UTC (rev 6645) @@ -106,6 +106,7 @@ #include <FL/Fl_File_Chooser.H> #include "file_manager.hh" +#include "options_dlg.hh" static const char* MITEM_VIEW_DATA = "&View/&Data"; static const char* MITEM_VIEW_BLOCKS = "&View/&Blocks"; @@ -129,8 +130,7 @@ - StgWorldGui::StgWorldGui(int W,int H,const char* L) -: Fl_Window(0,0,W,H,L) +StgWorldGui::StgWorldGui(int W,int H,const char* L) : Fl_Window(0,0,W,H,L) { //size_range( 100,100 ); // set minimum window size @@ -186,6 +186,8 @@ FL_MENU_TOGGLE| (canvas->showflags & STG_SHOW_ARROWS ? FL_MENU_VALUE : 0 )); mbar->add( MITEM_VIEW_BLOCKSRISING, FL_CTRL+'t', (Fl_Callback*)view_toggle_cb, (void*)canvas, FL_MENU_TOGGLE| (canvas->showflags & STG_SHOW_TRAILRISE ? FL_MENU_VALUE : 0 )); + + mbar->add( "View/&Options", FL_CTRL + 'o', (Fl_Callback *)optionsDlgCb, canvas ); mbar->add( "&Help", 0, 0, 0, FL_SUBMENU ); mbar->add( "Help/&About Stage...", 0, (Fl_Callback *)About_cb, this ); @@ -504,6 +506,12 @@ //printf( "value: %d\n", item->value() ); } +void StgWorldGui::optionsDlgCb( Fl_Widget*, StgCanvas* canvas ) { + std::vector<Option> options; + OptionsDlg od( options ); + od.display(); +} + void StgWorldGui::About_cb( Fl_Widget*, StgWorldGui* world ) { fl_register_images(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Playerstage-commit mailing list Playerstage-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-commit