]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView_pimpl.C
Angus insetindex patch + protect patch from Dekel
[lyx.git] / src / BufferView_pimpl.C
index 18efb50d74a6c991fc528317a259551781f5d1c5..f7151736c66e9f50dea2a17302f50f1d1937e026 100644 (file)
 #include "TextCache.h"
 #include "bufferlist.h"
 #include "insets/insetbib.h"
-#include "menus.h"
 #include "lyx_gui_misc.h"
 #include "lyxrc.h"
 #include "intl.h"
 #include "support/LAssert.h"
 #include "frontends/Dialogs.h"
+#ifndef NEW_MENUBAR
+# include "menus.h"
+#endif
 
 #ifdef SIGC_CXX_NAMESPACES
 using SigC::slot;
@@ -44,6 +46,7 @@ bool selection_possible = false;
 extern BufferList bufferlist;
 extern char ascii_type;
 
+extern "C" void TimerCB(FL_OBJECT *, long); 
 extern void sigchldhandler(pid_t pid, int * status);
 extern int bibitemMaxWidth(BufferView *, LyXFont const &);
 
@@ -130,7 +133,6 @@ void BufferView::Pimpl::buffer(Buffer * b)
        if (buffer_) {
                lyxerr[Debug::INFO] << "Buffer addr: " << buffer_ << endl;
                buffer_->addUser(bv_);
-               owner_->getMenus()->showMenus();
                // If we don't have a text object for this, we make one
                if (bv_->text == 0) {
                        resizeCurrentBuffer();
@@ -139,12 +141,23 @@ void BufferView::Pimpl::buffer(Buffer * b)
                        updateScrollbar();
                }
                bv_->text->first = screen_->TopCursorVisible(bv_->text);
+#ifdef NEW_MENUBAR
+               owner_->updateMenubar();
+#else
+               owner_->getMenus()->showMenus();
+#endif
+               owner_->updateToolbar();
                redraw();
                owner_->getDialogs()->updateBufferDependent();
                bv_->insetWakeup();
        } else {
                lyxerr[Debug::INFO] << "  No Buffer!" << endl;
+#ifdef NEW_MENUBAR
+               owner_->updateMenubar();
+#else
                owner_->getMenus()->hideMenus();
+#endif
+               owner_->updateToolbar();
                updateScrollbar();
                workarea_->redraw();
 
@@ -754,7 +767,7 @@ void BufferView::Pimpl::workAreaButtonRelease(int x, int y,
        if (button >= 2) return;
 
        bv_->setState();
-       owner_->getMiniBuffer()->Set(CurrentState(bv_));
+       owner_->showState();
 
        // Did we hit an editable inset?
        if (inset_hit != 0) {