mail[Wesnoth-commits] r33261 - in /trunk/src/widgets: textbox.cpp textbox.hpp


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

Header


Content

Posted by guillaume . melquiond on March 01, 2009 - 19:12:
Author: silene
Date: Sun Mar  1 19:12:59 2009
New Revision: 33261

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33261&view=rev
Log:
Fix random cursor position when creating a multiplayer game.

Modified:
    trunk/src/widgets/textbox.cpp
    trunk/src/widgets/textbox.hpp

Modified: trunk/src/widgets/textbox.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/widgets/textbox.cpp?rev=33261&r1=33260&r2=33261&view=diff
==============================================================================
--- trunk/src/widgets/textbox.cpp (original)
+++ trunk/src/widgets/textbox.cpp Sun Mar  1 19:12:59 2009
@@ -56,6 +56,9 @@
 void textbox::set_inner_location(SDL_Rect const &rect)
 {
        bg_register(rect);
+       if (text_image_.null()) return;
+       text_pos_ = 0;
+       update_text_cache(false);
 }
 
 const std::string textbox::text() const
@@ -233,14 +236,6 @@
                update_text_cache(true);
                set_dirty(true);
        }
-}
-
-void textbox::set_location(const SDL_Rect& rect)
-{
-       text_pos_ = 0;
-
-       scrollarea::set_location(rect);
-       set_shown_size(location().h);
 }
 
 void textbox::scroll(unsigned int pos)

Modified: trunk/src/widgets/textbox.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/widgets/textbox.hpp?rev=33261&r1=33260&r2=33261&view=diff
==============================================================================
--- trunk/src/widgets/textbox.hpp (original)
+++ trunk/src/widgets/textbox.hpp Sun Mar  1 19:12:59 2009
@@ -43,12 +43,6 @@
        void scroll_to_bottom();
 
        void set_wrap(bool val);
-
-       void set_location(const SDL_Rect& rect);
-
-       //VC++ doesn't like a 'using scrollarea::set_location' directive 
here, so we declare
-       //an inline forwarding function instead
-       void set_location(int x, int y) { widget::set_location(x,y); }
 
 protected:
        virtual void draw_contents();




Related Messages


Powered by MHonArc, Updated Sun Mar 01 20:00:05 2009