home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 10 / ioProg_10.iso / soft / optima / hpp.z / WTOOLTIP.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-31  |  4.7 KB  |  173 lines

  1. /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2.    %     Copyright (C) 1994, by WATCOM International Inc.  All rights    %
  3.    %     reserved.  No part of this software may be reproduced or        %
  4.    %     used in any form or by any means - graphic, electronic or       %
  5.    %     mechanical, including photocopying, recording, taping or        %
  6.    %     information storage and retrieval systems - except with the     %
  7.    %     written permission of WATCOM International Inc.                 %
  8.    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  9. */
  10.  
  11. /*************************************************************************
  12.  *
  13.  * WToolTip -- Wrapper for the Windows 95 ToolTip control.
  14.  *
  15.  *   Events:
  16.  *
  17.  *************************************************************************/
  18.  
  19. #ifndef _WTOOLTIP_HPP_INCLUDED
  20. #define _WTOOLTIP_HPP_INCLUDED
  21.  
  22. #ifndef _WNO_PRAGMA_PUSH
  23. #pragma pack(push,4);
  24. #pragma enum int;
  25. #endif
  26.  
  27. #ifndef _WCONTROL_HPP_INCLUDED
  28. #  include "wcontrol.hpp"
  29. #endif
  30. #ifndef _WWINDOW_HPP_INCLUDED
  31. #  include "wwindow.hpp"
  32. #endif
  33. #ifndef _WVECTOR_HPP_INCLUDED
  34. #  include "wvector.hpp"
  35. #endif
  36.  
  37. class WToolTip;
  38.  
  39. enum WToolTipIdentifierType {
  40.     WToolTipWindowHandle,
  41.     WToolTipIdentifier
  42. };
  43.  
  44. //
  45. // ToolTip styles
  46. //
  47.  
  48. #define WTOOLTSDefault          ((WStyle)0x00000001L) // TTS_ALWAYSTIP
  49. #define WTOOLTSAlwaysTip        ((WStyle)0x00000001L) // TTS_ALWAYSTIP
  50. #define WTOOLTSNoPrefix         ((WStyle)0x00000002L) // TTS_NOPREFIX
  51.  
  52. class WCMCLASS WToolTip : public WControl {
  53.     WDeclareSubclass( WToolTip, WControl );
  54.  
  55.     public:
  56.     
  57.         /**********************************************************
  58.          * Constructors and Destructors
  59.          *********************************************************/
  60.  
  61.         WToolTip();
  62.     
  63.         ~WToolTip();
  64.  
  65.         /**********************************************************
  66.          * Properties
  67.          *********************************************************/
  68.     
  69.         // Count
  70.  
  71.         WInt GetCount() const;
  72.  
  73.         // DelayTime
  74.  
  75.         WBool SetDelayTime( WInt milliseconds=500 );
  76.  
  77.         /**********************************************************
  78.          * Methods
  79.          *********************************************************/
  80.  
  81.         // Activate
  82.  
  83.         void Activate();
  84.  
  85.         // Add
  86.  
  87.         WBool Add( WWindow * parent, WToolTipIdentifierType type,
  88.                    const WRect & rect, const char * text=NULL,
  89.                    WWindow * window=NULL, WLong id=0,
  90.                    WBool getTextFromParent=FALSE );
  91.  
  92.         // Deactivate
  93.  
  94.         void Deactivate();
  95.  
  96.         // Delete
  97.  
  98.         WBool Delete( WLong itemNumber );
  99.  
  100.         // DeleteAll
  101.  
  102.         WBool DeleteAll();
  103.  
  104.         // Retrieve
  105.  
  106.         WLong Retrieve( const WPoint & pt, WWindow * win=NULL );
  107.  
  108.         /**********************************************************
  109.          * Item Properties
  110.          *********************************************************/
  111.  
  112.         // ID
  113.  
  114.         void SetID( WLong itemNumber, WLong id );
  115.         WLong GetID( WLong itemNumber ) const;
  116.  
  117.         // Parent
  118.  
  119.         WBool SetParent( WLong itemNumber, WWindow * parent );
  120.         WWindow * GetParent( WLong itemNumber );
  121.  
  122.         // Rectangle
  123.  
  124.         WBool SetRectangle( WLong itemNumber, const WRect & rect );
  125.         WRect GetRectangle( WLong itemNumber );
  126.  
  127.         // Text
  128.  
  129.         WBool SetText( WLong itemNumber, const WString & str );
  130.         WString GetText( WLong itemNumber );
  131.  
  132.         // Type
  133.  
  134.         void SetType( WLong itemNumber, WToolTipIdentifierType type );
  135.         WToolTipIdentifierType GetType( WLong itemNumber );
  136.  
  137.         // Window
  138.  
  139.         void SetWindow( WLong itemNumber, WWindow * window );
  140.         WWindow * GetWindow( WLong itemNumber );
  141.     
  142.         /**********************************************************
  143.          * Overrides
  144.          *********************************************************/
  145.  
  146.         virtual WBool SetParent( const WWindow * parent );
  147.  
  148.         virtual WWindow * GetParent() const;
  149.  
  150.         virtual WBool SetRectangle( const WRect & rectangle,
  151.                                     WBool update=TRUE );
  152.  
  153.         virtual WRect GetRectangle( WBool absolute=FALSE ) const;
  154.  
  155.         virtual WBool SetText( const WString & text );
  156.  
  157.         virtual WString GetText() const;
  158.  
  159.         virtual const WChar * InitializeClass();
  160.  
  161.         virtual WStyle GetDefaultStyle() const;
  162.  
  163.         virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
  164.                                    void * data=NULL );
  165. };
  166.  
  167. #ifndef _WNO_PRAGMA_PUSH
  168. #pragma enum pop;
  169. #pragma pack(pop);
  170. #endif
  171.  
  172. #endif // _WTOOLTIP_HPP_INCLUDED
  173.