news download themes documentation links










IconButton.hh

00001 // IconButton.hh
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: IconButton.hh,v 1.4 2003/11/27 14:27:48 fluxgen Exp $
00024 
00025 #ifndef ICONBUTTON_HH
00026 #define ICONBUTTON_HH
00027 
00028 #include "FbTk/FbPixmap.hh"
00029 #include "FbTk/Observer.hh"
00030 #include "FbTk/TextButton.hh"
00031 
00032 class FluxboxWindow;
00033 
00034 class IconButton: public FbTk::TextButton, public FbTk::Observer {
00035 public:
00036     IconButton(const FbTk::FbWindow &parent, const FbTk::Font &font, 
00037                FluxboxWindow &window);
00038     virtual ~IconButton();
00039 
00040     void exposeEvent(XExposeEvent &event);
00041     void clear();
00042     void clearArea(int x, int y,
00043                    unsigned int width, unsigned int height,
00044                    bool exposure = false);
00045     void moveResize(int x, int y,
00046                     unsigned int width, unsigned int height);
00047     void resize(unsigned int width, unsigned int height);
00048 
00049     void update(FbTk::Subject *subj);
00050     void setPixmap(bool use);
00051 
00052     FluxboxWindow &win() { return m_win; }
00053     const FluxboxWindow &win() const { return m_win; }
00054 
00055 protected:
00056     void drawText(int x = 0, int y = 0);
00057 private:
00058     void setupWindow();
00059 
00060     FluxboxWindow &m_win;
00061     FbTk::FbWindow m_icon_window;
00062     FbTk::FbPixmap m_icon_pixmap;
00063     FbTk::FbPixmap m_icon_mask;
00064     bool m_use_pixmap;
00065 };
00066 
00067 #endif // ICONBUTTON_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