4 * John Levon, <moz@compsoc.man.ac.uk>
8 #include "tabcreatedlg.h"
9 #include "support/lstrings.h"
14 TabularCreateDialog::TabularCreateDialog (FormTabularCreate *form, QWidget *parent, const char* name)
15 : TabularCreateDialogData(parent, name), form_(form)
18 table->setMinimumSize(100,100);
21 connect(rows,SIGNAL(valueChanged(int)),table,SLOT(setNumberRows(int)));
22 connect(cols,SIGNAL(valueChanged(int)),table,SLOT(setNumberColumns(int)));
23 connect(table,SIGNAL(colsChanged(unsigned int)),this,SLOT(colsChanged(unsigned int)));
24 connect(table,SIGNAL(rowsChanged(unsigned int)),this,SLOT(rowsChanged(unsigned int)));
25 QToolTip::add(table, _("Drag with left mouse button to resize"));
28 TabularCreateDialog::~TabularCreateDialog()
32 void TabularCreateDialog::colsChanged(unsigned int nr_cols)
34 if (nr_cols != strToUnsignedInt(cols->text()))
35 cols->setValue(nr_cols);
38 void TabularCreateDialog::rowsChanged(unsigned int nr_rows)
40 if (nr_rows != strToUnsignedInt(rows->text()))
41 rows->setValue(nr_rows);
44 void TabularCreateDialog::clickedInsert()
46 form_->apply(strToInt(rows->text()), strToInt(cols->text()));
51 void TabularCreateDialog::clickedCancel()