aboutsummaryrefslogtreecommitdiff
path: root/src/CommandDialog.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/CommandDialog.hh')
-rw-r--r--src/CommandDialog.hh75
1 files changed, 75 insertions, 0 deletions
diff --git a/src/CommandDialog.hh b/src/CommandDialog.hh
new file mode 100644
index 0000000..bc9d3a6
--- /dev/null
+++ b/src/CommandDialog.hh
@@ -0,0 +1,75 @@
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.3 2004/01/02 13:48:28 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#include "FbTk/Command.hh"
33#include "FbTk/RefCount.hh"
34
35class BScreen;
36
37class CommandDialog: public FbTk::FbWindow, public FbTk::EventHandler {
38public:
39 CommandDialog(BScreen &screen, const std::string &title);
40 CommandDialog(BScreen &screen, const std::string &title,
41 const std::string &pre_command);
42 virtual ~CommandDialog();
43
44 void setText(const std::string &text);
45 void setPostCommand(FbTk::RefCount<FbTk::Command> &postcommand) { m_postcommand = postcommand; }
46 void show();
47 void hide();
48
49 void exposeEvent(XExposeEvent &event);
50 void motionNotifyEvent(XMotionEvent &event);
51 void buttonPressEvent(XButtonEvent &event);
52 void handleEvent(XEvent &event);
53 void keyPressEvent(XKeyEvent &event);
54
55protected:
56 virtual void tabComplete();
57
58private:
59 void init();
60 void render();
61 void updateSizes();
62
63 FbTk::Font m_font;
64 FbTk::TextBox m_textbox;
65 FbTk::TextButton m_label;
66 FbTk::GContext m_gc;
67 FbTk::RefCount<FbTk::Command> m_postcommand; ///< command to do after the first command was issued (like reconfigure)
68 BScreen &m_screen;
69 int m_move_x, m_move_y;
70 Pixmap m_pixmap;
71 const std::string m_precommand; ///< command to be used before the text (usefull for setting workspace name)
72};
73
74
75#endif // SETWORKSPACENAME_HH