+2001-08-29 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * FormBase.C (C_CutandPastePH): new function that can be used as a
+ pre-handler to any xforms text input widget. Will trigger an event on
+ pasting into the widget using the middle mouse button.
+
+ * FormPreamble.C (build): use this pre-handler for the input widget.
+
2001-08-26 Angus Leeming <a.leeming@ic.ac.uk>
* FormCitation.C:
#include "xformsBC.h"
#include "support/LAssert.h"
+// Callback function invoked by xforms when the dialog is closed by the
+// window manager
extern "C" int C_FormBaseWMHideCB(FL_FORM * form, void *);
+// To trigger an input event when pasting in an xforms input object
+// using the middle mouse button.
+extern "C" int C_CutandPastePH(FL_OBJECT *, int, FL_Coord, FL_Coord,
+ int, void *);
+
FormBase::FormBase(ControlButtons & c, string const & t, bool allowResize)
: ViewBC<xformsBC>(c), minw_(0), minh_(0), allow_resize_(allowResize),
{
GetForm(ob)->InputCB(ob, d);
}
+
+
+// To trigger an input event when pasting in an xforms input object
+// using the middle mouse button.
+extern "C" int C_CutandPastePH(FL_OBJECT * ob, int event,
+ FL_Coord, FL_Coord, int key, void *)
+{
+ if ((event == FL_PUSH) && (key == 2) && (ob->objclass == FL_INPUT)) {
+ C_FormBaseInputCB(ob, 0);
+ }
+
+ return 0;
+}
#include "form_preamble.h"
#include "xforms_helpers.h"
+// To trigger an input event when pasting in an xforms input object
+// using the middle mouse button.
+extern "C" int C_CutandPastePH(FL_OBJECT *, int, FL_Coord, FL_Coord,
+ int, void *);
+
typedef FormCB<ControlPreamble, FormDB<FD_form_preamble> > base_class;
FormPreamble::FormPreamble(ControlPreamble & c)
void FormPreamble::build()
{
dialog_.reset(build_preamble());
-
+
fl_set_input_return(dialog_->input_preamble, FL_RETURN_CHANGED);
+ fl_set_object_prehandler(dialog_->input_preamble, C_CutandPastePH);
// Manage the ok, apply and cancel/close buttons
bc().setOK(dialog_->button_ok);