From 83727b8e6404f7e00e7369c39da8779dfb85ae09 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 18 Dec 2002 11:35:26 +0000 Subject: [PATCH] oops adding the other OB Widgets --- src/buttonwidget.cc | 56 +++++++++++++++++++++++++++++++++++++++++++++ src/buttonwidget.hh | 25 ++++++++++++++++++++ src/labelwidget.cc | 40 ++++++++++++++++++++++++++++++++ src/labelwidget.hh | 25 ++++++++++++++++++++ 4 files changed, 146 insertions(+) create mode 100644 src/buttonwidget.cc create mode 100644 src/buttonwidget.hh create mode 100644 src/labelwidget.cc create mode 100644 src/labelwidget.hh diff --git a/src/buttonwidget.cc b/src/buttonwidget.cc new file mode 100644 index 00000000..867cc5be --- /dev/null +++ b/src/buttonwidget.cc @@ -0,0 +1,56 @@ +// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- + +#ifdef HAVE_CONFIG_H +# include "../config.h" +#endif + +#include "buttonwidget.hh" + +namespace ob { + +OBButtonWidget::OBButtonWidget(otk::OtkWidget *parent, + OBWidget::WidgetType type) + : otk::OtkButton(parent), + OBWidget(type) +{ +} + + +OBButtonWidget::~OBButtonWidget() +{ +} + + +void OBButtonWidget::setStyle(otk::Style *style) +{ + otk::OtkButton::setStyle(style); + + switch (type()) { + case Type_LeftGrip: + case Type_RightGrip: + setTexture(style->getGripFocus()); + setUnfocusTexture(style->getGripUnfocus()); + setPressedFocusTexture(style->getGripFocus()); + setPressedUnfocusTexture(style->getGripUnfocus()); + setTexture(style->getGripFocus()); + setUnfocusTexture(style->getGripUnfocus()); + setPressedFocusTexture(style->getGripFocus()); + setPressedUnfocusTexture(style->getGripUnfocus()); + setBorderColor(_style->getBorderColor()); + setUnfocusBorderColor(style->getBorderColor()); + break; + default: + break; + } +} + + +void OBButtonWidget::adjust() +{ + otk::OtkButton::adjust(); + + // XXX: adjust shit +} + + +} diff --git a/src/buttonwidget.hh b/src/buttonwidget.hh new file mode 100644 index 00000000..bb23dd90 --- /dev/null +++ b/src/buttonwidget.hh @@ -0,0 +1,25 @@ +// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- +#ifndef __obbuttonwidget_hh +#define __obbuttonwidget_hh + +#include "otk/button.hh" +#include "widget.hh" + +namespace ob { + +class OBButtonWidget : public otk::OtkButton, public OBWidget +{ +private: + +public: + OBButtonWidget(otk::OtkWidget *parent, OBWidget::WidgetType type); + virtual ~OBButtonWidget(); + + virtual void setStyle(otk::Style *style); + + virtual void adjust(); +}; + +} + +#endif // __obbuttonwidget_hh diff --git a/src/labelwidget.cc b/src/labelwidget.cc new file mode 100644 index 00000000..9b18c0a9 --- /dev/null +++ b/src/labelwidget.cc @@ -0,0 +1,40 @@ +// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- + +#ifdef HAVE_CONFIG_H +# include "../config.h" +#endif + +#include "labelwidget.hh" + +namespace ob { + +OBLabelWidget::OBLabelWidget(otk::OtkWidget *parent, OBWidget::WidgetType type) + : otk::OtkFocusLabel(parent), + OBWidget(type) +{ +} + + +OBLabelWidget::~OBLabelWidget() +{ +} + + +void OBLabelWidget::setStyle(otk::Style *style) +{ + setTexture(style->getLabelFocus()); + setUnfocusTexture(style->getLabelUnfocus()); + + otk::OtkFocusLabel::setStyle(style); +} + + +void OBLabelWidget::adjust() +{ + otk::OtkFocusLabel::adjust(); + + // XXX: adjust shit +} + + +} diff --git a/src/labelwidget.hh b/src/labelwidget.hh new file mode 100644 index 00000000..def81fef --- /dev/null +++ b/src/labelwidget.hh @@ -0,0 +1,25 @@ +// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- +#ifndef __oblabelwidget_hh +#define __oblabelwidget_hh + +#include "otk/focuslabel.hh" +#include "widget.hh" + +namespace ob { + +class OBLabelWidget : public otk::OtkFocusLabel, public OBWidget +{ +private: + +public: + OBLabelWidget(otk::OtkWidget *parent, OBWidget::WidgetType type); + virtual ~OBLabelWidget(); + + virtual void setStyle(otk::Style *style); + + virtual void adjust(); +}; + +} + +#endif // __oblabelwidget_hh -- 2.45.2