mail[Wesnoth-commits] r27318 - in /trunk/src/gui/widgets: panel.cpp panel.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by koraq on June 20, 2008 - 12:38:
Author: mordante
Date: Thu Jun 19 17:12:54 2008
New Revision: 27318

URL: http://svn.gna.org/viewcvs/wesnoth?rev=27318&view=rev
Log:
Comment cleanups.

Modified:
    trunk/src/gui/widgets/panel.cpp
    trunk/src/gui/widgets/panel.hpp

Modified: trunk/src/gui/widgets/panel.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/panel.cpp?rev=27318&r1=27317&r2=27318&view=diff
==============================================================================
--- trunk/src/gui/widgets/panel.cpp (original)
+++ trunk/src/gui/widgets/panel.cpp Thu Jun 19 17:12:54 2008
@@ -38,6 +38,21 @@
 
 namespace gui2 {
 
+SDL_Rect tpanel::get_client_rect() const
+{
+       const tpanel_definition::tresolution* conf = 
+               dynamic_cast<const tpanel_definition::tresolution*>(config());
+       assert(conf);
+
+       SDL_Rect result = get_rect();
+       result.x += conf->left_border;
+       result.y += conf->top_border;
+       result.w -= conf->left_border + conf->right_border;
+       result.h -= conf->top_border + conf->bottom_border;
+
+       return result;
+}
+
 void tpanel::draw(surface& surface)
 {
        // Need to preserve the state and inherited draw clear the flag.
@@ -53,21 +68,6 @@
        }
 }
 
-SDL_Rect tpanel::get_client_rect() const
-{
-       const tpanel_definition::tresolution* conf = 
-               dynamic_cast<const tpanel_definition::tresolution*>(config());
-       assert(conf);
-
-       SDL_Rect result = get_rect();
-       result.x += conf->left_border;
-       result.y += conf->top_border;
-       result.w -= conf->left_border + conf->right_border;
-       result.h -= conf->top_border + conf->bottom_border;
-
-       return result;
-}
-
 tpoint tpanel::border_space() const
 {
        const tpanel_definition::tresolution* conf = 

Modified: trunk/src/gui/widgets/panel.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/panel.hpp?rev=27318&r1=27317&r2=27318&view=diff
==============================================================================
--- trunk/src/gui/widgets/panel.hpp (original)
+++ trunk/src/gui/widgets/panel.hpp Thu Jun 19 17:12:54 2008
@@ -19,34 +19,55 @@
 
 namespace gui2 {
 
-//! Visible container to hold children.
+/**
+ * Visible container to hold multiple widgets.
+ *
+ * This widget can draw items beyond the widgets it holds and in front of 
them.
+ * A panel is always active so these functions return dummy values.
+ */
 class tpanel : public tcontainer_ 
 {
 
 public:
-       //! Constructor.
-       //!
-       //! @param canvas_count  The canvas count for tcontrol.
+
+       /**
+        * Constructor.
+        *
+        * @param canvas_count        The canvas count for tcontrol.
+        */
        tpanel(const unsigned canvas_count = 2) : 
                tcontainer_(canvas_count)
        {
        }
 
-       bool has_vertical_scrollbar() const { return false; }
+       /** 
+        * Returns the client rect.
+        *
+        * The client rect is the area which is used for child items. The 
rest of
+        * the area of this widget is used for its own decoration.
+        *
+        * @returns                   The client rect.
+        */
+       SDL_Rect get_client_rect() const;
 
-       //! A panel is always active atm so ignore the request.
+       /** Inherited from tcontrol. */
        void set_active(const bool /*active*/) {}
+
+       /** Inherited from tcontrol. */
        bool get_active() const { return true; }
+
+       /** Inherited from tcontrol. */
        unsigned get_state() const { return 0; }
 
-       //! Inherited from tcontrol.
+       /** Inherited from tcontrol. */
        void draw(surface& surface);
 
-       SDL_Rect get_client_rect() const;
+       /** Inherited from tcontainer_. */
+       bool has_vertical_scrollbar() const { return false; }
 
 private:
 
-       //! Inherited from tcontrol.
+       /** Inherited from tcontrol. */
        const std::string& get_control_type() const 
                { static const std::string type = "panel"; return type; }
 




Related Messages


Powered by MHonArc, Updated Fri Jun 20 14:02:39 2008