home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / hpp.z / WSTATUS.HPP < prev    next >
C/C++ Source or Header  |  1996-10-18  |  5KB  |  152 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. #ifndef _WSTATUS_HPP_INCLUDED
  12. #define _WSTATUS_HPP_INCLUDED
  13.  
  14. #ifndef _WNO_PRAGMA_PUSH
  15. #pragma pack(push,8);
  16. #pragma enum int;
  17. #endif
  18.  
  19. #ifndef _WSTRING_HPP_INCLUDED
  20. #  include "wstring.hpp"
  21. #endif
  22. #ifndef _WCONTROL_HPP_INCLUDED
  23. #  include "wcontrol.hpp"
  24. #endif
  25. #ifndef _WFORM_HPP_INCLUDED
  26. #  include "wform.hpp"
  27. #endif
  28. #ifndef _WARRAY_HPP_INCLUDED
  29. #  include "warray.hpp"
  30. #endif
  31.  
  32. class WFont;
  33.  
  34. #define WStatusDefault        ((WStyle)0x50000103L)   // WS_VISIBLE|WS_CHILD|CCS_BOTTOM
  35. #define WStatusSizeGrip       ((WStyle)0x00000100L)   // SBARS_SIZEGRIP
  36.  
  37. enum WStatusBarItemType {
  38.     WSBITNormal=0x0000,
  39.     WSBITNoBorders=0x0100,
  40.     WSBITPopOut=0x0200
  41. };
  42.  
  43. typedef WArray< WLong >         WLongArray;
  44.  
  45. class WCMCLASS WStatusBar : public WControl {
  46.     WDeclareSubclass( WStatusBar, WControl );
  47.  
  48.     public:
  49.  
  50.         /*******************************************************************
  51.          * Constructors and Destructors
  52.          *******************************************************************/
  53.  
  54.         WStatusBar();
  55.  
  56.         ~WStatusBar();
  57.  
  58.         /*******************************************************************
  59.          * Properties
  60.          *******************************************************************/
  61.  
  62.         // ItemEdges
  63.         //
  64.         //    The number of items.  The positions parameter is an array
  65.         //    that holds the right edges of each part.  Setting an edge
  66.         //    to -1 means stretch to the end.  
  67.  
  68.         WLongArray GetItemEdges();
  69.         WBool      SetItemEdges( const WLongArray & positions );
  70.  
  71.         // SimpleMode
  72.         //
  73.         //     In "simple mode", the status bar displays only one line
  74.         //     of text.  The text is maintained independently of the text
  75.         //     in any panes.
  76.  
  77.         WBool GetSimpleMode() const;
  78.         WBool SetSimpleMode( WBool on );
  79.  
  80.         //  Height
  81.         //
  82.         //
  83.         WBool SetMinimumHeight( WULong height );
  84.  
  85.  
  86.         /*******************************************************************
  87.          * Methods
  88.          *******************************************************************/
  89.  
  90.         /*******************************************************************
  91.          * Item Properties
  92.          *******************************************************************/
  93.  
  94.         // Length
  95.  
  96.         WULong GetLength( WULong itemNumber ) const;
  97.  
  98.         // Rectangle
  99.  
  100.         WRect  GetRectangle( WULong itemNumber ) const;
  101.  
  102.         // Text
  103.         //
  104.         //    Get/set the text for an item.
  105.  
  106.         #define WSTATUSBAR_SIMPLE_ITEM 255
  107.  
  108.         WString GetText( WULong itemNumber ) const;
  109.         WBool SetText( WULong itemNumber, const WString & str,
  110.                        WStatusBarItemType type=WSBITNormal );
  111.  
  112.         // Type
  113.  
  114.         WStatusBarItemType GetType( WULong itemNumber ) const;
  115.  
  116.         /*******************************************************************
  117.          * Overriddes
  118.          *******************************************************************/
  119.  
  120.         virtual WRect GetRectangle( WBool absolute = FALSE ) const;
  121.         
  122.         virtual WBool SetText( const WString & text );
  123.  
  124.         virtual WString GetText() const;
  125.  
  126.         virtual const WChar * InitializeClass();
  127.  
  128.         virtual WStyle GetDefaultStyle() const;
  129.  
  130.         virtual WStyle GetDefaultExtendedStyle() const;
  131.  
  132.         virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
  133.                                    void * data=NULL );
  134.  
  135.         virtual WRect CalculateSize( const WRect &, WBool );
  136.  
  137.         /*******************************************************************
  138.          * Data members
  139.          *******************************************************************/
  140.  
  141.     private:
  142.  
  143.         WBool                   _simpleMode;
  144. };
  145.  
  146. #ifndef _WNO_PRAGMA_PUSH
  147. #pragma enum pop;
  148. #pragma pack(pop);
  149. #endif
  150.  
  151. #endif // _WSTATUS_HPP_INCLUDED
  152.