]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt2/QTabularDialog.C
better selection and scrolling behaviour
[lyx.git] / src / frontends / qt2 / QTabularDialog.C
index 0e3e7c40ad5af9e36d0b3a8228420f315b4ad574..1ec562904bce8745b0801608300d77b6d7ec0b87 100644 (file)
@@ -17,7 +17,7 @@
 #endif
 
 #include "ControlTabular.h"
+
 #include "QTabular.h"
 #include "QTabularDialog.h"
 #include "tabular.h"
@@ -60,25 +60,25 @@ void QTabularDialog::columnAppend_clicked()
        form_->controller().set(LyXTabular::APPEND_COLUMN);
 }
 
+
 void QTabularDialog::rowAppend_clicked()
 {
        form_->controller().set(LyXTabular::APPEND_ROW);
 }
 
+
 void QTabularDialog::columnDelete_clicked()
 {
        form_->controller().set(LyXTabular::DELETE_COLUMN);
 }
 
+
 void QTabularDialog::rowDelete_clicked()
 {
        form_->controller().set(LyXTabular::DELETE_ROW);
 }
 
+
 void QTabularDialog::borderSet_clicked()
 {
        form_->controller().set(LyXTabular::SET_ALL_LINES);
@@ -92,7 +92,7 @@ void QTabularDialog::borderUnset_clicked()
        form_->update_borders();
        form_->changed();
 }
+
 
 void QTabularDialog::leftBorder_changed()
 {
@@ -148,11 +148,13 @@ void QTabularDialog::width_changed()
 {
        string const width =
                LyXLength(widthED->text().toDouble(),
-                         widthUnit->currentLengthItem()).asString();
+                       widthUnit->currentLengthItem()).asString();
        if (form_->controller().isMulticolumnCell())
                form_->controller().set(LyXTabular::SET_MPWIDTH, width);
        else
                form_->controller().set(LyXTabular::SET_PWIDTH, width);
+       form_->changed();
+       form_->update_contents();
 }
 
 
@@ -160,6 +162,7 @@ void QTabularDialog::multicolumn_clicked()
 {
        form_->controller().set(LyXTabular::MULTICOLUMN);
        form_->changed();
+       form_->update_contents();
 }
 
 
@@ -197,33 +200,33 @@ void QTabularDialog::rotateCell_checked(int state)
 
 void QTabularDialog::hAlign_changed(int align)
 {
-       LyXTabular::Feature num = LyXTabular::ALIGN_BLOCK;
+       LyXTabular::Feature num = LyXTabular::ALIGN_LEFT;
        LyXTabular::Feature multi_num = LyXTabular::M_ALIGN_LEFT;
 
        switch (align) {
                case 0:
-               {
-                       num = LyXTabular::ALIGN_BLOCK;
-                       //FIXME: multi_num no equivalent
-                       break;
-               }
-               case 1:
                {
                        num = LyXTabular::ALIGN_LEFT;
                        multi_num = LyXTabular::M_ALIGN_LEFT;
                        break;
                }
-               case 2:
+               case 1:
                {
                        num = LyXTabular::ALIGN_CENTER;
                        multi_num = LyXTabular::M_ALIGN_CENTER;
                        break;
                }
-               case 3:
+               case 2:
                {
                        num = LyXTabular::ALIGN_RIGHT;
                        multi_num = LyXTabular::M_ALIGN_RIGHT;
                        break;
+               case 3:
+               {
+                       num = LyXTabular::ALIGN_BLOCK;
+                       //multi_num: no equivalent
+                       break;
+               }
                }
        }
        if (form_->controller().isMulticolumnCell())
@@ -235,8 +238,8 @@ void QTabularDialog::hAlign_changed(int align)
 
 void QTabularDialog::vAlign_changed(int align)
 {
-       LyXTabular::Feature num = LyXTabular::ALIGN_BLOCK;
-       LyXTabular::Feature multi_num = LyXTabular::M_ALIGN_LEFT;
+       LyXTabular::Feature num = LyXTabular::VALIGN_CENTER;
+       LyXTabular::Feature multi_num = LyXTabular::M_VALIGN_CENTER;
 
        switch (align) {
                case 0: