2001-03-23 17:09:34 +00:00
|
|
|
/*
|
|
|
|
* \file FormError.C
|
|
|
|
* This file is part of
|
2000-09-22 15:09:51 +00:00
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
2001-03-23 17:09:34 +00:00
|
|
|
* Copyright 2000-2001 The LyX Team.
|
2000-09-22 15:09:51 +00:00
|
|
|
*
|
|
|
|
* ======================================================
|
2001-03-23 17:09:34 +00:00
|
|
|
*
|
|
|
|
* \author Angus Leeming, a.leeming@.ac.uk
|
2000-09-22 15:09:51 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
2001-03-23 17:09:34 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "xformsBC.h"
|
|
|
|
#include "ControlError.h"
|
2000-09-22 15:09:51 +00:00
|
|
|
#include "FormError.h"
|
|
|
|
#include "form_error.h"
|
2001-03-23 17:09:34 +00:00
|
|
|
#include "xforms_helpers.h" // formatted
|
2000-10-03 05:53:25 +00:00
|
|
|
|
2001-03-23 17:09:34 +00:00
|
|
|
typedef FormCB<ControlError, FormDB<FD_form_error> > base_class;
|
2000-10-03 05:53:25 +00:00
|
|
|
|
2001-03-23 17:09:34 +00:00
|
|
|
FormError::FormError(ControlError & c)
|
|
|
|
: base_class(c, _("LaTeX Error"))
|
|
|
|
{}
|
2000-09-22 15:09:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
void FormError::build()
|
|
|
|
{
|
2001-03-15 13:37:04 +00:00
|
|
|
dialog_.reset(build_error());
|
2000-09-22 15:09:51 +00:00
|
|
|
|
2000-11-28 06:46:06 +00:00
|
|
|
// Manage the cancel/close button
|
2001-03-15 13:37:04 +00:00
|
|
|
bc().setCancel(dialog_->button_cancel);
|
2000-09-22 15:09:51 +00:00
|
|
|
}
|
2001-03-23 17:09:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
void FormError::update()
|
|
|
|
{
|
|
|
|
string const txt = formatted(controller().params(),
|
2001-04-04 21:53:26 +00:00
|
|
|
dialog_->message->w - 10);
|
2001-03-23 17:09:34 +00:00
|
|
|
fl_set_object_label(dialog_->message, txt.c_str());
|
|
|
|
}
|