X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fxforms%2FFormDocument.C;h=b88a029bcd595b2a92c06c4c030935156abb0dc0;hb=06c830f488023d8ff5c22cccee22c4effc8f65c3;hp=9242973071c9691a72bd5fe35eb9c5ef982be22b;hpb=0e7b7c21253c8d704a27d341b29bdbf7be6eddc0;p=lyx.git diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index 9242973071..b88a029bcd 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -31,6 +31,7 @@ #include "vspace.h" #include "bmtable.h" #include "support/filetools.h" +#include "support/lstrings.h" #include "language.h" #include "LyXView.h" #include "BufferView.h" @@ -39,6 +40,7 @@ #include "CutAndPaste.h" #include "bufferview_funcs.h" #include "xforms_helpers.h" +#include "debug.h" using Liason::setMinibuffer; using SigC::slot; @@ -139,7 +141,7 @@ void FormDocument::build() for (LyXTextClassList::const_iterator cit = textclasslist.begin(); cit != textclasslist.end(); ++cit) { - combo_doc_class->addto((*cit).description()); + combo_doc_class->addto(cit->description()); } fl_addto_choice(class_->choice_doc_spacing, @@ -191,7 +193,7 @@ void FormDocument::build() for (Languages::const_iterator cit = languages.begin(); cit != languages.end(); ++cit) { - combo_language->addto((*cit).second.lang()); + combo_language->addto(cit->second.lang()); } fl_addto_choice(language_->choice_quotes_language, @@ -199,6 +201,9 @@ void FormDocument::build() " «text» | »text« ")); bc().addReadOnly (language_->choice_inputenc); + bc().addReadOnly (language_->choice_quotes_language); + bc().addReadOnly (language_->radio_single); + bc().addReadOnly (language_->radio_double); // the document options form options_.reset(build_doc_options()); @@ -212,12 +217,16 @@ void FormDocument::build() for (n=0; tex_graphics[n][0]; ++n) { fl_addto_choice(options_->choice_postscript_driver, tex_graphics[n]); } + fl_addto_choice(options_->choice_citation_format, + _(" Author-year | Numerical ")); - bc().addReadOnly (options_->slider_secnumdepth); - bc().addReadOnly (options_->slider_tocdepth); - bc().addReadOnly (options_->check_use_amsmath); - bc().addReadOnly (options_->input_float_placement); - bc().addReadOnly (options_->choice_postscript_driver); + bc_.addReadOnly (options_->slider_secnumdepth); + bc_.addReadOnly (options_->slider_tocdepth); + bc_.addReadOnly (options_->check_use_amsmath); + bc_.addReadOnly (options_->check_use_natbib); + bc_.addReadOnly (options_->choice_citation_format); + bc_.addReadOnly (options_->input_float_placement); + bc_.addReadOnly (options_->choice_postscript_driver); // the document bullets form bullets_.reset(build_doc_bullet()); @@ -231,6 +240,8 @@ void FormDocument::build() bc().addReadOnly (bullets_->bmtable_bullet_panel); bc().addReadOnly (bullets_->choice_bullet_size); bc().addReadOnly (bullets_->input_bullet_latex); + bc().addReadOnly (bullets_->radio_bullet_depth); + bc().addReadOnly (bullets_->radio_bullet_panel); fl_addto_tabfolder(dialog_->tabbed_folder,_("Document"), class_->form); @@ -382,8 +393,7 @@ bool FormDocument::class_apply() // successfully loaded redo = true; setMinibuffer(lv_, _("Converting document to new document class...")); - CutAndPaste cap; - int ret = cap.SwitchLayoutsBetweenClasses( + int ret = CutAndPaste::SwitchLayoutsBetweenClasses( params.textclass, new_class, lv_->buffer()->paragraph); if (ret) { @@ -543,7 +553,7 @@ bool FormDocument::language_apply() if (old_language != new_language && old_language->RightToLeft() == new_language->RightToLeft() && !lv_->buffer()->isMultiLingual()) - lv_->buffer()->ChangeLanguage(old_language, new_language); + lv_->buffer()->changeLanguage(old_language, new_language); if (old_language != new_language) { redo = true; } @@ -562,6 +572,9 @@ bool FormDocument::options_apply() params.graphicsDriver = fl_get_choice_text(options_->choice_postscript_driver); params.use_amsmath = fl_get_button(options_->check_use_amsmath); + params.use_natbib = fl_get_button(options_->check_use_natbib); + params.use_numerical_citations = + fl_get_choice(options_->choice_citation_format)-1; int tmpchar = int(fl_get_counter_value(options_->slider_secnumdepth)); if (params.secnumdepth != tmpchar) @@ -705,6 +718,9 @@ void FormDocument::options_update(BufferParams const & params) fl_set_choice_text(options_->choice_postscript_driver, params.graphicsDriver.c_str()); fl_set_button(options_->check_use_amsmath, params.use_amsmath); + fl_set_button(options_->check_use_natbib, params.use_natbib); + fl_set_choice(options_->choice_citation_format, + int(params.use_numerical_citations)+1); fl_set_counter_value(options_->slider_secnumdepth, params.secnumdepth); fl_set_counter_value(options_->slider_tocdepth, params.tocdepth); if (!params.float_placement.empty()) @@ -1025,7 +1041,7 @@ void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long) if (!ob) ob = class_->choice_doc_class; - ProhibitInput(lv_->view()); + lv_->prohibitInput(); unsigned int tc = combo_doc_class->get() - 1; if (textclasslist.Load(tc)) { @@ -1047,7 +1063,7 @@ void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long) _("Reverting to original document class.")); combo_doc_class->select(int(lv_->buffer()->params.textclass) + 1); } - AllowInput(lv_->view()); + lv_->allowInput(); }