📄 circle.cpp
字号:
//程序CIRCLE.CPP(7.2.7) 功能:实现圆类CIRCLE的成员函数
#include "basgraph.h"
CIRCLE::CIRCLE(int x, int y, int r):POINT(x, y)
{
radius=r;
}
void CIRCLE::show()
{
if(!is_visible()){
visible=TRUE;
circle(x_pos, y_pos, radius);
}
}
void CIRCLE::hide()
{
unsigned int temp_color;
if(is_visible()){
temp_color=getcolor();
setcolor(getbkcolor());
visible=FALSE;
circle(x_pos, y_pos, radius);
setcolor(temp_color);
}
}
void CIRCLE::move_to(int x, int y)
{
hide();
x_pos=x;
y_pos=y;
show();
}
void CIRCLE::expand(int delta)
{
hide();
radius+=delta;
if(radius<0) radius=0;
show();
}
void CIRCLE::contract(int delta)
{
expand(-delta);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -