aboutsummaryrefslogtreecommitdiff
path: root/util/fbrun/FbRun.hh
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-08-27 00:20:19 (GMT)
committerfluxgen <fluxgen>2003-08-27 00:20:19 (GMT)
commit3e99a0752783eeb0de19eb07be47f8e1128d70f7 (patch)
treee6029e3df01e54fdb98909a4d2082c19221d9b6f /util/fbrun/FbRun.hh
parent450c1d80f6f1c62a17c7231aec400a06e8a22b0b (diff)
downloadfluxbox-3e99a0752783eeb0de19eb07be47f8e1128d70f7.zip
fluxbox-3e99a0752783eeb0de19eb07be47f8e1128d70f7.tar.bz2
using FbTk TextBox
Diffstat (limited to 'util/fbrun/FbRun.hh')
-rw-r--r--util/fbrun/FbRun.hh25
1 files changed, 6 insertions, 19 deletions
diff --git a/util/fbrun/FbRun.hh b/util/fbrun/FbRun.hh
index dfc74cc..f6a544c 100644
--- a/util/fbrun/FbRun.hh
+++ b/util/fbrun/FbRun.hh
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: FbRun.hh,v 1.12 2003/08/25 01:16:41 fluxgen Exp $ 22// $Id: FbRun.hh,v 1.13 2003/08/27 00:19:57 fluxgen Exp $
23 23
24#ifndef FBRUN_HH 24#ifndef FBRUN_HH
25#define FBRUN_HH 25#define FBRUN_HH
@@ -27,6 +27,7 @@
27#include "EventHandler.hh" 27#include "EventHandler.hh"
28#include "Font.hh" 28#include "Font.hh"
29#include "FbWindow.hh" 29#include "FbWindow.hh"
30#include "TextBox.hh"
30 31
31#include <string> 32#include <string>
32#include <vector> 33#include <vector>
@@ -34,19 +35,17 @@
34/** 35/**
35 Creates and managed a run window 36 Creates and managed a run window
36*/ 37*/
37class FbRun: public FbTk::EventHandler, public FbTk::FbWindow { 38class FbRun: public FbTk::TextBox {
38public: 39public:
39 FbRun(int x = 0, int y = 0, size_t width = 200); 40 FbRun(int x = 0, int y = 0, size_t width = 200);
40 ~FbRun(); 41 ~FbRun();
41 void handleEvent(XEvent * const ev); 42 void handleEvent(XEvent * const ev);
42 void setText(const std::string &text);
43 void setTitle(const std::string &title); 43 void setTitle(const std::string &title);
44 void resize(size_t width, size_t height); 44 void resize(unsigned int width, unsigned int height);
45 45
46 /// load and reconfigure for new font 46 /// load and reconfigure for new font
47 bool loadFont(const std::string &fontname); 47 bool loadFont(const std::string &fontname);
48 void setForegroundColor(const FbTk::Color &color); 48 void setForegroundColor(const FbTk::Color &color);
49 void setBackgroundColor(const FbTk::Color &color);
50 void setAntialias(bool val) { m_font.setAntialias(val); } 49 void setAntialias(bool val) { m_font.setAntialias(val); }
51 const FbTk::Font &font() const { return m_font; } 50 const FbTk::Font &font() const { return m_font; }
52 /// execute command and exit 51 /// execute command and exit
@@ -62,15 +61,12 @@ public:
62 @name events 61 @name events
63 */ 62 */
64 ///@{ 63 ///@{
65 void exposeEvent(XExposeEvent &ev);
66 void keyPressEvent(XKeyEvent &ev); 64 void keyPressEvent(XKeyEvent &ev);
67 ///@} 65 ///@}
68 66
69private: 67private:
70 void nextHistoryItem(); 68 void nextHistoryItem();
71 void prevHistoryItem(); 69 void prevHistoryItem();
72 void cursorLeft();
73 void cursorRight();
74 void drawString(int x, int y, const char *text, size_t len); 70 void drawString(int x, int y, const char *text, size_t len);
75 void getSize(size_t &width, size_t &height); 71 void getSize(size_t &width, size_t &height);
76 void createWindow(int x, int y, size_t width, size_t height); 72 void createWindow(int x, int y, size_t width, size_t height);
@@ -78,12 +74,7 @@ private:
78 /// set no maximizable for this window 74 /// set no maximizable for this window
79 void setNoMaximize(); 75 void setNoMaximize();
80 76
81 void cursorHome(); 77 void insertCharacter(char key);
82 void cursorEnd();
83 void backspace();
84 void deleteForward();
85 void killToEnd();
86 void insertCharacter(KeySym ks, char *keychar);
87 void adjustStartPos(); 78 void adjustStartPos();
88 void adjustEndPos(); 79 void adjustEndPos();
89 void firstHistoryItem(); 80 void firstHistoryItem();
@@ -92,8 +83,7 @@ private:
92 83
93 FbTk::Font m_font; ///< font used to draw command text 84 FbTk::Font m_font; ///< font used to draw command text
94 Display *m_display; ///< display connection 85 Display *m_display; ///< display connection
95 std::string m_runtext; ///< command to execute 86 int m_bevel;
96 int m_bevel; ///< distance to window edge from font in pixels
97 GC m_gc; ///< graphic context 87 GC m_gc; ///< graphic context
98 bool m_end; ///< marks when this object is done 88 bool m_end; ///< marks when this object is done
99 std::vector<std::string> m_history; ///< history list of commands 89 std::vector<std::string> m_history; ///< history list of commands
@@ -101,9 +91,6 @@ private:
101 std::string m_history_file; ///< holds filename for command history file 91 std::string m_history_file; ///< holds filename for command history file
102 Cursor m_cursor; 92 Cursor m_cursor;
103 93
104 int m_start_pos; ///< start position of portion of text to display
105 int m_cursor_pos; ///< relative to m_start_pos
106 int m_end_pos; ///< end postition of portion of text to display
107 Pixmap m_pixmap; 94 Pixmap m_pixmap;
108}; 95};
109 96