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"
27 #include "BufferView.h"
29 ControlCommand::ControlCommand(LyXView & lv, Dialogs & d, kb_action ac)
30 : ControlInset<InsetCommand, InsetCommandParams>(lv, d),
35 InsetCommandParams const ControlCommand::getParams(string const & arg)
37 InsetCommandParams params;
38 params.setFromString(arg);
43 InsetCommandParams const ControlCommand::getParams(InsetCommand const & inset)
45 return inset.params();
49 void ControlCommand::applyParamsToInset()
51 inset()->setParams(params());
52 lv_.view()->updateInset(inset(), true);
56 void ControlCommand::applyParamsNoInset()
58 if (action_ == LFUN_NOACTION) return;
59 lv_.getLyXFunc()->dispatch(action_, params().getAsString());