condensator(x1,y1,x2,y2);
cursor_on();
kn=0;
break;
case 3:
cursor_off();
setfillstyle(1,4);
floodfill(20,95,15);
cursor_on();
while(1){
if((ms_release(&ms,0)==1)||(ms_release(&ms,1)==1)){
x1=ms.hor_pos;
y1=ms.ver_pos;
break;
}
}
cursor_off();
for(i=0;i<=6;i++)
for(j=0;j<=6;j++)
a[i][j]=getpixel(x1-3+j,y1-3+i);
setcolor(8);
circle(x1,y1,3);
setfillstyle(1,14);
floodfill(x1,y1,8);
setcolor(15);
cursor_on();
while(1){
if((ms_release(&ms,0)==1)||(ms_release(&ms,1)==1)){
x2=ms.hor_pos;
y2=ms.ver_pos;
break;
}
}
cursor_off();
setfillstyle(1,7);
floodfill(20,95,15);
for(i=0;i<=6;i++)
for(j=0;j<=6;j++)
putpixel(x1-3+j,y1-3+i,a[i][j]);
if(x1>108&&x1<630&&x2>108&&x2<630)
if(y1>50&&y1<435&&y2>50&&y2<435)
// вызов функции, рисующей катушку
catushka(x1,y1,x2,y2);
cursor_on();
kn=0;
break;
case 4:
cursor_off();
setfillstyle(1,4);
floodfill(80,100,15);
floodfill(84,105,15);
cursor_on();
while(1){
if((ms_release(&ms,0)==1)||(ms_release(&ms,1)==1)){
x1=ms.hor_pos;
y1=ms.ver_pos;
break;
}
}
cursor_off();
for(i=0;i<=6;i++)
for(j=0;j<=6;j++)
a[i][j]=getpixel(x1-3+j,y1-3+i);
setcolor(8);
circle(x1,y1,3);
setfillstyle(1,14);
floodfill(x1,y1,8);
setcolor(15);
cursor_on();
while(1){
if((ms_release(&ms,0)==1)||(ms_release(&ms,1)==1)){
x2=ms.hor_pos;
y2=ms.ver_pos;
break;
}
}
cursor_off();
for(i=0;i<=6;i++)
for(j=0;j<=6;j++)
putpixel(x1-3+j,y1-3+i,a[i][j]);
if(x1>108&&x1<630&&x2>108&&x2<630)
if(y1>50&&y1<435&&y2>50&&y2<435)
// вызов функции, рисующей основной корпус
// реостата
rezistor(x1,y1,x2,y2);
cursor_on();
int x3,y3;
while(1){
if((ms_release(&ms,0)==1)||(ms_release(&ms,1)==1)){
x3=ms.hor_pos;
y3=ms.ver_pos;
break;
}
}
cursor_off();
if(x1>108&&x1<630&&x2>108&&x2<630&&x3>108&&x3<630)
if(y1>50&&y1<435&&y2>50&&y2<435&&y3>50&&y3<435)
// вызов функции, рисующей реостат
reostat(x1,y1,x2,y2,x3,y3);
setfillstyle(1,7);
floodfill(80,100,15);
floodfill(84,105,15);
cursor_on();
kn=0;
break;
case 5:
cursor_off();
setfillstyle(1,4);
floodfill(34,136,15);
floodfill(15,135,15);
floodfill(25,135,15);
cursor_on();
while(1){
if((ms_release(&ms,0)==1)||(ms_release(&ms,1)==1)){
x1=ms.hor_pos;
y1=ms.ver_pos;
break;
}
}
cursor_off();
for(i=0;i<=6;i++)
for(j=0;j<=6;j++)
a[i][j]=getpixel(x1-3+j,y1-3+i);
setcolor(8);
circle(x1,y1,3);
setfillstyle(1,14);
floodfill(x1,y1,8);
setcolor(15);
cursor_on();
while(1){
if((ms_release(&ms,0)==1)||(ms_release(&ms,1)==1)){
x2=ms.hor_pos;
y2=ms.ver_pos;
break;
}
}
cursor_off();
setfillstyle(1,7);
floodfill(15,135,15);
floodfill(25,135,15);
floodfill(34,136,15);
for(i=0;i<=6;i++)
for(j=0;j<=6;j++)
putpixel(x1-3+j,y1-3+i,a[i][j]);
if(x1>108&&x1<630&&x2>108&&x2<630)
if(y1>50&&y1<435&&y2>50&&y2<435)