2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 2000 The LyX Team.
9 * ======================================================
15 #pragma implementation
19 #include "FormError.h"
20 #include "form_error.h"
22 static int minh, minw;
24 FormError::FormError(LyXView * lv, Dialogs * d)
25 : FormBase(lv, d, _("LaTeX Error")),
26 dialog_(0), ih_(0), message_("")
28 // let the dialog be shown
29 // This is a permanent connection so we won't bother
30 // storing a copy because we won't be disconnecting.
31 d->showError.connect(slot(this, &FormError::showInset));
35 FormError::~FormError()
41 void FormError::showInset( InsetError * const inset )
43 if( dialogIsOpen || inset == 0 ) return;
45 ih_ = inset->hide.connect(slot(this, &FormError::hide));
47 message_ = inset->getContents();
52 void FormError::update()
54 fl_set_form_minsize(form(), minw, minh);
55 fl_set_object_label(dialog_->message, message_.c_str());
59 void FormError::build()
61 dialog_ = build_error();
63 // XFORMS bug workaround
64 // Define the min/max dimensions. Actually applied in update()
65 minw = form()->w; minh = form()->h;
69 void FormError::clearStore()
76 FL_FORM * const FormError::form() const
78 if( dialog_ ) // no need to test for dialog_->form