@@ -27,8 +27,6 @@ You should have received a copy of the GNU General Public License
2727along with LeMonADE-Viewer. If not, see <http://www.gnu.org/licenses/>.
2828
2929--------------------------------------------------------------------------------*/
30-
31-
3230#ifndef LEMONADE_VIEWER_H
3331#define LEMONADE_VIEWER_H
3432
@@ -41,6 +39,10 @@ along with LeMonADE-Viewer. If not, see <http://www.gnu.org/licenses/>.
4139#include < math.h>
4240#include < stdlib.h> // system
4341#include < map>
42+ #include < sstream>
43+ #include < cstring>
44+
45+
4446
4547#include < LeMonADE/analyzer/AbstractAnalyzer.h>
4648#include < LeMonADE/updater/AbstractUpdater.h>
@@ -53,6 +55,7 @@ along with LeMonADE-Viewer. If not, see <http://www.gnu.org/licenses/>.
5355#include < LeMonADE-Viewer/LeMonADEOpenGL.h>
5456#include < LeMonADE-Viewer/LineParser.h>
5557#include < LeMonADE-Viewer/LeMonADEViewerLineCommand.h>
58+ #include < LeMonADE-Viewer/LeMonADEViewerAboutWin.h>
5659
5760#include < FL/Fl.H>
5861#include < FL/Fl_Window.H>
@@ -98,10 +101,16 @@ template <class IngredientsType> class LeMonADEViewer: public AbstractUpdater
98101 std::cout << " cropped filename: " << cropFilename << std::endl;
99102 };
100103
104+ virtual ~LeMonADEViewer (){
105+ delete winAbout;
106+ delete winOpenGL;
107+ delete window;
108+ };
101109
102110
103111private: Fl_Double_Window* window;
104112 LeMonADEOpenGL<IngredientsType>* winOpenGL;
113+ LeMonADEViewerAboutWin* winAbout;
105114
106115 Fl_Button* B_ReverseWindingStart;
107116 Fl_Button* B_ReverseWinding;
@@ -221,7 +230,7 @@ private: Fl_Double_Window* window;
221230 o->tooltip (" License Information" );
222231 o->labelfont (FL_BOLD +FL_ITALIC );
223232 o->labelsize (22 );
224- o->callback (( Fl_Callback*)cb_pngscrennshot , this );
233+ o->callback (( Fl_Callback*)cb_license , this );
225234 /* @todo add license information window*/
226235 } // Fl_Button* o
227236
@@ -413,6 +422,9 @@ private: Fl_Double_Window* window;
413422 winOpenGL->initialize ();
414423
415424
425+ winAbout = new LeMonADEViewerAboutWin (600 ,600 ," About LeMonADE-Viewer" );
426+
427+
416428 /* std::string a = std::string("!setColor");
417429 CommandSetColor<IngredientsType>* f = new CommandSetColor<IngredientsType>();
418430
@@ -488,8 +500,8 @@ private: Fl_Double_Window* window;
488500 static void cb_povray ( Fl_Button*, void * );
489501 inline void cb_povray_i ( Fl_Button*, void * );
490502
491- static void cb_pngscrennshot ( Fl_Button*, void * );
492- inline void cb_pngscrennshot_i ( Fl_Button*, void * );
503+ static void cb_license ( Fl_Button*, void * );
504+ inline void cb_license_i ( Fl_Button*, void * );
493505
494506 static void cb_colorchooser ( Fl_Button*, void * );
495507 inline void cb_colorchooser_i ( Fl_Button*, void * );
@@ -664,17 +676,41 @@ void LeMonADEViewer<IngredientsType>::cb_povray_i( Fl_Button* , void* )
664676 }
665677
666678template <class IngredientsType >
667- void LeMonADEViewer<IngredientsType>::cb_pngscrennshot ( Fl_Button* obj, void * v )
679+ void LeMonADEViewer<IngredientsType>::cb_license ( Fl_Button* obj, void * v )
668680{
669681 // should be replace by the info -box
670- // LeMonADEViewer<IngredientsType> * T=( LeMonADEViewer<IngredientsType>* )v;
671- // T->cb_pngscrennshot_i (obj,v);
682+ LeMonADEViewer<IngredientsType> * T=( LeMonADEViewer<IngredientsType>* )v;
683+ T->cb_license_i (obj,v);
672684
673685}
674686
675687template <class IngredientsType >
676- void LeMonADEViewer<IngredientsType>::cb_pngscrennshot_i ( Fl_Button* , void * )
688+ void LeMonADEViewer<IngredientsType>::cb_license_i ( Fl_Button* , void * )
677689{
690+ std::cout << " About LeMonADE-Viewer" << std::endl;
691+ // const char *helpmsg = outputline.c_str();
692+
693+ /* static Fl_Double_Window *helpwin = 0;
694+ static Fl_Text_Display *helpdisp = 0;
695+ static Fl_Text_Buffer *helpbuff = 0;
696+ if ( !helpwin ) {
697+ Fl_Group::current(0); // ensure we don't become child of other win
698+ helpwin = new Fl_Double_Window(600,600,"About LeMonADE-Viewer");
699+ helpdisp = new Fl_Text_Display(0,0,helpwin->w(),helpwin->h());
700+ helpbuff = new Fl_Text_Buffer();
701+ helpdisp->buffer(helpbuff);
702+ helpdisp->textfont(FL_COURIER);
703+ helpdisp->textsize(12);
704+ helpbuff->text(helpmsg);
705+ helpwin->end();
706+ }*/
707+ // winAbout->resizable(helpdisp);
708+ // if ( !winAbout)
709+
710+ winAbout->showing ();
711+
712+
713+
678714 // should be replace by the info -box
679715 // std::cout << "Create png: testimage.png" << std::endl;
680716 // winOpenGL->screenshoot("testimage.png");
0 commit comments