home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 May / macformat-024.iso / Shareware City / Developers / CW CDEV Framework 1.1 / Framework / TControlPanel.h < prev   
Encoding:
C/C++ Source or Header  |  1995-01-09  |  1.8 KB  |  49 lines  |  [TEXT/MMCC]

  1. #pragma once
  2.  
  3. #ifndef    _H_TControlPanel
  4. #define    _H_TControlPanel
  5.  
  6. // Author:         Matthew E. Axsom
  7. // Version:     1.1 - 01/09/95
  8. // Description:    A C++ class for writing control panel's (CDEV's)
  9. //                 in Metrowerks CodeWarrior.
  10.  
  11. // internal error code for cdevMemErr.  Use instead of cdevMemErr since cdevMemErr
  12. // is 0 and framework uses a return code of zero to indicate success.
  13. #define    cdevFWMemErr    memFullErr
  14.  
  15. class TControlPanel {
  16. public:
  17.     short        fLastItem;                // last system item in control panel.
  18.  
  19.     DialogPtr    fDialog;                // control panel dialog box
  20.     EventRecord    *fEvent;                // event
  21.     
  22.             TControlPanel(short numItems,DialogPtr cp);
  23.     virtual    ~TControlPanel(void);
  24.     
  25.     //  processes all events 'cept macDev,initDev,closeDev
  26.     long actions(short message, short itemHit);    
  27.     long CommandKey(short);                // handles command key's for non sys7 machines
  28.     
  29.     // you'll need to override these methods w/your own.
  30.     
  31.     // these 2 are provided to ease porting from Symantec's CDEV framework.
  32.     // Initilization and clean up should be done from constructor/destructor
  33.     virtual long Init(void);            // called as a result of a initDev message
  34.     virtual long Close(void);            // called as a result of a closeDev message
  35.     
  36.     virtual long ItemHit(short itemHit);    // handles a mouse hit in the control panel
  37.     virtual long Idle(void);            // handling of nulDev message
  38.     virtual long Update(void);            // update user items
  39.     virtual long Activate(void);        // activate user items
  40.     virtual long Deactivate(void);        // deactivate user items
  41.     virtual long KeyDown(short c);        // key down was pressed
  42.     virtual long Undo(void);            // undo from edit menu or cmd-z
  43.     virtual long Cut(void);                // cut from edit menu or cmd-x
  44.     virtual long Copy(void);            // copy from edit menu or cmd-c
  45.     virtual long Paste(void);            // paste from edit menu or cmd-v
  46.     virtual long Clear(void);            // clear from edit menu
  47. };
  48.  
  49. #endif    //_H_TControlPanel