]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/tabcreatedlg.C
Move LaTeX and VC logs to GUI-I on xforms
[lyx.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 #include <gettext.h>
12 #include <qtooltip.h>
13
14 TabularCreateDialog::TabularCreateDialog (FormTabularCreate *form, QWidget *parent, const char* name)
15         : TabularCreateDialogData(parent, name), form_(form)
16 {
17         setCaption(name);
18         table->setMinimumSize(100,100); 
19         rows->setValue(5);
20         cols->setValue(5);
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")); 
26 }
27
28 TabularCreateDialog::~TabularCreateDialog()
29 {
30 }
31
32 void TabularCreateDialog::colsChanged(unsigned int nr_cols)
33 {
34         if (nr_cols != strToUnsignedInt(cols->text()))
35                 cols->setValue(nr_cols);
36 }
37
38 void TabularCreateDialog::rowsChanged(unsigned int nr_rows)
39 {
40         if (nr_rows != strToUnsignedInt(rows->text()))
41                 rows->setValue(nr_rows);
42 }
43
44 void TabularCreateDialog::clickedInsert()
45 {
46         form_->apply(strToInt(rows->text()), strToInt(cols->text()));
47         form_->close();
48         hide();
49 }
50  
51 void TabularCreateDialog::clickedCancel()
52 {
53         form_->close();
54         hide();
55 }