}
-GuiWorkArea::~GuiWorkArea()
-{
-}
-
-
void GuiWorkArea::setScrollbarParams(int h, int scroll_pos, int scroll_line_step)
{
verticalScrollBar()->setTracking(false);
void GuiWorkArea::paintEvent(QPaintEvent * e)
{
+ lyxerr << "paintEvent begin: x: " << e->rect().x()
+ << " y: " << e->rect().y()
+ << " w: " << e->rect().width()
+ << " h: " << e->rect().height() << endl;
/*
lyxerr[Debug::GUI] << BOOST_CURRENT_FUNCTION
<< "\n QWidget width\t" << this->width()
if (show_hcursor_)
q.drawPixmap(cursor_x_, cursor_y_ + cursor_h_ - 1, hcursor_);
+
+ lyxerr << "paintEvent end" << endl;
}
QPixmap GuiWorkArea::copyScreen(int x, int y, int w, int h) const
{
+ lyxerr << "copyScreen begin: x: " << x << " y: " << y << endl;
return paint_device_.copy(x, y, w, h);
+ lyxerr << "copyScreen end " << endl;
}
-void GuiWorkArea::drawScreen(int x, int y, QPixmap pixmap)
+void GuiWorkArea::drawScreen(int x, int y, const QPixmap & pixmap)
{
+ lyxerr << "drawScreen begin: x: " << x << " y: " << y << endl;
QPainter q(&paint_device_);
q.drawPixmap(x, y, pixmap);
update(x, y, pixmap.width(), pixmap.height());
+ lyxerr << "drawScreen end" << endl;
}
void GuiWorkArea::expose(int x, int y, int w, int h)
{
- /*
- if (x == 0 && y == 0 && w == viewport()->width() && h == viewport()->height()) {
- viewport()->repaint(x, y, w, h);
- return;
- }
- */
-
update(x, y, w, h);
}
#include <QAbstractScrollArea>
#include <QMouseEvent>
-#include <QWheelEvent>
#include <QResizeEvent>
#include <QKeyEvent>
-#include <QPaintEvent>
#include <QTimer>
-#include <QImage>
#include <QPixmap>
#include <queue>
-class Painter;
-
class QWidget;
class QDragEnterEvent;
class QDropEvent;
-class QMouseEvent;
+class QWheelEvent;
+class QPaintEvent;
namespace lyx {
+
+class Painter;
+
namespace frontend {
class GuiView;
Q_OBJECT
public:
-
+ ///
GuiWorkArea(int width, int height, LyXView & lyx_view);
- virtual ~GuiWorkArea();
/// return the width of the content pane
virtual int width() const { return viewport()->width(); }
-
/// return the height of the content pane
virtual int height() const { return viewport()->height(); }
///
QPixmap copyScreen(int x, int y, int w, int h) const;
/// Draw a pixmap onto the backing pixmap.
- /**
- QPixmap is implicitely shared so no need to pass by reference.
- */
- void drawScreen(int x, int y, QPixmap pixmap);
+ void drawScreen(int x, int y, const QPixmap & pixmap);
/// copies specified area of pixmap to screen
virtual void expose(int x, int y, int exp_width, int exp_height);
namespace lyx {
-int const button_size = 40;
+int const button_size = 32;
IconPalette::IconPalette(QWidget * parent)
void IconPalette::clicked()
{
- vector<Button>::const_iterator it(buttons_.begin());
- vector<Button>::const_iterator const end(buttons_.end());
+ vector<Button>::const_iterator it = buttons_.begin();
+ vector<Button>::const_iterator const end = buttons_.end();
for (; it != end; ++it) {
if (sender() == it->first) {
- // emit signal
+ // emit signal
button_clicked(it->second);
return;
}