radio.cpp

来自「DOS下的图形界面开发包」· C++ 代码 · 共 41 行

CPP
41
字号
// 1993 (c) ALL RIGHTS RESERVED
// AUTHOR: XuYongYong

/* 	radio.cpp
*/
#include "radio.h"

/**************************************************************************/
radio_class::radio_class (int ID,char *title_hotkey,
	int left,int top,int width,int height )
	:checkbox_class(ID,title_hotkey,left,top,width,height)
{	type =RADIO;}

/***************************************************************************/
void radio_class::draw ()
{
   if ( status & INVISIBLE) return;    // INVISIBLE
	setcolor (BLACK);
	FrameOval (box);
	control_class::draw ();
}
/**************************************************************************/
int radio_class::control_change_value
	(int new_value )
{   if (control_class::control_change_value(new_value)==TRUE)
		return TRUE;
  Trect tmprect=box;
	InsetRect (&tmprect,-2,-2);
	switch (new_value) {
		case UNCHECKED:
			FillOval (box,WHITE);
			break;
		case CHECKED:
			FillOval (tmprect,BLACK);
			break;
	}
	current_value =new_value;
	return TRUE;
}
/**************************************************************************/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?