2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
* \file GuiSetBorder.h
|
2006-03-05 17:24:44 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Edwin Leuven
|
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
2007-09-05 20:33:29 +00:00
|
|
|
|
|
|
|
#ifndef GUISETBORDER_H
|
|
|
|
#define GUISETBORDER_H
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
#include <QWidget>
|
|
|
|
#include <QPixmap>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
class QColor;
|
|
|
|
class QMouseEvent;
|
|
|
|
class QPaintEvent;
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
//namespace lyx {
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
class GuiSetBorder : public QWidget
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2012-11-10 12:34:45 +00:00
|
|
|
GuiSetBorder(QWidget * parent = 0, Qt::WindowFlags fl = 0);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
bool getLeft();
|
|
|
|
bool getRight();
|
|
|
|
bool getTop();
|
|
|
|
bool getBottom();
|
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
Q_SIGNALS:
|
2006-03-05 17:24:44 +00:00
|
|
|
void rightSet(bool);
|
|
|
|
void leftSet(bool);
|
|
|
|
void topSet(bool);
|
|
|
|
void bottomSet(bool);
|
|
|
|
void clicked();
|
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
public Q_SLOTS:
|
2006-03-05 17:24:44 +00:00
|
|
|
void setLeftEnabled(bool);
|
|
|
|
void setRightEnabled(bool);
|
|
|
|
void setTopEnabled(bool);
|
|
|
|
void setBottomEnabled(bool);
|
|
|
|
void setLeft(bool);
|
|
|
|
void setRight(bool);
|
|
|
|
void setTop(bool);
|
|
|
|
void setBottom(bool);
|
|
|
|
void setAll(bool);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void mousePressEvent(QMouseEvent * e);
|
|
|
|
void paintEvent(QPaintEvent * e);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void init();
|
|
|
|
|
|
|
|
void drawLine(QColor const & col, int x, int y, int x2, int y2);
|
|
|
|
|
|
|
|
void drawLeft(bool);
|
|
|
|
void drawRight(bool);
|
|
|
|
void drawTop(bool);
|
|
|
|
void drawBottom(bool);
|
|
|
|
|
|
|
|
class Border {
|
|
|
|
public:
|
|
|
|
Border() : set(true), enabled(true) {}
|
|
|
|
bool set;
|
|
|
|
bool enabled;
|
|
|
|
};
|
|
|
|
|
|
|
|
Border left_;
|
|
|
|
Border right_;
|
|
|
|
Border top_;
|
|
|
|
Border bottom_;
|
|
|
|
|
|
|
|
int m;
|
|
|
|
int l;
|
|
|
|
int w;
|
|
|
|
int h;
|
|
|
|
|
|
|
|
QPixmap buffer;
|
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
//} // namespace lyx
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
#endif // GUISETBORDER_H
|