2003-01-11 19:17:13 +00:00
|
|
|
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
|
2002-11-16 02:15:49 +00:00
|
|
|
#ifndef __button_hh
|
|
|
|
#define __button_hh
|
|
|
|
|
2003-02-08 07:33:48 +00:00
|
|
|
#include "label.hh"
|
2002-11-11 03:47:12 +00:00
|
|
|
|
|
|
|
namespace otk {
|
|
|
|
|
2003-02-08 07:33:48 +00:00
|
|
|
class Button : public Label {
|
2002-11-11 03:47:12 +00:00
|
|
|
|
|
|
|
public:
|
2003-01-11 19:17:13 +00:00
|
|
|
Button(Widget *parent);
|
2003-02-08 07:33:48 +00:00
|
|
|
virtual ~Button();
|
2002-11-14 11:41:50 +00:00
|
|
|
|
2003-02-08 07:33:48 +00:00
|
|
|
virtual inline bool isPressed() const { return _pressed; }
|
2002-11-14 11:41:50 +00:00
|
|
|
|
2003-02-08 07:33:48 +00:00
|
|
|
virtual void press(unsigned int mouse_button);
|
|
|
|
virtual void release(unsigned int mouse_button);
|
2002-11-11 03:47:12 +00:00
|
|
|
|
2003-02-08 07:33:48 +00:00
|
|
|
virtual void buttonPressHandler(const XButtonEvent &e);
|
|
|
|
virtual void buttonReleaseHandler(const XButtonEvent &e);
|
2002-11-14 11:41:50 +00:00
|
|
|
|
2003-02-08 07:33:48 +00:00
|
|
|
virtual void styleChanged(const 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-11 03:47:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
2002-11-16 02:15:49 +00:00
|
|
|
|
|
|
|
#endif
|