home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / hpp.z / WLABEL.HPP < prev    next >
C/C++ Source or Header  |  1996-10-18  |  3KB  |  120 lines

  1. /*************************************************************************
  2.  *
  3.  * WLabel -- Wrapper for the Windows 95 Static Label control.
  4.  *
  5.  *   Events:
  6.  *
  7.  *       DataAvailable --
  8.  *
  9.  *       DataClose --
  10.  *
  11.  *       DataOpen --
  12.  *
  13.  *       DataRequest --
  14.  *
  15.  *************************************************************************/
  16.  
  17. #ifndef _WLABEL_HPP_INCLUDED
  18. #define _WLABEL_HPP_INCLUDED
  19.  
  20. #ifndef _WNO_PRAGMA_PUSH
  21. #pragma pack(push,8);
  22. #pragma enum int;
  23. #endif
  24.  
  25. #ifndef _WSTATIC_HPP_INCLUDED
  26. #  include "wstatic.hpp"
  27. #endif
  28. #ifndef _WDATATRG_HPP_INCLUDED
  29. #  include "wdatatrg.hpp"
  30. #endif
  31.  
  32. class WDataSource;
  33.  
  34. //
  35. // Label styles
  36. //
  37.  
  38. #define WLSDefault              ((WStyle)0x5000010CL) // WS_VISIBLE|SS_LEFTNOWORDWRAP|WS_CHILD|SS_NOTIFY
  39.  
  40. class WCMCLASS WLabel : public WStatic {
  41.     WDeclareSubclass( WLabel, WStatic );
  42.  
  43.     public:
  44.  
  45.         /**********************************************************
  46.          * Constructors and Destructors
  47.          *********************************************************/
  48.  
  49.         WLabel();
  50.     
  51.         ~WLabel();
  52.     
  53.         /**********************************************************
  54.          * Properties
  55.          *********************************************************/
  56.     
  57.         // AutoSize
  58.  
  59.         virtual WBool SetAutoSize( WBool on );
  60.         virtual WBool GetAutoSize() const;
  61.  
  62.         // DataColumns
  63.  
  64.         WString GetDataColumns() const;
  65.         WBool   SetDataColumns( const WString & cols );
  66.  
  67.         // DataSource
  68.  
  69.         WDataSource *GetDataSource() const;
  70.         WBool        SetDataSource( WDataSource *source );
  71.  
  72.         /**********************************************************
  73.          * Methods
  74.          *********************************************************/
  75.  
  76.         // AutoSize
  77.  
  78.         virtual WBool AutoSize();
  79.  
  80.         /**********************************************************
  81.          * Overrides
  82.          *********************************************************/
  83.     
  84.         virtual WBool Move( const WRect & rectangle, WBool update=TRUE );
  85.         virtual WBool Move( const WRect & rectangle, WDeferMoveHandle & dwp );
  86.         virtual WBool Move( const WPoint & point, WBool update=TRUE );
  87.         virtual WBool Move( const WPoint & point, WDeferMoveHandle & dwp );
  88.  
  89.         virtual WBool SetFont( const WFont & font, WBool preserveSize=TRUE );
  90.  
  91.         virtual WBool SetText( const WString & text );
  92.  
  93.         virtual WStyle GetDefaultStyle() const;
  94.  
  95.         WBool DataOpenHandler( WLabel *, WDataOpenEventData *ev );
  96.         WBool DataCloseHandler( WLabel *, WDataCloseEventData *ev );
  97.         WBool DataAvailableHandler( WLabel *, WDataAvailableEventData *ev );
  98.         WBool DataRequestHandler( WLabel *, WDataRequestEventData *ev );
  99.  
  100.     protected:
  101.  
  102.         WBool AllocDTCell();
  103.  
  104.         /**********************************************************
  105.          * Data members
  106.          *********************************************************/
  107.     
  108.     private:
  109.  
  110.         WBool            _autoSize;
  111.         WDataTargetCell *_dataTarget;
  112. };
  113.  
  114. #ifndef _WNO_PRAGMA_PUSH
  115. #pragma enum pop;
  116. #pragma pack(pop);
  117. #endif
  118.  
  119. #endif // _WLABEL_HPP_INCLUDED
  120.