+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
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));
#include "ControlCommand.h"
#include "FormText.h"
#include "forms/form_text.h"
+#include "forms_gettext.h"
#include "support/lstrings.h"
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)
{}
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);
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();
virtual void build();
/// Update dialog before/whilst showing it.
virtual void update();
+
+ ///
+ string const label_;
};
#endif // FORMTEXT_H