|
|
|
@ -103,6 +103,7 @@ void QTSGraph::Circle(int x, int y, int radius) |
|
|
|
|
|
|
|
|
|
bool QTSGraph::MouseClicked() |
|
|
|
|
{ |
|
|
|
|
QCoreApplication::processEvents(QEventLoop::AllEvents, 50); |
|
|
|
|
bool m = EventMouseClicked; |
|
|
|
|
EventMouseClicked = false; |
|
|
|
|
return m; |
|
|
|
@ -149,6 +150,18 @@ int QTSGraph::ReadKey() |
|
|
|
|
return t; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int QTSGraph::ReadMouseButton() |
|
|
|
|
{ |
|
|
|
|
if(IDMouseButton == -1) |
|
|
|
|
{ |
|
|
|
|
while(!MouseClicked() && this->isVisible()) |
|
|
|
|
Delay(1); |
|
|
|
|
} |
|
|
|
|
int t = IDMouseButton; |
|
|
|
|
IDMouseButton = -1; |
|
|
|
|
return t; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void QTSGraph::Rectangle(int x1, int y1, int x2, int y2) |
|
|
|
|
{ |
|
|
|
|
QPainter painter(&Canvas); |
|
|
|
@ -233,10 +246,17 @@ void QTSGraph::mousePressEvent(QMouseEvent *event) |
|
|
|
|
if (event->buttons() & Qt::LeftButton) |
|
|
|
|
{ |
|
|
|
|
// Левая кнопка
|
|
|
|
|
IDMouseButton = 1; |
|
|
|
|
} |
|
|
|
|
else if (event->buttons() & Qt::RightButton) |
|
|
|
|
{ |
|
|
|
|
// Правая кнопка
|
|
|
|
|
IDMouseButton = 2; |
|
|
|
|
} |
|
|
|
|
else if (event->buttons() & Qt::MiddleButton) |
|
|
|
|
{ |
|
|
|
|
// Средняя кнопка
|
|
|
|
|
IDMouseButton = 3; |
|
|
|
|
} |
|
|
|
|
ResetTimer->start(ResetInterval); |
|
|
|
|
} |
|
|
|
|