]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormDocument.C
controller-view split of FormLog and FormVCLog.
[lyx.git] / src / frontends / xforms / FormDocument.C
index b0eab6e6bd6bf7a8e0886b71c4cb55fec88fd29f..0a114121bb0a6d3e7b95cb3bc7396e622b3e34fc 100644 (file)
 #include "bufferview_funcs.h"
 #include "xforms_helpers.h" 
 
-#ifdef CXX_WORKING_NAMESPACES
 using Liason::setMinibuffer;
-#endif
-
-#define USE_CLASS_COMBO 1
+using SigC::slot;
 
 FormDocument::FormDocument(LyXView * lv, Dialogs * d)
        : FormBaseBD(lv, d, _("Document Layout")), fbullet(0)
@@ -90,10 +87,6 @@ void FormDocument::build()
     bc().setUndoAll(dialog_->button_restore);
     bc().refresh();
 
-    // Workaround dumb xforms sizing bug
-    minw_ = form()->w;
-    minh_ = form()->h;
-
     // the document paper form
     paper_.reset(build_doc_paper());
     fl_addto_choice(paper_->choice_papersize2,
@@ -134,7 +127,6 @@ void FormDocument::build()
     class_.reset(build_doc_class());
 
     FL_OBJECT * obj;
-#ifdef USE_CLASS_COMBO
     // The language is a combo-box and has to be inserted manually
     obj = class_->choice_doc_class;
     fl_deactivate_object(obj);
@@ -150,14 +142,7 @@ void FormDocument::build()
     {
        combo_doc_class->addto((*cit).description());
     }
-#else
-    fl_clear_choice(class_->choice_doc_class);
-    for (LyXTextClassList::const_iterator cit = textclasslist.begin();
-        cit != textclasslist.end(); ++cit)
-    {
-       fl_addto_choice(class_->choice_doc_class,(*cit).description().c_str());
-    }
-#endif
+
     fl_addto_choice(class_->choice_doc_spacing,
                    _(" Single | OneHalf | Double | Other "));
     fl_addto_choice(class_->choice_doc_fontsize, "default|10|11|12");
@@ -174,9 +159,7 @@ void FormDocument::build()
 
     bc().addReadOnly (class_->radio_doc_indent);
     bc().addReadOnly (class_->radio_doc_skip);
-#ifndef USE_CLASS_COMBO
-    bc().addReadOnly (class_->choice_doc_class);
-#endif
+
     bc().addReadOnly (class_->choice_doc_pagestyle);
     bc().addReadOnly (class_->choice_doc_fonts);
     bc().addReadOnly (class_->choice_doc_fontsize);
@@ -392,11 +375,7 @@ bool FormDocument::class_apply()
        params.fontsize = fl_get_choice_text(class_->choice_doc_fontsize);
        params.pagestyle = fl_get_choice_text(class_->choice_doc_pagestyle);
 
-#ifdef USE_CLASS_COMBO   
        unsigned int const new_class = combo_doc_class->get() - 1;
-#else
-       unsigned int const new_class = fl_get_choice(class_->choice_doc_class) - 1;
-#endif
        
        if (params.textclass != new_class) {
                // try to load new_class
@@ -426,12 +405,7 @@ bool FormDocument::class_apply()
                        WriteAlert(_("Conversion Errors!"),
                                   _("Errors loading new document class."),
                                   _("Reverting to original document class."));
-#ifdef USE_CLASS_COMBO
                        combo_doc_class->select(int(params.textclass) + 1);
-#else
-                       fl_set_choice(class_->choice_doc_class,
-                                     params.textclass + 1);
-#endif
                }
        }
        BufferParams::PARSEP tmpsep = params.paragraph_separation;
@@ -624,13 +598,8 @@ void FormDocument::class_update(BufferParams const & params)
 
     LyXTextClass const & tclass = textclasslist.TextClass(params.textclass);
 
-#ifdef USE_CLASS_COMBO
     combo_doc_class->select_text(
        textclasslist.DescOfClass(params.textclass));
-#else  
-    fl_set_choice_text(class_->choice_doc_class, 
-                      textclasslist.DescOfClass(params.textclass).c_str());
-#endif
     fl_set_choice_text(class_->choice_doc_fonts, params.fonts.c_str());
     fl_clear_choice(class_->choice_doc_fontsize);
     fl_addto_choice(class_->choice_doc_fontsize, "default");
@@ -1059,13 +1028,7 @@ void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long)
 
     ProhibitInput(lv_->view());
 
-#ifdef USE_CLASS_COMBO
     unsigned int tc = combo_doc_class->get() - 1;
-    string tct = combo_doc_class->getline();
-#else
-    int tc = fl_get_choice(ob) - 1;
-    string tct = fl_get_choice_text(ob);
-#endif
     if (textclasslist.Load(tc)) {
            // we use a copy of the bufferparams because we do not
            // want to modify them yet. 
@@ -1083,12 +1046,7 @@ void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long)
        WriteAlert(_("Conversion Errors!"),
                   _("Unable to switch to new document class."),
                   _("Reverting to original document class."));
-#ifdef USE_CLASS_COMBO
        combo_doc_class->select(int(lv_->buffer()->params.textclass) + 1);
-#else
-       fl_set_choice(class_->choice_doc_class, 
-                     lv_->buffer()->params.textclass + 1);
-#endif
     }
     AllowInput(lv_->view());
 }