]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormText.C
Introduce LFUN_PRINT.
[lyx.git] / src / frontends / xforms / FormText.C
index 29487d2184c498991e423eea1d309be0d1417ab8..0fd0cd15097b14df836a03932e1cb7cf615b97f7 100644 (file)
@@ -5,24 +5,33 @@
  *
  * \author Angus Leeming
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-#include "xformsBC.h"
-#include "ControlCommand.h"
 #include "FormText.h"
+#include "ControlCommand.h"
 #include "forms/form_text.h"
 
+#include "xformsBC.h"
+#include "forms_gettext.h"
+
+#include "controllers/ButtonController.h"
+
 #include "support/lstrings.h"
 
-#include FORMS_H_LOCATION
+#include "lyx_forms.h"
+
+using lyx::support::trim;
+
+using std::string;
+
 
 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,13 +42,16 @@ 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);
-       bc().setCancel(dialog_->button_close);
-       bc().setRestore(dialog_->button_restore);
+       bcview().setOK(dialog_->button_ok);
+       bcview().setApply(dialog_->button_apply);
+       bcview().setCancel(dialog_->button_close);
+       bcview().setRestore(dialog_->button_restore);
 
-       bc().addReadOnly(dialog_->input_text);
+       bcview().addReadOnly(dialog_->input_text);
 }