diff --git a/src/frontends/xforms/Dialogs3.C b/src/frontends/xforms/Dialogs3.C index 0e826a1cf0..95499c0239 100644 --- a/src/frontends/xforms/Dialogs3.C +++ b/src/frontends/xforms/Dialogs3.C @@ -36,8 +36,10 @@ #include "forms/form_ert.h" #include "ControlIndex.h" -#include "FormIndex.h" -#include "forms/form_index.h" +#include "ControlLabel.h" + +#include "FormText.h" +#include "forms/form_text.h" #include "ControlRef.h" #include "FormRef.h" @@ -73,7 +75,7 @@ namespace { // "minipage", "ref", "tabular", "toc", // "url", "wrap" }; char const * const dialognames[] = { "bibitem", "bibtex", "citation", - "error", "ert", "index", "ref", + "error", "ert", "index", "label", "ref", "toc", "url" }; char const * const * const end_dialognames = @@ -128,7 +130,11 @@ Dialog * Dialogs::build(string const & name) dialog->setButtonController(new NoRepeatedApplyReadOnlyBC); } else if (name == "index") { dialog->setController(new ControlIndex(*dialog)); - dialog->setView(new FormIndex(*dialog)); + dialog->setView(new FormText(*dialog, _("Index"))); + dialog->setButtonController(new NoRepeatedApplyReadOnlyBC); + } else if (name == "label") { + dialog->setController(new ControlLabel(*dialog)); + dialog->setView(new FormText(*dialog, _("Label"))); dialog->setButtonController(new NoRepeatedApplyReadOnlyBC); } else if (name == "ref") { dialog->setController(new ControlRef(*dialog)); diff --git a/src/frontends/xforms/FormIndex.C b/src/frontends/xforms/FormText.C similarity index 50% rename from src/frontends/xforms/FormIndex.C rename to src/frontends/xforms/FormText.C index 99ef7d6036..29487d2184 100644 --- a/src/frontends/xforms/FormIndex.C +++ b/src/frontends/xforms/FormText.C @@ -1,5 +1,5 @@ /** - * \file xforms/FormIndex.C + * \file FormText.C * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * @@ -10,29 +10,28 @@ #include - #include "xformsBC.h" -#include "ControlIndex.h" -#include "FormIndex.h" -#include "forms/form_index.h" +#include "ControlCommand.h" +#include "FormText.h" +#include "forms/form_text.h" #include "support/lstrings.h" #include FORMS_H_LOCATION -typedef FormController > base_class; +typedef FormController > base_class; -FormIndex::FormIndex(Dialog & parent) - : base_class(parent, _("Index")) +FormText::FormText(Dialog & parent, string const & title) + : base_class(parent, title) {} -void FormIndex::build() +void FormText::build() { - dialog_.reset(build_index(this)); + dialog_.reset(build_text(this)); - fl_set_input_return(dialog_->input_key, FL_RETURN_CHANGED); - setPrehandler(dialog_->input_key); + fl_set_input_return(dialog_->input_text, FL_RETURN_CHANGED); + setPrehandler(dialog_->input_text); // Manage the ok, apply, restore and cancel/close buttons bc().setOK(dialog_->button_ok); @@ -40,20 +39,20 @@ void FormIndex::build() bc().setCancel(dialog_->button_close); bc().setRestore(dialog_->button_restore); - bc().addReadOnly(dialog_->input_key); + bc().addReadOnly(dialog_->input_text); } -void FormIndex::update() +void FormText::update() { string const contents = trim(controller().params().getContents()); - fl_set_input(dialog_->input_key, contents.c_str()); + fl_set_input(dialog_->input_text, contents.c_str()); bc().valid(!contents.empty()); } -void FormIndex::apply() +void FormText::apply() { - controller().params().setContents(fl_get_input(dialog_->input_key)); + controller().params().setContents(fl_get_input(dialog_->input_text)); } diff --git a/src/frontends/xforms/FormIndex.h b/src/frontends/xforms/FormText.h similarity index 60% rename from src/frontends/xforms/FormIndex.h rename to src/frontends/xforms/FormText.h index c1b2d29081..94cd5b8f44 100644 --- a/src/frontends/xforms/FormIndex.h +++ b/src/frontends/xforms/FormText.h @@ -1,6 +1,6 @@ // -*- C++ -*- /** - * \file xforms/FormIndex.h + * \file FormText.h * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * @@ -9,21 +9,20 @@ * Full author contact details are available in file CREDITS */ -#ifndef FORMINDEX_H -#define FORMINDEX_H +#ifndef FORMTEXT_H +#define FORMTEXT_H #include "FormDialogView.h" -class ControlIndex; -struct FD_index; +class ControlCommand; +struct FD_text; -/** This class provides an XForms implementation of the Index Dialog. - */ -class FormIndex : public FormController > { + +class FormText : public FormController > { public: /// - FormIndex(Dialog &); + FormText(Dialog &, string const & title); private: /// Set the Params variable for the Controller. virtual void apply(); @@ -33,4 +32,4 @@ private: virtual void update(); }; -#endif // FORMINDEX_H +#endif // FORMTEXT_H diff --git a/src/frontends/xforms/Makefile.am b/src/frontends/xforms/Makefile.am index 3ac9282f94..094f1e7950 100644 --- a/src/frontends/xforms/Makefile.am +++ b/src/frontends/xforms/Makefile.am @@ -91,8 +91,6 @@ libxforms_la_SOURCES = \ FormGraphics.h \ FormInclude.C \ FormInclude.h \ - FormIndex.C \ - FormIndex.h \ FormLog.C \ FormLog.h \ FormMathsBitmap.C \ @@ -133,6 +131,8 @@ libxforms_la_SOURCES = \ FormTabularCreate.h \ FormTexinfo.C \ FormTexinfo.h \ + FormText.C \ + FormText.h \ FormThesaurus.C \ FormThesaurus.h \ FormToc.C \ diff --git a/src/frontends/xforms/forms/Makefile.am b/src/frontends/xforms/forms/Makefile.am index 615ad924f0..8882867665 100644 --- a/src/frontends/xforms/forms/Makefile.am +++ b/src/frontends/xforms/forms/Makefile.am @@ -23,7 +23,6 @@ SRCS = form_aboutlyx.fd \ form_forks.fd \ form_graphics.fd \ form_include.fd \ - form_index.fd \ form_maths_delim.fd \ form_maths_matrix.fd \ form_maths_panel.fd \ @@ -41,6 +40,7 @@ SRCS = form_aboutlyx.fd \ form_tabular.fd \ form_tabular_create.fd \ form_texinfo.fd \ + form_text.fd \ form_thesaurus.fd \ form_toc.fd \ form_url.fd \ diff --git a/src/frontends/xforms/forms/form_index.fd b/src/frontends/xforms/forms/form_text.fd similarity index 98% rename from src/frontends/xforms/forms/form_index.fd rename to src/frontends/xforms/forms/form_text.fd index 72d4c05883..66c9de6456 100644 --- a/src/frontends/xforms/forms/form_index.fd +++ b/src/frontends/xforms/forms/form_text.fd @@ -7,7 +7,7 @@ Number of forms: 1 Unit of measure: FL_COORD_PIXEL =============== FORM =============== -Name: form_index +Name: form_text Width: 520 Height: 100 Number of Objects: 6 @@ -44,7 +44,7 @@ label: Keyword:|#K shortcut: resize: FL_RESIZE_X gravity: FL_NoGravity FL_NoGravity -name: input_key +name: input_text callback: C_FormDialogView_InputCB argument: 0