openbox/otk/button.hh

52 lines
1.1 KiB
C++
Raw Normal View History

#ifndef __button_hh
#define __button_hh
2002-11-16 13:21:24 +00:00
#include "focuslabel.hh"
2002-11-11 03:47:12 +00:00
namespace otk {
2002-11-16 13:21:24 +00:00
class OtkButton : public OtkFocusLabel {
2002-11-11 03:47:12 +00:00
public:
OtkButton(OtkWidget *parent);
~OtkButton();
2002-12-24 21:27:16 +00:00
inline const otk::BTexture *getPressedFocusTexture(void) const
2002-11-14 11:41:50 +00:00
{ return _pressed_focus_tx; }
2002-12-24 21:27:16 +00:00
void setPressedFocusTexture(otk::BTexture *texture)
2002-11-14 11:41:50 +00:00
{ _pressed_focus_tx = texture; }
2002-12-24 21:27:16 +00:00
inline const otk::BTexture *getPressedUnfocusTexture(void) const
2002-11-14 11:41:50 +00:00
{ return _pressed_unfocus_tx; }
2002-12-24 21:27:16 +00:00
void setPressedUnfocusTexture(otk::BTexture *texture)
2002-11-14 11:41:50 +00:00
{ _pressed_unfocus_tx = texture; }
2002-12-24 21:27:16 +00:00
void setTexture(otk::BTexture *texture);
void setUnfocusTexture(otk::BTexture *texture);
2002-11-14 11:41:50 +00:00
2002-11-11 03:47:12 +00:00
inline bool isPressed(void) const { return _pressed; }
2002-11-16 13:21:24 +00:00
void press(unsigned int mouse_button);
void release(unsigned int mouse_button);
2002-11-11 03:47:12 +00:00
void buttonPressHandler(const XButtonEvent &e);
void buttonReleaseHandler(const XButtonEvent &e);
2002-11-14 11:41:50 +00:00
2002-12-24 21:27:16 +00:00
virtual void setStyle(otk::Style *style);
2002-11-11 03:47:12 +00:00
private:
bool _pressed;
2002-11-16 13:21:24 +00:00
unsigned int _mouse_button;
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
};
}
#endif