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>
17 #pragma implementation
21 #include "ButtonControllerBase.h"
22 #include "ControlCommand.h"
25 #include "frontends/LyXView.h"
27 #include "BufferView.h"
28 #include "funcrequest.h"
31 ControlCommand::ControlCommand(LyXView & lv, Dialogs & d, kb_action ac)
32 : ControlInset<InsetCommand, InsetCommandParams>(lv, d),
37 InsetCommandParams const ControlCommand::getParams(string const & arg)
39 InsetCommandParams params;
40 params.setFromString(arg);
45 InsetCommandParams const ControlCommand::getParams(InsetCommand const & inset)
47 return inset.params();
51 void ControlCommand::applyParamsToInset()
53 inset()->setParams(params());
54 lv_.view()->updateInset(inset(), true);
58 void ControlCommand::applyParamsNoInset()
60 if (action_ == LFUN_NOACTION)
62 lv_.getLyXFunc()->dispatch(FuncRequest(action_, params().getAsString()));