]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormCopyright.C
More pref work from Angus
[lyx.git] / src / frontends / xforms / FormCopyright.C
index 75488fdbf9f9fce70e77dd162a9b7d70be44e024..0cef3ce770b7d69240c3aeeea52a5218fdb4895b 100644 (file)
 #pragma implementation
 #endif
 
-#include "xform_macros.h"
-#include "form_copyright.h"
-#include "FormCopyright.h"
 #include "Dialogs.h"
 #include "LyXView.h"
-#include "lyx_gui_misc.h"
-#include "gettext.h"
-
-C_RETURNCB(FormCopyright, WMHideCB)
-C_GENERICCB(FormCopyright, OKCB)
+#include "form_copyright.h"
+#include "FormCopyright.h"
 
-FormCopyright::FormCopyright(LyXView * lv, Dialogs * d)
-       : dialog_(0), lv_(lv), d_(d), h_(0)
+FormCopyright::FormCopyright( LyXView * lv, Dialogs * d        )
+       : FormBaseBI( lv, d, _("Copyright and Warranty") ),
+         dialog_(0)
 {
        // let the dialog be shown
        // This is a permanent connection so we won't bother
@@ -37,55 +32,18 @@ FormCopyright::~FormCopyright()
 }
 
 
-void FormCopyright::build()
+FL_FORM * FormCopyright::form() const
 {
-       dialog_ = build_copyright();
-       fl_set_form_atclose(dialog_->form,
-                           C_FormCopyrightWMHideCB, 0);
+       if ( dialog_ ) return dialog_->form;
+       return 0;
 }
 
 
-void FormCopyright::show()
-{
-       if (!dialog_) {
-               build();
-       }
-
-       if (dialog_->form->visible) {
-               fl_raise_form(dialog_->form);
-       } else {
-               fl_show_form(dialog_->form,
-                            FL_PLACE_MOUSE,
-                            FL_FULLBORDER,
-                            _("Copyright and Warranty"));
-               h_ = d_->hideAll.connect(slot(this, &FormCopyright::hide));
-       }
-}
-
-
-void FormCopyright::hide()
-{
-       if (dialog_
-           && dialog_->form
-           && dialog_->form->visible) {
-               fl_hide_form(dialog_->form);
-               h_.disconnect();
-       }
-}
-
-
-int FormCopyright::WMHideCB(FL_FORM * form, void *)
+void FormCopyright::build()
 {
-       // Ensure that the signal h is disconnected even if the
-       // window manager is used to close the dialog.
-       FormCopyright * pre = static_cast<FormCopyright*>(form->u_vdata);
-       pre->hide();
-       return FL_CANCEL;
-}
-
+       dialog_ = build_copyright();
 
-void FormCopyright::OKCB(FL_OBJECT * ob, long)
-{
-       FormCopyright * pre = static_cast<FormCopyright*>(ob->form->u_vdata);
-       pre->hide();
+       // Workaround dumb xforms sizing bug
+       minw_ = form()->w;
+       minh_ = form()->h;
 }