aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/MenuItem.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/MenuItem.hh')
-rw-r--r--src/FbTk/MenuItem.hh17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/FbTk/MenuItem.hh b/src/FbTk/MenuItem.hh
index 1d9ed20..efeab4d 100644
--- a/src/FbTk/MenuItem.hh
+++ b/src/FbTk/MenuItem.hh
@@ -1,5 +1,5 @@
1// MenuItem.hh for FbTk - Fluxbox Toolkit 1// MenuItem.hh for FbTk - Fluxbox Toolkit
2// Copyright (c) 2003 Henrik Kinnunen (fluxgen at users.sourceforge.net) 2// Copyright (c) 2003-2004 Henrik Kinnunen (fluxgen at users.sourceforge.net)
3// 3//
4// Permission is hereby granted, free of charge, to any person obtaining a 4// Permission is hereby granted, free of charge, to any person obtaining a
5// copy of this software and associated documentation files (the "Software"), 5// copy of this software and associated documentation files (the "Software"),
@@ -19,20 +19,22 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: MenuItem.hh,v 1.5 2004/06/07 20:33:20 fluxgen Exp $ 22// $Id: MenuItem.hh,v 1.6 2004/06/10 11:40:43 fluxgen Exp $
23 23
24#ifndef FBTK_MENUITEM_HH 24#ifndef FBTK_MENUITEM_HH
25#define FBTK_MENUITEM_HH 25#define FBTK_MENUITEM_HH
26 26
27#include "RefCount.hh" 27#include "RefCount.hh"
28#include "Command.hh" 28#include "Command.hh"
29#include <string>
30 29
30#include <string>
31#include <memory>
31namespace FbTk { 32namespace FbTk {
32 33
33class Menu; 34class Menu;
34class MenuTheme; 35class MenuTheme;
35class FbDrawable; 36class FbDrawable;
37class PixmapWithMask;
36 38
37/// An interface for a menu item in Menu 39/// An interface for a menu item in Menu
38class MenuItem { 40class MenuItem {
@@ -77,6 +79,7 @@ public:
77 virtual inline void setEnabled(bool enabled) { m_enabled = enabled; } 79 virtual inline void setEnabled(bool enabled) { m_enabled = enabled; }
78 virtual inline void setLabel(const char *label) { m_label = (label ? label : ""); } 80 virtual inline void setLabel(const char *label) { m_label = (label ? label : ""); }
79 virtual inline void setToggleItem(bool val) { m_toggle_item = val; } 81 virtual inline void setToggleItem(bool val) { m_toggle_item = val; }
82 void setIcon(const std::string &filename, int screen_num);
80 Menu *submenu() { return m_submenu; } 83 Menu *submenu() { return m_submenu; }
81 /** 84 /**
82 @name accessors 85 @name accessors
@@ -94,7 +97,7 @@ public:
94 bool highlight, 97 bool highlight,
95 int x, int y, 98 int x, int y,
96 unsigned int width, unsigned int height) const; 99 unsigned int width, unsigned int height) const;
97 virtual void updateTheme(const MenuTheme &theme) { } 100 virtual void updateTheme(const MenuTheme &theme);
98 /** 101 /**
99 Called when the item was clicked with a specific button 102 Called when the item was clicked with a specific button
100 @param button the button number 103 @param button the button number
@@ -111,6 +114,12 @@ private:
111 RefCount<Command> m_command; ///< command to be executed 114 RefCount<Command> m_command; ///< command to be executed
112 bool m_enabled, m_selected; 115 bool m_enabled, m_selected;
113 bool m_toggle_item; 116 bool m_toggle_item;
117
118 struct Icon {
119 std::auto_ptr<PixmapWithMask> pixmap;
120 std::string filename;
121 };
122 std::auto_ptr<Icon> m_icon;
114}; 123};
115 124
116} // end namespace FbTk 125} // end namespace FbTk