[692] | 1 | /*
|
---|
| 2 | -----------------------------------------------------------------------------
|
---|
| 3 | This source file is part of OGRE
|
---|
| 4 | (Object-oriented Graphics Rendering Engine)
|
---|
| 5 | For the latest info, see http://ogre.sourceforge.net/
|
---|
| 6 |
|
---|
| 7 | Copyright (c) 2000-2005 The OGRE Team
|
---|
| 8 | Also see acknowledgements in Readme.html
|
---|
| 9 |
|
---|
| 10 | This program is free software; you can redistribute it and/or modify it under
|
---|
| 11 | the terms of the GNU Lesser General Public License as published by the Free Software
|
---|
| 12 | Foundation; either version 2 of the License, or (at your option) any later
|
---|
| 13 | version.
|
---|
| 14 |
|
---|
| 15 | This program is distributed in the hope that it will be useful, but WITHOUT
|
---|
| 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
---|
| 17 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
---|
| 18 |
|
---|
| 19 | You should have received a copy of the GNU Lesser General Public License along with
|
---|
| 20 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
---|
| 21 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to
|
---|
| 22 | http://www.gnu.org/copyleft/lesser.txt.
|
---|
| 23 | -----------------------------------------------------------------------------
|
---|
| 24 | */
|
---|
| 25 |
|
---|
| 26 | #ifndef INCL_GTKCONFIG_H
|
---|
| 27 | #define INCL_GTKCONFIG_H
|
---|
| 28 |
|
---|
| 29 | #include "OgreConfigDialog.h"
|
---|
| 30 | #include "OgreRoot.h"
|
---|
| 31 | #include "OgreRenderSystem.h"
|
---|
| 32 |
|
---|
| 33 | #include <gtkmm/dialog.h>
|
---|
| 34 | #include <gtkmm/menu.h>
|
---|
| 35 | #include <gtkmm/treeview.h>
|
---|
| 36 | #include <gtkmm/liststore.h>
|
---|
| 37 | #include <gtkmm/label.h>
|
---|
| 38 | #include <gtkmm/optionmenu.h>
|
---|
| 39 |
|
---|
| 40 | namespace Ogre {
|
---|
| 41 | /** GTK+ config */
|
---|
| 42 | class GTKConfig : public ConfigDialog, public SigC::Object
|
---|
| 43 | {
|
---|
| 44 | public:
|
---|
| 45 | GTKConfig()
|
---|
| 46 | { }
|
---|
| 47 |
|
---|
| 48 | /**
|
---|
| 49 | * Displays a message about reading the config and then attempts to
|
---|
| 50 | * read it from a config file
|
---|
| 51 | */
|
---|
| 52 | bool display(void);
|
---|
| 53 |
|
---|
| 54 | protected:
|
---|
| 55 | class ModelColumns : public Gtk::TreeModel::ColumnRecord
|
---|
| 56 | {
|
---|
| 57 | public:
|
---|
| 58 | ModelColumns()
|
---|
| 59 | { add(col_name); add(col_value); }
|
---|
| 60 |
|
---|
| 61 | Gtk::TreeModelColumn<Glib::ustring> col_name;
|
---|
| 62 | Gtk::TreeModelColumn<Glib::ustring> col_value;
|
---|
| 63 | };
|
---|
| 64 |
|
---|
| 65 | bool on_window_delete(GdkEventAny* event);
|
---|
| 66 | void on_option_changed();
|
---|
| 67 | void on_renderer_changed();
|
---|
| 68 | void on_value_changed();
|
---|
| 69 | void on_btn_ok();
|
---|
| 70 | void on_btn_cancel();
|
---|
| 71 | private:
|
---|
| 72 | Gtk::Dialog* _winConfig;
|
---|
| 73 | ModelColumns _columns;
|
---|
| 74 | Glib::RefPtr<Gtk::ListStore> _list_store;
|
---|
| 75 | Gtk::TreeView* _lstOptions;
|
---|
| 76 | Glib::RefPtr<Gtk::TreeSelection> _option_selection;
|
---|
| 77 | int _cur_index;
|
---|
| 78 | Glib::ustring _cur_name;
|
---|
| 79 | Gtk::OptionMenu* _optRenderer;
|
---|
| 80 | Gtk::Label* _lblOptName;
|
---|
| 81 | Gtk::OptionMenu* _optOptValues;
|
---|
| 82 | Gtk::Menu* _opt_menu;
|
---|
| 83 | ConfigOptionMap _options;
|
---|
| 84 | RenderSystemList* _renderers;
|
---|
| 85 | RenderSystem* _selected_renderer;
|
---|
| 86 |
|
---|
| 87 | void update_option_list();
|
---|
| 88 | }; // class GTKConfig
|
---|
| 89 |
|
---|
| 90 | } // namespae Ogre
|
---|
| 91 |
|
---|
| 92 | #endif // INCL_GTKCONFIG_H
|
---|