ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 07.08.2024

Просмотров: 20

Скачиваний: 0

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

Лістинг модуля cq

#include <vcl.h>

#pragma hdrstop

#include "CQUnit.h"

#include "MainUnit.h"

int m=0,n=0;

//---------------------------------------------------------------------------

void __fastcall TCQForm::Button1Click(TObject *Sender)

{

if(m==0)

{

Image1->Canvas->Brush->Color=clBlack; Image1->Canvas->Ellipse(30,150,130,170);

Image1->Canvas->Pen->Color=clGreen;

Image1->Canvas->MoveTo(12,160); Image1->Canvas->LineTo(75,160);

Image1->Canvas->LineTo(75,110); Image1->Canvas->LineTo(15,170);

Image1->Canvas->Brush->Color=clGreen; Image1->Canvas->FloodFill(70,140,clGreen,fsBorder);

Image1->Canvas->Pen->Color=clBlack; Image1->Canvas->Ellipse(7,147,20,160);

Image1->Canvas->Ellipse(128,155,145,165); Image1->Canvas->Ellipse(10,165,25,175);

Image1->Canvas->MoveTo(130,160); Image1->Canvas->LineTo(75,110);

Image1->Canvas->LineTo(75,70); Image1->Canvas->Brush->Color=clWhite;

Image1->Canvas->Chord(52,65,61,85,61,80,52,80);

Image1->Canvas->Brush->Color=clGreen;

Image1->Canvas->Chord(45,70,130,110,75,70,75,110);

Image1->Canvas->Brush->Color=clWhite;

Image1->Canvas->Chord(70,90,90,100,75,90,75,100); Image1->Canvas->Chord(63,65,72,85,72,80,63,80);

Image1->Canvas->Brush->Color=clWhite; Image1->Canvas->Chord(70,90,90,100,75,90,75,100);

Image1->Canvas->Brush->Color=clBlack; Image1->Canvas->Ellipse(55,70,59,75);

Image1->Canvas->Ellipse(66,70,70,75); Image1->Canvas->Arc(50,90,70,100,50,95,70,95);

Image1->Canvas->Arc(50,89,70,99,50,94,70,94); m=1; Button1->Caption=("Сховати");

}

else

if(m==1) {Image1->Visible=false; m=2; Button1->Caption=("Показати"); }

else {Image1->Visible=true; m=1; Button1->Caption=("Сховати");}

}

//---------------------------------------------------------------------------

void __fastcall TCQForm::Button2Click(TObject *Sender)

{

if(n==0)

{

Image2->Canvas->MoveTo(10,180); Image2->Canvas->LineTo(110,180);

Image2->Canvas->LineTo(140,120); Image2->Canvas->LineTo(40,120);

Image2->Canvas->LineTo(10,180); Image2->Canvas->Brush->Color=clBlack;

Image2->Canvas->FloodFill(15,175,clBlack,fsBorder);

Image2->Canvas->Pen->Color=clGray;

Image2->Canvas->MoveTo(25,165); Image2->Canvas->LineTo(105,165);

Image2->Canvas->LineTo(125,135); Image2->Canvas->LineTo(45,135);

Image2->Canvas->LineTo(25,165); Image2->Canvas->Brush->Color=clGray;

Image2->Canvas->FloodFill(35,160,clGray,fsBorder);

Image2->Canvas->Pen->Color=clGreen; Image2->Canvas->Brush->Color=clGreen;

Image2->Canvas->Rectangle(60,90,90,150);

Image2->Canvas->Chord(60,135,90,160,60,150,90,150);

Image2->Canvas->Brush->Color=clRed;

Image2->Canvas->Chord(30,50,120,120,120,90,30,90);

Image2->Canvas->Brush->Color=clWhite;

Image2->Canvas->Ellipse(40,70,50,80); Image2->Canvas->Ellipse(100,65,110,75);

Image2->Canvas->Ellipse(55,75,65,85); Image2->Canvas->Ellipse(48,63,58,73);

Image2->Canvas->Ellipse(80,61,90,71); Image2->Canvas->Ellipse(65,60,75,70);

Image2->Canvas->Ellipse(70,70,80,80); Image2->Canvas->Ellipse(85,70,95,80);

n=1;

Button2->Caption=("Сховати");

}

else

if(n==1) {Image2->Visible=false; n=2; Button2->Caption=("Показати"); }

else {Image2->Visible=true; n=1; Button2->Caption=("Сховати");}

}