]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/tabcreatedlg.C
implement getLabelList
[lyx.git] / src / frontends / kde / tabcreatedlg.C
1 /**
2  * \file tabcreatedlg.C
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author John Levon
7  */
8
9 #include <config.h>
10 #include "tabcreatedlg.h"
11 #include "support/lstrings.h"
12
13 #include <gettext.h>
14 #include <qtooltip.h>
15
16 TabularCreateDialog::TabularCreateDialog (FormTabularCreate * form, QWidget * parent, char const * name)
17         : TabularCreateDialogData(parent, name), form_(form)
18 {
19         setCaption(name);
20         table->setMinimumSize(100,100); 
21         spin_rows->setValue(5);
22         spin_cols->setValue(5);
23         connect(spin_rows,SIGNAL(valueChanged(int)),table,SLOT(setNumberRows(int)));
24         connect(spin_cols,SIGNAL(valueChanged(int)),table,SLOT(setNumberColumns(int)));
25         connect(table,SIGNAL(colsChanged(unsigned int)),this,SLOT(colsChanged(unsigned int))); 
26         connect(table,SIGNAL(rowsChanged(unsigned int)),this,SLOT(rowsChanged(unsigned int))); 
27         QToolTip::add(table, _("Drag with left mouse button to resize")); 
28 }
29
30
31 TabularCreateDialog::~TabularCreateDialog()
32 {
33 }
34
35
36 void TabularCreateDialog::colsChanged(unsigned int nr_cols)
37 {
38         if (nr_cols != strToUnsignedInt(spin_cols->text()))
39                 spin_cols->setValue(nr_cols);
40 }
41
42
43 void TabularCreateDialog::rowsChanged(unsigned int nr_rows)
44 {
45         if (nr_rows != strToUnsignedInt(spin_rows->text()))
46                 spin_rows->setValue(nr_rows);
47 }
48
49
50 void TabularCreateDialog::clickedInsert()
51 {
52         form_->OKButton();
53 }
54
55  
56 void TabularCreateDialog::clickedCancel()
57 {
58         form_->CancelButton(); 
59 }