]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt2/QTabularCreateDialog.C
better selection and scrolling behaviour
[lyx.git] / src / frontends / qt2 / QTabularCreateDialog.C
index 19dc39a458493fdab3829a5bd4a4a1437963303a..579ef07fbb4095f33778e74099a9586268052d8d 100644 (file)
@@ -1,69 +1,54 @@
 /**
  * \file QTabularCreateDialog.C
- * Copyright 2001 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author John Levon, moz@compsoc.man.ac.uk
- * \author Edwin Leuven, leuven@fee.uva.nl
+ * \author John Levon
+ * \author Edwin Leuven
+ *
+ * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
-#include <gettext.h>
 
-#include "QTabularCreateDialog.h"
-#include "QTabularCreate.h"
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include "gettext.h"
+
 #include "support/lstrings.h"
 
+#include "QTabularCreate.h"
+#include "QTabularCreateDialog.h"
+
 #include <qpushbutton.h>
 #include <qspinbox.h>
 #include "emptytable.h"
-#include <qpainter.h>
-#include <qtableview.h>
-#include <qtooltip.h>
 
-QTabularCreateDialog::QTabularCreateDialog(QTabularCreate * form, QWidget * parent,  const char * name, bool modal, WFlags fl)
-        : QTabularCreateDialogBase(parent, name, modal, fl), 
+
+QTabularCreateDialog::QTabularCreateDialog(QTabularCreate * form)
+       : QTabularCreateDialogBase(0, 0, false, 0),
        form_(form)
 {
-       setCaption(name);
        table->setMinimumSize(100,100);
-       rows->setValue(5);
-       columns->setValue(5);
-       QToolTip::add(table, _("Drag with left mouse button to resize"));
-}
+       rowsSB->setValue(5);
+       columnsSB->setValue(5);
 
-QTabularCreateDialog::~QTabularCreateDialog()
-{
-        // no need to delete child widgets, Qt does it all for us
+       connect(okPB, SIGNAL(clicked()),
+               form_, SLOT(slotOK()));
+       connect(closePB, SIGNAL(clicked()),
+               form_, SLOT(slotClose()));
 }
 
-void QTabularCreateDialog::insert_tabular()
-{
-       form_->apply((rows->text()).toInt(), (columns->text()).toInt());
-       form_->close();
-       hide();
-}
 
-void QTabularCreateDialog::cancel_adaptor()
+void QTabularCreateDialog::columnsChanged(int)
 {
-       form_->close();
-       hide();
+       form_->changed();
 }
 
-void QTabularCreateDialog::colsChanged(int nr_cols)
-{
-       if (nr_cols != (columns->text()).toInt())
-               columns->setValue(nr_cols);
-}
 
-void QTabularCreateDialog::rowsChanged(int nr_rows)
+void QTabularCreateDialog::rowsChanged(int)
 {
-       if (nr_rows != (rows->text()).toInt()) 
-               rows->setValue(nr_rows);
+       form_->changed();
 }