home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
hpp.z
/
WPICBTTN.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-18
|
4KB
|
132 lines
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 1994, by WATCOM International Inc. All rights %
% reserved. No part of this software may be reproduced or %
% used in any form or by any means - graphic, electronic or %
% mechanical, including photocopying, recording, taping or %
% information storage and retrieval systems - except with the %
% written permission of WATCOM International Inc. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
/*************************************************************************
*
* WPictureButton
*
* Events:
*
*************************************************************************/
#ifndef _WPICBUTTON_HPP_INCLUDED
#define _WPICBUTTON_HPP_INCLUDED
#ifndef _WNO_PRAGMA_PUSH
#pragma pack(push,8);
#pragma enum int;
#endif
#ifndef _WCOMBTTN_HPP_INCLUDED
# include "wcombttn.hpp"
#endif
#ifndef _WDRAWITM_HPP_INCLUDED
# include "wdrawitm.hpp"
#endif
class WBitmap;
class WIcon;
class WCMCLASS WPictureButton : public WCommandButton {
WDeclareSubclass( WPictureButton, WCommandButton );
public:
/**********************************************************
* Constructors and Destructors
*********************************************************/
WPictureButton();
~WPictureButton();
/**********************************************************
* Properties
*********************************************************/
// Bitmap -- The bitmap associated with the picture box.
WBool SetBitmap( const WBitmap & bitmap );
WBitmap GetBitmap() const;
// Icon -- The icon associated with the picture box.
WBool SetIcon( const WIcon & icon );
WIcon GetIcon() const;
/**********************************************************
* Methods
*********************************************************/
/**********************************************************
* Overrides
*********************************************************/
virtual WBool SetStyle( WStyle style, WBool clone );
virtual WBool SetStyle( WStyle style );
virtual WBool AutoSize();
virtual WStyle GetDefaultStyle() const;
virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
void * data=NULL );
virtual WBool LoadWindow( WWindow * parent,
const WResourceID & id,
WModuleHandle module=_ApplicationModule );
protected:
virtual WBool MakeWindow( WWindow * parent, WUInt id,
const WChar * className,
const WChar * title, const WRect & r,
WStyle wstyle, WStyle exStyle,
void * data=NULL );
/**********************************************************
* Event Handlers
*********************************************************/
WBool QueryNewPaletteEventHandler( WPictureButton * pictureButton,
WEventData * event );
WBool PaintEventHandler( WPictureButton * pictureButton,
WPaintEventData * event );
WBool DrawItemEventHandler( WPictureButton * pictureButton,
WDrawItemEventData * event );
/**********************************************************
* Others
*********************************************************/
private:
void DrawNormalOutline( WCanvas & p, WRect & r );
void DrawPressedOutline( WCanvas & p, WRect & r );
/**********************************************************
* Data members
*********************************************************/
private:
WBitmap * _bitmap;
WIcon * _icon;
WBool _currIsBitmap;
};
#ifndef _WNO_PRAGMA_PUSH
#pragma enum pop;
#pragma pack(pop);
#endif
#endif // _WPICBUTTON_HPP_INCLUDED