KUMARACC.C
----------
----------
Code:
#include<stdio.h>
#include<dos.h>
#include<conio.h>
#include "d:\kumaracc\button.c"
#include "d:\kumaracc\hvline.c"
#include "d:\kumaracc\label.c"
#include "d:\kumaracc\rect.c"
#include "d:\kumaracc\rmbutton.c"
#include "d:\kumaracc\textbox.c"
# define ALT_A 7680
# define ALT_L 9728
# define ALT_X 11520
void main(){
int key,c;
do{
clrscr();
printf("Enter choice\n");
printf("\n1. hvline\n2. label\n3. rect\n4. rmbutton\n5. textbox\n7. button\n6. Exit\n");
scanf("%d",&c);
switch(c){
case 1 : hline(10,10,20,'*');
vline(10,12,22,'*');
getch();
break;
case 2 : label(10,10,3,4,"DBList");
getch();
break;
case 3 : rect(10,10,30,12,'*','|');
getch();
break;
case 4 : rmbutton(10,10);
getch();
break;
case 5 : textbox(10,10,30);
getch();
break;
case 7 : button(10,10,"Open");
getch();
break;
case 6 : exit(0);
}
}while(1);
}
HVLINE.C
--------
// LS = LineSymbol
int i;
void hline(int x,int y,int x1,char LS){
for(i=x;i<=x1;i++){
gotoxy(i,y);
printf("%c",LS);
}
}
void vline(int x,int y,int y1,char LS){
for(i=y;i<=y1;i++){
gotoxy(x,i);
printf("%c",LS);
}
}
RECT.C
------
// LS = Line Symbol
void rect(int x,int y,int x1,int y1,char LS,char LS1){
hline(x,y,x1,LS);
hline(x,y1,x1,LS);
vline(x,y+1,y1-1,LS1);
vline(x1,y+1,y1-1,LS1);
}
BUTTON.C
--------
//CL = Character Length
void button(int x,int y,char *Caption){
int CL;
CL=strlen(Caption);
rect(x,y-1,x+CL+3,y+1,'*','*');
gotoxy(x+2,y);
printf("%s",Caption);
}
TEXTBOX.C
---------
// ML = Maximum Length
void textbox(int x,int y,int ML){
rect(x,y,x+ML+1,y+2,'-','|');
}
RMBUTTON.C
----------
// rmbutton = Record Move Button
void rmbutton(int x,int y){
int i;
rect(x,y-1,x+16,y+1,'þ','þ');
for(i=x+4;i<=x+12;i=i+4){
gotoxy(i,y);
printf("þ");
}
gotoxy(x+2,y);
printf("F");
gotoxy(x+6,y);
printf("P");
gotoxy(x+10,y);
printf("N");
gotoxy(x+14,y);
printf("L");
}
Comment