More cleanups.

This commit is contained in:
Mark de Wever 2008-04-30 18:39:59 +00:00
parent 2c3d8719f2
commit de5a5dc3dd
4 changed files with 16 additions and 47 deletions

View file

@ -43,12 +43,9 @@
namespace gui2 {
tgrid::tgrid(const unsigned rows, const unsigned cols,
const unsigned default_flags, const unsigned default_border_size) :
tgrid::tgrid(const unsigned rows, const unsigned cols) :
rows_(rows),
cols_(cols),
default_flags_(default_flags),
default_border_size_(default_border_size),
best_row_height_(),
best_col_width_(),
minimum_row_height_(),

View file

@ -28,43 +28,28 @@ class tgrid : public virtual twidget
public:
// ***** ***** FLAGS ***** *****
// static const unsigned VERTICAL_RESIZE_GROW = 1 << 1;
static const unsigned VERTICAL_GROW_SEND_TO_CLIENT = 1 << 2;
static const unsigned VERTICAL_GROW_SEND_TO_CLIENT = 1 << 0;
static const unsigned VERTICAL_ALIGN_TOP = 3 << 4;
static const unsigned VERTICAL_ALIGN_CENTER = 2 << 4;
static const unsigned VERTICAL_ALIGN_BOTTOM = 1 << 4;
// static const unsigned VERTICAL_ALIGN_LANGUAGE = 0 << 4;
static const unsigned VERTICAL_ALIGN_TOP = 3 << 1;
static const unsigned VERTICAL_ALIGN_CENTER = 2 << 1;
static const unsigned VERTICAL_ALIGN_BOTTOM = 1 << 1;
static const unsigned HORIZONTAL_GROW_SEND_TO_CLIENT = 1 << 3;
// static const unsigned HORIZONTAL_RESIZE_GROW = 1 << 16;
static const unsigned HORIZONTAL_GROW_SEND_TO_CLIENT = 1 << 17;
static const unsigned HORIZONTAL_ALIGN_LEFT = 3 << 4;
static const unsigned HORIZONTAL_ALIGN_CENTER = 2 << 4;
static const unsigned HORIZONTAL_ALIGN_RIGHT = 1 << 4;
static const unsigned HORIZONTAL_ALIGN_LEFT = 3 << 18;
static const unsigned HORIZONTAL_ALIGN_CENTER = 2 << 18;
static const unsigned HORIZONTAL_ALIGN_RIGHT = 1 << 18;
// static const unsigned HORIZONTAL_ALIGN_LANGUAGE = 0 << 18;
static const unsigned BORDER_TOP = 1 << 24;
static const unsigned BORDER_BOTTOM = 1 << 25;
static const unsigned BORDER_LEFT = 1 << 26;
static const unsigned BORDER_RIGHT = 1 << 27;
static const unsigned BORDER_TOP = 1 << 6;
static const unsigned BORDER_BOTTOM = 1 << 7;
static const unsigned BORDER_LEFT = 1 << 8;
static const unsigned BORDER_RIGHT = 1 << 9;
tgrid(const unsigned rows, const unsigned cols,
const unsigned default_flags, const unsigned default_border_size);
tgrid(const unsigned rows = 0, const unsigned cols = 0);
virtual ~tgrid();
#if 0
// FIXME if these are really not needed remove them.
void add_child(twidget* widget, const unsigned row, const unsigned col, const unsigned flags)
{ add_child(widget, row, col, flags, default_border_size_); }
void add_child(twidget* widget, const unsigned row, const unsigned col)
{ add_child(widget, row, col, default_flags_, default_border_size_); }
#endif
void add_child(twidget* widget, const unsigned row,
const unsigned col, const unsigned flags, const unsigned border_size);
@ -214,12 +199,6 @@ private:
unsigned rows_;
unsigned cols_;
//! Default flags for a grid cell.
const unsigned default_flags_;
//! Default border size for a grid cell.
const unsigned default_border_size_;
//! The optimal row heights / col widths.
mutable std::vector<unsigned> best_row_height_; //FIXME implement
mutable std::vector<unsigned> best_col_width_; //FIXME implement

View file

@ -31,7 +31,7 @@ public:
//! @param canvas_count The canvas count for tcontrol.
tpanel(const bool load_conf = true, const unsigned canvas_count = 2) :
tcontrol(canvas_count),
grid_(0, 0, 0, 0)
grid_()
{
if(load_conf) load_config();
grid_.set_parent(this);
@ -73,14 +73,7 @@ public:
void set_rows_cols(const unsigned rows, const unsigned cols)
{ grid_.set_rows_cols(rows, cols); }
#if 0
// FIXME if these are really not needed remove them.
void add_child(twidget* widget, const unsigned row, const unsigned col)
{ grid_.add_child(widget, row, col); }
void add_child(twidget* widget, const unsigned row, const unsigned col, const unsigned flags)
{ grid_.add_child(widget, row, col, flags); }
#endif
void add_child(twidget* widget, const unsigned row,
const unsigned col, const unsigned flags, const unsigned border_size)
{ grid_.add_child(widget, row, col, flags, border_size); }

View file

@ -543,7 +543,7 @@ twidget* tbuilder_text_box::build() const
twidget* tbuilder_grid::build() const
{
tgrid *grid = new tgrid(0, 0, 0, 0);
tgrid *grid = new tgrid();
grid->set_rows_cols(rows, cols);