// curvtypwin.hpp -- the curve type window // // Written by Frederic Bouvier, started August 2002. // // Copyright (C) 2002 Frederic Bouvier - fredb@users.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as // published by the Free Software Foundation; either version 2 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // $Id: curvtypwin.hpp,v 1.8 2005/05/09 07:01:51 fredb Exp $ #ifndef _curvtypwin_hpp_ #define _curvtypwin_hpp_ #include "window.hpp" #include #include #include #include #include "curve.hpp" class FGSD_CurveTypeWindow { public: FGSD_CurveTypeWindow( FGSD_Curve *__curve ); ~FGSD_CurveTypeWindow(); bool exec(); static void c2d_cb( Fl_Widget *o, void *v ); static void c2d5_cb( Fl_Widget *o, void *v ); static void c3d_cb( Fl_Widget *o, void *v ); void button_cb( Fl_Widget *o, int n ); static void ok_cb( Fl_Widget *o, void *v ); static void cancel_cb( Fl_Widget *o, void *v ); void button_cb( bool __ok ); FGSD_Curve::CurveType type() const; const char *material() const; bool water() const; double height() const; private: FGSD_Window *_window; Fl_Round_Button *_curve2D; Fl_Round_Button *_curve2D5; Fl_Round_Button *_curve3D; Fl_Input *_altitude; Fl_Choice *_material; Fl_Check_Button *_water; Fl_Button *_ok; Fl_Button *_cancel; FGSD_Curve *_curve; FGSD_Curve::CurveType _curType; double _height; }; inline bool FGSD_CurveTypeWindow::exec() { bool ret = false; if ( _window ) ret = _window->exec(); return ret; } inline FGSD_Curve::CurveType FGSD_CurveTypeWindow::type() const { return _curType; } inline const char *FGSD_CurveTypeWindow::material() const { const char *ret = ""; if ( !_curve->opened() ) ret = _material->text(); return ret; } inline bool FGSD_CurveTypeWindow::water() const { return _water->value() ? true : false; } inline double FGSD_CurveTypeWindow::height() const { return _height; } #endif