2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 2000 The LyX Team.
9 * ======================================================
14 #include FORMS_H_LOCATION
17 #pragma implementation
22 #include "xform_macros.h"
24 C_RETURNCB(FormBase, WMHideCB)
25 C_GENERICCB(FormBase, ApplyCB)
26 C_GENERICCB(FormBase, CancelCB)
27 C_GENERICCB(FormBase, InputCB)
28 C_GENERICCB(FormBase, OKCB)
30 FormBase::FormBase(LyXView * lv, Dialogs * d, string const & t)
31 : lv_(lv), d_(d), u_(0), h_(0), title(t), dialogIsOpen(false)
39 fl_set_form_atclose(form(),
40 C_FormBaseWMHideCB, 0);
43 fl_freeze_form( form() );
44 update(); // make sure its up-to-date
45 fl_unfreeze_form( form() );
48 if (form()->visible) {
49 fl_raise_form(form());
52 FL_PLACE_MOUSE | FL_FREE_SIZE,
55 u_ = d_->updateBufferDependent.
56 connect(slot(this, &FormBase::update));
57 h_ = d_->hideBufferDependent.
58 connect(slot(this, &FormBase::hide));
65 if (form() && form()->visible) {
71 // free up the dialog for another inset
77 int FormBase::WMHideCB(FL_FORM * form, void *)
79 // Ensure that the signals (u and h) are disconnected even if the
80 // window manager is used to close the dialog.
81 FormBase * pre = static_cast<FormBase*>(form->u_vdata);
87 void FormBase::ApplyCB(FL_OBJECT * ob, long)
89 FormBase * pre = static_cast<FormBase*>(ob->form->u_vdata);
94 void FormBase::CancelCB(FL_OBJECT * ob, long)
96 FormBase * pre = static_cast<FormBase*>(ob->form->u_vdata);
101 void FormBase::InputCB(FL_OBJECT * ob, long data )
103 FormBase * pre = static_cast<FormBase*>(ob->form->u_vdata);
108 void FormBase::OKCB(FL_OBJECT * ob, long)
110 FormBase * pre = static_cast<FormBase*>(ob->form->u_vdata);