Author: mordante
Date: Sun Feb 14 20:36:25 2010
New Revision: 41213

URL: http://svn.gna.org/viewcvs/wesnoth?rev=41213&view=rev
Log:
Add a new set_size version.

This version only sets the size, which will be used in the new tree view
to place its members.

Modified:
    trunk/src/gui/widgets/grid.hpp
    trunk/src/gui/widgets/widget.cpp
    trunk/src/gui/widgets/widget.hpp

Modified: trunk/src/gui/widgets/grid.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/grid.hpp?rev=41213&r1=41212&r2=41213&view=diff
==============================================================================
--- trunk/src/gui/widgets/grid.hpp (original)
+++ trunk/src/gui/widgets/grid.hpp Sun Feb 14 20:36:25 2010
@@ -236,6 +236,8 @@
        /** Inherited from twidget. */
        void set_size(const tpoint& origin, const tpoint& size);
 
+       using twidget::set_size;
+
        /***** ***** ***** ***** Inherited ***** ***** ***** *****/
 
        /** Inherited from twidget. */

Modified: trunk/src/gui/widgets/widget.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/widget.cpp?rev=41213&r1=41212&r2=41213&view=diff
==============================================================================
--- trunk/src/gui/widgets/widget.cpp (original)
+++ trunk/src/gui/widgets/widget.cpp Sun Feb 14 20:36:25 2010
@@ -124,6 +124,17 @@
        set_dirty();
 }
 
+void twidget::set_size(const tpoint& size)
+{
+       assert(size.x >= 0);
+       assert(size.y >= 0);
+
+       w_ = size.x;
+       h_ = size.y;
+
+       set_dirty();
+}
+
 twidget* twidget::find_at(const tpoint& coordinate,
                const bool must_be_active)
 {

Modified: trunk/src/gui/widgets/widget.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/widget.hpp?rev=41213&r1=41212&r2=41213&view=diff
==============================================================================
--- trunk/src/gui/widgets/widget.hpp (original)
+++ trunk/src/gui/widgets/widget.hpp Sun Feb 14 20:36:25 2010
@@ -240,6 +240,17 @@
         */
        virtual void set_size(const tpoint& origin, const tpoint& size);
 
+       /**
+        * Sets the size of the widget.
+        *
+        * This version is meant to resize a widget, since the origin isn't
+        * modified. This can be used if a widget needs to change its size and 
the
+        * layout will be fixed later.
+        *
+        * @param size                The size of the widget.
+        */
+       virtual void set_size(const tpoint& size);
+
        /***** ***** ***** ***** query ***** ***** ***** *****/
 
        /**


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to