home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR24 / MEMSZ211.ZIP / ITEMS.H < prev    next >
C/C++ Source or Header  |  1993-09-13  |  7KB  |  330 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 ULONG NewValue ( void )
  54.     {
  55.       return ( 0 ) ;
  56.     }
  57.  
  58.     virtual VOID Repaint
  59.     (
  60.       HPS hPS,
  61.       RECTL &Rectangle,
  62.       COLOR TextColor,
  63.       COLOR BackColor,
  64.       BOOL Mandatory
  65.     )
  66.     {
  67.       return ;
  68.     }
  69. } ;
  70.  
  71. class Clock : public Item
  72. {
  73.   private:
  74.     COUNTRYINFO CountryInfo ;
  75.     ResourceString *DaysOfWeek ;
  76.  
  77.   public:
  78.     Clock ( USHORT id, PSZ pName, PSZ pLabel, PSZ pMenuOption, COUNTRYINFO &countryinfo, class ResourceString *daysofweek )
  79.       : Item ( id, pName, pLabel, pMenuOption )
  80.     {
  81.       CountryInfo = countryinfo ;
  82.       DaysOfWeek = daysofweek ;
  83.     }
  84.  
  85.     ULONG NewValue ( void ) ;
  86.  
  87.     VOID Repaint
  88.     (
  89.       HPS hPS,
  90.       RECTL &Rectangle,
  91.       COLOR TextColor,
  92.       COLOR BackColor,
  93.       BOOL Mandatory
  94.     ) ;
  95. } ;
  96.  
  97. class ElapsedTime : public Item
  98. {
  99.   private:
  100.     COUNTRYINFO CountryInfo ;
  101.     ResourceString *Day ;
  102.     ResourceString *Days ;
  103.  
  104.   public:
  105.     ElapsedTime ( USHORT id, PSZ pName, PSZ pLabel, PSZ pMenuOption, COUNTRYINFO &countryinfo, class ResourceString *day, class ResourceString *days )
  106.       : Item ( id, pName, pLabel, pMenuOption )
  107.     {
  108.       CountryInfo = countryinfo ;
  109.       Day = day ;
  110.       Days = days ;
  111.     }
  112.  
  113.     ULONG NewValue ( void ) ;
  114.  
  115.     VOID Repaint
  116.     (
  117.       HPS hPS,
  118.       RECTL &Rectangle,
  119.       COLOR TextColor,
  120.       COLOR BackColor,
  121.       BOOL Mandatory
  122.     ) ;
  123. } ;
  124.  
  125. class MemoryFree : public Item
  126. {
  127.   private:
  128.     COUNTRYINFO CountryInfo ;
  129.     class SwapFree *SwapFree ;
  130.  
  131.   public:
  132.     MemoryFree ( USHORT id, PSZ pName, PSZ pLabel, PSZ pMenuOption, COUNTRYINFO &countryinfo, class SwapFree *swapfree )
  133.       : Item ( id, pName, pLabel, pMenuOption )
  134.     {
  135.       CountryInfo = countryinfo ;
  136.       SwapFree = swapfree ;
  137.     }
  138.  
  139.     ULONG NewValue ( void ) ;
  140.  
  141.     VOID Repaint
  142.     (
  143.       HPS hPS,
  144.       RECTL &Rectangle,
  145.       COLOR TextColor,
  146.       COLOR BackColor,
  147.       BOOL Mandatory
  148.     ) ;
  149. } ;
  150.  
  151. class SwapSize : public Item
  152. {
  153.   private:
  154.     COUNTRYINFO CountryInfo ;
  155.     PSZ SwapPath ;
  156.  
  157.   public:
  158.     SwapSize ( USHORT id, PSZ pName, PSZ pLabel, PSZ pMenuOption, COUNTRYINFO countryinfo, PSZ swappath )
  159.       : Item ( id, pName, pLabel, pMenuOption )
  160.     {
  161.       CountryInfo = countryinfo ;
  162.       SwapPath = new BYTE [ strlen(PCHAR(swappath)) + 1 ] ;
  163.       strcpy ( PCHAR(SwapPath), PCHAR(swappath) ) ;
  164.     }
  165.  
  166.     ~SwapSize ( void )
  167.     {
  168.       delete [] SwapPath ;
  169.     }
  170.  
  171.     ULONG NewValue ( void ) ;
  172.  
  173.     VOID Repaint
  174.     (
  175.       HPS hPS,
  176.       RECTL &Rectangle,
  177.       COLOR TextColor,
  178.       COLOR BackColor,
  179.       BOOL Mandatory
  180.     ) ;
  181. } ;
  182.  
  183. class SwapFree : public Item
  184. {
  185.   private:
  186.     COUNTRYINFO CountryInfo ;
  187.     PSZ SwapPath ;
  188.     ULONG MinFree ;
  189.  
  190.   public:
  191.     SwapFree ( USHORT id, PSZ pName, PSZ pLabel, PSZ pMenuOption, COUNTRYINFO &countryinfo, PSZ swappath, ULONG minfree )
  192.       : Item ( id, pName, pLabel, pMenuOption )
  193.     {
  194.       CountryInfo = countryinfo ;
  195.       SwapPath = new BYTE [ strlen(PCHAR(swappath)) + 1 ] ;
  196.       strcpy ( PCHAR(SwapPath), PCHAR(swappath) ) ;
  197.       MinFree = minfree ;
  198.     }
  199.  
  200.     ~SwapFree ( void )
  201.     {
  202.       delete [] SwapPath ;
  203.     }
  204.  
  205.     ULONG NewValue ( void ) ;
  206.  
  207.     VOID Repaint
  208.     (
  209.       HPS hPS,
  210.       RECTL &Rectangle,
  211.       COLOR TextColor,
  212.       COLOR BackColor,
  213.       BOOL Mandatory
  214.     ) ;
  215. } ;
  216.  
  217. class SpoolSize : public Item
  218. {
  219.   private:
  220.     COUNTRYINFO CountryInfo ;
  221.     PSZ SpoolPath ;
  222.  
  223.   public:
  224.     SpoolSize ( USHORT id, PSZ pName, PSZ pLabel, PSZ pMenuOption, COUNTRYINFO &countryinfo, PSZ spoolpath )
  225.       : Item ( id, pName, pLabel, pMenuOption )
  226.     {
  227.       CountryInfo = countryinfo ;
  228.       SpoolPath = new BYTE [ strlen(PCHAR(spoolpath)) + 1 ] ;
  229.       strcpy ( PCHAR(SpoolPath), PCHAR(spoolpath) ) ;
  230.     }
  231.  
  232.     ~SpoolSize ( void )
  233.     {
  234.       delete [] SpoolPath ;
  235.     }
  236.  
  237.     ULONG NewValue ( void ) ;
  238.  
  239.     VOID Repaint
  240.     (
  241.       HPS hPS,
  242.       RECTL &Rectangle,
  243.       COLOR TextColor,
  244.       COLOR BackColor,
  245.       BOOL Mandatory
  246.     ) ;
  247. } ;
  248.  
  249. class CpuLoad : public Item
  250. {
  251.   private:
  252.     PULONG IdleCount ;
  253.     ULONG MaxCount ;
  254.  
  255.   public:
  256.     CpuLoad ( USHORT id, PSZ pName, PSZ pLabel, PSZ pMenuOption, ULONG maxcount, PULONG idlecount )
  257.       : Item ( id, pName, pLabel, pMenuOption )
  258.     {
  259.       MaxCount = maxcount ;
  260.       IdleCount = idlecount ;
  261.     }
  262.  
  263.     ULONG NewValue ( void ) ;
  264.  
  265.     VOID Repaint
  266.     (
  267.       HPS hPS,
  268.       RECTL &Rectangle,
  269.       COLOR TextColor,
  270.       COLOR BackColor,
  271.       BOOL Mandatory
  272.     ) ;
  273. } ;
  274.  
  275. class TaskCount : public Item
  276. {
  277.   private:
  278.     HAB Anchor ;
  279.  
  280.   public:
  281.     TaskCount ( USHORT id, PSZ pName, PSZ pLabel, PSZ pMenuOption, HAB anchor )
  282.       : Item ( id, pName, pLabel, pMenuOption )
  283.     {
  284.       Anchor = anchor ;
  285.     }
  286.  
  287.     ULONG NewValue ( void ) ;
  288.  
  289.     VOID Repaint
  290.     (
  291.       HPS hPS,
  292.       RECTL &Rectangle,
  293.       COLOR TextColor,
  294.       COLOR BackColor,
  295.       BOOL Mandatory
  296.     ) ;
  297. } ;
  298.  
  299. class DriveFree : public Item
  300. {
  301.   private:
  302.     COUNTRYINFO CountryInfo ;
  303.     class ResourceString *DriveError ;
  304.     USHORT DriveNumber ;
  305.     BOOL Error ;
  306.  
  307.   public:
  308.     DriveFree ( USHORT id, PSZ pName, PSZ pLabel, PSZ pMenuOption, COUNTRYINFO &countryinfo, USHORT drivenumber, class ResourceString *driveerror )
  309.       : Item ( id, pName, pLabel, pMenuOption )
  310.     {
  311.       CountryInfo = countryinfo ;
  312.       DriveError = driveerror ;
  313.       DriveNumber = drivenumber ;
  314.       Error = FALSE ;
  315.     }
  316.  
  317.     ULONG NewValue ( void ) ;
  318.  
  319.     VOID Repaint
  320.     (
  321.       HPS hPS,
  322.       RECTL &Rectangle,
  323.       COLOR TextColor,
  324.       COLOR BackColor,
  325.       BOOL Mandatory
  326.     ) ;
  327. } ;
  328.  
  329. #endif
  330.