2001-03-26 14:33:58 +00:00
|
|
|
/* This file is part of
|
2002-03-21 21:21:28 +00:00
|
|
|
* ======================================================
|
2001-03-26 14:33:58 +00:00
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
|
|
|
* Copyright 2001 The LyX Team.
|
|
|
|
*
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* \file ControlTabularCreate.C
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
2002-05-29 16:21:03 +00:00
|
|
|
#include "ControlTabularCreate.h"
|
2001-04-26 18:40:38 +00:00
|
|
|
#include "ViewBase.h"
|
|
|
|
#include "ButtonControllerBase.h"
|
2001-03-26 14:33:58 +00:00
|
|
|
#include "BufferView.h"
|
|
|
|
#include "lyxfunc.h"
|
2002-05-29 16:21:03 +00:00
|
|
|
|
|
|
|
#include "frontends/LyXView.h"
|
|
|
|
|
2001-04-11 17:59:08 +00:00
|
|
|
#include "support/lstrings.h"
|
2001-03-26 14:33:58 +00:00
|
|
|
|
2002-05-29 16:21:03 +00:00
|
|
|
|
2001-03-26 14:33:58 +00:00
|
|
|
ControlTabularCreate::ControlTabularCreate(LyXView & lv, Dialogs & d)
|
2002-01-16 14:47:58 +00:00
|
|
|
: ControlDialogBD(lv, d)
|
2002-06-18 15:44:30 +00:00
|
|
|
{}
|
2001-03-26 14:33:58 +00:00
|
|
|
|
|
|
|
|
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;
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-03-26 14:33:58 +00:00
|
|
|
view().apply();
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
string const val(tostr(params().first) + " " + tostr(params().second));
|
|
|
|
|
2002-08-04 23:11:50 +00:00
|
|
|
lv_.getLyXFunc()->dispatch(LFUN_TABULAR_INSERT, val);
|
2001-03-26 14:33:58 +00:00
|
|
|
}
|