#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"
// "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 =
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));
+++ /dev/null
-/**
- * \file xforms/FormIndex.C
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Angus Leeming
- *
- * Full author contact details are available in file CREDITS
- */
-
-#include <config.h>
-
-
-#include "xformsBC.h"
-#include "ControlIndex.h"
-#include "FormIndex.h"
-#include "forms/form_index.h"
-
-#include "support/lstrings.h"
-
-#include FORMS_H_LOCATION
-
-typedef FormController<ControlIndex, FormView<FD_index> > base_class;
-
-FormIndex::FormIndex(Dialog & parent)
- : base_class(parent, _("Index"))
-{}
-
-
-void FormIndex::build()
-{
- dialog_.reset(build_index(this));
-
- fl_set_input_return(dialog_->input_key, FL_RETURN_CHANGED);
- setPrehandler(dialog_->input_key);
-
- // Manage the ok, apply, restore and cancel/close buttons
- bc().setOK(dialog_->button_ok);
- bc().setApply(dialog_->button_apply);
- bc().setCancel(dialog_->button_close);
- bc().setRestore(dialog_->button_restore);
-
- bc().addReadOnly(dialog_->input_key);
-}
-
-
-void FormIndex::update()
-{
- string const contents = trim(controller().params().getContents());
- fl_set_input(dialog_->input_key, contents.c_str());
-
- bc().valid(!contents.empty());
-}
-
-
-void FormIndex::apply()
-{
- controller().params().setContents(fl_get_input(dialog_->input_key));
-}
+++ /dev/null
-// -*- C++ -*-
-/**
- * \file xforms/FormIndex.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Angus Leeming
- *
- * Full author contact details are available in file CREDITS
- */
-
-#ifndef FORMINDEX_H
-#define FORMINDEX_H
-
-
-#include "FormDialogView.h"
-
-class ControlIndex;
-struct FD_index;
-
-/** This class provides an XForms implementation of the Index Dialog.
- */
-class FormIndex : public FormController<ControlIndex, FormView<FD_index> > {
-public:
- ///
- FormIndex(Dialog &);
-private:
- /// Set the Params variable for the Controller.
- virtual void apply();
- /// Build the dialog.
- virtual void build();
- /// Update dialog before/whilst showing it.
- virtual void update();
-};
-
-#endif // FORMINDEX_H
--- /dev/null
+/**
+ * \file FormText.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Angus Leeming
+ *
+ * Full author contact details are available in file CREDITS
+ */
+
+#include <config.h>
+
+#include "xformsBC.h"
+#include "ControlCommand.h"
+#include "FormText.h"
+#include "forms/form_text.h"
+
+#include "support/lstrings.h"
+
+#include FORMS_H_LOCATION
+
+typedef FormController<ControlCommand, FormView<FD_text> > base_class;
+
+FormText::FormText(Dialog & parent, string const & title)
+ : base_class(parent, title)
+{}
+
+
+void FormText::build()
+{
+ dialog_.reset(build_text(this));
+
+ 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);
+ bc().setApply(dialog_->button_apply);
+ bc().setCancel(dialog_->button_close);
+ bc().setRestore(dialog_->button_restore);
+
+ bc().addReadOnly(dialog_->input_text);
+}
+
+
+void FormText::update()
+{
+ string const contents = trim(controller().params().getContents());
+ fl_set_input(dialog_->input_text, contents.c_str());
+
+ bc().valid(!contents.empty());
+}
+
+
+void FormText::apply()
+{
+ controller().params().setContents(fl_get_input(dialog_->input_text));
+}
--- /dev/null
+// -*- C++ -*-
+/**
+ * \file FormText.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Angus Leeming
+ *
+ * Full author contact details are available in file CREDITS
+ */
+
+#ifndef FORMTEXT_H
+#define FORMTEXT_H
+
+
+#include "FormDialogView.h"
+
+class ControlCommand;
+struct FD_text;
+
+
+class FormText : public FormController<ControlCommand, FormView<FD_text> > {
+public:
+ ///
+ FormText(Dialog &, string const & title);
+private:
+ /// Set the Params variable for the Controller.
+ virtual void apply();
+ /// Build the dialog.
+ virtual void build();
+ /// Update dialog before/whilst showing it.
+ virtual void update();
+};
+
+#endif // FORMTEXT_H
FormGraphics.h \
FormInclude.C \
FormInclude.h \
- FormIndex.C \
- FormIndex.h \
FormLog.C \
FormLog.h \
FormMathsBitmap.C \
FormTabularCreate.h \
FormTexinfo.C \
FormTexinfo.h \
+ FormText.C \
+ FormText.h \
FormThesaurus.C \
FormThesaurus.h \
FormToc.C \
form_forks.fd \
form_graphics.fd \
form_include.fd \
- form_index.fd \
form_maths_delim.fd \
form_maths_matrix.fd \
form_maths_panel.fd \
form_tabular.fd \
form_tabular_create.fd \
form_texinfo.fd \
+ form_text.fd \
form_thesaurus.fd \
form_toc.fd \
form_url.fd \
+++ /dev/null
-Magic: 13000
-
-Internal Form Definition File
- (do not change)
-
-Number of forms: 1
-Unit of measure: FL_COORD_PIXEL
-
-=============== FORM ===============
-Name: form_index
-Width: 520
-Height: 100
-Number of Objects: 6
-
---------------------
-class: FL_BOX
-type: UP_BOX
-box: 0 0 520 100
-boxtype: FL_UP_BOX
-colors: FL_COL1 FL_COL1
-alignment: FL_ALIGN_CENTER
-style: FL_NORMAL_STYLE
-size: FL_DEFAULT_SIZE
-lcol: FL_BLACK
-label:
-shortcut:
-resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
-name:
-callback:
-argument:
-
---------------------
-class: FL_INPUT
-type: NORMAL_INPUT
-box: 90 10 420 30
-boxtype: FL_DOWN_BOX
-colors: FL_COL1 FL_MCOL
-alignment: FL_ALIGN_LEFT
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: Keyword:|#K
-shortcut:
-resize: FL_RESIZE_X
-gravity: FL_NoGravity FL_NoGravity
-name: input_key
-callback: C_FormDialogView_InputCB
-argument: 0
-
---------------------
-class: FL_BUTTON
-type: NORMAL_BUTTON
-box: 10 60 100 30
-boxtype: FL_UP_BOX
-colors: FL_COL1 FL_COL1
-alignment: FL_ALIGN_CENTER
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: Restore|#R
-shortcut:
-resize: FL_RESIZE_NONE
-gravity: FL_SouthWest FL_SouthWest
-name: button_restore
-callback: C_FormDialogView_RestoreCB
-argument: 0
-
---------------------
-class: FL_BUTTON
-type: RETURN_BUTTON
-box: 190 60 100 30
-boxtype: FL_UP_BOX
-colors: FL_COL1 FL_COL1
-alignment: FL_ALIGN_CENTER
-style: FL_NORMAL_STYLE
-size: FL_DEFAULT_SIZE
-lcol: FL_BLACK
-label: OK
-shortcut: ^M
-resize: FL_RESIZE_NONE
-gravity: FL_SouthEast FL_SouthEast
-name: button_ok
-callback: C_FormDialogView_OKCB
-argument: 0
-
---------------------
-class: FL_BUTTON
-type: NORMAL_BUTTON
-box: 300 60 100 30
-boxtype: FL_UP_BOX
-colors: FL_COL1 FL_COL1
-alignment: FL_ALIGN_CENTER
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: Apply|#A
-shortcut:
-resize: FL_RESIZE_NONE
-gravity: FL_SouthEast FL_SouthEast
-name: button_apply
-callback: C_FormDialogView_ApplyCB
-argument: 0
-
---------------------
-class: FL_BUTTON
-type: NORMAL_BUTTON
-box: 410 60 100 30
-boxtype: FL_UP_BOX
-colors: FL_COL1 FL_COL1
-alignment: FL_ALIGN_CENTER
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: Cancel|^[
-shortcut:
-resize: FL_RESIZE_NONE
-gravity: FL_SouthEast FL_SouthEast
-name: button_close
-callback: C_FormDialogView_CancelCB
-argument: 0
-
-==============================
-create_the_forms
--- /dev/null
+Magic: 13000
+
+Internal Form Definition File
+ (do not change)
+
+Number of forms: 1
+Unit of measure: FL_COORD_PIXEL
+
+=============== FORM ===============
+Name: form_text
+Width: 520
+Height: 100
+Number of Objects: 6
+
+--------------------
+class: FL_BOX
+type: UP_BOX
+box: 0 0 520 100
+boxtype: FL_UP_BOX
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label:
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name:
+callback:
+argument:
+
+--------------------
+class: FL_INPUT
+type: NORMAL_INPUT
+box: 90 10 420 30
+boxtype: FL_DOWN_BOX
+colors: FL_COL1 FL_MCOL
+alignment: FL_ALIGN_LEFT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Keyword:|#K
+shortcut:
+resize: FL_RESIZE_X
+gravity: FL_NoGravity FL_NoGravity
+name: input_text
+callback: C_FormDialogView_InputCB
+argument: 0
+
+--------------------
+class: FL_BUTTON
+type: NORMAL_BUTTON
+box: 10 60 100 30
+boxtype: FL_UP_BOX
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Restore|#R
+shortcut:
+resize: FL_RESIZE_NONE
+gravity: FL_SouthWest FL_SouthWest
+name: button_restore
+callback: C_FormDialogView_RestoreCB
+argument: 0
+
+--------------------
+class: FL_BUTTON
+type: RETURN_BUTTON
+box: 190 60 100 30
+boxtype: FL_UP_BOX
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label: OK
+shortcut: ^M
+resize: FL_RESIZE_NONE
+gravity: FL_SouthEast FL_SouthEast
+name: button_ok
+callback: C_FormDialogView_OKCB
+argument: 0
+
+--------------------
+class: FL_BUTTON
+type: NORMAL_BUTTON
+box: 300 60 100 30
+boxtype: FL_UP_BOX
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Apply|#A
+shortcut:
+resize: FL_RESIZE_NONE
+gravity: FL_SouthEast FL_SouthEast
+name: button_apply
+callback: C_FormDialogView_ApplyCB
+argument: 0
+
+--------------------
+class: FL_BUTTON
+type: NORMAL_BUTTON
+box: 410 60 100 30
+boxtype: FL_UP_BOX
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Cancel|^[
+shortcut:
+resize: FL_RESIZE_NONE
+gravity: FL_SouthEast FL_SouthEast
+name: button_close
+callback: C_FormDialogView_CancelCB
+argument: 0
+
+==============================
+create_the_forms