#include "graphics/GraphicsImage.h"
#include "graphics/GraphicsLoader.h"
+#include "gettext.h"
#include "support/filetools.h" // LibFileSearch
#include "support/forkedcontr.h"
#include <boost/utility.hpp>
#include <boost/bind.hpp>
#include <boost/current_function.hpp>
-#include <boost/signals/trackable.hpp>
using lyx::support::libFileSearch;
using lyx::support::ForkedcallsController;
void WorkArea::setBufferView(BufferView * buffer_view)
{
+ if (buffer_view_) {
+ message_connection_.disconnect();
+ lyx_view_.disconnectBufferView();
+ }
+
+ theApp->setBufferView(buffer_view);
+
hideCursor();
buffer_view_ = buffer_view;
toggleCursor();
+
+ message_connection_ = buffer_view_->message.connect(
+ boost::bind(&WorkArea::displayMessage, this, _1));
+
+ lyx_view_.connectBufferView(*buffer_view);
}
if (!buffer_view_->buffer()) {
greyOut();
+ updateScrollbar();
return;
}
* of the cursor. Note we cannot do this inside
* dispatch() itself, because that's called recursively.
*/
-// if (buffer_view_->available())
+// if (buffer_view_->buffer())
toggleCursor();
// uneeded "redraw()" call commented out for now.
// Skip these when selecting
if (cmd0.action != LFUN_MOUSE_MOTION) {
lyx_view_.updateLayoutChoice();
+ lyx_view_.updateMenubar();
lyx_view_.updateToolbars();
}
void WorkArea::resizeBufferView()
{
+ lyx_view_.busy(true);
+ lyx_view_.message(_("Formatting document..."));
buffer_view_->workAreaResize(width(), height());
lyx_view_.updateLayoutChoice();
redraw();
+ lyx_view_.busy(false);
+ lyx_view_.clearMessage();
}
if (cursor_visible_)
return;
- if (!buffer_view_->available())
+ if (!buffer_view_->buffer())
return;
CursorShape shape = BAR_SHAPE;
cursor_timeout_.restart();
}
+
+void WorkArea::displayMessage(lyx::docstring const & message)
+{
+ lyx_view_.message(message);
+}
+
} // namespace frontend
} // namespace lyx