00001 /* $Id: editor_settings.hpp 52533 2012-01-07 02:35:17Z shadowmaster $ */ 00002 /* 00003 Copyright (C) 2008 - 2012 by Mark de Wever <koraq@xs4all.nl> 00004 Part of the Battle for Wesnoth Project http://www.wesnoth.org/ 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY. 00012 00013 See the COPYING file for more details. 00014 */ 00015 00016 #ifndef GUI_DIALOGS_EDITOR_SETTINGS_HPP_INCLUDED 00017 #define GUI_DIALOGS_EDITOR_SETTINGS_HPP_INCLUDED 00018 00019 #include "time_of_day.hpp" 00020 #include "gui/dialogs/dialog.hpp" 00021 00022 #include <vector> 00023 00024 namespace editor { 00025 00026 class editor_display; 00027 00028 } // namespace editor 00029 00030 namespace gui2 { 00031 00032 class tlabel; 00033 class ttoggle_button; 00034 00035 class teditor_settings : public tdialog 00036 { 00037 public: 00038 teditor_settings(editor::editor_display* display 00039 , const std::vector<time_of_day>& tods); 00040 00041 static bool execute(editor::editor_display* display 00042 , const std::vector<time_of_day>& tods 00043 , CVideo& video) 00044 { 00045 return teditor_settings(display, tods).show(video); 00046 } 00047 00048 private: 00049 00050 /** Callback for the next tod button */ 00051 void do_next_tod(twindow& window); 00052 00053 void update_tod_display(twindow& window); 00054 00055 void slider_update_callback(twindow& window); 00056 00057 void set_selected_tod(time_of_day tod); 00058 const time_of_day& get_selected_tod() const; 00059 00060 void update_selected_tod_info(twindow& window); 00061 00062 private: 00063 /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ 00064 virtual const std::string& window_id() const; 00065 00066 /** Inherited from tdialog. */ 00067 void pre_show(CVideo& video, twindow& window); 00068 00069 /** Inherited from tdialog. */ 00070 void post_show(twindow& window); 00071 00072 /** Available time_of_days */ 00073 std::vector<time_of_day> tods_; 00074 00075 /** Current map generator index */ 00076 int current_tod_; 00077 00078 /** Label for the current tod */ 00079 tlabel* current_tod_label_; 00080 00081 /** Label for the current tod image*/ 00082 tlabel* current_tod_image_; 00083 00084 ttoggle_button* custom_tod_toggle_; 00085 ttoggle_button* custom_tod_auto_refresh_; 00086 00087 tfield_bool* custom_tod_toggle_field_; 00088 00089 tfield_integer* custom_tod_red_field_; 00090 tfield_integer* custom_tod_green_field_; 00091 tfield_integer* custom_tod_blue_field_; 00092 00093 /** 00094 * The display to update when the ToD changes. 00095 * 00096 * The pointer may be NULL, in the unit tests, but normally it should be a 00097 * pointer to a valid object. 00098 */ 00099 editor::editor_display* display_; 00100 00101 bool can_update_display_; 00102 }; 00103 00104 } // namespace gui2 00105 00106 #endif
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:02:42 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |