X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fstate_sketch.cpp;h=71a1ec807db190ea7b3a3461aeeb238357cb14ea;hb=82172e34b62d1e335b1deb00bfc714e293f1c165;hp=46aafb6dbb7a787df388631a3465b940ca7e1aac;hpb=c34eaa5441242b3e9a7b7645e9ee4983d14eae85;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/state_sketch.cpp b/synfig-studio/trunk/src/gtkmm/state_sketch.cpp index 46aafb6..71a1ec8 100644 --- a/synfig-studio/trunk/src/gtkmm/state_sketch.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_sketch.cpp @@ -2,7 +2,7 @@ /*! \file state_sketch.cpp ** \brief Template File ** -** $Id: state_sketch.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $ +** $Id$ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley @@ -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; }