1 /* === S I N F G =========================================================== */
2 /*! \file editmodeset.cpp
3 ** \brief Template File
5 ** $Id: editmodeset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
8 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
10 ** This software and associated documentation
11 ** are CONFIDENTIAL and PROPRIETARY property of
12 ** the above-mentioned copyright holder.
14 ** You may not copy, print, publish, or in any
15 ** other way distribute this software without
16 ** a prior written agreement with
17 ** the copyright holder.
20 /* ========================================================================= */
22 /* === H E A D E R S ======================================================= */
31 #include "editmodeset.h"
32 #include <sinfgapp/canvasinterface.h>
38 using namespace sinfg;
39 using namespace sinfgapp;
40 using namespace Action;
42 /* === M A C R O S ========================================================= */
44 ACTION_INIT(Action::EditModeSet);
45 ACTION_SET_NAME(Action::EditModeSet,"edit_mode_set");
46 ACTION_SET_LOCAL_NAME(Action::EditModeSet,"Set Edit Mode");
47 ACTION_SET_TASK(Action::EditModeSet,"set");
48 ACTION_SET_CATEGORY(Action::EditModeSet,Action::CATEGORY_OTHER);
49 ACTION_SET_PRIORITY(Action::EditModeSet,0);
50 ACTION_SET_VERSION(Action::EditModeSet,"0.0");
51 ACTION_SET_CVS_ID(Action::EditModeSet,"$Id: editmodeset.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
53 /* === G L O B A L S ======================================================= */
55 /* === P R O C E D U R E S ================================================= */
57 /* === M E T H O D S ======================================================= */
59 Action::EditModeSet::EditModeSet()
64 Action::EditModeSet::get_param_vocab()
66 ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
68 ret.push_back(ParamDesc("edit_mode",Param::TYPE_EDITMODE)
69 .set_local_name(_("New Edit Mode"))
76 Action::EditModeSet::is_canidate(const ParamList &x)
78 return canidate_check(get_param_vocab(),x);
82 Action::EditModeSet::set_param(const sinfg::String& name, const Action::Param ¶m)
85 if(name=="edit_mode" && param.get_type()==Param::TYPE_EDITMODE)
87 set_edit_mode(param.get_edit_mode());
93 return Action::CanvasSpecific::set_param(name,param);
97 Action::EditModeSet::is_ready()const
99 return Action::CanvasSpecific::is_ready() && get_canvas_interface();
103 Action::EditModeSet::perform()
107 old_edit_mode=get_canvas_interface()->get_mode();
109 if(old_edit_mode==get_edit_mode())
112 get_canvas_interface()->mode_=get_edit_mode();
114 get_canvas_interface()->signal_mode_changed_(get_edit_mode());
118 Action::EditModeSet::undo()
122 if(old_edit_mode==get_edit_mode())
125 get_canvas_interface()->mode_=old_edit_mode;
127 get_canvas_interface()->signal_mode_changed_(old_edit_mode);