2001-03-26 14:33:58 +00:00
|
|
|
/* This file is part of
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
|
|
|
* Copyright 2001 The LyX Team.
|
|
|
|
*
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* \file ControlTabularCreate.C
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "ControlTabularCreate.h"
|
|
|
|
#include "BufferView.h"
|
|
|
|
#include "Dialogs.h"
|
|
|
|
#include "LyXView.h"
|
|
|
|
#include "lyxfunc.h"
|
2001-04-11 17:59:08 +00:00
|
|
|
#include "support/lstrings.h"
|
2001-03-26 14:33:58 +00:00
|
|
|
|
|
|
|
ControlTabularCreate::ControlTabularCreate(LyXView & lv, Dialogs & d)
|
|
|
|
: ControlDialog<ControlConnectBD>(lv, d)
|
|
|
|
{
|
|
|
|
d_.showTabularCreate.connect(SigC::slot(this,
|
|
|
|
&ControlTabularCreate::show));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-04-11 17:59:08 +00:00
|
|
|
ControlTabularCreate::rowsCols & ControlTabularCreate::params()
|
2001-03-26 14:33:58 +00:00
|
|
|
{
|
2001-04-11 17:59:08 +00:00
|
|
|
return params_;
|
2001-03-26 14:33:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ControlTabularCreate::setParams()
|
|
|
|
{
|
|
|
|
bc().valid(); // so that the user can press Ok
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ControlTabularCreate::apply()
|
|
|
|
{
|
|
|
|
if (!lv_.view()->available())
|
|
|
|
return;
|
|
|
|
|
|
|
|
view().apply();
|
|
|
|
|
2001-04-11 17:59:08 +00:00
|
|
|
string const val(tostr(params().first) + " " + tostr(params().second));
|
|
|
|
|
|
|
|
lv_.getLyXFunc()->Dispatch(LFUN_INSET_TABULAR, val);
|
2001-03-26 14:33:58 +00:00
|
|
|
}
|