mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 21:49:51 +00:00
01ecde6ab8
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6361 a592a061-630c-0410-9148-cb99ea01b6c8
58 lines
1.4 KiB
C
58 lines
1.4 KiB
C
/**
|
|
* \file FormTabularCreate.C
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Jürgen Vigna
|
|
*
|
|
* Full author contact details are available in file CREDITS
|
|
*/
|
|
|
|
#include <config.h>
|
|
#include <utility>
|
|
|
|
|
|
#include "xformsBC.h"
|
|
#include "ControlTabularCreate.h"
|
|
#include "FormTabularCreate.h"
|
|
#include "forms/form_tabular_create.h"
|
|
#include "Tooltips.h"
|
|
#include "support/lstrings.h"
|
|
#include FORMS_H_LOCATION
|
|
|
|
|
|
using std::make_pair;
|
|
|
|
|
|
typedef FormCB<ControlTabularCreate, FormDB<FD_tabular_create> > base_class;
|
|
|
|
FormTabularCreate::FormTabularCreate()
|
|
: base_class(_("Insert Tabular"))
|
|
{}
|
|
|
|
|
|
void FormTabularCreate::build()
|
|
{
|
|
dialog_.reset(build_tabular_create(this));
|
|
|
|
// Manage the ok, apply and cancel/close buttons
|
|
bc().setOK(dialog_->button_ok);
|
|
bc().setApply(dialog_->button_apply);
|
|
bc().setCancel(dialog_->button_close);
|
|
|
|
// set up the tooltips
|
|
string str = _("Number of columns in the tabular.");
|
|
tooltips().init(dialog_->slider_columns, str);
|
|
str = _("Number of rows in the tabular.");
|
|
tooltips().init(dialog_->slider_rows, str);
|
|
}
|
|
|
|
|
|
void FormTabularCreate::apply()
|
|
{
|
|
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);
|
|
|
|
controller().params() = make_pair(xsize, ysize);
|
|
}
|