2002-03-11 17:00:41 +00:00
|
|
|
|
/**
|
2003-02-27 15:57:11 +00:00
|
|
|
|
* \file FormTabularCreate.C
|
2002-09-05 15:14:23 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-11 17:00:41 +00:00
|
|
|
|
*
|
2002-09-05 14:10:50 +00:00
|
|
|
|
* \author J<EFBFBD>rgen Vigna
|
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2000-10-24 13:13:59 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
#include "FormTabularCreate.h"
|
2003-09-05 13:15:43 +00:00
|
|
|
|
#include "ControlTabularCreate.h"
|
2002-06-13 13:43:51 +00:00
|
|
|
|
#include "forms/form_tabular_create.h"
|
2003-09-05 13:15:43 +00:00
|
|
|
|
|
2003-03-06 08:24:33 +00:00
|
|
|
|
#include "Tooltips.h"
|
2003-09-05 13:15:43 +00:00
|
|
|
|
#include "xformsBC.h"
|
2000-10-24 13:13:59 +00:00
|
|
|
|
|
2003-09-05 13:15:43 +00:00
|
|
|
|
#include "lyx_forms.h"
|
2002-02-16 15:59:55 +00:00
|
|
|
|
|
|
|
|
|
using std::make_pair;
|
|
|
|
|
|
|
|
|
|
|
2003-03-09 19:34:46 +00:00
|
|
|
|
typedef FormController<ControlTabularCreate, FormView<FD_tabular_create> > base_class;
|
2000-10-24 13:13:59 +00:00
|
|
|
|
|
2003-03-09 19:34:46 +00:00
|
|
|
|
FormTabularCreate::FormTabularCreate(Dialog & parent)
|
2003-04-30 02:06:04 +00:00
|
|
|
|
: base_class(parent, _("Insert Table"))
|
2001-03-26 14:33:58 +00:00
|
|
|
|
{}
|
2000-10-24 13:13:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FormTabularCreate::build()
|
|
|
|
|
{
|
2002-06-13 13:43:51 +00:00
|
|
|
|
dialog_.reset(build_tabular_create(this));
|
2000-10-24 13:13:59 +00:00
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
// Manage the ok, apply and cancel/close buttons
|
2003-03-10 03:13:28 +00:00
|
|
|
|
bcview().setOK(dialog_->button_ok);
|
|
|
|
|
bcview().setApply(dialog_->button_apply);
|
|
|
|
|
bcview().setCancel(dialog_->button_close);
|
2003-03-06 08:24:33 +00:00
|
|
|
|
|
|
|
|
|
// set up the tooltips
|
2003-03-06 08:36:14 +00:00
|
|
|
|
string str = _("Number of columns in the tabular.");
|
2003-03-06 08:24:33 +00:00
|
|
|
|
tooltips().init(dialog_->slider_columns, str);
|
2003-03-06 08:36:14 +00:00
|
|
|
|
str = _("Number of rows in the tabular.");
|
2003-03-06 08:24:33 +00:00
|
|
|
|
tooltips().init(dialog_->slider_rows, str);
|
2000-10-24 13:13:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FormTabularCreate::apply()
|
|
|
|
|
{
|
2001-04-11 17:59:08 +00:00
|
|
|
|
unsigned int ysize = (unsigned int)(fl_get_slider_value(dialog_->slider_columns) + 0.5);
|
|
|
|
|
unsigned int xsize = (unsigned int)(fl_get_slider_value(dialog_->slider_rows) + 0.5);
|
2000-10-24 13:13:59 +00:00
|
|
|
|
|
2002-02-16 15:59:55 +00:00
|
|
|
|
controller().params() = make_pair(xsize, ysize);
|
2000-11-28 06:46:06 +00:00
|
|
|
|
}
|