Add Widget::get/setBorder().

This commit is contained in:
David Capello 2011-01-27 23:30:11 -03:00
parent 034a943a0c
commit 1738a93fca
2 changed files with 17 additions and 0 deletions

View File

@ -679,6 +679,19 @@ void Widget::setBounds(const Rect& rc)
jwidget_set_rect(this, &jrc);
}
Border Widget::getBorder() const
{
return Border(border_width.l, border_width.t, border_width.r, border_width.b);
}
void Widget::setBorder(const Border& br)
{
border_width.l = br.left();
border_width.t = br.top();
border_width.r = br.right();
border_width.b = br.bottom();
}
void jwidget_relayout(JWidget widget)
{
jwidget_set_rect(widget, widget->rc);

View File

@ -10,6 +10,7 @@
#include <string>
#include "gfx/rect.h"
#include "gfx/border.h"
#include "gui/component.h"
#include "gui/jbase.h"
#include "gui/jrect.h"
@ -243,6 +244,9 @@ public:
gfx::Rect getBounds() const;
void setBounds(const gfx::Rect& rc);
gfx::Border getBorder() const;
void setBorder(const gfx::Border& border);
// ===============================================================
// REFRESH ISSUES
// ===============================================================