home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 10 / ioProg_10.iso / soft / optima / hpp.z / PROPSHT.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-15  |  1.8 KB  |  63 lines

  1. #ifndef _PROPSHT_HPP
  2. #define _PROPSHT_HPP
  3.  
  4. #include "mmpropst.hpp"
  5. #include "propctrl.hpp"
  6.  
  7. class MTPropertyDialog;
  8.  
  9. // MTPropertySheetBase:
  10. //      Abstract base class for a property sheet.  This is a base
  11. //    class of TabControlEditor etc. as well as for MTPropertySheet
  12.  
  13. class METACLASSDEF MTPropertySheetBase {
  14.     public:
  15.     virtual inline        ~MTPropertySheetBase();
  16.     virtual WBool        Create( MTPropertyDialog * prt ) = 0;
  17.     virtual WBool        Refresh( const DTObject * obj ) = 0;
  18.     virtual WBool        Validate( WString & errMsg ) = 0;
  19.     virtual WBool        Update( DTObject * obj ) = 0;
  20.     virtual WBool        UpdatePropertyRect() = 0;
  21.     virtual WString        GetDescription() = 0;
  22.     virtual WWindow *   GetWindow() = 0;
  23.     virtual void        PropertyChanged( const WString & name ) = 0;
  24. };
  25.  
  26. inline MTPropertySheetBase::~MTPropertySheetBase() {}
  27.  
  28.  
  29.  
  30. // MTPropertySheet:
  31. //    Implementation of auto-generated property sheets
  32.  
  33. class METACLASSDEF MTPropertySheet : public WModelessDialog,
  34.                      public MTPropertySheetBase
  35. {
  36.     public:
  37.     MTPropertySheet( const MMPropertySheet * data );
  38.     ~MTPropertySheet();
  39.  
  40.     virtual WBool            Create( MTPropertyDialog * prt );
  41.     virtual WString            GetDescription();
  42.  
  43.     virtual WBool            Refresh( const DTObject * obj );
  44.     virtual WBool            Validate( WString & errMsg );
  45.     virtual WBool            Update( DTObject * obj );
  46.  
  47.     virtual WBool            UpdatePropertyRect();
  48.     virtual void            PropertyChanged( const WString & name );
  49.  
  50.     virtual WWindow *        GetWindow() { return this; }
  51.     virtual void            FocusFirst();
  52.     virtual const MMPropertySheet*    GetData() const;
  53.  
  54.     virtual WUInt            GetNumControls();
  55.     virtual MTPropertyControl * GetControl( WUInt i );
  56.  
  57.     private:
  58.     const MMPropertySheet *        _data;
  59.     MTPropertyControl **        _controls;
  60. };
  61.  
  62. #endif // _PROPSHT_HPP
  63.