|
|
|
@ -1,5 +1,7 @@ |
|
|
|
|
#include "../qtsgraph.h" |
|
|
|
|
#include <string> |
|
|
|
|
#include <iostream> |
|
|
|
|
using namespace std; |
|
|
|
|
using namespace Qt; |
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[]) |
|
|
|
|
{ |
|
|
|
@ -20,30 +22,39 @@ void QTSGraph::PaintBox() |
|
|
|
|
{ |
|
|
|
|
// Начало рисования
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i <= 5; i++) |
|
|
|
|
SetColor(clRed); |
|
|
|
|
Circle(300, 300, 100); |
|
|
|
|
int k; |
|
|
|
|
k = ReadKey(); |
|
|
|
|
OutTextXY(20, 40, "Код нажатой клавиши: " + to_string(k)); |
|
|
|
|
if(k == 16777220) |
|
|
|
|
{ |
|
|
|
|
SetPenStyle(1, 1); |
|
|
|
|
PutPixel(300, 300, clRed, 3); |
|
|
|
|
for(int i = 0; i <= 5; i++) |
|
|
|
|
{ |
|
|
|
|
SetPenStyle(1, 1); |
|
|
|
|
SetColor(clBlue); |
|
|
|
|
Rectangle(5, 390 + i * 20, 220, 410 + i * 20); |
|
|
|
|
SetColor(clBlack); |
|
|
|
|
OutTextXY(10, 405 + i * 20, to_string(i)); |
|
|
|
|
SetPenStyle(1, i); |
|
|
|
|
Line(30, 400 + i * 20, 200, 400 + i * 20); |
|
|
|
|
} |
|
|
|
|
SetColor(0x00AAAAAA); |
|
|
|
|
Line(120, 120, 135, 260); |
|
|
|
|
SetPenWidth(5); |
|
|
|
|
SetColor(clBlue); |
|
|
|
|
Rectangle(5, 390 + i * 20, 220, 410 + i * 20); |
|
|
|
|
SetColor(clBlack); |
|
|
|
|
OutTextXY(10, 405 + i * 20, std::to_string(i)); |
|
|
|
|
SetPenStyle(1, i); |
|
|
|
|
Line(30, 400 + i * 20, 200, 400 + i * 20); |
|
|
|
|
} |
|
|
|
|
SetColor(0x00AAAAAA); |
|
|
|
|
Line(120, 120, 135, 260); |
|
|
|
|
SetPenWidth(5); |
|
|
|
|
SetColor(clBlue); |
|
|
|
|
Line(110, 110, 125, 250); |
|
|
|
|
PutPixel(100, 100, 0x00FF0000, 10); |
|
|
|
|
Delay(1000); |
|
|
|
|
PutPixel(300, 100); |
|
|
|
|
int x = 1; |
|
|
|
|
while(!MouseClicked() && x < 1024) |
|
|
|
|
{ |
|
|
|
|
PutPixel(x, 50, 0x555555 + x * 16, 5); |
|
|
|
|
x += 1; |
|
|
|
|
Delay(10); |
|
|
|
|
Line(110, 110, 125, 250); |
|
|
|
|
PutPixel(100, 100, 0x00FF0000, 10); |
|
|
|
|
Delay(1000); |
|
|
|
|
PutPixel(300, 100); |
|
|
|
|
int x = 1; |
|
|
|
|
while(!MouseClicked() && x < 1024) |
|
|
|
|
{ |
|
|
|
|
PutPixel(x, 50, 0x555555 + x * 16, 5); |
|
|
|
|
x += 1; |
|
|
|
|
Delay(10); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Конец рисования
|
|
|
|
|