本文整理汇总了C++中etl::handle::set_active方法的典型用法代码示例。如果您正苦于以下问题:C++ handle::set_active方法的具体用法?C++ handle::set_active怎么用?C++ handle::set_active使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类etl::handle
的用法示例。
在下文中一共展示了handle::set_active方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: canvas_specific
bool
Action::System::set_action_status(etl::handle<Action::Undoable> action, bool x)
{
Stack::iterator iter;
int failed=false;
if(action->is_active()==x)
return true;
handle<Action::Undoable> cur_pos=undo_action_stack_.front();
Action::CanvasSpecific* canvas_specific(dynamic_cast<Action::CanvasSpecific*>(action.get()));
handle<UIInterface> uim=new ConfidentUIInterface();
iter=find(undo_action_stack_.begin(),undo_action_stack_.end(),action);
if(iter!=undo_action_stack_.end())
{
while(undo_action_stack_.front()!=action)
{
if(!undo_(uim))
{
return false;
}
}
if(!undo_(uim))
{
return false;
}
action->set_active(x);
if(redo_(get_ui_interface()))
{
signal_action_status_changed_(action);
}
else
{
action->set_active(!x);
failed=true;
}
while(undo_action_stack_.front()!=cur_pos)
{
if(!redo_(uim))
{
redo_action_stack_.front()->set_active(false);
signal_action_status_changed_(redo_action_stack_.front());
}
}
if(!failed && canvas_specific && canvas_specific->is_dirty())
{
Canvas::Handle canvas=canvas_specific->get_canvas();
handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
assert(canvas_interface);
//canvas_interface->signal_dirty_preview()();
}
return true;
}
iter=find(redo_action_stack_.begin(),redo_action_stack_.end(),action);
if(iter!=redo_action_stack_.end())
{
action->set_active(x);
signal_action_status_changed_(action);
if(canvas_specific && canvas_specific->is_dirty())
{
Canvas::Handle canvas=canvas_specific->get_canvas();
handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
assert(canvas_interface);
//canvas_interface->signal_dirty_preview()();
}
return true;
}
return false;
}