#include "insetinfo.h"
#include "lyxparagraph.h"
-#include "error.h"
+#include "debug.h"
#include "lyxdraw.h"
#include "gettext.h"
#include "lyx_gui_misc.h" // CancelCloseBoxCB
{
string tmp = lex.GetString(); // should be "Info"
if (tmp != "Info")
- lyxerr.print("ERROR (InsetInfo::Read): "
- "consistency check 1 failed.");
+ lyxerr << "ERROR (InsetInfo::Read): "
+ "consistency check 1 failed." << endl;
while (lex.IsOK()) {
if (!lex.EatLine())
continue;
string const token = strip(lex.GetString());
- lyxerr.debug("Note: " + token, Error::LEX_PARSER);
+ lyxerr[Debug::PARSER] << "Note: " << token << endl;
if (token != "\\end_inset") {
contents += token + '\n';
}
}
+// This is just a wrapper.
+extern "C" void C_InsetInfo_CloseInfoCB(FL_OBJECT *, long data)
+{
+ InsetInfo::CloseInfoCB(0, data);
+}
void InsetInfo::Edit(int, int)
{
+ static int ow = -1, oh;
+
if(current_view->currentBuffer()->isReadonly())
WarnReadonly();
fl_set_object_gravity(obj, NorthWestGravity, SouthEastGravity);
obj = fl_add_button(FL_NORMAL_BUTTON,130,140,120,30,idex(_("Close|#C^[")));
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_gravity(obj, SouthWestGravity, SouthEastGravity);
- fl_set_object_callback(obj, CloseInfoCB, (long)this);
+ fl_set_object_gravity(obj, SouthEastGravity, SouthEastGravity);
+ fl_set_object_callback(obj, C_InsetInfo_CloseInfoCB, (long)this);
fl_set_object_shortcut(obj, scex(_("Close|#C^[")), (long)this);
fl_end_form();
fl_set_form_atclose(form, CancelCloseBoxCB, 0);
if (form->visible) {
fl_raise_form(form);
} else {
- fl_show_form(form,FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER,
+ fl_show_form(form,FL_PLACE_MOUSE | FL_FREE_SIZE,FL_FULLBORDER,
_("Note"));
+ if (ow < 0) {
+ ow = form->w;
+ oh = form->h;
+ }
+ fl_set_form_minsize(form, ow, oh);
}
}