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 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