2002-11-16 02:15:49 +00:00
|
|
|
#ifndef __widget_hh
|
|
|
|
#define __widget_hh
|
2002-11-13 10:21:17 +00:00
|
|
|
|
2002-12-04 13:07:40 +00:00
|
|
|
#include "basewidget.hh"
|
2002-11-10 13:33:34 +00:00
|
|
|
|
2002-11-17 09:41:58 +00:00
|
|
|
extern "C" {
|
|
|
|
#include <assert.h>
|
|
|
|
}
|
|
|
|
|
2002-11-10 13:33:34 +00:00
|
|
|
namespace otk {
|
|
|
|
|
2002-12-04 13:14:11 +00:00
|
|
|
class OtkWidget : public OtkBaseWidget {
|
2002-11-10 13:33:34 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2002-11-11 03:46:25 +00:00
|
|
|
enum Direction { Horizontal, Vertical };
|
|
|
|
|
|
|
|
OtkWidget(OtkWidget *parent, Direction = Horizontal);
|
2002-11-16 14:30:18 +00:00
|
|
|
OtkWidget(OtkEventDispatcher *event_dispatcher, Style *style,
|
|
|
|
Direction direction = Horizontal, Cursor cursor = 0,
|
|
|
|
int bevel_width = 1);
|
2002-11-10 13:33:34 +00:00
|
|
|
|
|
|
|
virtual ~OtkWidget();
|
|
|
|
|
2002-11-14 11:42:38 +00:00
|
|
|
virtual void update(void);
|
2002-11-13 10:21:17 +00:00
|
|
|
|
|
|
|
inline bool isStretchableHorz(void) const { return _stretchable_horz; }
|
2002-11-17 09:41:58 +00:00
|
|
|
void setStretchableHorz(bool s_horz = true) { _stretchable_horz = s_horz; }
|
2002-11-10 13:33:34 +00:00
|
|
|
|
2002-11-13 10:21:17 +00:00
|
|
|
inline bool isStretchableVert(void) const { return _stretchable_vert; }
|
2002-11-17 09:41:58 +00:00
|
|
|
void setStretchableVert(bool s_vert = true) { _stretchable_vert = s_vert; }
|
2002-11-10 13:33:34 +00:00
|
|
|
|
2002-11-11 03:46:25 +00:00
|
|
|
inline Direction getDirection(void) const { return _direction; }
|
|
|
|
void setDirection(Direction dir) { _direction = dir; }
|
|
|
|
|
2002-11-16 09:59:37 +00:00
|
|
|
inline OtkEventDispatcher *getEventDispatcher(void)
|
|
|
|
{ return _event_dispatcher; }
|
|
|
|
void setEventDispatcher(OtkEventDispatcher *disp);
|
|
|
|
|
2002-11-10 13:33:34 +00:00
|
|
|
private:
|
|
|
|
|
2002-11-13 10:21:17 +00:00
|
|
|
void adjust(void);
|
|
|
|
void adjustHorz(void);
|
|
|
|
void adjustVert(void);
|
|
|
|
void internalResize(int width, int height);
|
|
|
|
|
2002-11-11 03:46:25 +00:00
|
|
|
Direction _direction;
|
2002-11-10 13:33:34 +00:00
|
|
|
|
|
|
|
bool _stretchable_vert;
|
|
|
|
bool _stretchable_horz;
|
|
|
|
|
2002-11-16 09:59:37 +00:00
|
|
|
OtkEventDispatcher *_event_dispatcher;
|
2002-11-10 13:33:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
2002-11-13 10:21:17 +00:00
|
|
|
|
|
|
|
#endif // __widget_hh
|