00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef RUNCOMMANDDIALOG_HH
00026 #define RUNCOMMANDDIALOG_HH
00027
00028 #include "FbTk/TextBox.hh"
00029 #include "FbTk/TextButton.hh"
00030 #include "FbTk/Font.hh"
00031 #include "FbTk/GContext.hh"
00032 #include "FbTk/Command.hh"
00033 #include "FbTk/RefCount.hh"
00034
00035 class BScreen;
00036
00037 class CommandDialog: public FbTk::FbWindow, public FbTk::EventHandler {
00038 public:
00039 CommandDialog(BScreen &screen, const std::string &title);
00040 CommandDialog(BScreen &screen, const std::string &title,
00041 const std::string &pre_command);
00042 virtual ~CommandDialog();
00043
00044 void setText(const std::string &text);
00045 void setPostCommand(FbTk::RefCount<FbTk::Command> &postcommand) { m_postcommand = postcommand; }
00046 void show();
00047 void hide();
00048
00049 void exposeEvent(XExposeEvent &event);
00050 void motionNotifyEvent(XMotionEvent &event);
00051 void buttonPressEvent(XButtonEvent &event);
00052 void handleEvent(XEvent &event);
00053 void keyPressEvent(XKeyEvent &event);
00054
00055 protected:
00056 virtual void tabComplete();
00057
00058 private:
00059 void init();
00060 void render();
00061 void updateSizes();
00062
00063 FbTk::Font m_font;
00064 FbTk::TextBox m_textbox;
00065 FbTk::TextButton m_label;
00066 FbTk::GContext m_gc;
00067 FbTk::RefCount<FbTk::Command> m_postcommand;
00068 BScreen &m_screen;
00069 int m_move_x, m_move_y;
00070 Pixmap m_pixmap;
00071 const std::string m_precommand;
00072 };
00073
00074
00075 #endif // SETWORKSPACENAME_HH