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"
28 ControlCommand::ControlCommand(LyXView & lv, Dialogs & d, kb_action ac)
29 : ControlInset<InsetCommand, InsetCommandParams>(lv, d),
34 InsetCommandParams const ControlCommand::getParams(string const & arg)
36 InsetCommandParams params;
37 params.setFromString(arg);
42 InsetCommandParams const ControlCommand::getParams(InsetCommand const & inset)
44 return inset.params();
48 void ControlCommand::applyParamsToInset()
50 inset()->setParams(params());
51 lv_.view()->updateInset(inset(), true);
55 void ControlCommand::applyParamsNoInset()
57 if (action_ == LFUN_NOACTION) return;
58 lv_.getLyXFunc()->Dispatch(action_, params().getAsString());