]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormText.C
remove defaults stuff, let Qt handle no toolbar
[lyx.git] / src / frontends / xforms / FormText.C
index 29487d2184c498991e423eea1d309be0d1417ab8..7b5f73671d497c8fbab8160b3ebe4477c5b3a3de 100644 (file)
 #include <config.h>
 
 #include "xformsBC.h"
+#include "ButtonController.h"
 #include "ControlCommand.h"
 #include "FormText.h"
 #include "forms/form_text.h"
+#include "forms_gettext.h"
 
 #include "support/lstrings.h"
 
@@ -21,8 +23,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,13 +35,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);
 }