]> git.lyx.org Git - lyx.git/blobdiff - src/XFormsView.C
Fix deleting of paragraphs after undo (fix #236).
[lyx.git] / src / XFormsView.C
index 059e174a43e0f6b501d6d129b9cefac135442a4f..ce655b409019082e1b22768ddbe0449f615f2d3a 100644 (file)
@@ -15,9 +15,6 @@
 #pragma implementation
 #endif
 
-//#include <sys/time.h>
-//#include <unistd.h>
-
 #include "XFormsView.h"
 #if FL_REVISION < 89 || (FL_REVISION == 89 && FL_FIXLEVEL < 5)
 #include "lyxlookup.h"
@@ -29,6 +26,7 @@
 #include "support/filetools.h"        // OnlyFilename()
 #include "frontends/Toolbar.h"
 #include "frontends/Menubar.h"
+#include "frontends/Timeout.h"
 #include "MenuBackend.h"
 #include "ToolbarDefaults.h"
 #include "lyxfunc.h"
@@ -42,7 +40,15 @@ extern void QuitLyX();
 // This is very temporary
 BufferView * current_view;
 
-extern "C" int C_XFormsView_atCloseMainFormCB(FL_FORM *, void *);
+extern "C" {
+       
+static
+int C_XFormsView_atCloseMainFormCB(FL_FORM * form, void * p)
+{
+       return XFormsView::atCloseMainFormCB(form, p);
+}
+       
+}
 
 
 XFormsView::XFormsView(int width, int height)
@@ -53,7 +59,7 @@ XFormsView::XFormsView(int width, int height)
 
        // Connect the minibuffer signals
        minibuffer->stringReady.connect(SigC::slot(getLyXFunc(),
-                                                  &LyXFunc::miniDispatch));
+                                               &LyXFunc::miniDispatch));
        minibuffer->timeout.connect(SigC::slot(getLyXFunc(),
                                               &LyXFunc::initMiniBuffer));
        
@@ -87,14 +93,6 @@ int XFormsView::atCloseMainFormCB(FL_FORM *, void *)
 }
 
 
-// Wrapper for the above
-extern "C"
-int C_XFormsView_atCloseMainFormCB(FL_FORM * form, void * p)
-{
-       return XFormsView::atCloseMainFormCB(form, p);
-}
-
-
 void XFormsView::setPosition(int x, int y)
 {
        fl_set_form_position(form_, x, y);
@@ -103,6 +101,7 @@ void XFormsView::setPosition(int x, int y)
 
 void XFormsView::show(int place, int border, string const & title)
 {
+       fl_set_form_minsize(form_, form_->w, form_->h);
        fl_show_form(form_, place, border, title.c_str());
        getLyXFunc()->initMiniBuffer();
 #if FL_REVISION < 89 || (FL_REVISION == 89 && FL_FIXLEVEL < 5)
@@ -166,7 +165,7 @@ void XFormsView::create_form_form_main(int width, int height)
        // TIMERS
        //
 
-       autosave_timeout.timeout.connect(SigC::slot(this, &XFormsView::AutoSave));
+       autosave_timeout->timeout.connect(SigC::slot(this, &XFormsView::AutoSave));
        
        //
        // Misc
@@ -192,6 +191,8 @@ void XFormsView::create_form_form_main(int width, int height)
        fl_set_form_minsize(form_, 50, 50);
        
        fl_end_form();
+
+       minibuffer->dd_init(); 
 }
 
 
@@ -204,17 +205,18 @@ void XFormsView::init()
        
        // Start autosave timer
        if (lyxrc.autosave) {
-               autosave_timeout.setTimeout(lyxrc.autosave * 1000);
-               autosave_timeout.start();
+               autosave_timeout->setTimeout(lyxrc.autosave * 1000);
+               autosave_timeout->start();
        }
 
        intl->InitKeyMapper(lyxrc.use_kbmap);
 }
 
 
-void XFormsView::setWindowTitle(string const & title)
+void XFormsView::setWindowTitle(string const & title, string const & icon_title)
 {
        fl_set_form_title(form_, title.c_str());
+       fl_winicontitle(form_->window, icon_title.c_str());
 }
 
 
@@ -232,7 +234,7 @@ void XFormsView::prohibitInput() const
        static Cursor cursor;
        static bool cursor_undefined = true;
    
-       if (cursor_undefined){
+       if (cursor_undefined) {
                cursor = XCreateFontCursor(fl_get_display(), XC_watch);
                XFlush(fl_get_display());
                cursor_undefined = false;