2006-06-30 14:50:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file InsertTableWidget.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Edwin Leuven
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef INSERTTABLEWIDGET_H
|
|
|
|
#define INSERTTABLEWIDGET_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2007-11-23 09:44:02 +00:00
|
|
|
class GuiView;
|
2006-06-30 14:50:44 +00:00
|
|
|
|
|
|
|
class InsertTableWidget : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
|
2013-05-02 16:27:32 +00:00
|
|
|
InsertTableWidget(QWidget *);
|
2006-06-30 14:50:44 +00:00
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
//! widget is visible
|
|
|
|
void visible(bool);
|
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
//! show the widget
|
|
|
|
void show(bool);
|
|
|
|
//! enable/disable parent
|
|
|
|
void updateParent();
|
|
|
|
|
|
|
|
protected Q_SLOTS:
|
|
|
|
void mouseMoveEvent(QMouseEvent *);
|
|
|
|
void mouseReleaseEvent(QMouseEvent *);
|
|
|
|
void mousePressEvent(QMouseEvent *);
|
|
|
|
void paintEvent(QPaintEvent *);
|
2007-05-28 22:27:45 +00:00
|
|
|
|
2006-06-30 14:50:44 +00:00
|
|
|
private:
|
|
|
|
//! update the geometry
|
|
|
|
void resetGeometry();
|
|
|
|
//! initialize parameters to default values
|
|
|
|
void init();
|
|
|
|
//! draw the grid
|
|
|
|
void drawGrid(int rows, int cols, Qt::GlobalColor color);
|
|
|
|
|
|
|
|
//! colwidth in pixels
|
|
|
|
int colwidth_;
|
|
|
|
//! rowheight in pixels
|
|
|
|
int rowheight_;
|
|
|
|
//! total rows
|
|
|
|
int rows_;
|
|
|
|
//! total cols
|
|
|
|
int cols_;
|
|
|
|
//! row of pointer
|
|
|
|
int bottom_;
|
|
|
|
//! column of pointer
|
2007-05-28 22:27:45 +00:00
|
|
|
int right_;
|
2006-06-30 14:50:44 +00:00
|
|
|
//! widget under mouse
|
|
|
|
bool underMouse_;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // INSERTTABLEWIDGET_H
|