]> git.lyx.org Git - features.git/blob - src/frontends/kde/tabcreatedlg.C
ec25e4725631ba632a650576d08ed8e2c106d238
[features.git] / src / frontends / kde / tabcreatedlg.C
1 /*
2  * tabcreatedlg.C
3  * (C) 2000 LyX Team
4  * John Levon, <moz@compsoc.man.ac.uk>
5  */
6
7 #include <config.h>
8 #include "tabcreatedlg.h"
9 #include "support/lstrings.h"
10
11 TabularCreateDialog::TabularCreateDialog (FormTabularCreate *form, QWidget *parent, const char* name)
12         : TabularCreateDialogData(parent, name), form_(form)
13 {
14         setCaption(name);
15         table->setMinimumSize(100,100); 
16         rows->setValue(5);
17         cols->setValue(5);
18         connect(rows,SIGNAL(valueChanged(int)),table,SLOT(setNumberRows(int)));
19         connect(cols,SIGNAL(valueChanged(int)),table,SLOT(setNumberColumns(int)));
20         connect(table,SIGNAL(colsChanged(unsigned int)),this,SLOT(colsChanged(unsigned int))); 
21         connect(table,SIGNAL(rowsChanged(unsigned int)),this,SLOT(rowsChanged(unsigned int))); 
22 }
23
24 TabularCreateDialog::~TabularCreateDialog()
25 {
26 }
27
28 void TabularCreateDialog::colsChanged(unsigned int nr_cols)
29 {
30         if (nr_cols != strToUnsignedInt(cols->text()))
31                 cols->setValue(nr_cols);
32 }
33
34 void TabularCreateDialog::rowsChanged(unsigned int nr_rows)
35 {
36         if (nr_rows != strToUnsignedInt(rows->text()))
37                 rows->setValue(nr_rows);
38 }
39
40 void TabularCreateDialog::clickedInsert()
41 {
42         form_->apply(strToInt(rows->text()), strToInt(cols->text()));
43         form_->close();
44         hide();
45 }
46  
47 void TabularCreateDialog::clickedCancel()
48 {
49         form_->close();
50         hide();
51 }