From 784af7b916d986949397e86eec51c0982321f65c Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Fri, 22 Nov 2002 10:47:56 +0000 Subject: [PATCH] Use a control-view split for the xforms document dialog. Clean up reporting of errors loading class templates by the controller. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5699 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/controllers/ChangeLog | 5 + src/frontends/controllers/ControlDocument.C | 39 +-- src/frontends/controllers/ControlDocument.h | 4 +- src/frontends/qt2/ChangeLog | 4 + src/frontends/qt2/QDocumentDialog.C | 36 +-- src/frontends/xforms/ChangeLog | 8 + src/frontends/xforms/Dialogs2.C | 2 +- src/frontends/xforms/Dialogs_impl.h | 4 +- src/frontends/xforms/FormDocument.C | 263 +++++--------------- src/frontends/xforms/FormDocument.h | 41 +-- src/frontends/xforms/forms/form_document.fd | 140 +++++------ 11 files changed, 200 insertions(+), 346 deletions(-) diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index ad862f68b7..1b59357705 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,8 @@ +2002-11-21 Angus Leeming + + * ControlDocument.[Ch] (classApply): no longer returns bool. + (loadTextclass): new method. Wrapper for textclasslist[tc].load(). + 2002-11-21 Lars Gullik Bjønnes * biblio.C (getAbbreviatedAuthor): use boost::format diff --git a/src/frontends/controllers/ControlDocument.C b/src/frontends/controllers/ControlDocument.C index 9c261828c6..b3c1c5d994 100644 --- a/src/frontends/controllers/ControlDocument.C +++ b/src/frontends/controllers/ControlDocument.C @@ -65,7 +65,6 @@ void ControlDocument::apply() setLanguage(); - // FIXME: do we need to use return value from classApply() here? (Lgb) classApply(); view().apply(); @@ -101,26 +100,15 @@ void ControlDocument::setLanguage() } -bool ControlDocument::classApply() +void ControlDocument::classApply() { BufferParams & params = buffer()->params; - unsigned int const old_class = params.textclass; - unsigned int const new_class = bp_->textclass; + lyx::textclass_type const old_class = params.textclass; + lyx::textclass_type const new_class = bp_->textclass; - // exit if nothing changes - if (new_class == old_class) { - return true; - } - - // try to load new_class - if (!textclasslist[new_class].load()) { - // problem changing class - // -- warn user (to retain old style) - Alert::alert(_("Conversion Errors!"), - _("Errors loading new document class."), - _("Reverting to original document class.")); - return false; - } + // exit if nothing changes or if unable to load the new class + if (new_class == old_class || !loadTextclass(new_class)) + return; // successfully loaded view().apply(); @@ -141,7 +129,20 @@ bool ControlDocument::classApply() Alert::alert(_("Conversion Errors!"),s, _("into chosen document class")); } - return true; +} + + +bool ControlDocument::loadTextclass(lyx::textclass_type tc) const +{ + bool const success = textclasslist[tc].load(); + if (!success) { + // problem changing class + // -- warn user (to retain old style) + Alert::alert(_("Conversion Errors!"), + _("Errors loading new document class."), + _("Reverting to original document class.")); + } + return success; } diff --git a/src/frontends/controllers/ControlDocument.h b/src/frontends/controllers/ControlDocument.h index 2f2ba87b05..6799ddb5d0 100644 --- a/src/frontends/controllers/ControlDocument.h +++ b/src/frontends/controllers/ControlDocument.h @@ -43,7 +43,9 @@ public: /// void saveAsDefault(); /// - bool classApply(); + void classApply(); + /// + bool loadTextclass(lyx::textclass_type tc) const; private: /// apply settings void apply(); diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 9fd7a8df72..e05346e90e 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2002-11-21 Angus Leeming + + * QDocumentDialog.C (classChanged): use ControlDocument::loadTextclass. + 2002-11-21 Lars Gullik Bjønnes * QVCLog.C (update_contents): use boost::format diff --git a/src/frontends/qt2/QDocumentDialog.C b/src/frontends/qt2/QDocumentDialog.C index e6d0f367e5..2c50f32882 100644 --- a/src/frontends/qt2/QDocumentDialog.C +++ b/src/frontends/qt2/QDocumentDialog.C @@ -452,23 +452,31 @@ void QDocumentDialog::updatePagestyle(string const & items, string const & sel) void QDocumentDialog::classChanged() { - unsigned int tc = layoutModule->classCO->currentItem(); + ControlDocument & cntrl = form_->controller(); + BufferParams & params = cntrl.params(); - BufferParams & params = form_->controller().params(); - params.textclass = layoutModule->classCO->currentItem(); + lyx::textclass_type const tc = layoutModule->classCO->currentItem(); - if (lyxrc.auto_reset_options) { + if (controller().loadTextclass(tc)) { params.textclass = tc; - params.useClassDefaults(); - form_->update_contents(); - } else { - // update the params which are needed in any case - // (fontsizes, pagestyle) - params.textclass = tc; - updateFontsize(form_->controller().textClass().opt_fontsize(), - params.fontsize); - updatePagestyle(form_->controller().textClass().opt_pagestyle(), - params.pagestyle); + if (lyxrc.auto_reset_options) { + params.useClassDefaults(); + form_->update_contents(); + } else { + updateFontsize(cntrl.textClass().opt_fontsize(), + params.fontsize); + + updatePagestyle(cntrl.textClass().opt_pagestyle(), + params.pagestyle); + } + } else { + for (int n = 0; nclassCO->count(); ++n) { + if (layoutModule->classCO->text(n) == + cntrl.textClass().description().c_str()) { + layoutModule->classCO->setCurrentItem(n); + break; + } + } } } diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 47a3c48e4f..5bd76ac55d 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -6,6 +6,14 @@ * ColorHandler.C (getGCForeground): use boost::format +2002-11-21 Angus Leeming + + * FormDocument.[Ch]: + * forms/form_document.fd: controller-view split of doc dialog. + + * Dialogs_impl.h: + * Dialogs2.C: changes due to controller-view split of doc dialog. + 2002-11-21 Angus Leeming * forms/fdfix.sh: Don't use "if [ $? -ne 0 ]; then..." diff --git a/src/frontends/xforms/Dialogs2.C b/src/frontends/xforms/Dialogs2.C index 035fe12593..2544acd6ac 100644 --- a/src/frontends/xforms/Dialogs2.C +++ b/src/frontends/xforms/Dialogs2.C @@ -63,7 +63,7 @@ void Dialogs::createCitation(string const & s) void Dialogs::showDocument() { - pimpl_->document.show(); + pimpl_->document.controller().show(); } diff --git a/src/frontends/xforms/Dialogs_impl.h b/src/frontends/xforms/Dialogs_impl.h index d1d80393b1..d5852dbe5f 100644 --- a/src/frontends/xforms/Dialogs_impl.h +++ b/src/frontends/xforms/Dialogs_impl.h @@ -45,6 +45,7 @@ #include "FormCitation.h" #include "forms/form_citation.h" +#include "ControlDocument.h" #include "FormDocument.h" #include "forms/form_document.h" @@ -191,7 +192,8 @@ CharacterDialog; typedef GUI CitationDialog; -typedef FormDocument DocumentDialog; +typedef GUI +DocumentDialog; typedef GUI ErrorDialog; diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index 9ebd2c5adc..0c1ad89426 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -15,8 +15,10 @@ #pragma implementation #endif +#include "ControlDocument.h" #include "FormDocument.h" #include "forms/form_document.h" +#include "xformsBC.h" #include "bmtable.h" #include "checkedwidgets.h" @@ -24,12 +26,12 @@ #include "input_validators.h" // fl_unsigned_float_filter #include "xforms_helpers.h" -#include "buffer.h" -#include "BufferView.h" +//#include "buffer.h" +//#include "BufferView.h" #include "CutAndPaste.h" #include "debug.h" #include "language.h" -#include "lyx_main.h" // for user_lyxdir +//#include "lyx_main.h" // for user_lyxdir #include "lyxrc.h" #include "lyxtextclasslist.h" #include "tex-strings.h" @@ -37,10 +39,8 @@ #include "controllers/frnt_lang.h" #include "controllers/helper_funcs.h" -#include "frontends/LyXView.h" -#include "frontends/Alert.h" - -#include "support/filetools.h" +#include "support/lstrings.h" // contains_functor, getStringFromVector +#include "support/filetools.h" // LibFileSearch #include XPM_H_LOCATION #include FORMS_H_LOCATION @@ -53,8 +53,10 @@ using std::bind2nd; using std::vector; -FormDocument::FormDocument(LyXView & lv, Dialogs & d) - : FormBaseBD(lv, d, _("Document Layout"), false), +typedef FormCB > base_class; + +FormDocument::FormDocument() + : base_class(_("Document Layout"), false), ActCell(0), Confirmed(0), current_bullet_panel(0), current_bullet_depth(0), fbullet(0) {} @@ -73,13 +75,6 @@ void FormDocument::redraw() } -FL_FORM * FormDocument::form() const -{ - if (dialog_.get()) return dialog_->form; - return 0; -} - - void FormDocument::build() { // the tabbed folder @@ -287,13 +282,13 @@ void FormDocument::build() options_.reset(build_document_options(this)); // disable for read-only documents - bc_.addReadOnly(options_->counter_secnumdepth); - bc_.addReadOnly(options_->counter_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); + bc().addReadOnly(options_->counter_secnumdepth); + bc().addReadOnly(options_->counter_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); // trigger an input event for cut&paste with middle mouse button. setPrehandler(options_->input_float_placement); @@ -311,16 +306,16 @@ void FormDocument::build() bullets_.reset(build_document_bullet(this)); // disable for read-only documents - bc_.addReadOnly(bullets_->radio_bullet_depth_1); - bc_.addReadOnly(bullets_->radio_bullet_depth_2); - bc_.addReadOnly(bullets_->radio_bullet_depth_3); - bc_.addReadOnly(bullets_->radio_bullet_depth_4); - bc_.addReadOnly(bullets_->radio_bullet_panel_standard); - bc_.addReadOnly(bullets_->radio_bullet_panel_maths); - bc_.addReadOnly(bullets_->radio_bullet_panel_ding1); - bc_.addReadOnly(bullets_->radio_bullet_panel_ding2); - bc_.addReadOnly(bullets_->radio_bullet_panel_ding3); - bc_.addReadOnly(bullets_->radio_bullet_panel_ding4); + bc().addReadOnly(bullets_->radio_bullet_depth_1); + bc().addReadOnly(bullets_->radio_bullet_depth_2); + bc().addReadOnly(bullets_->radio_bullet_depth_3); + bc().addReadOnly(bullets_->radio_bullet_depth_4); + bc().addReadOnly(bullets_->radio_bullet_panel_standard); + bc().addReadOnly(bullets_->radio_bullet_panel_maths); + bc().addReadOnly(bullets_->radio_bullet_panel_ding1); + bc().addReadOnly(bullets_->radio_bullet_panel_ding2); + bc().addReadOnly(bullets_->radio_bullet_panel_ding3); + bc().addReadOnly(bullets_->radio_bullet_panel_ding4); bc().addReadOnly(bullets_->bmtable_bullet_panel); bc().addReadOnly(bullets_->choice_bullet_size); bc().addReadOnly(bullets_->input_bullet_latex); @@ -367,32 +362,13 @@ void FormDocument::build() void FormDocument::apply() { - if (!lv_.view()->available() || !dialog_.get()) - return; - - bool redo = class_apply(); - paper_apply(); - redo = language_apply() || redo; - redo = options_apply() || redo; - bullets_apply(); - - if (redo) { - lv_.view()->redoCurrentBuffer(); - } - lv_.buffer()->markDirty(); - lv_.message(_("Document layout set")); -} - + BufferParams & params = controller().params(); -void FormDocument::cancel() -{ - // this avoids confusion when reopening - BufferParams & param = lv_.buffer()->params; - param.temp_bullets[0] = param.user_defined_bullets[0]; - param.temp_bullets[1] = param.user_defined_bullets[1]; - param.temp_bullets[2] = param.user_defined_bullets[2]; - param.temp_bullets[3] = param.user_defined_bullets[3]; - hide(); + class_apply(params); + paper_apply(params); + language_apply(params); + options_apply(params); + bullets_apply(params); } @@ -403,7 +379,7 @@ void FormDocument::update() checkReadOnly(); - BufferParams const & params = lv_.buffer()->params; + BufferParams const & params = controller().params(); class_update(params); paper_update(params); @@ -413,43 +389,9 @@ void FormDocument::update() } -namespace { -// should this go elsewhere? Maybe a ControllerDocument? (JMarc) -/** Save the buffer's parameters as user default. - This function saves a file \c user_lyxdir/templates/defaults.lyx - which parameters are those of the current buffer. This file - is used as a default template when creating a new - file. Returns \c true on success. -*/ -bool saveParamsAsDefault(BufferParams const ¶ms) -{ - if (!Alert::askQuestion(_("Do you want to save the current settings"), - _("for the document layout as default?"), - _("(they will be valid for any new document)"))) - return false; - - string const fname = AddName(AddPath(user_lyxdir, "templates/"), - "defaults.lyx"); - Buffer defaults(fname); - defaults.params = params; - - // add an empty paragraph. Is this enough? - Paragraph * par = new Paragraph; - par->layout(params.getLyXTextClass().defaultLayout()); - defaults.paragraphs.set(par); - - return defaults.writeFile(defaults.fileName()); -} - -} //namespace - - -bool FormDocument::input(FL_OBJECT * ob, long) +ButtonPolicy::SMInput FormDocument::input(FL_OBJECT * ob, long) { - if (ob == class_->choice_doc_class) { - CheckChoiceClass(ob, 0); - - } else if (ob == bullets_->choice_bullet_size) { + if (ob == bullets_->choice_bullet_size) { ChoiceBulletSize(ob, 0); } else if (ob == bullets_->input_bullet_latex) { @@ -504,17 +446,11 @@ bool FormDocument::input(FL_OBJECT * ob, long) fl_get_button(options_->check_use_natbib)); } else if (ob == dialog_->button_save_defaults) { - BufferParams params; - class_apply(params); - paper_apply(params); - language_apply(params); - options_apply(params); - bullets_apply(params); - params.preamble = lv_.buffer()->params.preamble; - saveParamsAsDefault(params); + apply(); + controller().saveAsDefault(); } else if (ob == dialog_->button_reset_defaults) { - BufferParams params = lv_.buffer()->params; + BufferParams & params = controller().params(); params.textclass = combo_doc_class->get() - 1; params.useClassDefaults(); UpdateLayoutDocument(params); @@ -651,7 +587,7 @@ bool FormDocument::input(FL_OBJECT * ob, long) setEnabled(paper_->choice_paperpackage, enable && fl_get_button(paper_->radio_portrait)); } - return true; + return ButtonPolicy::SMI_VALID; } @@ -659,7 +595,7 @@ void FormDocument::ComboInputCB(int, void * v, Combox * combox) { FormDocument * pre = static_cast(v); if (combox == pre->combo_doc_class.get()) - pre->CheckChoiceClass(0, 0); + pre->CheckChoiceClass(); pre->bc().valid(); } @@ -754,49 +690,6 @@ bool FormDocument::class_apply(BufferParams ¶ms) } -bool FormDocument::class_apply() -{ - BufferParams ¶ms = lv_.buffer()->params; - - unsigned int const old_class = params.textclass; - - bool redo = class_apply(params); - - if (params.textclass != old_class) { - // try to load new_class - if (textclasslist[params.textclass].load()) { - // successfully loaded - redo = true; - lv_.message(_("Converting document to new document class...")); - int ret = CutAndPaste::SwitchLayoutsBetweenClasses( - old_class, params.textclass, - &*(lv_.buffer()->paragraphs.begin()), - lv_.buffer()->params); - if (ret) { - string s; - if (ret == 1) { - s = _("One paragraph couldn't be converted"); - } else { - s += tostr(ret); - s += _(" paragraphs couldn't be converted"); - } - Alert::alert(_("Conversion Errors!"),s, - _("into chosen document class")); - } - - } else { - // problem changing class -- warn user and retain old style - Alert::alert(_("Conversion Errors!"), - _("Errors loading new document class."), - _("Reverting to original document class.")); - combo_doc_class->select(int(old_class) + 1); - } - } - - return redo; -} - - void FormDocument::paper_apply(BufferParams & params) { params.papersize2 = char(fl_get_choice(paper_->choice_papersize) - 1); @@ -852,12 +745,6 @@ void FormDocument::paper_apply(BufferParams & params) } -void FormDocument::paper_apply() -{ - paper_apply(lv_.buffer()->params); -} - - bool FormDocument::language_apply(BufferParams & params) { InsetQuotes::quote_language lga = InsetQuotes::EnglishQ; @@ -890,20 +777,10 @@ bool FormDocument::language_apply(BufferParams & params) params.quotes_times = InsetQuotes::DoubleQ; int const pos = combo_language->get(); - Language const * old_language = params.language; Language const * new_language = languages.getLanguage(lang_[pos-1]); if (!new_language) new_language = default_language; - if (old_language != new_language - && old_language->RightToLeft() == new_language->RightToLeft() - && !lv_.buffer()->isMultiLingual()) - lv_.buffer()->changeLanguage(old_language, new_language); - - if (old_language != new_language) { - redo = true; - } - params.language = new_language; params.inputenc = getString(language_->choice_inputenc); @@ -911,12 +788,6 @@ bool FormDocument::language_apply(BufferParams & params) } -bool FormDocument::language_apply() -{ - return language_apply(lv_.buffer()->params); -} - - bool FormDocument::options_apply(BufferParams & params) { bool redo = false; @@ -941,16 +812,10 @@ bool FormDocument::options_apply(BufferParams & params) } -bool FormDocument::options_apply() -{ - return options_apply(lv_.buffer()->params); -} - - void FormDocument::bullets_apply(BufferParams & params) { /* update the bullet settings */ - BufferParams & buf_params = lv_.buffer()->params; + BufferParams & buf_params = controller().params(); // a little bit of loop unrolling params.user_defined_bullets[0] = buf_params.temp_bullets[0]; @@ -960,11 +825,6 @@ void FormDocument::bullets_apply(BufferParams & params) } -void FormDocument::bullets_apply() -{ - bullets_apply(lv_.buffer()->params); -} - void FormDocument::UpdateClassParams(BufferParams const & params) { // These are the params that have to be updated on any class change @@ -1215,7 +1075,8 @@ void FormDocument::bullets_update(BufferParams const & params) (XpmVersion==4 && XpmRevision<7))) return; - bool const isLinuxDoc = lv_.buffer()->isLinuxDoc(); + bool const isLinuxDoc = + controller().docType() == ControlDocument::LINUXDOC; setEnabled(fbullet, !isLinuxDoc); if (isLinuxDoc) return; @@ -1230,7 +1091,7 @@ void FormDocument::bullets_update(BufferParams const & params) void FormDocument::checkReadOnly() { - if (bc().readOnly(lv_.buffer()->isReadonly())) { + if (bc().readOnly(controller().bufferIsReadonly())) { combo_doc_class->deactivate(); combo_language->deactivate(); postWarning(_("Document is read-only." @@ -1245,7 +1106,7 @@ void FormDocument::checkReadOnly() void FormDocument::ChoiceBulletSize(FL_OBJECT * ob, long /*data*/) { - BufferParams & param = lv_.buffer()->params; + BufferParams & param = controller().params(); // convert from 1-6 range to -1-4 param.temp_bullets[current_bullet_depth].setSize(fl_get_choice(ob) - 2); @@ -1256,7 +1117,7 @@ void FormDocument::ChoiceBulletSize(FL_OBJECT * ob, long /*data*/) void FormDocument::InputBulletLaTeX(FL_OBJECT *, long) { - BufferParams & param = lv_.buffer()->params; + BufferParams & param = controller().params(); param.temp_bullets[current_bullet_depth]. setText(getString(bullets_->input_bullet_latex)); @@ -1273,7 +1134,7 @@ void FormDocument::BulletDepth(FL_OBJECT * ob) /* */ /* I'm inclined to just go with 3 and 4 at the moment and */ /* maybe try to support the others later */ - BufferParams & param = lv_.buffer()->params; + BufferParams & param = controller().params(); int data = 0; if (ob == bullets_->radio_bullet_depth_1) @@ -1358,7 +1219,7 @@ void FormDocument::BulletBMTable(FL_OBJECT * ob, long /*data*/) /* to that extracted from the current chosen position of the BMTable */ /* Don't forget to free the button's old pixmap first. */ - BufferParams & param = lv_.buffer()->params; + BufferParams & param = controller().params(); int bmtable_button = fl_get_bmtable(ob); /* try to keep the button held down till another is pushed */ @@ -1370,38 +1231,28 @@ void FormDocument::BulletBMTable(FL_OBJECT * ob, long /*data*/) } -void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long) +void FormDocument::CheckChoiceClass() { - if (!ob) - ob = class_->choice_doc_class; + BufferParams & params = controller().params(); - lv_.prohibitInput(); + lyx::textclass_type const tc = combo_doc_class->get() - 1; - unsigned int tc = combo_doc_class->get() - 1; - if (textclasslist[tc].load()) { - // we use a copy of the bufferparams because we do not - // want to modify them yet. - BufferParams params = lv_.buffer()->params; + if (controller().loadTextclass(tc)) { + params.textclass = tc; if (lyxrc.auto_reset_options) { - params.textclass = tc; params.useClassDefaults(); UpdateLayoutDocument(params); } else { // update the params which are needed in any case // (fontsizes, pagestyle) - params.textclass = tc; UpdateClassParams(params); } } else { - // unable to load new style - Alert::alert(_("Conversion Errors!"), - _("Unable to switch to new document class."), - _("Reverting to original document class.")); - combo_doc_class->select(int(lv_.buffer()->params.textclass) + 1); + int const revert = int(params.textclass); + combo_doc_class->select(revert + 1); } - lv_.allowInput(); } diff --git a/src/frontends/xforms/FormDocument.h b/src/frontends/xforms/FormDocument.h index e6109d2e83..f7834a1e95 100644 --- a/src/frontends/xforms/FormDocument.h +++ b/src/frontends/xforms/FormDocument.h @@ -16,12 +16,14 @@ #pragma interface #endif -#include "FormBaseDeprecated.h" +#include "FormBase.h" #include #include +class ControlDocument; + class Combox; class BufferParams; @@ -35,30 +37,23 @@ struct FD_document_bullet; /** This class provides an XForms implementation of the FormDocument dialog. The table-layout-form here changes values for latex-tabulars */ -class FormDocument : public FormBaseBD { +class FormDocument : public FormCB > { public: - FormDocument(LyXView &, Dialogs &); + FormDocument(); /// static void ComboInputCB(int, void *, Combox *); private: - /// Pointer to the actual instantiation of the ButtonController. - virtual xformsBC & bc(); /** Redraw the form (on receipt of a Signal indicating, for example, that the xforms colours have been re-mapped). */ virtual void redraw(); /// Build the dialog virtual void build(); /// Filter the inputs - virtual bool input( FL_OBJECT *, long); + virtual ButtonPolicy::SMInput input( FL_OBJECT *, long); /// Update the dialog. virtual void update(); /// Apply from dialog virtual void apply(); - /// Cancel from dialog - virtual void cancel(); - - /// - virtual FL_FORM * form() const; /// void ChoiceBulletSize(FL_OBJECT * ob, long); @@ -73,7 +68,7 @@ private: /// void checkReadOnly(); /// - void CheckChoiceClass(FL_OBJECT * ob, long); + void CheckChoiceClass(); /// void UpdateLayoutDocument(BufferParams const & params); /// @@ -101,20 +96,7 @@ private: /// void bullets_apply(BufferParams &); - /// - void paper_apply(); - /// - bool class_apply(); - /// - bool language_apply(); - /// - bool options_apply(); - /// - void bullets_apply(); - /// Real GUI implementation. - boost::scoped_ptr dialog_; - /// boost::scoped_ptr paper_; /// boost::scoped_ptr class_; @@ -138,17 +120,8 @@ private: boost::scoped_ptr combo_language; /// boost::scoped_ptr combo_doc_class; - /// The ButtonController - ButtonController bc_; /// std::vector lang_; }; - -inline -xformsBC & FormDocument::bc() -{ - return bc_; -} - #endif diff --git a/src/frontends/xforms/forms/form_document.fd b/src/frontends/xforms/forms/form_document.fd index c2be070d79..7802f4273b 100644 --- a/src/frontends/xforms/forms/form_document.fd +++ b/src/frontends/xforms/forms/form_document.fd @@ -64,7 +64,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_close -callback: C_FormBaseDeprecatedCancelCB +callback: C_FormBaseCancelCB argument: 0 -------------------- @@ -82,7 +82,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_apply -callback: C_FormBaseDeprecatedApplyCB +callback: C_FormBaseApplyCB argument: 0 -------------------- @@ -100,7 +100,7 @@ shortcut: ^M resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_ok -callback: C_FormBaseDeprecatedOKCB +callback: C_FormBaseOKCB argument: 0 -------------------- @@ -136,7 +136,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_restore -callback: C_FormBaseDeprecatedRestoreCB +callback: C_FormBaseRestoreCB argument: 0 -------------------- @@ -154,7 +154,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_save_defaults -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -172,7 +172,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_reset_defaults -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 =============== FORM =============== @@ -232,7 +232,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_papersize -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -250,7 +250,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_custom_width -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -268,7 +268,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_custom_width_units -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -286,7 +286,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_custom_height -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -304,7 +304,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_custom_height_units -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -358,7 +358,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_portrait -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -376,7 +376,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_landscape -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -430,7 +430,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_use_geometry -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -448,7 +448,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_paperpackage -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -466,7 +466,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_top_margin -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -484,7 +484,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_top_margin_units -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -502,7 +502,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_bottom_margin -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -520,7 +520,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_bottom_margin_units -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -538,7 +538,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_inner_margin -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -556,7 +556,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_inner_margin_units -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -574,7 +574,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_outer_margin -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -592,7 +592,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_outer_margin_units -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -610,7 +610,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_head_height -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -628,7 +628,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_head_height_units -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -646,7 +646,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_head_sep -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -664,7 +664,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_head_sep_units -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -682,7 +682,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_foot_skip -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -700,7 +700,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_foot_skip_units -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 =============== FORM =============== @@ -796,7 +796,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_doc_fonts -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -814,7 +814,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_doc_fontsize -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -832,7 +832,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_doc_class -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -850,7 +850,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_doc_pagestyle -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -868,7 +868,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_doc_spacing -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -886,7 +886,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_doc_extra -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -904,7 +904,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_doc_skip -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -922,7 +922,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_doc_skip -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -958,7 +958,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_doc_sides_one -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -976,7 +976,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_doc_sides_two -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1030,7 +1030,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_doc_columns_one -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1048,7 +1048,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_doc_columns_two -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1102,7 +1102,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_doc_indent -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1120,7 +1120,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_doc_skip -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 value: 1 @@ -1157,7 +1157,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_doc_spacing -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1175,7 +1175,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_doc_skip_units -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 =============== FORM =============== @@ -1235,7 +1235,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_inputenc -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1253,7 +1253,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_quotes_language -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1289,7 +1289,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_single -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1307,7 +1307,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_double -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1343,7 +1343,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_language -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 =============== FORM =============== @@ -1385,7 +1385,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_float_placement -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1403,7 +1403,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: counter_secnumdepth -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 bounds: -2 5 precision: 0 @@ -1425,7 +1425,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: counter_tocdepth -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 bounds: -1 5 precision: 0 @@ -1447,7 +1447,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_postscript_driver -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1465,7 +1465,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_use_amsmath -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1483,7 +1483,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_use_natbib -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1501,7 +1501,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_citation_format -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 =============== FORM =============== @@ -1561,7 +1561,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: bmtable_bullet_panel -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1579,7 +1579,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_bullet_size -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1597,7 +1597,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_bullet_latex -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1633,7 +1633,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_bullet_depth_1 -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 value: 1 @@ -1652,7 +1652,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_bullet_depth_2 -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1670,7 +1670,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_bullet_depth_3 -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1688,7 +1688,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_bullet_depth_4 -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1742,7 +1742,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_NoGravity FL_NoGravity name: radio_bullet_panel_standard -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 value: 1 @@ -1761,7 +1761,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_NoGravity FL_NoGravity name: radio_bullet_panel_maths -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1779,7 +1779,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_NoGravity FL_NoGravity name: radio_bullet_panel_ding1 -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1797,7 +1797,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_NoGravity FL_NoGravity name: radio_bullet_panel_ding2 -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1815,7 +1815,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_NoGravity FL_NoGravity name: radio_bullet_panel_ding3 -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- @@ -1833,7 +1833,7 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_NoGravity FL_NoGravity name: radio_bullet_panel_ding4 -callback: C_FormBaseDeprecatedInputCB +callback: C_FormBaseInputCB argument: 0 -------------------- -- 2.39.2