openbox/otk/button.hh

53 lines
1.2 KiB
C++
Raw Normal View History

// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#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 {
class Button : public FocusLabel {
2002-11-11 03:47:12 +00:00
public:
Button(Widget *parent);
~Button();
2002-11-11 03:47:12 +00:00
2003-01-20 06:11:12 +00:00
inline const RenderTexture *getPressedFocusTexture(void) const
2002-11-14 11:41:50 +00:00
{ return _pressed_focus_tx; }
2003-01-20 06:11:12 +00:00
void setPressedFocusTexture(RenderTexture *texture)
2002-11-14 11:41:50 +00:00
{ _pressed_focus_tx = texture; }
2003-01-20 06:11:12 +00:00
inline const RenderTexture *getPressedUnfocusTexture(void) const
2002-11-14 11:41:50 +00:00
{ return _pressed_unfocus_tx; }
2003-01-20 06:11:12 +00:00
void setPressedUnfocusTexture(RenderTexture *texture)
2002-11-14 11:41:50 +00:00
{ _pressed_unfocus_tx = texture; }
2003-01-20 06:11:12 +00:00
void setTexture(RenderTexture *texture);
void setUnfocusTexture(RenderTexture *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
2003-01-22 22:46:16 +00:00
virtual void setStyle(RenderStyle *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
2003-01-20 06:11:12 +00:00
RenderTexture *_pressed_focus_tx;
RenderTexture *_pressed_unfocus_tx;
2002-11-11 03:47:12 +00:00
2003-01-20 06:11:12 +00:00
RenderTexture *_unpr_focus_tx;
RenderTexture *_unpr_unfocus_tx;
2002-11-11 03:47:12 +00:00
};
}
#endif