home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / hpp.z / WCONTROL.HPP < prev    next >
C/C++ Source or Header  |  1996-10-18  |  6KB  |  193 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.  * WControl
  14.  *
  15.  *
  16.  *   Events:
  17.  *
  18.  *       Scroll --
  19.  *
  20.  *************************************************************************/
  21.  
  22. #ifndef _WCONTROL_HPP_INCLUDED
  23. #define _WCONTROL_HPP_INCLUDED
  24.  
  25. #ifndef _WNO_PRAGMA_PUSH
  26. #pragma pack(push,8);
  27. #pragma enum int;
  28. #endif
  29.  
  30. #ifndef _WWINDOW_HPP_INCLUDED
  31. #  include "wwindow.hpp"
  32. #endif
  33.  
  34. //
  35. // Control styles
  36. //
  37.  
  38. #define WCCSTop                 ((WStyle)0x00000001L) // CCS_TOP
  39. #define WCCSNoMoveY             ((WStyle)0x00000002L) // CCS_NOMOVEY
  40. #define WCCSBottom              ((WStyle)0x00000003L) // CCS_BOTTOM
  41. #define WCCSNoResize            ((WStyle)0x00000004L) // CCS_NORESIZE
  42. #define WCCSNoParentAlign       ((WStyle)0x00000008L) // CCS_NOPARENTALIGN
  43. #define WCCSAdjustable          ((WStyle)0x00000020L) // CCS_ADJUSTABLE
  44. #define WCCSNoDivider           ((WStyle)0x00000040L) // CCS_NODIVIDER
  45.  
  46. enum WTextJustification {
  47.     WAliLeft,
  48.     WTJCenter,
  49.     WTJRight
  50. };
  51.  
  52. enum WVTextJustification {
  53.     WVTJTop,
  54.     WVTJCenter,
  55.     WVTJBottom
  56. };
  57.  
  58. struct WScrollBarEventData;
  59.  
  60. class WCMCLASS WControl : public WWindow {
  61.     WDeclareSubclass( WControl, WWindow );
  62.     
  63.     public:
  64.  
  65.         /**************************************************************
  66.          * Constructors and destructors
  67.          **************************************************************/
  68.  
  69.         WControl();
  70.  
  71.     protected:
  72.  
  73.         WControl( WWindow * parent, WWindowHandle hdl );
  74.  
  75.     public:
  76.  
  77.         ~WControl();
  78.     
  79.         /**************************************************************
  80.          * Properties
  81.          **************************************************************/
  82.  
  83.         // DeferResizePercentages
  84.  
  85.         WBool GetDeferResizePercentages() const;
  86.         WBool SetDeferResizePercentages( WBool deferResizePercentages );
  87.  
  88.         // FDXModified
  89.  
  90.         WBool SetFDXModified( WBool modified ); // WCMINLINE
  91.         WBool GetFDXModified() const; // WCMINLINE
  92.  
  93.         // FDXModifiedPointer
  94.  
  95.         WBool SetFDXModifiedPointer( WBool * fdxModified ); // WCMINLINE
  96.  
  97.         // NextControlInGroup
  98.  
  99.         WControl *GetNextControlInGroup() const;
  100.  
  101.         // ResizePercentages
  102.  
  103.         WRect GetResizePercentages() const; // WCMINLINE
  104.         WBool SetResizePercentages( const WRect & resizePercentages );
  105.  
  106.         // TabGroup
  107.  
  108.         WBool SetTabGroup( WBool tabGroup );
  109.         WBool GetTabGroup() const;
  110.  
  111.         // TabStop
  112.  
  113.         WBool SetTabStop( WBool tabStop );
  114.         WBool GetTabStop() const;
  115.  
  116.         /**************************************************************
  117.          * Methods
  118.          **************************************************************/
  119.  
  120.         // FDXIn
  121.  
  122.         virtual WBool FDXIn();
  123.  
  124.         // FDXOut
  125.  
  126.         virtual WBool FDXOut();
  127.  
  128.         /**************************************************************
  129.          * Event Handlers
  130.          **************************************************************/
  131.  
  132.         WBool ControlColorEventHandler( WControl * control,
  133.                                         WMessageEventData * event );
  134.  
  135.         WBool DestroyEventHandler( WControl * control, WEventData * event );
  136.  
  137.         /**************************************************************
  138.          * Overrides
  139.          **************************************************************/
  140.  
  141.         virtual WBool LoadWindow( WWindow * parent,
  142.                                   const WResourceID & id,
  143.                                   WModuleHandle module=_ApplicationModule );
  144.  
  145.         virtual WBool MakeWindow( WWindow * parent, WUInt id,
  146.                                   const WChar * className,
  147.                                   const WChar * title, const WRect & r,
  148.                                   WStyle wstyle, WStyle exStyle,
  149.                                   void * data=NULL );
  150.  
  151.         /**************************************************************
  152.          * Other
  153.          **************************************************************/
  154.  
  155.         WRect GetPendingResizePercentages() const; // WCMINLINE
  156.         WBool SetPendingResizePercentages( const WRect & pendingResizePercentages ); // WCMINLINE
  157.  
  158.         virtual WBool SetParent( const WWindow * parent );
  159.  
  160.         virtual WBool RedirectChildInput();
  161.  
  162.         virtual int operator ==( const WControl & obj ) const;
  163.  
  164.         static WBool InitializeCommonControls();
  165.  
  166.         /**************************************************************
  167.          * Data members
  168.          **************************************************************/
  169.  
  170.     private:
  171.  
  172.         WBool *         _fdxModified;
  173.         WRect           _resizePercentages;
  174.         WRect           _pendingResizePercentages;
  175.         WBool           _deferResizePercentages;
  176. };
  177.  
  178. #ifdef WCM_ENABLE_INLINES
  179.   #ifndef WCM_NO_WCONTROL_INLINES
  180.     #define WCMINLINE inline
  181.     #include "wcontrol.inl"
  182.   #endif
  183. #endif
  184.  
  185. extern template WVector<WControl>;
  186.  
  187. #ifndef _WNO_PRAGMA_PUSH
  188. #pragma enum pop;
  189. #pragma pack(pop);
  190. #endif
  191.  
  192. #endif // _WCONTROL_HPP_INCLUDED
  193.