mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
Set the label on the FormText input widget from Dialogs3.C.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6335 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
21448b2bf8
commit
543964eb3a
@ -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
|
||||
|
@ -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));
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user