1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 2001 The LyX Team.
8 * ======================================================
10 * \file ControlCommand.C
11 * \author Angus Leeming <a.leeming@ic.ac.uk>
15 #pragma implementation
21 #include "ButtonControllerBase.h"
22 #include "ControlCommand.h"
23 #include "ControlInset.tmpl"
26 #include "frontends/LyXView.h"
28 #include "BufferView.h"
30 ControlCommand::ControlCommand(LyXView & lv, Dialogs & d, kb_action ac)
31 : ControlInset<InsetCommand, InsetCommandParams>(lv, d),
36 InsetCommandParams const ControlCommand::getParams(string const & arg)
38 InsetCommandParams params;
39 params.setFromString(arg);
44 InsetCommandParams const ControlCommand::getParams(InsetCommand const & inset)
46 return inset.params();
50 void ControlCommand::applyParamsToInset()
52 inset()->setParams(params());
53 lv_.view()->updateInset(inset(), true);
57 void ControlCommand::applyParamsNoInset()
59 if (action_ == LFUN_NOACTION) return;
60 lv_.getLyXFunc()->dispatch(action_, params().getAsString());