-
Notifications
You must be signed in to change notification settings - Fork 5
/
tileselector.h
52 lines (43 loc) · 1.13 KB
/
tileselector.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef TILESELECTOR_H
#define TILESELECTOR_H
#include <QWidget>
#include <QString>
#include <QMouseEvent>
#include <QPixmap>
#include <QPainter>
//#include <QResizeEvent>
#include "tilebuffer.h"
class TileSelector : public QWidget
{
Q_OBJECT
public:
explicit TileSelector(QWidget *parent = 0);
~TileSelector();
void paintEvent(QPaintEvent *);
void mouseMoveEvent(QMouseEvent * ev);
void mousePressEvent(QMouseEvent * ev);
void leaveEvent(QEvent *);
void mouseReleaseEvent(QMouseEvent *ev);
void resizeEvent(QResizeEvent *);
void setTileBuffer(TileBuffer *tilebuffer);
QVector<QVector<int> > getSelectedTiles();
void IncTextureWidth();
void DecTextureWidth();
void setTextureWidth(int NumberOfTilesInAxisX);
int getTextureWidth();
QPixmap *getTexture() const;
signals:
void onTilesSelected();
public slots:
private:
void repaintBuffer();
TileBuffer *Buffer;
int TileSizeX, TileSizeY;
QPixmap *TilesImageBuf;
QRect HiglightRect;
QRect GrabbedAreaRect;
bool isMouseHovering;
bool isMouseDown;
int NumTilesInAxisX;
};
#endif // TILESELECTOR_H