circle.cpp
来自「教材例子」· C++ 代码 · 共 31 行
CPP
31 行
//程序CIRCLE.CPP(8.6.6) 功能:圆类CIRCLE的类实现
#include "figstack.h"
CIRCLE::CIRCLE(int x, int y, int r):FIGURE(x, y)
{
radius=r;
}
void CIRCLE::show()
{
if(!is_visible()){
visible=TRUE;
circle(x_pos, y_pos, radius);
}
}
void CIRCLE::hide()
{
int temp_color;
if(is_visible()){
temp_color=getcolor();
setcolor(getbkcolor());
visible=FALSE;
circle(x_pos, y_pos, radius);
setcolor(temp_color);
}
}
void CIRCLE::expand(int delta)
{
this->hide();
if(delta>0) radius*=delta;
else if(delta<0) radius/=-delta;
this->show();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?