2002-03-11 17:00:41 +00:00
|
|
|
|
/**
|
2002-03-11 22:47:41 +00:00
|
|
|
|
* \file xforms/FormTabularCreate.C
|
2002-03-11 17:00:41 +00:00
|
|
|
|
* Copyright 2000-2001 The LyX Team.
|
|
|
|
|
* See the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author \author J<EFBFBD>rgen Vigna, jug@sad.it
|
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
|
|
|
|
#ifdef __GNUG__
|
|
|
|
|
#pragma implementation
|
|
|
|
|
#endif
|
|
|
|
|
|
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"
|
|
|
|
|
#include "form_tabular_create.h"
|
2001-01-08 16:14:09 +00:00
|
|
|
|
#include "support/lstrings.h"
|
2000-10-24 13:13:59 +00:00
|
|
|
|
|
2002-02-16 15:59:55 +00:00
|
|
|
|
|
|
|
|
|
using std::make_pair;
|
|
|
|
|
|
|
|
|
|
|
2001-03-26 14:33:58 +00:00
|
|
|
|
typedef FormCB<ControlTabularCreate, FormDB<FD_form_tabular_create> > base_class;
|
2000-10-24 13:13:59 +00:00
|
|
|
|
|
2001-03-26 14:33:58 +00:00
|
|
|
|
FormTabularCreate::FormTabularCreate(ControlTabularCreate & c)
|
|
|
|
|
: base_class(c, _("Insert Tabular"))
|
|
|
|
|
{}
|
2000-10-24 13:13:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FormTabularCreate::build()
|
|
|
|
|
{
|
2001-03-15 13:37:04 +00:00
|
|
|
|
dialog_.reset(build_tabular_create());
|
2000-10-24 13:13:59 +00:00
|
|
|
|
|
|
|
|
|
fl_set_slider_bounds(dialog_->slider_rows, 1, 50);
|
|
|
|
|
fl_set_slider_bounds(dialog_->slider_columns, 1, 50);
|
|
|
|
|
fl_set_slider_value(dialog_->slider_rows, 5);
|
|
|
|
|
fl_set_slider_value(dialog_->slider_columns, 5);
|
|
|
|
|
fl_set_slider_precision(dialog_->slider_rows, 0);
|
|
|
|
|
fl_set_slider_precision(dialog_->slider_columns, 0);
|
|
|
|
|
|
2000-11-28 06:46:06 +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);
|
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
|
|
|
|
}
|