]> git.lyx.org Git - features.git/commitdiff
Set the label on the FormText input widget from Dialogs3.C.
authorAngus Leeming <leeming@lyx.org>
Tue, 4 Mar 2003 13:54:05 +0000 (13:54 +0000)
committerAngus Leeming <leeming@lyx.org>
Tue, 4 Mar 2003 13:54:05 +0000 (13:54 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6335 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/xforms/ChangeLog
src/frontends/xforms/Dialogs3.C
src/frontends/xforms/FormText.C
src/frontends/xforms/FormText.h

index d14a9721e867649e39cf536db7a5623dad8465a1..52bf4b9c10fbe3ea84b6e6b67e23ab6618fb323d 100644 (file)
@@ -1,3 +1,10 @@
+2003-03-04  Angus Leeming  <leeming@lyx.org>
+
+       * FormText.[Ch]: the label of the input widget is passed to the
+       FormText c-tor and used in the build method. 
+
+       * Dialogs3.C: pass an extra arg to the FormText c-tor.
+
 2003-02-28  Alfredo Braunstein <abraunst@libero.it>
 
        * FormPreferences.C
index 95499c023989692d85c5a5619a7c2195ef841f45..2482052a84c449ca48062f3e0a70fe1f9d3a0e2c 100644 (file)
@@ -130,11 +130,13 @@ Dialog * Dialogs::build(string const & name)
                dialog->setButtonController(new NoRepeatedApplyReadOnlyBC);
        } else if (name == "index") {
                dialog->setController(new ControlIndex(*dialog));
-               dialog->setView(new FormText(*dialog, _("Index")));
+               dialog->setView(new FormText(*dialog,
+                                            _("Index"), _("Keyword:|#K")));
                dialog->setButtonController(new NoRepeatedApplyReadOnlyBC);
        } else if (name == "label") {
                dialog->setController(new ControlLabel(*dialog));
-               dialog->setView(new FormText(*dialog, _("Label")));
+               dialog->setView(new FormText(*dialog,
+                                            _("Label"), _("Label:|#L")));
                dialog->setButtonController(new NoRepeatedApplyReadOnlyBC);
        } else if (name == "ref") {
                dialog->setController(new ControlRef(*dialog));
index 29487d2184c498991e423eea1d309be0d1417ab8..868b9e7611560d2cc3d55b96cacd3aa8d1ca741a 100644 (file)
@@ -14,6 +14,7 @@
 #include "ControlCommand.h"
 #include "FormText.h"
 #include "forms/form_text.h"
+#include "forms_gettext.h"
 
 #include "support/lstrings.h"
 
@@ -21,8 +22,8 @@
 
 typedef FormController<ControlCommand, FormView<FD_text> > base_class;
 
-FormText::FormText(Dialog & parent, string const & title)
-       : base_class(parent, title)
+FormText::FormText(Dialog & parent, string const & title, string const & label)
+       : base_class(parent, title), label_(label)
 {}
 
 
@@ -33,6 +34,9 @@ void FormText::build()
        fl_set_input_return(dialog_->input_text, FL_RETURN_CHANGED);
        setPrehandler(dialog_->input_text);
 
+       fl_set_object_label(dialog_->input_text, idex(label_).c_str());
+       fl_set_button_shortcut(dialog_->input_text, scex(label_).c_str(), 1);
+
        // Manage the ok, apply, restore and cancel/close buttons
        bc().setOK(dialog_->button_ok);
        bc().setApply(dialog_->button_apply);
index 94cd5b8f44b68d2f0d56e6e417091318c67fc847..13ce31f33d0d4f92bd6fa75c8415ea5450ecc68a 100644 (file)
@@ -22,7 +22,7 @@ struct FD_text;
 class FormText : public FormController<ControlCommand, FormView<FD_text> > {
 public:
        ///
-       FormText(Dialog &, string const & title);
+       FormText(Dialog &, string const & title, string const & label);
 private:
        /// Set the Params variable for the Controller.
        virtual void apply();
@@ -30,6 +30,9 @@ private:
        virtual void build();
        /// Update dialog before/whilst showing it.
        virtual void update();
+
+       ///
+       string const label_;
 };
 
 #endif // FORMTEXT_H