]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_gui.C
more fixes and updates
[lyx.git] / src / lyx_gui.C
index 1949740193a681ffec9fef47fe39d2d67f7f8242..cc6498dc01b74af6c53a0b9003c160283520544a 100644 (file)
@@ -26,7 +26,7 @@
 #include "tex-strings.h"
 #include "lyx_main.h"
 #include "latexoptions.h"
-#include "error.h"
+#include "debug.h"
 #include "version.h"
 #include "LyXView.h"
 #include "buffer.h"
@@ -144,17 +144,17 @@ FL_resource res[] =
 };
 
 
-static int LyX_XErrHandler(Display *display, XErrorEvent *xeev)
+extern "C" int LyX_XErrHandler(Display *display, XErrorEvent *xeev)
 {
 //#warning Please see if you can trigger this!
        // emergency save
-       if (!bufferlist.isEmpty())
+       if (!bufferlist.empty())
                bufferlist.emergencyWriteAll();
 
        // Get the reason for the crash.
        char etxt[513];
        XGetErrorText(display, xeev->error_code, etxt, 512);
-       lyxerr.print(etxt);
+       lyxerr << etxt << endl;
        // By doing an abort we get a nice backtrace. (hopefully)
        abort();
        return 0; // Solaris CC wants us to return something
@@ -175,7 +175,7 @@ LyXGUI::LyXGUI(LyX *owner, int *argc, char *argv[], bool GUI)
        fl_get_app_resources(res, num_res);
        Display *display = fl_get_display();
        if (!display) {
-               lyxerr.print("LyX: unable to access X display, exiting");
+               lyxerr << "LyX: unable to access X display, exiting" << endl;
                exit(1);
        }
        fcntl(ConnectionNumber(display), F_SETFD, FD_CLOEXEC);
@@ -259,7 +259,8 @@ void LyXGUI::init()
                 fl_set_font_name(FL_BOLD_STYLE, menufontname.c_str());
         else
 #endif
-                lyxerr.print("Could not set menu font to " + menufontname);
+                lyxerr << "Could not set menu font to "
+                      << menufontname << endl;
 
 #if FL_REVISION > 85
         if (fl_set_font_name(FL_NORMAL_STYLE, popupfontname.c_str()) < 0)
@@ -271,7 +272,8 @@ void LyXGUI::init()
                 fl_set_font_name(FL_NORMAL_STYLE, popupfontname.c_str());
         else
 #endif
-                lyxerr.print("Could not set popup font to " + popupfontname);
+                lyxerr << "Could not set popup font to "
+                      << popupfontname << endl;
 
        // put here (after fl_initialize) to avoid segfault. Cannot be done
        // in setDefaults() (Matthias 140496)
@@ -323,9 +325,9 @@ void LyXGUI::init()
 
 void LyXGUI::create_forms()
 {
-       lyxerr.debug("Initializing LyXView...");
+       lyxerr.debug() << "Initializing LyXView..." << endl;
        lyxViews = new LyXView(width, height);
-       lyxerr.debug("Initializing LyXView...done");
+       lyxerr.debug() << "Initializing LyXView...done" << endl;
 
        // From here down should be done by somebody else. (Lgb)
 
@@ -420,6 +422,9 @@ void LyXGUI::create_forms()
        fl_addto_choice(fd_form_character->choice_color, 
                        _(" No change %l| No color | Black | White | Red | Green "
                        "| Blue | Cyan | Magenta | Yellow %l| Reset "));
+       fl_set_form_minsize(fd_form_character->form_character,
+                           fd_form_character->form_character->w,
+                           fd_form_character->form_character->h);
 
        // the document form
        fd_form_document = create_form_form_document();
@@ -468,6 +473,9 @@ void LyXGUI::create_forms()
                        _(" Smallskip | Medskip | Bigskip | Length "));
        fl_set_input_return(fd_form_document->input_default_skip,
                            FL_RETURN_ALWAYS);
+       fl_set_form_minsize(fd_form_document->form_document,
+                           fd_form_document->form_document->w,
+                           fd_form_document->form_document->h);
 
         // the paper form
        fd_form_paper = create_form_form_paper();
@@ -573,6 +581,8 @@ void LyXGUI::create_forms()
        // the ref form
        fd_form_ref = create_form_form_ref();
        fl_set_form_atclose(fd_form_ref->form_ref, CancelCloseBoxCB, 0);
+       fl_set_form_minsize(fd_form_ref->form_ref, fd_form_ref->form_ref->w,
+                           fd_form_ref->form_ref->h);
 
        // the latex options form
        fd_latex_options = create_form_LaTeXOptions();
@@ -622,7 +632,7 @@ void LyXGUI::runTime()
 
        while (!finished) {
                if (fl_check_forms() == FL_EVENT) {
-                       lyxerr.print("LyX: This shouldn't happen...");
+                       lyxerr << "LyX: This shouldn't happen..." << endl;
                        fl_XNextEvent(&ev);
                }
        }