ribbon_menu.h
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2013 The ClanLib Team
4 **
5 ** This software is provided 'as-is', without any express or implied
6 ** warranty. In no event will the authors be held liable for any damages
7 ** arising from the use of this software.
8 **
9 ** Permission is granted to anyone to use this software for any purpose,
10 ** including commercial applications, and to alter it and redistribute it
11 ** freely, subject to the following restrictions:
12 **
13 ** 1. The origin of this software must not be misrepresented; you must not
14 ** claim that you wrote the original software. If you use this software
15 ** in a product, an acknowledgment in the product documentation would be
16 ** appreciated but is not required.
17 ** 2. Altered source versions must be plainly marked as such, and must not be
18 ** misrepresented as being the original software.
19 ** 3. This notice may not be removed or altered from any source distribution.
20 **
21 ** Note: Some of the libraries ClanLib may link to may have additional
22 ** requirements or restrictions.
23 **
24 ** File Author(s):
25 **
26 ** Magnus Norddahl
27 ** Harry Storbacka
28 */
29 
30 #pragma once
31 
32 #include "../../Display/2D/image.h"
33 #include "../gui_component.h"
34 #include "../gui_message_input.h"
35 #include "../gui_theme_part.h"
36 
37 namespace clan
38 {
39 
40 class RibbonMenu_Impl;
41 class Ribbon_Impl;
42 
44 {
45 public:
46  RibbonMenuItem() : separator(false) { }
47  RibbonMenuItem(Image image, std::string text) : separator(false), image(image), text(text) { }
48 
49  bool separator;
51  std::string text;
53 };
54 
55 class RibbonMenu : public GUIComponent
56 {
57 public:
58  Callback_v0 &add_item(Image image, std::string text);
59  void add_separator();
60 
61 private:
62  std::shared_ptr<RibbonMenu_Impl> impl;
63  RibbonMenu(GUIComponent *owner);
64 
65  friend class Ribbon_Impl;
66  friend class Ribbon;
67 };
68 
69 }
Definition: ribbon_menu.h:55
Definition: ribbon_menu.h:43
std::string text
Definition: ribbon_menu.h:51
GUI base component class.
Definition: gui_component.h:80
RibbonMenuItem(Image image, std::string text)
Definition: ribbon_menu.h:47
RibbonMenuItem()
Definition: ribbon_menu.h:46
Callback_v0 func_clicked
Definition: ribbon_menu.h:52
Ribbon component.
Definition: ribbon.h:46
friend class Ribbon_Impl
Definition: ribbon_menu.h:65
Image class.
Definition: image.h:60
Callback_v0 & add_item(Image image, std::string text)
Image image
Definition: ribbon_menu.h:50
bool separator
Definition: ribbon_menu.h:49
Callback_v0.
Definition: callback_v0.h:152