X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FXFormsView.C;h=bb73db762bd46c46dd94ee6baa7d8ae81ab7c8d2;hb=98c966c64594611e469313314abd1e59524adb4a;hp=f22445be0f7933c9e0e9633c3ddc33d42a06dc16;hpb=82d18e917b011ec7cf0cffdf8c06e917f95d9d25;p=lyx.git diff --git a/src/XFormsView.C b/src/XFormsView.C index f22445be0f..bb73db762b 100644 --- a/src/XFormsView.C +++ b/src/XFormsView.C @@ -1,9 +1,8 @@ - /* This file is part of - * ====================================================== - * + * ====================================================== + * * LyX, The Document Processor - * + * * Copyright 1995 Matthias Ettrich * Copyright 1995-2001 The LyX Team. * @@ -26,6 +25,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" @@ -40,13 +40,13 @@ extern void QuitLyX(); BufferView * current_view; extern "C" { - + static int C_XFormsView_atCloseMainFormCB(FL_FORM * form, void * p) { return XFormsView::atCloseMainFormCB(form, p); } - + } @@ -58,10 +58,10 @@ 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)); - + // Make sure the buttons are disabled if needed. updateToolbar(); } @@ -112,10 +112,10 @@ void XFormsView::show(int place, int border, string const & title) void XFormsView::create_form_form_main(int width, int height) /* to make this work as it should, .lyxrc should have been * read first; OR maybe this one should be made dynamic. - * Hmmmm. Lgb. + * Hmmmm. Lgb. * We will probably not have lyxrc before the main form is - * initialized, because error messages from lyxrc parsing - * are presented (and rightly so) in GUI popups. Asger. + * initialized, because error messages from lyxrc parsing + * are presented (and rightly so) in GUI popups. Asger. */ { // the main form @@ -127,7 +127,7 @@ void XFormsView::create_form_form_main(int width, int height) // Parameters for the appearance of the main form int const air = 2; int const bw = abs(fl_get_border_width()); - + // // THE MENUBAR // @@ -157,20 +157,20 @@ void XFormsView::create_form_form_main(int width, int height) // MINIBUFFER // - minibuffer = new MiniBuffer(this, air, height - (25 + air), + minibuffer = new MiniBuffer(this, air, height - (25 + air), width - (2 * air), 25); // // TIMERS // - autosave_timeout.timeout.connect(SigC::slot(this, &XFormsView::AutoSave)); - + autosave_timeout->timeout.connect(SigC::slot(this, &XFormsView::AutoSave)); + // // Misc // - // assign an icon to main form + // assign an icon to main form string iconname = LibFileSearch("images", "lyx", "xpm"); if (!iconname.empty()) { unsigned int w, h; @@ -188,8 +188,10 @@ void XFormsView::create_form_form_main(int width, int height) // set min size fl_set_form_minsize(form_, 50, 50); - + fl_end_form(); + + minibuffer->dd_init(); } @@ -199,20 +201,21 @@ void XFormsView::init() invalidateLayoutChoice(); updateLayoutChoice(); updateMenubar(); - + // 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()); } @@ -229,14 +232,14 @@ 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; } - - /* set the cursor to the watch for all forms and the canvas */ + + /* set the cursor to the watch for all forms and the canvas */ XDefineCursor(fl_get_display(), getForm()->window, cursor); XFlush(fl_get_display()); @@ -247,7 +250,7 @@ void XFormsView::prohibitInput() const void XFormsView::allowInput() const { /* reset the cursor from the watch for all forms and the canvas */ - + XUndefineCursor(fl_get_display(), getForm()->window); XFlush(fl_get_display());