Author: mordante
Date: Wed Apr 30 20:39:59 2008
New Revision: 26264
URL: http://svn.gna.org/viewcvs/wesnoth?rev=26264&view=rev
Log:
More cleanups.
Modified:
trunk/src/gui/widgets/grid.cpp
trunk/src/gui/widgets/grid.hpp
trunk/src/gui/widgets/panel.hpp
trunk/src/gui/widgets/window_builder.cpp
Modified: trunk/src/gui/widgets/grid.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/grid.cpp?rev=26264&r1=26263&r2=26264&view=diff
==============================================================================
--- trunk/src/gui/widgets/grid.cpp (original)
+++ trunk/src/gui/widgets/grid.cpp Wed Apr 30 20:39:59 2008
@@ -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_(),
Modified: trunk/src/gui/widgets/grid.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/grid.hpp?rev=26264&r1=26263&r2=26264&view=diff
==============================================================================
--- trunk/src/gui/widgets/grid.hpp (original)
+++ trunk/src/gui/widgets/grid.hpp Wed Apr 30 20:39:59 2008
@@ -28,43 +28,28 @@
public:
// ***** ***** FLAGS ***** *****
-// static const unsigned VERTICAL_RESIZE_GROW = 1 << 1;
- static const unsigned VERTICAL_GROW_SEND_TO_CLIENT = 1 << 2;
-
- 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 HORIZONTAL_RESIZE_GROW = 1 << 16;
- static const unsigned HORIZONTAL_GROW_SEND_TO_CLIENT = 1 << 17;
-
- 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 VERTICAL_GROW_SEND_TO_CLIENT = 1 << 0;
+
+ 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_ALIGN_LEFT = 3 << 4;
+ static const unsigned HORIZONTAL_ALIGN_CENTER = 2 << 4;
+ static const unsigned HORIZONTAL_ALIGN_RIGHT = 1 << 4;
+
+ 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 @@
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
Modified: trunk/src/gui/widgets/panel.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/panel.hpp?rev=26264&r1=26263&r2=26264&view=diff
==============================================================================
--- trunk/src/gui/widgets/panel.hpp (original)
+++ trunk/src/gui/widgets/panel.hpp Wed Apr 30 20:39:59 2008
@@ -31,7 +31,7 @@
//! @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 @@
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); }
Modified: trunk/src/gui/widgets/window_builder.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/window_builder.cpp?rev=26264&r1=26263&r2=26264&view=diff
==============================================================================
--- trunk/src/gui/widgets/window_builder.cpp (original)
+++ trunk/src/gui/widgets/window_builder.cpp Wed Apr 30 20:39:59 2008
@@ -543,7 +543,7 @@
twidget* tbuilder_grid::build() const
{
- tgrid *grid = new tgrid(0, 0, 0, 0);
+ tgrid *grid = new tgrid();
grid->set_rows_cols(rows, cols);
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits