2 * FormCopyright Interface Class Implementation
6 #include "lyx_gui_misc.h"
8 #include FORMS_H_LOCATION
10 #include "xform_macros.h"
11 #include "FormCopyright.h"
16 #pragma implementation
19 C_RETURNCB(FormCopyright, WMHideCB)
20 C_GENERICCB(FormCopyright, OKCB)
22 FormCopyright::FormCopyright(LyXView * lv, Dialogs * d)
23 : dialog_(0), lv_(lv), d_(d), h_(0)
25 // let the dialog be shown
26 // This is a permanent connection so we won't bother
27 // storing a copy because we won't be disconnecting.
28 d->showCopyright.connect(slot(this, &FormCopyright::show));
32 FormCopyright::~FormCopyright()
38 void FormCopyright::build()
40 dialog_ = build_copyright();
44 void FormCopyright::show()
48 fl_set_form_atclose(dialog_->form_copyright,
49 C_FormCopyrightWMHideCB, 0);
52 if (dialog_->form_copyright->visible) {
53 fl_raise_form(dialog_->form_copyright);
55 fl_show_form(dialog_->form_copyright,
58 _("Copyright and Warranty"));
59 h_ = d_->hideAll.connect(slot(this, &FormCopyright::hide));
64 void FormCopyright::hide()
67 && dialog_->form_copyright
68 && dialog_->form_copyright->visible) {
69 fl_hide_form(dialog_->form_copyright);
76 void FormCopyright::free()
78 // we don't need to delete h here because
79 // hide() does that after disconnecting.
81 if (dialog_->form_copyright
82 && dialog_->form_copyright->visible) {
85 fl_free_form(dialog_->form_copyright);
92 int FormCopyright::WMHideCB(FL_FORM * form, void *)
94 // Ensure that the signal h is disconnected even if the
95 // window manager is used to close the dialog.
96 FormCopyright * pre = static_cast<FormCopyright*>(form->u_vdata);
102 void FormCopyright::OKCB(FL_OBJECT * ob, long)
104 FormCopyright * pre = static_cast<FormCopyright*>(ob->form->u_vdata);