home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / Chip_1997-10_cd.bin / tema / sybase / powerj / hpp.z / WPROGBAR.HPP < prev    next >
C/C++ Source or Header  |  1996-10-18  |  5KB  |  159 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.  * WProgressBar -- Wrapper for the Windows 95 Progress Bar control.
  14.  *
  15.  *   Events:
  16.  *
  17.  *************************************************************************/
  18.  
  19. #ifndef _WPROGRESSBAR_HPP_INCLUDED
  20. #define _WPROGRESSBAR_HPP_INCLUDED
  21.  
  22. #ifndef _WNO_PRAGMA_PUSH
  23. #pragma pack(push,8);
  24. #pragma enum int;
  25. #endif
  26.  
  27. #ifndef _WCONTROL_HPP_INCLUDED
  28. #  include "wcontrol.hpp"
  29. #endif
  30. #ifndef _WSTRING_HPP_INCLUDED
  31. #  include "wstring.hpp"
  32. #endif
  33.  
  34. //
  35. // ProgressBar styles
  36. //
  37.  
  38. #define WPROGBSDefault          ((WStyle)0x50000000L) // WS_CHILD|WS_VISIBLE
  39. #define WPROGBSNoText           WPROGBSDefault
  40.  
  41. struct WProgressBarFDXDataStruct {
  42.     WUShort             position;
  43.     WRange              range;
  44. };
  45.  
  46. enum WProgressBarStyle {
  47.     WProgressBarStyleNormal,
  48.     WProgressBarStylePercent,
  49.     WProgressBarStylePosition,
  50.     WProgressBarStyleCaption
  51. };
  52.  
  53. class WCMCLASS WProgressBar : public WControl {
  54.     WDeclareSubclass( WProgressBar, WControl );
  55.     
  56.     public:
  57.  
  58.         /**********************************************************
  59.          * Constructors and Destructors
  60.          *********************************************************/
  61.  
  62.         WProgressBar();
  63.     
  64.         ~WProgressBar();
  65.     
  66.         /**********************************************************
  67.          * Properties
  68.          *********************************************************/
  69.  
  70.         // BarStyle
  71.         //
  72.         //    The type of bar to paint.
  73.  
  74.         WProgressBarStyle GetBarStyle() const;
  75.         WBool             SetBarStyle( WProgressBarStyle style );
  76.  
  77.         // FDXDataSource
  78.  
  79.         WBool SetFDXDataSource( WUShort * fdxDataSource );
  80.         WBool SetFDXDataSource( WProgressBarFDXDataStruct * fdxDataSource );
  81.  
  82.         // Maximum
  83.  
  84.         WBool   SetMaximum( WUShort maximum );
  85.         WUShort GetMaximum();
  86.  
  87.         // Minimum
  88.  
  89.         WBool   SetMinimum( WUShort minimum );
  90.         WUShort GetMinimum();
  91.  
  92.         // Position
  93.  
  94.         WBool   SetPosition( WUShort position );
  95.         WUShort GetPosition();
  96.  
  97.         // Range
  98.  
  99.         WBool  SetRange( const WRange & range );
  100.         WRange GetRange() const;
  101.  
  102.         // Step
  103.  
  104.         WBool   SetStep( WUShort step );
  105.         WUShort GetStep();
  106.  
  107.         /**********************************************************
  108.          * Methods
  109.          *********************************************************/
  110.  
  111.         // Increment
  112.  
  113.         WUShort Increment( WUShort inc=0 );
  114.  
  115.         /**********************************************************
  116.          * Overrides and handlers
  117.          *********************************************************/
  118.  
  119.         virtual const WChar * InitializeClass();
  120.  
  121.         virtual WStyle GetDefaultStyle() const;
  122.  
  123.         virtual WBool ProcessNotify( WUInt id, WNotify code,
  124.                                      WNotifyInfo info, WLong & returns );
  125.  
  126.         virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
  127.                                    void * data=NULL );
  128.  
  129.         virtual WBool FDXIn();
  130.  
  131.         virtual WBool FDXOut();
  132.  
  133.         WBool PaintHandler( WProgressBar *, WPaintEventData * );
  134.  
  135.         virtual WBool ProcessMessage( const WMessage & msg,
  136.                                       WLong & returns );
  137.  
  138.         /**********************************************************
  139.          * Data members
  140.          *********************************************************/
  141.  
  142.     private:
  143.  
  144.         WUShort                         _currPos;
  145.         WUShort                         _step;
  146.         WUShort                         _minRange;
  147.         WUShort                         _maxRange;
  148.         WUShort *                       _fdxDataSource;
  149.         WProgressBarFDXDataStruct *     _fdxDataSourceStruct;
  150.         WProgressBarStyle               _barStyle;
  151. };
  152.  
  153. #ifndef _WNO_PRAGMA_PUSH
  154. #pragma enum pop;
  155. #pragma pack(pop);
  156. #endif
  157.  
  158. #endif // _WPROGRESSBAR_HPP_INCLUDED
  159.