home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 19.ddi / OWLINC.PAK / CONTROL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  2.1 KB  |  67 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows - (C) Copyright 1991, 1993 by Borland International
  3. //   include\owl\control.h
  4. //   Defines class TControl.  This defines the basic behavior
  5. //   of all controls.
  6. //----------------------------------------------------------------------------
  7. #if !defined(__OWL_CONTROL_H)
  8. #define __OWL_CONTROL_H
  9.  
  10. #if !defined(__OWL_WINDOW_H)
  11.   #include <owl\window.h>
  12. #endif
  13.  
  14. //
  15. //  class TControl
  16. //  ----- --------
  17. //
  18. class _OWLCLASS TControl : public TWindow {
  19.   public:
  20.     TControl(TWindow*        parent,
  21.              int             id,
  22.              const char far* title,
  23.              int x, int y, int w, int h,
  24.              TModule*        module = 0);
  25.  
  26.     TControl(TWindow* parent, int resourceId, TModule* module = 0);
  27.  
  28.   protected:
  29.     //
  30.     // these methods are called for owner-draw controls (buttons, list boxes,
  31.     // and combo boxes)
  32.     //
  33.     virtual int   CompareItem(COMPAREITEMSTRUCT far& compareInfo);
  34.     virtual void  DeleteItem(DELETEITEMSTRUCT far& deleteInfo);
  35.     virtual void  MeasureItem(MEASUREITEMSTRUCT far& measureInfo);
  36.     virtual void  DrawItem(DRAWITEMSTRUCT far& drawInfo);
  37.  
  38.     //
  39.     // default behavior for DrawItem is to call one of the following based on
  40.     // the draw type:
  41.     //
  42.     virtual void  ODADrawEntire(DRAWITEMSTRUCT far& drawInfo);
  43.     virtual void  ODAFocus(DRAWITEMSTRUCT far& drawInfo);
  44.     virtual void  ODASelect(DRAWITEMSTRUCT far& drawInfo);
  45.  
  46.     //
  47.     // message response functions
  48.     //
  49.     void          EvPaint();
  50.     LRESULT       EvCompareItem(UINT ctrlId, COMPAREITEMSTRUCT far& comp);
  51.     void          EvDeleteItem(UINT ctrlId, DELETEITEMSTRUCT far& del);
  52.     void          EvDrawItem(UINT ctrlId, DRAWITEMSTRUCT far& draw);
  53.     void          EvMeasureItem(UINT ctrlId, MEASUREITEMSTRUCT far& meas);
  54.  
  55.   private:
  56.     //
  57.     // hidden to prevent accidental copying or assignment
  58.     //
  59.     TControl(const TControl&);
  60.     TControl& operator =(const TControl&);
  61.  
  62.   DECLARE_RESPONSE_TABLE(TControl);
  63.   DECLARE_STREAMABLE(_OWLCLASS, TControl, 1);
  64. };
  65.  
  66. #endif  // __OWL_CONTROL_H
  67.