home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ocl150a.zip / OCL / Samples / GTakPM / Source / GTPMWin.hpp < prev    next >
C/C++ Source or Header  |  1996-08-12  |  5KB  |  229 lines

  1. // GTakPM
  2. // (c) Benjamin Stein 1994
  3. // All Rights Reserved
  4. // GTPMWin.hpp
  5.  
  6. // $Header: W:/Projects/OCL/Samples/GTakPM/Source/rcs/GTPMWin.hpp 1.50 1996/08/11 23:48:08 B.STEIN Release $
  7.  
  8. #ifndef GTPMWIN_HPP_INCLUDED
  9.   #define GTPMWIN_HPP_INCLUDED
  10.  
  11. #ifndef GTAKPM_HPP_INCLUDED
  12.   #include "..\Source\GTakPM.hpp"
  13. #endif
  14.  
  15. struct DirItem
  16. {
  17.  OString fullName;
  18.  OString name;
  19. };
  20.  
  21. typedef DirItem FileItem ;
  22. typedef FileItem *pFileItem;
  23.  
  24. struct DirInfo
  25. {
  26.  RECORDCORE rc;          // base information
  27.  pDirItem   dirItem;
  28.  BOOL       selected;    // directory is selected
  29.  BOOL       expanded;    // expanded subdirectory?
  30.  BOOL       wasExpanded;
  31. };
  32.  
  33.  
  34. class DrivesCnr : public OContainer<DirInfo, RECORDCORE>
  35. {
  36.  protected:
  37.    pGTPMWin ParentWindow;
  38.  
  39.    lOString           DriveList;
  40.    OList<DirItem>     DirList;
  41.  
  42.  public:
  43.    OThread<DrivesCnr> populate;
  44.    OThread<DrivesCnr> select;
  45.  
  46.    OIcon              hd_ico;
  47.    OIcon              hdS_ico;
  48.    OIcon              cd_ico;
  49.    OIcon              cdS_ico;
  50.    OIcon              folder_ico;
  51.    OIcon              folderS_ico;
  52.    OIcon              openfolder_ico;
  53.    OIcon              openfolderS_ico;
  54.    OIcon              dontKnow_ico;
  55.  
  56.      DrivesCnr       (pGTPMWin Parent);
  57.  
  58.    virtual
  59.      ~DrivesCnr      ();
  60.  
  61.    virtual  
  62.       PSZ isOfType   () const 
  63.       { return("DrivesCnr"); }
  64.  
  65.    BOOL
  66.       setupDetails   (),
  67.       setupItems     ();
  68.  
  69.    void
  70.       collectDirectories (),
  71.  
  72.       getDirectories     (pDirInfo Parent,
  73.                           PSZ Directory,
  74.                           BOOL recursive = TRUE,
  75.                           BOOL selected = FALSE),
  76.  
  77.       insertDirs         (pDirInfo Parent,
  78.                           PSZ Directory,
  79.                           PFILEFINDBUF3 pffb,
  80.                           ULONG cFiles,
  81.                           BOOL selected = FALSE),
  82.  
  83.       recurse            (pDirInfo Parent,
  84.                           BOOL recursive = TRUE,
  85.                           BOOL selected = FALSE),
  86.  
  87.       selectDirRecord    (pDirInfo Parent),
  88.  
  89.       beginSelect        ();
  90. };
  91.  
  92.  
  93. struct FileInfo
  94. {
  95.  MINIRECORDCORE rc;       // base information
  96.  pFileItem      fileItem;     
  97.  CDATE          date;     // date of file
  98.  CTIME          time;     // time of file
  99.  ULONG          cbFile;   // file size
  100.  BOOL           selected; // file is selected
  101. };
  102.  
  103.  
  104. class FilesCnr : public OContainer<FileInfo, MINIRECORDCORE>
  105. {
  106.  protected:
  107.    pGTPMWin          ParentWindow;
  108.    OList<FileItem>   FileList;
  109.  
  110.  public:
  111.    OThread<FilesCnr> populate; 
  112.    OString           scanDirectory;
  113.    OIcon             file_ico;
  114.    OIcon             fileS_ico;
  115.  
  116.       FilesCnr       (pGTPMWin Parent);
  117.  
  118.    virtual
  119.       ~FilesCnr      ();
  120.  
  121.    virtual  
  122.       PSZ isOfType      () const 
  123.       { return("FilesCnr"); }
  124.  
  125.    BOOL
  126.       setupDetails   (),
  127.       setupItems     ();
  128.  
  129.    void
  130.       getFiles       (), 
  131.       insertFiles    (PFILEFINDBUF3 pffb,
  132.                       ULONG cFiles);
  133. };
  134.  
  135.  
  136.  
  137.  
  138. class GTPMWin 
  139.   : public OFrame 
  140. {
  141.  protected:
  142.    BOOL             wasOutOfContainer;
  143.    BOOL             processing;
  144.    BOOL             showMonitor;
  145.    HWND             frameMenu;
  146.    OThread<GTPMWin> expander;
  147.    OThread<GTPMWin> backupThr;
  148.    OThread<GTPMWin> restoreThr;
  149.  
  150.    OBitmap          bmp_monitor;
  151.    OBitmap          bmp_rescan;
  152.    OBitmap          bmp_procedures;
  153.    OBitmap          bmp_tape;
  154.    OBitmap          bmp_backup;
  155.    OBitmap          bmp_restore;
  156.    OBitmap          bmp_compare;
  157.    OBitmap          bmp_settings;
  158.    OBitmap          bmp_quit;
  159.    OBitmap          bmp_load;
  160.    OBitmap          bmp_unload;
  161.    OBitmap          bmp_rewind;
  162.    OBitmap          bmp_erase;
  163.    OBitmap          bmp_eraseq;
  164.    OBitmap          bmp_lock;
  165.    OBitmap          bmp_unlock;
  166.    OBitmap          bmp_stop_asap;
  167.  
  168.    OGraphicsButton  btn_monitor;
  169.    OGraphicsButton  btn_rescan;
  170.    OGraphicsButton  btn_procedures;
  171.    OGraphicsButton  btn_tape;
  172.    OGraphicsButton  btn_backup;
  173.    OGraphicsButton  btn_restore;
  174.    OGraphicsButton  btn_compare;
  175.    OGraphicsButton  btn_settings;
  176.    OGraphicsButton  btn_quit;
  177.    OGraphicsButton  btn_load;
  178.    OGraphicsButton  btn_unload;
  179.    OGraphicsButton  btn_rewind;
  180.    OGraphicsButton  btn_erase;
  181.    OGraphicsButton  btn_eraseq;
  182.    OGraphicsButton  btn_lock;
  183.    OGraphicsButton  btn_unlock;
  184.    OGraphicsButton  btn_stop_asap;
  185.  
  186.  public:
  187.    pTape         tape;
  188.  
  189.    pOStatusLine  statline;
  190.    pOButtonBar   toolbar;
  191.    pOButtonBar   tapebar;
  192.    pDrivesCnr    Drives;
  193.    pFilesCnr     Files;
  194.    pOListBox     Includes;
  195.    pOListBox     Excludes;
  196.    pOListBox     monitor;
  197.  
  198.    OPMPipeTool   pmpipe;
  199.  
  200.  
  201.      GTPMWin        ();
  202.  
  203.    virtual
  204.      ~GTPMWin       ();
  205.  
  206.    virtual
  207.      PSZ isOfType() const
  208.      { return("GTPMWin"); }
  209.  
  210.    void
  211.      expandFolder   (),
  212.      backup         (),
  213.      restore        (),
  214.      addExclude     (PSZ str),
  215.      addInclude     (PSZ str),
  216.      updateListbox  (PSZ str),
  217.      printout       (),
  218.      resizeClients  (MPARAM sizeparms);  // processes WM_SIZE
  219.  
  220.    BOOL
  221.      control        (MPARAM mp1, MPARAM mp2),  // process WM_CONTROL
  222.      command        (MPARAM mp1, MPARAM mp2),  // process WM_COMMAND
  223.      OCommand       (ULONG msg, MPARAM mp1, MPARAM mp2); 
  224. };
  225.  
  226. #endif // GTPMWIN_HPP_INCLUDED
  227.  
  228. // end of source
  229.