all repos — openbox @ cbf9dd0c4c8669392d9c7c8461d1af411f0ab0a4

openbox fork - make it a bit more like ryudo

beginnings of button class
Marius Nita marius@cs.pdx.edu
commit

cbf9dd0c4c8669392d9c7c8461d1af411f0ab0a4

parent

f0e2abf573760ab075b4683d7724f72f2d00f914

2 files changed, 65 insertions(+), 0 deletions(-)

jump to
A otk/button.cc

@@ -0,0 +1,31 @@

+#include "button.hh" + +namespace otk { + +OtkButton::OtkButton(OtkWidget *parent) + : OtkWidget(parent), _text(""), _pressed(false), + _unfocus_tx(OtkWidget::getStyle()->getButtonUnfocus()) +{ +} + +OtkButton::~OtkButton() +{ + +} + +void OtkButton::setText(const std::string &text) +{ + std::string a = text; +} + +void OtkButton::press(void) +{ + +} + +void OtkButton::release(void) +{ + +} + +}
A otk/button.hh

@@ -0,0 +1,34 @@

+#include "widget.hh" +#include "style.hh" +#include "texture.hh" +//#include "pixmap.hh" + +namespace otk { + +class OtkButton : public OtkWidget { + +public: + + OtkButton(OtkWidget *parent); + ~OtkButton(); + + inline const std::string &getText(void) const { return _text; } + void setText(const std::string &text); + + //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); + +private: + + std::string _text; + //OtkPixmap _pixmap; + bool _pressed; + BTexture *_unfocus_tx; + +}; + +}