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
20 #include "ControlCommand.h"
26 ControlCommand::ControlCommand(LyXView & lv, Dialogs & d, kb_action ac)
27 : ControlInset<InsetCommand, InsetCommandParams>(lv, d),
32 InsetCommandParams const ControlCommand::getParams(string const & arg)
34 InsetCommandParams params;
35 params.setFromString(arg);
39 InsetCommandParams const ControlCommand::getParams(InsetCommand const & inset)
41 return inset.params();
44 void ControlCommand::applyParamsToInset()
46 inset()->setParams(params());
47 lv_.view()->updateInset(inset(), true);
50 void ControlCommand::applyParamsNoInset()
52 if (action_ == LFUN_NOACTION) return;
53 lv_.getLyXFunc()->Dispatch(action_, params().getAsString());