home *** CD-ROM | disk | FTP | other *** search
/ Point Programming 1 / PPROG1.ISO / c / sclib31 / examples / fileboxs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-31  |  1.2 KB  |  46 lines

  1. #include <scl1.h>
  2. #include <scl1clor.H>
  3.  
  4.     /*************************************
  5.      Shows the use of fileboxs functions */
  6.  
  7. main()
  8. {
  9. char Buffer[FB_BUF_SIZE];
  10. FBData fb2;
  11. FB3Data fb3;
  12. FBData fbw;
  13.  
  14. memset(Buffer,0,sizeof(Buffer));
  15. InitMouse(IM_SHOW);
  16.  
  17. FileBox2(FB_INIT,&fb2);       /* initialize the FBData structure */
  18. WFileBox(FB_INIT,&fbw);       /* initialize the FBData structure */
  19. FileBox3(FB_INIT,&fb3);       /* initialize the FB3Data structure */
  20.  
  21. fb2.NColor=fb3.NColor=fbw.NColor=WHITE_BLACK;  /* change display colors */
  22. fb2.RColor=fb3.RColor=fbw.RColor= BLACK_WHITE;
  23. fb2.Filename=fb3.Filename=fbw.Filename=Buffer; /* buffer to hold dir.info */
  24.  
  25.    /* set files attributes */
  26.  
  27. fb2.Attrib=fb3.Attrib=fbw.Attrib=F_READ_ONLY+F_HIDDEN+F_SYSTEM+F_DIRECTORY;
  28.  
  29. FileBox2(FB_DRAW,&fb2);       /* display FileBox */
  30. FileBox2(FB_ACTIVE,&fb2);     /* let user make a selection */
  31.  
  32. /* sort by name and place directories first in the list */
  33.  
  34. fb3.SortType=FB_NAME+FB_DIR_FIRST;
  35.  
  36. FileBox3(FB_DRAW,&fb3);       /* display FileBox */
  37. FileBox3(FB_ACTIVE,&fb3);     /* let user make a selection */
  38.  
  39. WFileBox(FB_DRAW,&fbw);       /* display Wide FileBox */
  40. WFileBox(FB_ACTIVE,&fbw);     /* let user make a selection */
  41. }
  42.  
  43.  
  44.  
  45.  
  46.