]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QTabularCreateDialog.C
The big renaming. Yowser.
[lyx.git] / src / frontends / qt2 / QTabularCreateDialog.C
1 /**
2  * \file QTabularCreateDialog.C
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author John Levon, moz@compsoc.man.ac.uk
7  * \author Edwin Leuven, leuven@fee.uva.nl
8  */
9
10 #include <config.h>
11 #include <gettext.h>
12
13 #include "QTabularCreateDialog.h"
14 #include "QTabularCreate.h"
15  
16 #include "support/lstrings.h"
17
18 #include <qpushbutton.h>
19 #include <qspinbox.h>
20 #include "emptytable.h"
21 #include <qpainter.h>
22 #include <qtableview.h>
23 #include <qtooltip.h>
24
25 QTabularCreateDialog::QTabularCreateDialog(QTabularCreate * form, QWidget * parent,  const char * name, bool modal, WFlags fl)
26          : QTabularCreateDialogBase(parent, name, modal, fl), 
27         form_(form)
28 {
29         setCaption(name);
30         table->setMinimumSize(100,100);
31         rows->setValue(5);
32         columns->setValue(5);
33         QToolTip::add(table, _("Drag with left mouse button to resize"));
34 }
35
36  
37 QTabularCreateDialog::~QTabularCreateDialog()
38 {
39          // no need to delete child widgets, Qt does it all for us
40 }
41  
42
43 void QTabularCreateDialog::insert_tabular()
44 {
45         form_->apply((rows->text()).toInt(), (columns->text()).toInt());
46         form_->close();
47         hide();
48 }
49  
50
51 void QTabularCreateDialog::cancel_adaptor()
52 {
53         form_->close();
54         hide();
55 }
56
57  
58 void QTabularCreateDialog::colsChanged(int nr_cols)
59 {
60         if (nr_cols != (columns->text()).toInt())
61                 columns->setValue(nr_cols);
62 }
63
64  
65 void QTabularCreateDialog::rowsChanged(int nr_rows)
66 {
67         if (nr_rows != (rows->text()).toInt()) 
68                 rows->setValue(nr_rows);
69 }