Loading
新闻中心库存中心价格中心PDF中心图片中心
ICGLE 电子技术支持中心,为电气人员和相关企业提供全面的信息(IC技术\IC库存\IC图片\PDF资料等)服务
总线设计PCB设计单片机DSPARM
JAVA驱动设计C/C++汇编J2EE网络协议中间件技术嵌入式系统无线通信通信网络模拟技术接口电路显示光电传感与控制EDA/PLD
气流体控制电子产品电机及工具通信设备仪器仪表电线电缆建筑电气低压电器高压电器电源工控自动化广电设备医疗器械More..
电源设计仪器仪表技术专递电路图片电子专栏储存技术汽车电子测量测试音响技术家用电器
成功方案市场分析行业标准应用前沿芯片应用综合专区
设计彩色框的C源程序
来源:普博C/C++语言世界   作者:佚名
字体大小:[大][中][小]


/*
*
* Short driver module
*
*/

main()
{
clrscr();
box(1,1,23,79);
box(2,2,21,77);
box(3,3,19,75);
box(4,4,17,73);
box(5,5,15,71);
box(6,6,13,69);
box(7,7,11,67);
box(8,8,9,65);
box(9,9,7,63);
box(10,10,5,61);
box(11,11,3,59);
box(12,12,1,57);
poscur(24,1);
}

/************************************************************
* BOX *
*----------------------------------------------------------*
* Written by: Jeff Ebert 7/01/87 *
* Modified by: xxxxxxxxxx *
* *
* Please modify me! *
* Possible Enhancements include but are not limited to: *
* 1) Variable box character styles [1 line or 2] *
* 2) Error checking *
* 3) Color options *
* *
* *
* This function builds a simple double frame for a menu. *
* The function is passed the parameters for the upper *
* left corner row, upper left corner column the height *
* of the frame and the width. *
* *
************************************************************/
#include

#define ULCOR 201
#define URCOR 187
#define LLCOR 200
#define LRCOR 188
#define VBAR 186
#define HBAR 205
#define ESC 27


box(row, col, hgt, wdth)
int row, col, hgt, wdth;

{
int x, y;

poscur(row,col);
putchar(ULCOR);
for(x = col + 1; x <=(col + wdth -1); x++)
putchar(HBAR);
putchar(URCOR);

for(x = row + 1; x <=(row + hgt - 1); x++){
poscur(x,col);
putchar(VBAR);
poscur(x,col+wdth);
putchar(VBAR);
}
poscur(x,col);
putchar(LLCOR);
for(x= col + 1; x <=(col + wdth -1); x++)
putchar(HBAR);
putchar(LRCOR);
}

/********************************************************
* POSCUR *
*------------------------------------------------------*
* This function positions the cursor at the specified *
* x,y coordinate. It uses the ANSI standard ESCAPE *
* sequence to produce the desired effect. Its not the *
* fastest way to position the cursor, but perhaps the *
* most portable. *
* *
********************************************************/
poscur(xcor,ycor)
int xcor,ycor;
{
printf("%c[%d;%dH",ESC,xcor,ycor);
}


/********************************************************
* CLRSCR *
*------------------------------------------------------*
* This function positions the cursor at the specified *
* x,y coordinate. It uses the ANSI standard ESCAPE *
* sequence to produce the desired effect. Its not the *
* fastest way to position the cursor, but perhaps the *
* most portable. *
* *
********************************************************/
clrscr()
{
printf("%c[2J",ESC);
}
Upload by 小刘(2007-6-1)
IC
IC
推荐技术文章:
IC
IC

©2007 版权归ICGLE所有   页面执行时间:78.125毫秒