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
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS
|
2000-10-24 13:13:59 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
2001-04-11 17:59:08 +00:00
|
|
|
|
#include <utility>
|
2000-10-24 13:13:59 +00:00
|
|
|
|
|
2000-10-24 17:54:10 +00:00
|
|
|
|
|
2001-03-26 14:33:58 +00:00
|
|
|
|
#include "xformsBC.h"
|
|
|
|
|
#include "ControlTabularCreate.h"
|
2000-10-24 13:13:59 +00:00
|
|
|
|
#include "FormTabularCreate.h"
|
2002-06-13 13:43:51 +00:00
|
|
|
|
#include "forms/form_tabular_create.h"
|
2003-03-06 08:24:33 +00:00
|
|
|
|
#include "Tooltips.h"
|
2001-01-08 16:14:09 +00:00
|
|
|
|
#include "support/lstrings.h"
|
2002-06-13 13:43:51 +00:00
|
|
|
|
#include FORMS_H_LOCATION
|
2000-10-24 13:13:59 +00:00
|
|
|
|
|
2002-02-16 15:59:55 +00:00
|
|
|
|
|
|
|
|
|
using std::make_pair;
|
|
|
|
|
|
|
|
|
|
|
2002-06-13 13:43:51 +00:00
|
|
|
|
typedef FormCB<ControlTabularCreate, FormDB<FD_tabular_create> > base_class;
|
2000-10-24 13:13:59 +00:00
|
|
|
|
|
2002-08-12 14:28:43 +00:00
|
|
|
|
FormTabularCreate::FormTabularCreate()
|
|
|
|
|
: base_class(_("Insert Tabular"))
|
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
|
2001-03-15 13:37:04 +00:00
|
|
|
|
bc().setOK(dialog_->button_ok);
|
|
|
|
|
bc().setApply(dialog_->button_apply);
|
2002-03-12 14:11:15 +00:00
|
|
|
|
bc().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
|
|
|
|
}
|