news download themes documentation links










CommandDialog.hh

00001 // CommandDialog.hh for Fluxbox
00002 // Copyright (c) 2003 Henrik Kinnunen (fluxgen(at)users.sourceforge.net)
00003 //                and Simon Bowden    (rathnor at users.sourceforge.net)
00004 //
00005 // Permission is hereby granted, free of charge, to any person obtaining a
00006 // copy of this software and associated documentation files (the "Software"),
00007 // to deal in the Software without restriction, including without limitation
00008 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
00009 // and/or sell copies of the Software, and to permit persons to whom the
00010 // Software is furnished to do so, subject to the following conditions:
00011 //
00012 // The above copyright notice and this permission notice shall be included in
00013 // all copies or substantial portions of the Software.
00014 //
00015 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00016 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00017 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
00018 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00019 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00020 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00021 // DEALINGS IN THE SOFTWARE.
00022 
00023 // $Id: CommandDialog.hh,v 1.3 2004/01/02 13:48:28 fluxgen Exp $
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

Fluxbox CVS-Jan-2003




      



Got comments about the page? Send them to webmaster.
If you have general Fluxbox related questions ask them on our irc channel or mailing lists.

Show Source








Designed by aLEczapKA