// tilefilewin.hpp -- the tile file selection window // // Written by Frederic Bouvier, started April 2003. // // Copyright (C) 2003 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: tilefilewin.hpp,v 1.8 2005/05/09 07:02:15 fredb Exp $ #ifndef _tilefilewin_hpp_ #define _tilefilewin_hpp_ #include #include #include #include "window.hpp" #include #include #include class FGSD_TileFileWindow : public FGSD_Window { public: class TileBrowser : public Fl_Multi_Browser { public: TileBrowser( int x, int y, int w, int h, const char *l = 0 ); void load( const char *dir, bool up, const std::list &sceneryList ); private: }; FGSD_TileFileWindow( const std::list &pathList, const char *__current ); static void closeDialog( Fl_Widget *w, void *v ); static void openDir( Fl_Widget *w, void *v ); void openDir(); static void select( Fl_Widget *w, void *v ); static void browserClick( Fl_Widget *w, void *v ); void browserClick(); int level() const; std::vector selected() const; std::string currentPath() const; private: Fl_Button *_close; Fl_Button *_open; Fl_Button *_select; TileBrowser *_browser; Fl_Output *_chunkName; const std::list &_sceneryList; std::string _curdir; int _level; }; inline int FGSD_TileFileWindow::level() const { return _level; } inline std::string FGSD_TileFileWindow::currentPath() const { return _curdir; } #endif