aboutsummaryrefslogtreecommitdiff
path: root/src/CommandDialog.hh
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-12-19 03:53:21 (GMT)
committerfluxgen <fluxgen>2003-12-19 03:53:21 (GMT)
commit65a6213dbe1f71cbdb080dc95e8cd34bbc80afdb (patch)
tree8d2d565518bc9e06ebe85d063733de63b240bcd7 /src/CommandDialog.hh
parentc2042323b707a4c36e0408c1eef61981093a1468 (diff)
downloadfluxbox-65a6213dbe1f71cbdb080dc95e8cd34bbc80afdb.zip
fluxbox-65a6213dbe1f71cbdb080dc95e8cd34bbc80afdb.tar.bz2
generic command dialog, replaces old setworkspacename
Diffstat (limited to 'src/CommandDialog.hh')
-rw-r--r--src/CommandDialog.hh68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/CommandDialog.hh b/src/CommandDialog.hh
new file mode 100644
index 0000000..2bc0678
--- /dev/null
+++ b/src/CommandDialog.hh
@@ -0,0 +1,68 @@
1// CommandDialog.hh for Fluxbox
2// Copyright (c) 2003 Henrik Kinnunen (fluxgen(at)users.sourceforge.net)
3// and Simon Bowden (rathnor at users.sourceforge.net)
4//
5// Permission is hereby granted, free of charge, to any person obtaining a
6// copy of this software and associated documentation files (the "Software"),
7// to deal in the Software without restriction, including without limitation
8// the rights to use, copy, modify, merge, publish, distribute, sublicense,
9// and/or sell copies of the Software, and to permit persons to whom the
10// Software is furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE.
22
23// $Id: CommandDialog.hh,v 1.1 2003/12/19 03:53:21 fluxgen Exp $
24
25#ifndef RUNCOMMANDDIALOG_HH
26#define RUNCOMMANDDIALOG_HH
27
28#include "FbTk/TextBox.hh"
29#include "FbTk/TextButton.hh"
30#include "FbTk/Font.hh"
31#include "FbTk/GContext.hh"
32
33class BScreen;
34
35class CommandDialog: public FbTk::FbWindow, public FbTk::EventHandler {
36public:
37 CommandDialog(BScreen &screen, const std::string &title);
38 CommandDialog(BScreen &screen, const std::string &title,
39 const std::string &pre_command);
40 virtual ~CommandDialog();
41
42 void setText(const std::string &text);
43
44 void show();
45 void hide();
46
47 void motionNotifyEvent(XMotionEvent &event);
48 void buttonPressEvent(XButtonEvent &event);
49 void handleEvent(XEvent &event);
50 void keyPressEvent(XKeyEvent &event);
51
52private:
53 void init();
54
55 void render();
56
57 FbTk::Font m_font;
58 FbTk::TextBox m_textbox;
59 FbTk::TextButton m_label;
60 FbTk::GContext m_gc;
61 BScreen &m_screen;
62 int m_move_x, m_move_y;
63 Pixmap m_pixmap;
64 const std::string m_precommand; ///< command to be used before the text (usefull for setting workspace name)
65};
66
67
68#endif // SETWORKSPACENAME_HH