aboutsummaryrefslogtreecommitdiff
path: root/src/CommandDialog.hh
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-08-17 11:10:17 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-08-17 11:10:17 (GMT)
commita23778a44d2469fdc414884f5fe72fde09c100cc (patch)
treedcff8778bef2f70fb1112f60f6de290a0aebe777 /src/CommandDialog.hh
parent72fd5e03a48396e6feec86534d266c68a9edd915 (diff)
downloadfluxbox-a23778a44d2469fdc414884f5fe72fde09c100cc.zip
fluxbox-a23778a44d2469fdc414884f5fe72fde09c100cc.tar.bz2
add SetTitle and SetTitleDialog key commands
Diffstat (limited to 'src/CommandDialog.hh')
-rw-r--r--src/CommandDialog.hh36
1 files changed, 6 insertions, 30 deletions
diff --git a/src/CommandDialog.hh b/src/CommandDialog.hh
index bd0a6df..0e12ce3 100644
--- a/src/CommandDialog.hh
+++ b/src/CommandDialog.hh
@@ -23,26 +23,20 @@
23#ifndef RUNCOMMANDDIALOG_HH 23#ifndef RUNCOMMANDDIALOG_HH
24#define RUNCOMMANDDIALOG_HH 24#define RUNCOMMANDDIALOG_HH
25 25
26#include "FbTk/TextBox.hh" 26#include "TextDialog.hh"
27#include "FbTk/TextButton.hh"
28#include "FbTk/GContext.hh"
29#include "FbTk/RefCount.hh" 27#include "FbTk/RefCount.hh"
30 28
31class BScreen;
32class Command; 29class Command;
33 30
34/** 31/**
35 * Displays a fluxbox command dialog which executes fluxbox 32 * Displays a fluxbox command dialog which executes fluxbox
36 * action commands. 33 * action commands.
37 */ 34 */
38class CommandDialog: public FbTk::FbWindow, public FbTk::EventHandler { 35class CommandDialog: public TextDialog {
39public: 36public:
40 CommandDialog(BScreen &screen, const std::string &title, 37 CommandDialog(BScreen &screen, const std::string &title,
41 const std::string pre_command = ""); 38 const std::string pre_command = "");
42 virtual ~CommandDialog(); 39
43
44 /// Sets the entry text.
45 void setText(const std::string &text);
46 /** 40 /**
47 * Sets the command to be executed after the command is done. 41 * Sets the command to be executed after the command is done.
48 * @param postcommand the command. 42 * @param postcommand the command.
@@ -50,32 +44,14 @@ public:
50 void setPostCommand(FbTk::RefCount<FbTk::Command<void> > &postcommand) { 44 void setPostCommand(FbTk::RefCount<FbTk::Command<void> > &postcommand) {
51 m_postcommand = postcommand; 45 m_postcommand = postcommand;
52 } 46 }
53 void show();
54 void hide();
55
56 void exposeEvent(XExposeEvent &event);
57 void motionNotifyEvent(XMotionEvent &event);
58 void buttonPressEvent(XButtonEvent &event);
59 void handleEvent(XEvent &event);
60 void keyPressEvent(XKeyEvent &event);
61
62protected:
63 /// expand the current word, using the history as a references
64 virtual void tabComplete();
65 47
66private: 48private:
67 void init(); 49 /// expand the current word, using the history as a references
68 void render(); 50 void tabComplete();
69 void updateSizes(); 51 void exec(const std::string &string);
70 52
71 FbTk::TextBox m_textbox; //< entry field
72 FbTk::TextButton m_label; //< text in the titlebar
73 FbTk::GContext m_gc;
74 /// command to do after the first command was issued (like reconfigure) 53 /// command to do after the first command was issued (like reconfigure)
75 FbTk::RefCount<FbTk::Command<void> > m_postcommand; 54 FbTk::RefCount<FbTk::Command<void> > m_postcommand;
76 BScreen &m_screen;
77 int m_move_x, m_move_y;
78 Pixmap m_pixmap;
79 /// command to be used before the text (usefull for setting workspace name) 55 /// command to be used before the text (usefull for setting workspace name)
80 const std::string m_precommand; 56 const std::string m_precommand;
81}; 57};