oops adding the other OB Widgets

This commit is contained in:
Dana Jansens 2002-12-18 11:35:26 +00:00
parent 77a8e11660
commit 83727b8e64
4 changed files with 146 additions and 0 deletions

56
src/buttonwidget.cc Normal file
View file

@ -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
}
}

25
src/buttonwidget.hh Normal file
View file

@ -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

40
src/labelwidget.cc Normal file
View file

@ -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
}
}

25
src/labelwidget.hh Normal file
View file

@ -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