{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

stortoll -...

Info icon This preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 http://www.sourcecodesworld.com/source/show.asp?ScriptID=1125 //////// FILE 1 - STORETOLL.C ///////////////// //////// LOOK BELOW FOR THE DATABASE FILE ///// #include<stdio.h> #include<conio.h> #include<graphics.h> #include<dos.h> #include<time.h> #include<stdlib.h> #define NO 0 #define YES 1 #define NONE -1 //in a menu there can be three items #define MAX_MENU 6 int x,y int selection int button,x,y void *p size_t area int validate(int) FILE *date FILE *f2 FILE *fop FILE *today char todaydate[15] FILE *day char salebydate[10] FILE *itemtoday FILE *itembydate char str[10] int customer struct MENU { int x
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Sheet1 Page 2 int y int x1 int y1 unsigned char Active[MAX_MENU] char *head } int mouseon(struct MENU *t) void process() void xorbar(int sx,int sy,int ex,int ey,int c) void show() void hide() void status() //position of the billprocess menu struct MENU Billprocess = {0,0,80,20} //position of the print menu struct MENU Print = {90,0,165,20} struct MENU Management = {175,0,260,20} void main() { int gd=DETECT,gm initgraph(&gd,&gm,"f:\tcpp") selection=NONE for(gd=0 gd<MAX_MENU gd++) { //gd=3 Billprocess.Active[gd]=YES //gd=1 Print.Active[gd]=YES Management.Active[gd]=YES } //head that is printed on msg Billprocess.head="processbill" Print.head="Print" Management.head="management" //allocation for image memory area=imagesize(0,0,150,150)
Image of page 2
Sheet1 Page 3 p=malloc(area) if(p==NULL) { closegraph() restorecrtmode() printf("not enough memory") exit(1) } //style of the menu setfillstyle(1,7) //full window bar(0,0,660,650) welcomescreen() x=2 y=2 process() //end() closegraph() getch() } void process() { //menu items in billprocess menu char *bp[]={"Processbill","Openbill","Exit"} //menu item in print menu char *pr[]={"Printbill"} char *mgt[]={"SalesToday","SalesBydate","Itemsoldtoday","Itemsoldbydate"} char KEY //menu bar position win(0,0,660,20) //drawing button for menu items drawbtn(&Billprocess,"Billprocess")
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Sheet1 Page 4 drawbtn(&Print,"Print") drawbtn(&Management,"Management") settextstyle(0,0,0) //outtextxy(close(x+y),close(y+7),"x") show() //instantly menus are idle Billprocess.Active[3]=NO Print.Active[1]=NO Management.Active[4]=NO while(1) { if(kbhit()) { KEY=getch() //way to exit press esc or - if(KEY==27 || KEY==45) break } status() if(button==1) { //if(mouseon(&close)) //break if(mouseon(&Billprocess)) { pullmenudown(bp,3,&Billprocess) if(selection==NONE) msg("no selection") if(selection==0) { char str[3]
Image of page 4
Sheet1
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern