home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / Chip_1997-10_cd.bin / tema / sybase / powerj / hpp.z / WPICBTTN.HPP < prev    next >
C/C++ Source or Header  |  1996-10-18  |  4KB  |  132 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.  * WPictureButton
  14.  *
  15.  *   Events:
  16.  *
  17.  *************************************************************************/
  18.  
  19. #ifndef _WPICBUTTON_HPP_INCLUDED
  20. #define _WPICBUTTON_HPP_INCLUDED
  21.  
  22. #ifndef _WNO_PRAGMA_PUSH
  23. #pragma pack(push,8);
  24. #pragma enum int;
  25. #endif
  26.  
  27. #ifndef _WCOMBTTN_HPP_INCLUDED
  28. #  include "wcombttn.hpp"
  29. #endif
  30. #ifndef _WDRAWITM_HPP_INCLUDED
  31. #  include "wdrawitm.hpp"
  32. #endif
  33.  
  34. class WBitmap;
  35. class WIcon;
  36.  
  37. class WCMCLASS WPictureButton : public WCommandButton {
  38.     WDeclareSubclass( WPictureButton, WCommandButton );
  39.  
  40.     public:
  41.  
  42.         /**********************************************************
  43.          * Constructors and Destructors
  44.          *********************************************************/
  45.     
  46.         WPictureButton();
  47.  
  48.         ~WPictureButton();
  49.  
  50.         /**********************************************************
  51.          * Properties
  52.          *********************************************************/
  53.     
  54.         // Bitmap -- The bitmap associated with the picture box. 
  55.  
  56.         WBool SetBitmap( const WBitmap & bitmap );
  57.         WBitmap GetBitmap() const;
  58.  
  59.         // Icon -- The icon associated with the picture box.
  60.  
  61.         WBool SetIcon( const WIcon & icon );
  62.         WIcon GetIcon() const;
  63.     
  64.         /**********************************************************
  65.          * Methods
  66.          *********************************************************/
  67.  
  68.         /**********************************************************
  69.          * Overrides
  70.          *********************************************************/
  71.     
  72.         virtual WBool SetStyle( WStyle style, WBool clone );
  73.         virtual WBool SetStyle( WStyle style );
  74.  
  75.         virtual WBool AutoSize();
  76.  
  77.         virtual WStyle GetDefaultStyle() const;
  78.  
  79.         virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
  80.                                    void * data=NULL );
  81.  
  82.         virtual WBool LoadWindow( WWindow * parent,
  83.                                   const WResourceID & id,
  84.                                   WModuleHandle module=_ApplicationModule );
  85.  
  86.     protected:
  87.         virtual WBool MakeWindow( WWindow * parent, WUInt id,
  88.                                   const WChar * className,
  89.                                   const WChar * title, const WRect & r,
  90.                                   WStyle wstyle, WStyle exStyle,
  91.                                   void * data=NULL );
  92.  
  93.         /**********************************************************
  94.          * Event Handlers
  95.          *********************************************************/
  96.     
  97.         WBool QueryNewPaletteEventHandler( WPictureButton * pictureButton,
  98.                                            WEventData * event );
  99.  
  100.         WBool PaintEventHandler( WPictureButton * pictureButton,
  101.                                  WPaintEventData * event );
  102.  
  103.         WBool DrawItemEventHandler( WPictureButton * pictureButton,
  104.                                     WDrawItemEventData * event );
  105.  
  106.         /**********************************************************
  107.          * Others
  108.          *********************************************************/
  109.  
  110.     private:
  111.  
  112.         void DrawNormalOutline( WCanvas & p, WRect & r );
  113.  
  114.         void DrawPressedOutline( WCanvas & p, WRect & r );
  115.  
  116.         /**********************************************************
  117.          * Data members
  118.          *********************************************************/
  119.     
  120.     private:
  121.         WBitmap *       _bitmap;
  122.         WIcon *         _icon;
  123.         WBool           _currIsBitmap;
  124. };
  125.  
  126. #ifndef _WNO_PRAGMA_PUSH
  127. #pragma enum pop;
  128. #pragma pack(pop);
  129. #endif
  130.  
  131. #endif // _WPICBUTTON_HPP_INCLUDED
  132.