mail[Wesnoth-commits] r28482 - in /trunk: data/themes/editor2.cfg src/editor2/editor_controller.cpp src/editor2/editor_controller.hpp


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

Header


Content

Posted by kailoran on August 12, 2008 - 13:39:
Author: ilor
Date: Tue Aug 12 13:39:34 2008
New Revision: 28482

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28482&view=rev
Log:
editor2: toolbar tooltips: buttons and terrain palette groups. Old editor's 
toolbar glitch appears to be fixed though I'm not sure what was the cause.

Modified:
    trunk/data/themes/editor2.cfg
    trunk/src/editor2/editor_controller.cpp
    trunk/src/editor2/editor_controller.hpp

Modified: trunk/data/themes/editor2.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/themes/editor2.cfg?rev=28482&r1=28481&r2=28482&view=diff
==============================================================================
--- trunk/data/themes/editor2.cfg (original)
+++ trunk/data/themes/editor2.cfg Tue Aug 12 13:39:34 2008
@@ -175,6 +175,7 @@
             id=draw_button_editor
             image=draw_button_editor
             items=editor-tool-paint
+                       auto_tooltip=yes
             ref=top-right-panel
             #harcoded since the brushes are above, which are hardcoded in 
src/editor/editor_layout.cpp
             rect="=+15,200,+24,+24"
@@ -185,6 +186,7 @@
             id=flood_button_editor
             image=flood_button_editor
             items=editor-tool-fill
+                       auto_tooltip=yes
             rect="+6,=,+24,+24"
             xanchor=right
             yanchor=fixed
@@ -193,6 +195,7 @@
             id=start_position_button_editor
             image=start_position_button_editor
             items=editor-tool-starting-position
+                       auto_tooltip=yes
             rect="+6,=,+24,+24"
             xanchor=right
             yanchor=fixed
@@ -201,6 +204,7 @@
             id=select_button_editor
             image=resize_button_editor
             items=editor-tool-select
+                       auto_tooltip=yes
             rect="+6,=,+24,+24"
             xanchor=right
             yachnor=fixed
@@ -209,6 +213,7 @@
             id=undo_button_editor
             image=undo_button_editor
             items=undo
+                       auto_tooltip=yes
             ref=draw_button_editor
             rect="=,+6,+24,+24"
             xanchor=right
@@ -218,6 +223,7 @@
             id=redo_button_editor
             image=redo_button_editor
             items=redo
+                       auto_tooltip=yes
             rect="+6,=,+24,+24"
             xanchor=right
             yachnor=fixed
@@ -226,6 +232,7 @@
             id=zoom_in_button_editor
             image=zoom_in_button_editor
             items=zoomin
+                       auto_tooltip=yes
             rect="+6,=,+24,+24"
             xanchor=right
             yachnor=fixed
@@ -234,6 +241,7 @@
             id=zoom_out_button_editor
             image=zoom_out_button_editor
             items=zoomout
+                       auto_tooltip=yes
             rect="+6,=,+24,+24"
             xanchor=right
             yanchor=fixed

Modified: trunk/src/editor2/editor_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_controller.cpp?rev=28482&r1=28481&r2=28482&view=diff
==============================================================================
--- trunk/src/editor2/editor_controller.cpp (original)
+++ trunk/src/editor2/editor_controller.cpp Tue Aug 12 13:39:34 2008
@@ -51,7 +51,8 @@
 : controller_base(SDL_GetTicks(), game_config, video)
 , mouse_handler_base(get_map())
 , map_context_(editor_map(game_config, 44, 33, t_translation::GRASS_LAND))
-, gui_(NULL), map_generator_(NULL), do_quit_(false), quit_mode_(EXIT_ERROR)
+, gui_(NULL), map_generator_(NULL), tooltip_manager_(video), 
floating_label_manager_(NULL)
+, do_quit_(false), quit_mode_(EXIT_ERROR)
 , toolbar_dirty_(true), auto_update_transitions_(true)
 {
        init(video);
@@ -61,7 +62,6 @@
        palette_ = new terrain_palette(gui(), *size_specs_, get_map(), 
game_config,
                foreground_terrain_, background_terrain_);
        //brush_bar_ = new brush_bar(gui(), *size_specs_);
-       
        const config::child_list& children = 
game_config.get_children("brush");
        foreach (const config* i, game_config.get_children("brush")) {
                brushes_.push_back(brush(*i));
@@ -102,6 +102,7 @@
        refresh_all();
        gui_->draw();
        palette_->draw(true);
+       load_tooltips();
        events::raise_draw_event();     
 }
 
@@ -114,6 +115,12 @@
        gui_->set_grid(preferences::grid());
        prefs_disp_manager_ = new preferences::display_manager(gui_);
        
gui_->add_redraw_observer(boost::bind(&editor_controller::display_redraw_callback,
 this, _1));
+}
+
+void editor_controller::load_tooltips()
+{
+       // Tooltips for the groups
+       palette_->load_tooltips();
 }
 
 editor_controller::~editor_controller()
@@ -794,6 +801,8 @@
        adjust_sizes(gui(), *size_specs_);
        palette_->adjust_size();
        palette_->draw(true);
+       //display::redraw_everything removes our custom tooltips so reload 
them
+       load_tooltips();
        gui().invalidate_all();
 }
 

Modified: trunk/src/editor2/editor_controller.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_controller.hpp?rev=28482&r1=28481&r2=28482&view=diff
==============================================================================
--- trunk/src/editor2/editor_controller.hpp (original)
+++ trunk/src/editor2/editor_controller.hpp Tue Aug 12 13:39:34 2008
@@ -28,6 +28,7 @@
 #include "../key.hpp"
 #include "../mouse_handler_base.hpp"
 #include "../sdl_utils.hpp"
+#include "../tooltips.hpp"
 
 #include <deque>
 #include <boost/utility.hpp>
@@ -116,6 +117,8 @@
                /** init the display object and general set-up */ 
                void init(CVideo& video);
                
+               void load_tooltips();
+               
                void redraw_toolbar();
                
                void refresh_image_cache();
@@ -149,8 +152,8 @@
                brush_bar* brush_bar_;
                
                preferences::display_manager* prefs_disp_manager_;
-               tooltips::manager* tooltip_manager_;
-               font::floating_label_context* floating_label_manager_;
+               tooltips::manager tooltip_manager_;
+               font::floating_label_context* floating_label_manager_;        
  
                
                bool do_quit_;
                EXIT_STATUS quit_mode_;




Related Messages


Powered by MHonArc, Updated Tue Aug 12 14:00:28 2008