]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormTabularCreate.C
Implemented controller-view split for FormBibtex.
[lyx.git] / src / frontends / xforms / FormTabularCreate.C
index 78f93114c5afc19edcfdce8175b63bf3a9af2258..2b8a0f57d28df39235ea604ae28f1982e44bc740 100644 (file)
 #include "insets/insettabular.h"
 #include "support/lstrings.h"
 
+using SigC::slot;
+
 FormTabularCreate::FormTabularCreate(LyXView * lv, Dialogs * d)
-       : FormBaseBD(lv, d, _("Insert Tabular"),
-                    new OkApplyCancelReadOnlyPolicy),
-         dialog_(0)
+       : FormBaseBD(lv, d, _("Insert Tabular"))
 {
        // let the dialog be shown
        // This is a permanent connection so we won't bother
@@ -39,33 +39,24 @@ FormTabularCreate::FormTabularCreate(LyXView * lv, Dialogs * d)
 }
 
 
-FormTabularCreate::~FormTabularCreate()
-{
-       delete dialog_;
-}
-
-
 FL_FORM * FormTabularCreate::form() const
 {
-       if (dialog_) return dialog_->form;
+       if (dialog_.get())
+               return dialog_->form;
        return 0;
 }
 
 
 void FormTabularCreate::connect()
 {
-       bc_.valid(true);
+       bc().valid(true);
        FormBaseBD::connect();
 }
 
 
 void FormTabularCreate::build()
 {
-       dialog_ = build_tabular_create();
-
-       // Workaround dumb xforms sizing bug
-       minw_ = form()->w;
-       minh_ = form()->h;
+       dialog_.reset(build_tabular_create());
 
        fl_set_slider_bounds(dialog_->slider_rows, 1, 50);
        fl_set_slider_bounds(dialog_->slider_columns, 1, 50);
@@ -75,10 +66,10 @@ void FormTabularCreate::build()
        fl_set_slider_precision(dialog_->slider_columns, 0);
 
         // Manage the ok, apply and cancel/close buttons
-       bc_.setOK(dialog_->button_ok);
-       bc_.setApply(dialog_->button_apply);
-       bc_.setCancel(dialog_->button_cancel);
-       bc_.refresh();
+       bc().setOK(dialog_->button_ok);
+       bc().setApply(dialog_->button_apply);
+       bc().setCancel(dialog_->button_cancel);
+       bc().refresh();
 }
 
 
@@ -94,5 +85,5 @@ void FormTabularCreate::apply()
 
 void FormTabularCreate::update()
 {
-       bc_.readOnly(lv_->buffer()->isReadonly());
+       bc().readOnly(lv_->buffer()->isReadonly());
 }