2 * FormCopyright Interface Class Implementation
7 #include FORMS_H_LOCATION
10 #pragma implementation
13 #include "xform_macros.h"
14 #include "form_copyright.h"
15 #include "FormCopyright.h"
18 #include "lyx_gui_misc.h"
21 C_RETURNCB(FormCopyright, WMHideCB)
22 C_GENERICCB(FormCopyright, OKCB)
24 FormCopyright::FormCopyright(LyXView * lv, Dialogs * d)
25 : dialog_(0), lv_(lv), d_(d), h_(0)
27 // let the dialog be shown
28 // This is a permanent connection so we won't bother
29 // storing a copy because we won't be disconnecting.
30 d->showCopyright.connect(slot(this, &FormCopyright::show));
34 FormCopyright::~FormCopyright()
40 void FormCopyright::build()
42 dialog_ = build_copyright();
43 fl_set_form_atclose(dialog_->form,
44 C_FormCopyrightWMHideCB, 0);
48 void FormCopyright::show()
54 if (dialog_->form->visible) {
55 fl_raise_form(dialog_->form);
57 fl_show_form(dialog_->form,
60 _("Copyright and Warranty"));
61 h_ = d_->hideAll.connect(slot(this, &FormCopyright::hide));
66 void FormCopyright::hide()
70 && dialog_->form->visible) {
71 fl_hide_form(dialog_->form);
77 int FormCopyright::WMHideCB(FL_FORM * form, void *)
79 // Ensure that the signal h is disconnected even if the
80 // window manager is used to close the dialog.
81 FormCopyright * pre = static_cast<FormCopyright*>(form->u_vdata);
87 void FormCopyright::OKCB(FL_OBJECT * ob, long)
89 FormCopyright * pre = static_cast<FormCopyright*>(ob->form->u_vdata);