mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-28 12:26:59 +00:00
467323b2b8
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2121 a592a061-630c-0410-9148-cb99ea01b6c8
58 lines
1.5 KiB
C
58 lines
1.5 KiB
C
/* This file is part of
|
|
* ======================================================
|
|
*
|
|
* LyX, The Document Processor
|
|
*
|
|
* Copyright 2000-2001 The LyX Team.
|
|
*
|
|
* ======================================================
|
|
*
|
|
* \file FormTabularCreate.C
|
|
*/
|
|
|
|
#include <config.h>
|
|
#include <utility>
|
|
|
|
#ifdef __GNUG__
|
|
#pragma implementation
|
|
#endif
|
|
|
|
#include "xformsBC.h"
|
|
#include "ControlTabularCreate.h"
|
|
#include "FormTabularCreate.h"
|
|
#include "form_tabular_create.h"
|
|
#include "support/lstrings.h"
|
|
|
|
typedef FormCB<ControlTabularCreate, FormDB<FD_form_tabular_create> > base_class;
|
|
|
|
FormTabularCreate::FormTabularCreate(ControlTabularCreate & c)
|
|
: base_class(c, _("Insert Tabular"))
|
|
{}
|
|
|
|
|
|
void FormTabularCreate::build()
|
|
{
|
|
dialog_.reset(build_tabular_create());
|
|
|
|
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);
|
|
|
|
// Manage the ok, apply and cancel/close buttons
|
|
bc().setOK(dialog_->button_ok);
|
|
bc().setApply(dialog_->button_apply);
|
|
bc().setCancel(dialog_->button_cancel);
|
|
}
|
|
|
|
|
|
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() = std::make_pair(xsize, ysize);
|
|
}
|