]> git.lyx.org Git - lyx.git/blobdiff - src/insets/inseterror.C
removed a warning from screen and added CFLAGS in lyx.spec.in.
[lyx.git] / src / insets / inseterror.C
index bac1127fcf4f4e5c08ebe7791e5859ce6db458e5..42f3a1e63d7c8be6661a119ee4fe1524479c5b45 100644 (file)
@@ -3,10 +3,10 @@
  * 
  *           LyX, The Document Processor
  *      
- *         Copyright (C) 1995 Matthias Ettrich
- *          Copyright (C) 1995-1998 The LyX Team.
+ *         Copyright 1995 Matthias Ettrich
+ *          Copyright 1995-1999 The LyX Team.
  *
- *======================================================*/
+ * ======================================================*/
 
 #include <config.h>
 
 #pragma implementation
 #endif
 
-
 #include "definitions.h"
 #include "inseterror.h"
 #include "lyxdraw.h"
 #include "gettext.h"
 #include "lyx_gui_misc.h" // CancelCloseBoxCB
 
-//     $Id: inseterror.C,v 1.1 1999/09/27 18:44:39 larsbj Exp $        
-
-#if !defined(lint) && !defined(WITH_WARNINGS)
-static char vcid[] = "$Id: inseterror.C,v 1.1 1999/09/27 18:44:39 larsbj Exp $";
-#endif /* lint */
-
 /* Error, used for the LaTeX-Error Messages */
 
 InsetError::InsetError()
 {
-       form = NULL;
+       form = 0;
 }
 
-InsetError::InsetError(LString const & string)
+InsetError::InsetError(string const & string)
        : contents(string)
 {
-       form = NULL;
+       form = 0;
 }
 
 
@@ -46,7 +39,7 @@ InsetError::~InsetError()
        if (form) {
                fl_hide_form(form);
                fl_free_form(form);
-               form = NULL;
+               form = 0;
        }
 }
 
@@ -117,19 +110,19 @@ int InsetError::Latex(FILE *, signed char /*fragile*/)
 }
 
 
-int InsetError::Latex(LString &, signed char /*fragile*/)
+int InsetError::Latex(string &, signed char /*fragile*/)
 {
        return 0;
 }
 
 
-int InsetError::Linuxdoc(LString &)
+int InsetError::Linuxdoc(string &)
 {
        return 0;
 }
 
 
-int InsetError::DocBook(LString &)
+int InsetError::DocBook(string &)
 {
        return 0;
 }
@@ -153,24 +146,33 @@ void InsetError::CloseErrorCB(FL_OBJECT *, long data)
        if (inset->form) {
                fl_hide_form(inset->form);
                fl_free_form(inset->form);
-               inset->form = NULL;
+               inset->form = 0;
        }
 }
 
+// A C wrapper
+extern "C" void C_InsetError_CloseErrorCB(FL_OBJECT *, long data)
+{
+        InsetError::CloseErrorCB(0,data);
+}
+
+
 void InsetError::Edit(int, int)
 {
+       static int ow = 400, oh = 240;
+
        if (!form) {
                FL_OBJECT *obj;
-               form = fl_bgn_form(FL_UP_BOX,400,240);
+               form = fl_bgn_form(FL_UP_BOX,ow,oh);
                strobj = fl_add_box(FL_FRAME_BOX,10,10,380,180,"");
                fl_set_object_color(strobj,FL_MCOL,FL_MCOL);
                fl_set_object_gravity(strobj, FL_NorthWest, FL_SouthEast);
                obj = fl_add_button(FL_RETURN_BUTTON,140,200,120,30,_("Close"));
-               fl_set_object_callback(obj, CloseErrorCB, (long)this);
-               fl_set_object_gravity(obj, FL_South, FL_South);
+               fl_set_object_callback(obj, C_InsetError_CloseErrorCB, (long)this);
+               fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
                fl_set_object_resize(obj, FL_RESIZE_NONE);
                fl_end_form();
-               fl_set_form_atclose(form, CancelCloseBoxCB, NULL);
+               fl_set_form_atclose(form, CancelCloseBoxCB, 0);
        }
        fl_set_object_label(strobj, contents.c_str());
        if (form->visible) {
@@ -178,6 +180,7 @@ void InsetError::Edit(int, int)
        } else {
                fl_show_form(form,FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER, 
                             _("LaTeX Error"));
+               fl_set_form_minsize(form, ow, oh);
        }
 }