openbox/otk/button.hh

55 lines
1.3 KiB
C++
Raw Normal View History

2002-11-14 11:41:50 +00:00
#include "focuswidget.hh"
2002-11-11 03:47:12 +00:00
//#include "pixmap.hh"
namespace otk {
2002-11-14 11:41:50 +00:00
class OtkButton : public OtkFocusWidget {
2002-11-11 03:47:12 +00:00
public:
OtkButton(OtkWidget *parent);
~OtkButton();
2002-11-14 11:41:50 +00:00
inline const BTexture *getPressedFocusTexture(void) const
{ return _pressed_focus_tx; }
void setPressedFocusTexture(BTexture *texture)
{ _pressed_focus_tx = texture; }
inline const BTexture *getPressedUnfocusTexture(void) const
{ return _pressed_unfocus_tx; }
void setPressedUnfocusTexture(BTexture *texture)
{ _pressed_unfocus_tx = texture; }
void setTexture(BTexture *texture);
void setUnfocusTexture(BTexture *texture);
2002-11-11 03:47:12 +00:00
inline const std::string &getText(void) const { return _text; }
2002-11-14 11:41:50 +00:00
void setText(const std::string &text) { _text = text; _dirty = true; }
2002-11-11 03:47:12 +00:00
//inline const OtkPixmap &getPixmap(void) const { return _pixmap; }
//void setPixmap(const OtkPixmap &pixmap);
inline bool isPressed(void) const { return _pressed; }
void press(void);
void release(void);
virtual void update(void);
virtual bool expose(const XExposeEvent &e);
2002-11-15 03:10:34 +00:00
virtual bool configure(const XConfigureEvent &e);
2002-11-14 11:41:50 +00:00
2002-11-11 03:47:12 +00:00
private:
std::string _text;
//OtkPixmap _pixmap;
bool _pressed;
bool _dirty;
2002-11-14 11:41:50 +00:00
BTexture *_pressed_focus_tx;
BTexture *_pressed_unfocus_tx;
2002-11-11 03:47:12 +00:00
2002-11-14 11:41:50 +00:00
BTexture *_unpr_focus_tx;
BTexture *_unpr_unfocus_tx;
2002-11-11 03:47:12 +00:00
};
}