home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / OWLINC.PAK / CONTROL.H < prev    next >
C/C++ Source or Header  |  1995-08-29  |  2KB  |  68 lines

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