Prevent compiler warnings about unused parameters.
[synfig.git] / synfig-studio / trunk / src / gtkmm / state_sketch.cpp
index ec6e840..71a1ec8 100644 (file)
@@ -190,7 +190,15 @@ void
 StateSketch_Context::clear_sketch()
 {
        get_work_area()->clear_persistant_strokes();
-       get_canvas_view()->get_smach().process_event(EVENT_REFRESH);
+
+       // if the sketch is currently shown, make sure it is updated
+       //! \todo is there a better way than this of getting Duckmatic to update its stroke_list_?
+       if (checkbutton_show_sketch.get_active())
+       {
+               get_work_area()->set_show_persistant_strokes(false);
+               get_work_area()->set_show_persistant_strokes(true);
+               get_canvas_view()->get_smach().process_event(EVENT_REFRESH);
+       }
 }
 
 void
@@ -199,7 +207,15 @@ StateSketch_Context::undo_stroke()
        if(!get_work_area()->persistant_stroke_list().empty())
        {
                get_work_area()->persistant_stroke_list().pop_back();
-               get_canvas_view()->get_smach().process_event(EVENT_REFRESH);
+
+               // if the sketch is currently shown, make sure it is updated
+               //! \todo is there a better way than this of getting Duckmatic to update its stroke_list_?
+               if (checkbutton_show_sketch.get_active())
+               {
+                       get_work_area()->set_show_persistant_strokes(false);
+                       get_work_area()->set_show_persistant_strokes(true);
+                       get_canvas_view()->get_smach().process_event(EVENT_REFRESH);
+               }
        }
 }
 
@@ -334,8 +350,8 @@ StateSketch_Context::StateSketch_Context(CanvasView* canvas_view):
        prev_table_status=get_canvas_view()->tables_are_visible();
        //if(prev_table_status)get_canvas_view()->hide_tables();
 
-       // Hide the time bar
-       //get_canvas_view()->hide_timebar();
+       // Disable the time bar
+       //get_canvas_view()->set_sensitive_timebar(false);
 
        // Connect a signal
        //get_work_area()->signal_user_click().connect(sigc::mem_fun(*this,&studio::StateSketch_Context::on_user_click));
@@ -355,9 +371,8 @@ StateSketch_Context::~StateSketch_Context()
        // Restore duck clicking
        get_work_area()->allow_duck_clicks=true;
 
-       // Show the time bar
-       if(get_canvas_view()->get_canvas()->rend_desc().get_time_start()!=get_canvas_view()->get_canvas()->rend_desc().get_time_end())
-               get_canvas_view()->show_timebar();
+       // Enable the time bar
+       //get_canvas_view()->set_sensitive_timebar(true);
 
        // Bring back the tables if they were out before
        if(prev_table_status)get_canvas_view()->show_tables();
@@ -433,27 +448,27 @@ StateSketch_Context::refresh_tool_options()
 }
 
 Smach::event_result
-StateSketch_Context::event_refresh_tool_options(const Smach::event& x)
+StateSketch_Context::event_refresh_tool_options(const Smach::event& /*x*/)
 {
        refresh_tool_options();
        return Smach::RESULT_ACCEPT;
 }
 
 Smach::event_result
-StateSketch_Context::event_yield_tool_options(const Smach::event& x)
+StateSketch_Context::event_yield_tool_options(const Smach::event& /*x*/)
 {
        yield_tool_options();
        return Smach::RESULT_ACCEPT;
 }
 
 Smach::event_result
-StateSketch_Context::event_stop_handler(const Smach::event& x)
+StateSketch_Context::event_stop_handler(const Smach::event& /*x*/)
 {
        throw Smach::egress_exception();
 }
 
 Smach::event_result
-StateSketch_Context::event_refresh_handler(const Smach::event& x)
+StateSketch_Context::event_refresh_handler(const Smach::event& /*x*/)
 {
        return Smach::RESULT_ACCEPT;
 }