The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
item_palette.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2012 - 2017 by Fabian Mueller <fabianmueller5@gmx.de>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 /**
16  * Manage the item-palette in the editor.
17  */
18 
19 #pragma once
20 
22 #include "overlay.hpp"
23 
24 namespace editor {
25 
26 class editor_toolkit;
27 
28 //std::string get_selected_terrain();
29 
30 /** Palette where the terrain to be drawn can be selected. */
31 class item_palette : public editor_palette<overlay> {
32 public:
33 
35  const config& cfg,
36  editor_toolkit &toolkit);
37 
38  virtual void setup(const config& cfg);
39 
40  virtual std::string get_help_string();
41 
42 private:
43 
44  virtual const std::string& get_id(const overlay& item);
45 
46  virtual void draw_item(const overlay& item, surface& image, std::stringstream& tooltip_text);
47 
48 };
49 
50 }
virtual void draw_item(const overlay &item, surface &image, std::stringstream &tooltip_text)
std::vector< char_t > string
virtual const std::string & get_id(const overlay &item)
virtual void setup(const config &cfg)
Setup the internal data structure.
General purpose widgets.
Manage the empty-palette in the editor.
Definition: action.cpp:29
Palette where the terrain to be drawn can be selected.
virtual std::string get_help_string()
this module manages the cache of images.
Definition: image.cpp:109
item_palette(editor_display &gui, const config &cfg, editor_toolkit &toolkit)
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:93