diff options
author | fluxgen <fluxgen> | 2003-04-14 12:13:36 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-04-14 12:13:36 (GMT) |
commit | f4ce449632eeb85aaeae63f32a7165d71047cde0 (patch) | |
tree | 22c3cf8815c69cf4397d0567fd07327e988f9981 /src/TextButton.hh | |
parent | 0c895209d2d1425389100e6be734b960475c6883 (diff) | |
download | fluxbox-f4ce449632eeb85aaeae63f32a7165d71047cde0.zip fluxbox-f4ce449632eeb85aaeae63f32a7165d71047cde0.tar.bz2 |
merged with embedded-tab-branch
Diffstat (limited to 'src/TextButton.hh')
-rw-r--r-- | src/TextButton.hh | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/TextButton.hh b/src/TextButton.hh new file mode 100644 index 0000000..77615aa --- /dev/null +++ b/src/TextButton.hh | |||
@@ -0,0 +1,59 @@ | |||
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.2 2003/04/14 12:08:50 fluxgen Exp $ | ||
23 | |||
24 | #ifndef TEXTBUTTON_HH | ||
25 | #define TEXTBUTTON_HH | ||
26 | |||
27 | #include "Button.hh" | ||
28 | #include "Text.hh" | ||
29 | #include <string> | ||
30 | |||
31 | namespace FbTk { | ||
32 | class Font; | ||
33 | }; | ||
34 | |||
35 | /// Displays a text on a button | ||
36 | class TextButton: public FbTk::Button { | ||
37 | public: | ||
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 | int bevel() const { return m_bevel; } | ||
52 | private: | ||
53 | const FbTk::Font *m_font; | ||
54 | std::string m_text; | ||
55 | FbTk::Justify m_justify; | ||
56 | int m_bevel; | ||
57 | }; | ||
58 | |||
59 | #endif // TEXTBUTTON_HH | ||