summaryrefslogtreecommitdiff
path: root/src/TextButton.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/TextButton.hh')
-rw-r--r--src/TextButton.hh64
1 files changed, 0 insertions, 64 deletions
diff --git a/src/TextButton.hh b/src/TextButton.hh
deleted file mode 100644
index 788f737..0000000
--- a/src/TextButton.hh
+++ /dev/null
@@ -1,64 +0,0 @@
1// TextButton.hh for Fluxbox Window Manager
2// Copyright (c) 2003 Henrik Kinnunen (fluxgen[at]fluxbox.org)
3//
4// Permission is hereby granted, free of charge, to any person obtaining a
5// copy of this software and associated documentation files (the "Software"),
6// to deal in the Software without restriction, including without limitation
7// the rights to use, copy, modify, merge, publish, distribute, sublicense,
8// and/or sell copies of the Software, and to permit persons to whom the
9// Software is furnished to do so, subject to the following conditions:
10//
11// The above copyright notice and this permission notice shall be included in
12// all copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE.
21
22// $Id: TextButton.hh,v 1.3 2003/08/11 14:42:03 fluxgen Exp $
23
24#ifndef TEXTBUTTON_HH
25#define TEXTBUTTON_HH
26
27#include "Button.hh"
28#include "Text.hh"
29#include <string>
30
31namespace FbTk {
32class Font;
33};
34
35/// Displays a text on a button
36class TextButton: public FbTk::Button {
37public:
38 TextButton(const FbTk::FbWindow &parent,
39 const FbTk::Font &font, const std::string &text);
40
41 void setJustify(FbTk::Justify just);
42 void setText(const std::string &text);
43 void setFont(const FbTk::Font &font);
44 void setBevel(int bevel);
45 /// clears window and redraw text
46 void clear();
47
48 inline FbTk::Justify justify() const { return m_justify; }
49 inline const std::string &text() const { return m_text; }
50 inline const FbTk::Font &font() const { return *m_font; }
51 unsigned int textWidth() const;
52 int bevel() const { return m_bevel; }
53
54protected:
55 void drawText(int x_offset = 0, int y_offset = 0);
56
57private:
58 const FbTk::Font *m_font;
59 std::string m_text;
60 FbTk::Justify m_justify;
61 int m_bevel;
62};
63
64#endif // TEXTBUTTON_HH