gui/dialogs/campaign_difficulty.hpp

Go to the documentation of this file.
00001 /* $Id: campaign_difficulty.hpp 53086 2012-02-16 20:21:16Z mordante $ */
00002 /*
00003    Copyright (C) 2010 - 2012 by Ignacio Riquelme Morelle <shadowm2006@gmail.com>
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_CAMPAIGN_DIFFICULTY_HPP_INCLUDED
00017 #define GUI_DIALOGS_CAMPAIGN_DIFFICULTY_HPP_INCLUDED
00018 
00019 #include "gui/dialogs/dialog.hpp"
00020 
00021 #include "gui/auxiliary/old_markup.hpp"
00022 #include <vector>
00023 
00024 namespace gui2 {
00025 
00026 class tcampaign_difficulty : public tdialog
00027 {
00028 public:
00029     explicit tcampaign_difficulty(
00030               const std::vector<std::string>& items
00031             , const int default_difficulty = -1);
00032 
00033     /**
00034      * Returns the selected item index after displaying.
00035      * @return -1 if the dialog was cancelled.
00036      */
00037     int selected_index() const { return index_; }
00038 
00039 private:
00040     int index_;
00041     std::vector<tlegacy_menu_item> items_;
00042 
00043     const int default_difficulty_;
00044 
00045     /** Inherited from tdialog, implemented by REGISTER_DIALOG. */
00046     virtual const std::string& window_id() const;
00047 
00048     /** Inherited from tdialog. */
00049     void pre_show(CVideo& video, twindow& window);
00050 
00051     /** Inherited from tdialog. */
00052     void post_show(twindow& window);
00053 };
00054 
00055 
00056 }
00057 
00058 
00059 #endif /* ! GUI_DIALOGS_CAMPAIGN_DIFFICULTY_HPP_INCLUDED */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Wed May 23 2012 01:02:43 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs