]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormBibitem.C
Introduce LFUN_PRINT.
[lyx.git] / src / frontends / xforms / FormBibitem.C
index 856cd3299f42730e79e244ec72304a1ed1cfe083..2544235c7c80edf1504dc60f8a3c565076b45b98 100644 (file)
@@ -1,34 +1,42 @@
 /**
  * \file FormBibitem.C
- * Copyright 2001 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author Angus Leeming, a.leeming@ic.ac.uk 
- * \author John Levon, moz@compsoc.man.ac.uk
+ * \author Angus Leeming
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS.
  */
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include <config.h>
-#include "xformsBC.h"
-#include "ControlBibitem.h"
+
 #include "FormBibitem.h"
-#include "form_bibitem.h"
-#include "gettext.h"
+#include "ControlCommand.h"
+#include "forms/form_bibitem.h"
+
+#include "Tooltips.h"
+#include "xformsBC.h"
+
 #include "support/lstrings.h" // compare
 
-typedef FormCB<ControlBibitem, FormDB<FD_form_bibitem> > base_class;
+#include "lyx_forms.h"
+
+using lyx::support::compare;
+
+using std::string;
 
-FormBibitem::FormBibitem(ControlBibitem & c)
-       : base_class(c, _("Bibliography Entry"))
+
+typedef FormController<ControlCommand, FormView<FD_bibitem> > base_class;
+
+FormBibitem::FormBibitem(Dialog & parent)
+       : base_class(parent, _("Bibliography Entry"))
 {}
 
 
 void FormBibitem::build()
 {
-       dialog_.reset(build_bibitem());
+       dialog_.reset(build_bibitem(this));
 
        fl_set_input_return(dialog_->input_key,   FL_RETURN_CHANGED);
        fl_set_input_return(dialog_->input_label, FL_RETURN_CHANGED);
@@ -36,18 +44,24 @@ void FormBibitem::build()
        setPrehandler(dialog_->input_key);
        setPrehandler(dialog_->input_label);
 
-        // Manage the ok, apply, restore and cancel/close buttons
-       bc().setOK(dialog_->button_ok);
-       bc().setCancel(dialog_->button_close);
+       // Manage the ok, apply, restore and cancel/close buttons
+       bcview().setOK(dialog_->button_ok);
+       bcview().setCancel(dialog_->button_close);
+
+       bcview().addReadOnly(dialog_->input_key);
+       bcview().addReadOnly(dialog_->input_label);
 
-       bc().addReadOnly(dialog_->input_key);
-       bc().addReadOnly(dialog_->input_label);
+       // set up the tooltips
+       string str = _("Key used within LyX document.");
+       tooltips().init(dialog_->input_key, str);
+       str = _("Label used for final output.");
+       tooltips().init(dialog_->input_label, str);
 }
 
 
 ButtonPolicy::SMInput FormBibitem::input(FL_OBJECT *, long)
 {
-       // minimal validation 
+       // minimal validation
        if (!compare(fl_get_input(dialog_->input_key), ""))
                return ButtonPolicy::SMI_NOOP;