home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
hpp.z
/
WPICTBOX.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-18
|
5KB
|
176 lines
/*************************************************************************
*
* WPictureBox -- Wrapper for the Windows 95 Static PictureBox control.
*
* Events:
*
* DataAvailable --
*
* DataClose --
*
* DataOpen --
*
* DataRequest --
*
*************************************************************************/
#ifndef _WPICTBOX_HPP_INCLUDED
#define _WPICTBOX_HPP_INCLUDED
#ifndef _WNO_PRAGMA_PUSH
#pragma pack(push,8);
#pragma enum int;
#endif
#ifndef _WSTATIC_HPP_INCLUDED
# include "wstatic.hpp"
#endif
#ifndef _WBITMAP_HPP_INCLUDED
# include "wbitmap.hpp"
#endif
#ifndef _WICON_HPP_INCLUDED
# include "wicon.hpp"
#endif
#ifndef _WMETAFIL_HPP_INCLUDED
# include "wmetafil.hpp"
#endif
#ifndef _WCURSOR_HPP_INCLUDED
# include "wcursor.hpp"
#endif
#ifndef _WDRAWITM_HPP_INCLUDED
# include "wdrawitm.hpp"
#endif
#ifndef _WDATATRG_HPP_INCLUDED
# include "wdatatrg.hpp"
#endif
class WDataSource;
//
// PictureBox styles
//
#define WPBSDefault ((WStyle)0x50000103L) // WS_VISIBLE|WS_CHILD|SS_NOTIFY|SS_ICON
class WCMCLASS WPictureBox : public WStatic {
WDeclareSubclass( WPictureBox, WStatic );
public:
/***************************************************************
* Constructors and Destructors
***************************************************************/
WPictureBox();
~WPictureBox();
/***************************************************************
* Properties
***************************************************************/
// AutoSize
virtual WBool SetAutoSize( WBool on );
virtual WBool GetAutoSize() const;
// Bitmap -- The bitmap associated with the picture box.
WBool SetBitmap( const WBitmap & bitmap );
WBitmap GetBitmap() const;
// Cursor -- The cursor associated with the picture box.
WBool SetCursor( const WCursor & cursor );
WCursor GetCursor() const;
// DataColumns
WString GetDataColumns() const;
WBool SetDataColumns( const WString & cols );
// DataSource
WDataSource *GetDataSource() const;
WBool SetDataSource( WDataSource *source );
// Icon -- The icon associated with the picture box.
WBool SetIcon( const WIcon & icon );
WIcon GetIcon() const;
// Metafile -- The metafile associated with the picture box.
WBool SetMetafile( const WMetafile & metafile );
WMetafile GetMetafile() const;
/***************************************************************
* Methods
***************************************************************/
// AutoSize
//
// Invoked when autosizing needs to be done
virtual WBool AutoSize();
/***************************************************************
* Overrides
***************************************************************/
virtual WBool SetStyle( WStyle style, WBool clone );
virtual WBool SetStyle( WStyle style );
virtual WStyle GetDefaultStyle() const;
virtual WStyle GetDefaultExtendedStyle() const;
virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
void * data=NULL );
virtual WBool LoadWindow( WWindow * parent,
const WResourceID & id,
WModuleHandle module=_ApplicationModule );
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 PaintEventHandler( WPictureBox * pictureBox,
WPaintEventData * event );
WBool QueryNewPaletteEventHandler( WPictureBox * pictureBox,
WEventData * event );
WBool DataOpenHandler( WPictureBox *, WDataOpenEventData *ev );
WBool DataCloseHandler( WPictureBox *, WDataCloseEventData *ev );
WBool DataAvailableHandler( WPictureBox *, WDataAvailableEventData *ev );
WBool DataRequestHandler( WPictureBox *, WDataRequestEventData *ev );
protected:
WBool AllocDTCell();
/***************************************************************
* Data members
***************************************************************/
private:
WIcon _icon;
WBitmap _bitmap;
WCursor _cursor;
WMetafile * _metafile;
WInt _current;
WDataTargetCell *_dataTarget;
WBool _autoSize;
WBool _ignoreChange;
};
#ifndef _WNO_PRAGMA_PUSH
#pragma enum pop;
#pragma pack(pop);
#endif
#endif // _WPICTBOX_HPP_INCLUDED