home *** CD-ROM | disk | FTP | other *** search
- #include "barchart.h"
-
- struct XYBase Myxyb;
- struct Rect screenRect, pRect;
- struct WindowRecord wRecord;
-
- main()
- {
-
- InitGraf(&qd.thePort);
- InitWindows();
- InitFonts();
- setupmenus();
- InitDialogs();
- InitCursor();
-
- screenRect = qd.screenBits.bounds;
- SetRect(&dragRect, 4, 24, screenRect.right-4, screenRect.bottom-4);
-
- pRect.top = 40;
- pRect.left = 5;
- pRect.bottom = 335;
- pRect.right = 505;
- myWindow = NewWindow(&wRecord, &pRect, "Sample Chart",
- TRUE, 0, -1L, TRUE, 0L);
- SetPort(myWindow);
- pRect = qd.thePort->portRect;
-
- redraw();
-
- handleevents();
-
- exit(0);
- }
-
- redraw()
- {
- register int i;
- static char *hlabels[] = {" ", "84", "85", "86", "87" };
- static char *vlabels[] = {"0", "10", "20", "30", "40" };
-
-
- drawaxes(&Myxyb, 60, 230, 350, 180);
-
- labelhorizontal(&Myxyb, hlabels, 5);
- labelvertical(&Myxyb, vlabels, 5);
-
- for (i=1;i<5;i++) {
- drawbar(&Myxyb, -31+i*348/4, 20, i*24, &qd.black);
- }
-
-
- for (i=1;i<5;i++) {
- drawbar(&Myxyb, -10+i*348/4, 20, i*36, &qd.ltGray);
- }
-
-
- for (i=1;i<5;i++) {
- drawbar(&Myxyb, 11+i*348/4, 20, i*44, &qd.gray);
- }
-
- }
-
-
- setupmenus()
- {
- int i;
- InitMenus();
- myMenus[0] = NewMenu(appleMenu, "\024");
- AddResMenu(myMenus[0], 'DRVR');
- for (i=0;i<NMENUS;i++)
- InsertMenu(myMenus[i], 0);
-
- DrawMenuBar();
- }
-