]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetinfo.C
removed a warning from screen and added CFLAGS in lyx.spec.in.
[lyx.git] / src / insets / insetinfo.C
index e016e92247e353603713ae9b5b7a0980e712051b..52e8935c176af5ccba552526383d6b99d3a83764 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "insetinfo.h"
 #include "lyxparagraph.h"
-#include "error.h"
+#include "debug.h"
 #include "lyxdraw.h"
 #include "gettext.h"
 #include "lyx_gui_misc.h" // CancelCloseBoxCB
@@ -100,8 +100,8 @@ void InsetInfo::Read(LyXLex &lex)
 {
        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())
@@ -110,7 +110,7 @@ void InsetInfo::Read(LyXLex &lex)
                        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';
@@ -170,9 +170,16 @@ void InsetInfo::CloseInfoCB(FL_OBJECT *, long data)
        }
 }
 
+// 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();
        
@@ -185,8 +192,8 @@ void InsetInfo::Edit(int, int)
                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);
@@ -195,8 +202,13 @@ void InsetInfo::Edit(int, int)
        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);
        }
 }