home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 15 / CD_ASCQ_15_070894.iso / vrac / memsz231.zip / ITEMS.H < prev    next >
Text File  |  1994-02-14  |  9KB  |  372 lines

  1. /******************************************************************** ITEMS.H
  2.  *                                                                          *
  3.  *                     Display Item Class Definition                        *
  4.  *                                                                          *
  5.  ****************************************************************************/
  6.  
  7. #ifndef ITEMS_H
  8. #define ITEMS_H
  9.  
  10. class Item
  11. {
  12.   private:
  13.     USHORT Id ;                  // Item ID.
  14.     BOOL   Flag ;                // Flag: Show this item at this time?
  15.     BYTE   Name [80] ;           // Text for items profile name.
  16.     BYTE   Label [80] ;          // Text to display on left part of line.
  17.     BYTE   MenuOption [80] ;     // Text to display in system menu.
  18.  
  19.   protected:
  20.     ULONG  Value ;               // Current value.
  21.  
  22.   public:
  23.     Item ( USHORT id, PSZ pName, PSZ pLabel, PSZ pMenuOption )
  24.     {
  25.       Id = id ;
  26.       Flag = TRUE ;
  27.       strcpy ( PCHAR(Name), PCHAR(pName) ) ;
  28.       strcpy ( PCHAR(Label), PCHAR(pLabel) ) ;
  29.       strcpy ( PCHAR(MenuOption), PCHAR(pMenuOption) ) ;
  30.       Value = 0 ;
  31.     }
  32.  
  33.     USHORT QueryId     ( void ) { return ( Id   ) ; }
  34.     BOOL   QueryFlag   ( void ) { return ( Flag ) ; }
  35.     PBYTE  QueryName   ( void ) { return ( Name ) ; }
  36.     PBYTE  QueryLabel  ( void ) { return ( Label ) ; }
  37.     PBYTE  QueryOption ( void ) { return ( MenuOption ) ; }
  38.     ULONG  QueryValue  ( void ) { return ( Value ) ; }
  39.  
  40.     VOID SetFlag   ( void ) { Flag = TRUE ; }
  41.     VOID ResetFlag ( void ) { Flag = FALSE ; }
  42.  
  43.     VOID Paint
  44.     (
  45.       HPS hPS,
  46.       RECTL &Rectangle,
  47.       COLOR TextColor,
  48.       COLOR BackColor,
  49.       PSZ Text,
  50.       ULONG NewValue
  51.     ) ;
  52.  
  53.     virtual VOID Measure ( HPS hPS, RECTL &Rectangle ) ;
  54.  
  55.     virtual ULONG NewValue ( void )
  56.     {
  57.       return ( 0 ) ;
  58.     }
  59.  
  60.     virtual VOID Repaint
  61.     (
  62.       HPS hPS,
  63.       RECTL &Rectangle,
  64.       COLOR TextColor,
  65.       COLOR BackColor,
  66.       BOOL Mandatory
  67.     )
  68.     {
  69.       return ;
  70.     }
  71. } ;
  72.  
  73. class Clock : public Item
  74. {
  75.   private:
  76.     COUNTRYINFO CountryInfo ;
  77.     ResourceString *DaysOfWeek ;
  78.  
  79.   public:
  80.     Clock ( USHORT id, PSZ pName, PSZ pLabel, PSZ pMenuOption, COUNTRYINFO &countryinfo, class ResourceString *daysofweek )
  81.       : Item ( id, pName, pLabel, pMenuOption )
  82.     {
  83.       CountryInfo = countryinfo ;
  84.       DaysOfWeek = daysofweek ;
  85.     }
  86.  
  87.     VOID Measure ( HPS hPS, RECTL &Rectangle ) ;
  88.  
  89.     ULONG NewValue ( void ) ;
  90.  
  91.     VOID Repaint
  92.     (
  93.       HPS hPS,
  94.       RECTL &Rectangle,
  95.       COLOR TextColor,
  96.       COLOR BackColor,
  97.       BOOL Mandatory
  98.     ) ;
  99. } ;
  100.  
  101. class ElapsedTime : public Item
  102. {
  103.   private:
  104.     COUNTRYINFO CountryInfo ;
  105.     ResourceString *Day ;
  106.     ResourceString *Days ;
  107.  
  108.   public:
  109.     ElapsedTime ( USHORT id, PSZ pName, PSZ pLabel, PSZ pMenuOption, COUNTRYINFO &countryinfo, class ResourceString *day, class ResourceString *days )
  110.       : Item ( id, pName, pLabel, pMenuOption )
  111.     {
  112.       CountryInfo = countryinfo ;
  113.       Day = day ;
  114.       Days = days ;
  115.     }
  116.  
  117.     VOID Measure ( HPS hPS, RECTL &Rectangle ) ;
  118.  
  119.     ULONG NewValue ( void ) ;
  120.  
  121.     VOID Repaint
  122.     (
  123.       HPS hPS,
  124.       RECTL &Rectangle,
  125.       COLOR TextColor,
  126.       COLOR BackColor,
  127.       BOOL Mandatory
  128.     ) ;
  129. } ;
  130.  
  131. class SwapFree : public Item
  132. {
  133.   private:
  134.     COUNTRYINFO CountryInfo ;
  135.     PSZ SwapPath ;
  136.     ULONG MinFree ;
  137.  
  138.   public:
  139.     SwapFree ( USHORT id, PSZ pName, PSZ pLabel, PSZ pMenuOption, COUNTRYINFO &countryinfo, PSZ swappath, ULONG minfree )
  140.       : Item ( id, pName, pLabel, pMenuOption )
  141.     {
  142.       CountryInfo = countryinfo ;
  143.       SwapPath = new BYTE [ strlen(PCHAR(swappath)) + 1 ] ;
  144.       strcpy ( PCHAR(SwapPath), PCHAR(swappath) ) ;
  145.       MinFree = minfree ;
  146.     }
  147.  
  148.     ~SwapFree ( void )
  149.     {
  150.       delete [] SwapPath ;
  151.     }
  152.  
  153.     ULONG NewValue ( void ) ;
  154.  
  155.     VOID Repaint
  156.     (
  157.       HPS hPS,
  158.       RECTL &Rectangle,
  159.       COLOR TextColor,
  160.       COLOR BackColor,
  161.       BOOL Mandatory
  162.     ) ;
  163. } ;
  164.  
  165. class MemoryFree : public Item
  166. {
  167.   private:
  168.     COUNTRYINFO CountryInfo ;
  169.     class SwapFree *SwapFree ;
  170.  
  171.   public:
  172.     MemoryFree ( USHORT id, PSZ pName, PSZ pLabel, PSZ pMenuOption, COUNTRYINFO &countryinfo, class SwapFree *swapfree )
  173.       : Item ( id, pName, pLabel, pMenuOption )
  174.     {
  175.       CountryInfo = countryinfo ;
  176.       SwapFree = swapfree ;
  177.     }
  178.  
  179.     ULONG NewValue ( void ) ;
  180.  
  181.     VOID Repaint
  182.     (
  183.       HPS hPS,
  184.       RECTL &Rectangle,
  185.       COLOR TextColor,
  186.       COLOR BackColor,
  187.       BOOL Mandatory
  188.     ) ;
  189. } ;
  190.  
  191. class SwapSize : public Item
  192. {
  193.   private:
  194.     COUNTRYINFO CountryInfo ;
  195.     PSZ SwapPath ;
  196.  
  197.   public:
  198.     SwapSize ( USHORT id, PSZ pName, PSZ pLabel, PSZ pMenuOption, COUNTRYINFO countryinfo, PSZ swappath )
  199.       : Item ( id, pName, pLabel, pMenuOption )
  200.     {
  201.       CountryInfo = countryinfo ;
  202.       SwapPath = new BYTE [ strlen(PCHAR(swappath)) + 1 ] ;
  203.       strcpy ( PCHAR(SwapPath), PCHAR(swappath) ) ;
  204.     }
  205.  
  206.     ~SwapSize ( void )
  207.     {
  208.       delete [] SwapPath ;
  209.     }
  210.  
  211.     ULONG NewValue ( void ) ;
  212.  
  213.     VOID Repaint
  214.     (
  215.       HPS hPS,
  216.       RECTL &Rectangle,
  217.       COLOR TextColor,
  218.       COLOR BackColor,
  219.       BOOL Mandatory
  220.     ) ;
  221. } ;
  222.  
  223. class SpoolSize : public Item
  224. {
  225.   private:
  226.     COUNTRYINFO CountryInfo ;
  227.     PSZ SpoolPath ;
  228.  
  229.   public:
  230.     SpoolSize ( USHORT id, PSZ pName, PSZ pLabel, PSZ pMenuOption, COUNTRYINFO &countryinfo, PSZ spoolpath )
  231.       : Item ( id, pName, pLabel, pMenuOption )
  232.     {
  233.       CountryInfo = countryinfo ;
  234.       SpoolPath = new BYTE [ strlen(PCHAR(spoolpath)) + 1 ] ;
  235.       strcpy ( PCHAR(SpoolPath), PCHAR(spoolpath) ) ;
  236.     }
  237.  
  238.     ~SpoolSize ( void )
  239.     {
  240.       delete [] SpoolPath ;
  241.     }
  242.  
  243.     ULONG NewValue ( void ) ;
  244.  
  245.     VOID Repaint
  246.     (
  247.       HPS hPS,
  248.       RECTL &Rectangle,
  249.       COLOR TextColor,
  250.       COLOR BackColor,
  251.       BOOL Mandatory
  252.     ) ;
  253. } ;
  254.  
  255. class CpuLoad : public Item
  256. {
  257.   private:
  258.     PULONG IdleCount ;
  259.     ULONG MaxCount ;
  260.  
  261.   public:
  262.     CpuLoad ( USHORT id, PSZ pName, PSZ pLabel, PSZ pMenuOption, ULONG maxcount, PULONG idlecount )
  263.       : Item ( id, pName, pLabel, pMenuOption )
  264.     {
  265.       MaxCount = maxcount ;
  266.       IdleCount = idlecount ;
  267.     }
  268.  
  269.     ULONG NewValue ( void ) ;
  270.  
  271.     VOID Repaint
  272.     (
  273.       HPS hPS,
  274.       RECTL &Rectangle,
  275.       COLOR TextColor,
  276.       COLOR BackColor,
  277.       BOOL Mandatory
  278.     ) ;
  279. } ;
  280.  
  281. class TaskCount : public Item
  282. {
  283.   private:
  284.     HAB Anchor ;
  285.  
  286.   public:
  287.     TaskCount ( USHORT id, PSZ pName, PSZ pLabel, PSZ pMenuOption, HAB anchor )
  288.       : Item ( id, pName, pLabel, pMenuOption )
  289.     {
  290.       Anchor = anchor ;
  291.     }
  292.  
  293.     ULONG NewValue ( void ) ;
  294.  
  295.     VOID Repaint
  296.     (
  297.       HPS hPS,
  298.       RECTL &Rectangle,
  299.       COLOR TextColor,
  300.       COLOR BackColor,
  301.       BOOL Mandatory
  302.     ) ;
  303. } ;
  304.  
  305. class DriveFree : public Item
  306. {
  307.   private:
  308.     COUNTRYINFO CountryInfo ;
  309.     class ResourceString *DriveError ;
  310.     USHORT DriveNumber ;
  311.     BOOL Error ;
  312.     BOOL ShowFileSystemName ;
  313.     BYTE FileSystem [80] ;
  314.  
  315.   public:
  316.     DriveFree ( USHORT id, PSZ pName, PSZ pLabel, PSZ pMenuOption, COUNTRYINFO &countryinfo, USHORT drivenumber, class ResourceString *driveerror, BOOL showfilesystemname, PSZ filesystem )
  317.       : Item ( id, pName, pLabel, pMenuOption )
  318.     {
  319.       CountryInfo = countryinfo ;
  320.       DriveError = driveerror ;
  321.       DriveNumber = drivenumber ;
  322.       Error = FALSE ;
  323.       ShowFileSystemName = showfilesystemname ;
  324.       strcpy ( PCHAR(FileSystem), PCHAR(filesystem) ) ;
  325.     }
  326.  
  327.     VOID SetShowFileSystemName ( BOOL showfilesystemname ) { ShowFileSystemName = showfilesystemname ; }
  328.  
  329.     VOID Measure ( HPS hPS, RECTL &Rectangle ) ;
  330.  
  331.     ULONG NewValue ( void ) ;
  332.  
  333.     VOID Repaint
  334.     (
  335.       HPS hPS,
  336.       RECTL &Rectangle,
  337.       COLOR TextColor,
  338.       COLOR BackColor,
  339.       BOOL Mandatory
  340.     ) ;
  341. } ;
  342.  
  343. class TotalFree : public Item
  344. {
  345.   private:
  346.     COUNTRYINFO CountryInfo ;
  347.     ULONG Drives ;
  348.  
  349.   public:
  350.     TotalFree ( USHORT id, PSZ pName, PSZ pLabel, PSZ pMenuOption, COUNTRYINFO &countryinfo, ULONG drives )
  351.       : Item ( id, pName, pLabel, pMenuOption )
  352.     {
  353.       CountryInfo = countryinfo ;
  354.       Drives = drives ;
  355.     }
  356.  
  357.     VOID ResetMask ( ULONG drives ) { Drives = drives ; }
  358.  
  359.     ULONG NewValue ( void ) ;
  360.  
  361.     VOID Repaint
  362.     (
  363.       HPS hPS,
  364.       RECTL &Rectangle,
  365.       COLOR TextColor,
  366.       COLOR BackColor,
  367.       BOOL Mandatory
  368.     ) ;
  369. } ;
  370.  
  371. #endif
  372.