-/* This file is part of
- * ======================================================
- *
- * LyX, The Document Processor
- *
- * Copyright 2001 The LyX Team.
+/**
+ * \file ControlTabularCreate.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
- * ======================================================
+ * \author unknown
*
- * \file ControlTabularCreate.C
+ * Full author contact details are available in file CREDITS
*/
#include <config.h>
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
#include "ControlTabularCreate.h"
-#include "BufferView.h"
-#include "Dialogs.h"
-#include "LyXView.h"
-#include "lyxfunc.h"
+#include "funcrequest.h"
-ControlTabularCreate::ControlTabularCreate(LyXView & lv, Dialogs & d)
- : ControlDialog<ControlConnectBD>(lv, d)
-{
- d_.showTabularCreate.connect(SigC::slot(this,
- &ControlTabularCreate::show));
-}
+#include "support/tostr.h"
-string & ControlTabularCreate::params() const
-{
- Assert(params_);
- return *params_;
-}
+ControlTabularCreate::ControlTabularCreate(Dialog & parent)
+ : Dialog::Controller(parent)
+{}
-void ControlTabularCreate::setParams()
+bool ControlTabularCreate::initialiseParams(string const &)
{
- if (params_) delete params_;
- params_ = new string;
-
- bc().valid(); // so that the user can press Ok
+ params_.first = 5;
+ params_.second = 5;
+ return true;
}
void ControlTabularCreate::clearParams()
{
- if (params_) {
- delete params_;
- params_ = 0;
- }
+ params_.first = 0;
+ params_.second = 0;
}
-void ControlTabularCreate::apply()
+void ControlTabularCreate::dispatchParams()
{
- if (!lv_.view()->available())
- return;
-
- view().apply();
-
- lv_.getLyXFunc()->Dispatch(LFUN_INSET_TABULAR, params());
+ string data = tostr(params().first) + ' ' + tostr(params().second);
+ kernel().dispatch(FuncRequest(LFUN_TABULAR_INSERT, data));
}