]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormTabularCreate.C
try this for distinguishing inner and outer tabs
[lyx.git] / src / frontends / xforms / FormTabularCreate.C
index 0b2a0a38bdcf2a554fdc474a4eda9b5ce89a2c0e..78f93114c5afc19edcfdce8175b63bf3a9af2258 100644 (file)
 
 #include "FormTabularCreate.h"
 #include "form_tabular_create.h"
+#include "buffer.h"
 #include "BufferView.h"
 #include "Dialogs.h"
 #include "LyXView.h"
 #include "insets/insettabular.h"
+#include "support/lstrings.h"
 
 FormTabularCreate::FormTabularCreate(LyXView * lv, Dialogs * d)
        : FormBaseBD(lv, d, _("Insert Tabular"),
@@ -72,7 +74,7 @@ void FormTabularCreate::build()
        fl_set_slider_precision(dialog_->slider_rows, 0);
        fl_set_slider_precision(dialog_->slider_columns, 0);
 
-        // manage the ok, apply and cancel/close buttons
+        // Manage the ok, apply and cancel/close buttons
        bc_.setOK(dialog_->button_ok);
        bc_.setApply(dialog_->button_apply);
        bc_.setCancel(dialog_->button_cancel);
@@ -85,8 +87,12 @@ void FormTabularCreate::apply()
        int ysize = int(fl_get_slider_value(dialog_->slider_columns) + 0.5);
        int xsize = int(fl_get_slider_value(dialog_->slider_rows) + 0.5);
 
-       InsetTabular * in = new InsetTabular( *lv_->buffer(), xsize, ysize );
-       if (!lv_->view()->open_new_inset(in)) {
-               delete in;
-       }
+       string tmp = tostr(xsize) + " " + tostr(ysize);
+       lv_->getLyXFunc()->Dispatch(LFUN_INSET_TABULAR, tmp);
+}
+
+
+void FormTabularCreate::update()
+{
+       bc_.readOnly(lv_->buffer()->isReadonly());
 }