#include "LyXFunc.h"
#include "Layout.h"
#include "LyXRC.h"
+#include "MenuBackend.h"
#include "MetricsInfo.h"
#include "Paragraph.h"
#include "paragraph_funcs.h"
}
+Menu const & BufferView::contextMenu(int x, int y) const
+{
+ // FIXME: Do something more elaborate here.
+ return menubackend.getMenu(from_ascii("edit"));
+}
+
+
void BufferView::scrollDocView(int value)
{
int const offset = value - d->scrollbarParameters_.position;
class FuncStatus;
class Intl;
class Inset;
+class Menu;
class ParIterator;
class ParagraphMetrics;
class Point;
ScrollbarParameters const & scrollbarParameters() const;
/// \return Tool tip for the given position.
docstring toolTip(int x, int y) const;
+ /// \return the context menu for the given position.
+ Menu const & contextMenu(int x, int y) const;
/// Save the current position as bookmark.
/// if idx == 0, save to temp_bookmark
#include "GuiApplication.h"
#include "GuiKeySymbol.h"
#include "GuiPainter.h"
+#include "GuiPopupMenu.h"
#include "GuiView.h"
#include "KeySymbol.h"
#include "Language.h"
#include "frontends/FontMetrics.h"
#include "frontends/WorkAreaManager.h"
+#include <QContextMenuEvent>
#include <QInputContext>
+#include <QHelpEvent>
#include <QLayout>
#include <QMainWindow>
#include <QPainter>
-#include <QToolButton>
#include <QPalette>
#include <QScrollBar>
#include <QTabBar>
#include <QTimer>
+#include <QToolButton>
#include <boost/bind.hpp>
}
+void GuiWorkArea::contextMenuEvent(QContextMenuEvent * e)
+{
+ QPoint pos = e->pos();
+ Menu const & menu = buffer_view_->contextMenu(pos.x(), pos.y());
+ LYXERR(Debug::GUI, "context menu resquested: " << menu.name());
+
+ // FIXME: do something with GuiPopupMenu and MenuBackend.
+ // Some cleanups of GuiPopupMenu and GuiMenubar are needed
+ // before!
+ QAbstractScrollArea::contextMenuEvent(e);
+}
+
+
void GuiWorkArea::focusInEvent(QFocusEvent * /*event*/)
{
// Repaint the whole screen.
#include <QTabWidget>
#include <QTimer>
-class QWidget;
+class QContextMenuEvent;
class QDragEnterEvent;
class QDropEvent;
class QKeyEvent;
class QWheelEvent;
class QPaintEvent;
+class QWidget;
#ifdef CursorShape
#undef CursorShape
///
bool event(QEvent *);
///
+ void contextMenuEvent(QContextMenuEvent *);
+ ///
void focusInEvent(QFocusEvent *);
///
void focusOutEvent(QFocusEvent *);