home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
hpp.z
/
WWELL.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-18
|
7KB
|
222 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. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
/*************************************************************************
*
* WWell -- Wrapper for the Windows 95 Well control.
*
*
* Events:
*
* Click --
*
* DrawItem --
*
* Select --
*
*************************************************************************/
#ifndef _WWELL_HPP_INCLUDED
#define _WWELL_HPP_INCLUDED
#ifndef _WNO_PRAGMA_PUSH
#pragma pack(push,8);
#pragma enum int;
#endif
#ifndef _WPOINT_HPP_INCLUDED
# include "wpoint.hpp"
#endif
#ifndef _WRECT_HPP_INCLUDED
# include "wrect.hpp"
#endif
#ifndef _WDRAWITM_HPP_INCLUDED
# include "wdrawitm.hpp"
#endif
#ifndef _WCONTROL_HPP_INCLUDED
# include "wcontrol.hpp"
#endif
//
// WWell styles
//
#define WWellDefault ((WStyle)0x50000000L) // WS_VISIBLE | WS_CHILD
class WCMCLASS WWell: public WControl {
WDeclareSubclass( WWell, WControl );
/**************************************************************
* Contructors and destructors
**************************************************************/
public:
WWell(); // 4x4 well
WWell( WUInt numColumns, WUInt numRows );
~WWell();
/**************************************************************
* Properties
**************************************************************/
// ColumnCount
WUInt GetColumnCount() const;
virtual WBool SetColumnCount( WUInt numColumns );
// RowCount
WUInt GetRowCount() const;
virtual WBool SetRowCount( WUInt numRows );
// Selected
//
// Note: item.x represents the column,
// item.y represents the row
WBool SetSelected( const WPoint & item, WBool redraw=TRUE );
WPoint GetSelected() const;
// TrackMouse
WBool GetTrackMouse() const;
WBool SetTrackMouse( WBool trackMouse );
/**************************************************************
* Methods
**************************************************************/
// CalculateIdealHeight
WUInt CalculateIdealHeight( WUInt itemHeight );
// CalculateIdealWidth
WUInt CalculateIdealWidth( WUInt itemWidth );
/**************************************************************
* Others
**************************************************************/
public:
WBool PaintHandler( WWindow * window, WPaintEventData * event );
WBool PositionChangedEventHandler( WWell * window,
WMoveEventData * event );
WBool MouseMoveEventHandler( WWell * window,
WMouseEventData * event );
WBool LeftButtonDownEventHandler( WWell * window,
WMouseEventData * event );
WBool KeyDownEventHandler( WWell * window,
WKeyPressEventData * event );
WBool CharacterPressEventHandler( WWell * window,
WCharacterPressEventData * event );
private:
virtual WStyle GetDefaultStyle() const;
virtual WULong GetDialogCode( WUInt wParam = 0, WLong lParam = 0 );
void SetEvents();
/**************************************************************
* Data members
**************************************************************/
protected:
WUInt _numColumns;
WUInt _numRows;
WUInt _selectedItem;
WBool _trackMouse;
};
class WCMCLASS WColorWell : public WWell {
WDeclareSubclass( WColorWell, WWell );
/**************************************************************
* Contructors and destructors
**************************************************************/
public:
WColorWell(); // 4x4 well
WColorWell( WUInt numColumns, WUInt numRows );
~WColorWell();
/**************************************************************
* Properties
**************************************************************/
// ResetColorsOnSizeChange
WBool GetResetColorsOnSizeChange() const;
WBool SetResetColorsOnSizeChange( WBool resetOnChange );
/**************************************************************
* Methods
**************************************************************/
// ResetMonochromeColors
WBool ResetMonochromeColors( WBool repaint=TRUE );
// ResetColors
WBool ResetColors( WBool repaint=TRUE );
/**************************************************************
* Item Properties
**************************************************************/
// Color
WColor GetColor( WInt itemNumber );
WBool SetColor( WInt itemNumber, const WColor & color,
WBool repaint=FALSE );
/**************************************************************
* Others
**************************************************************/
virtual WBool SetRowCount( WUInt numRows );
virtual WBool SetColumnCount( WUInt numColumns );
private:
WBool DrawItemEventHandler( WWell * window,
WDrawItemEventData * event );
/**************************************************************
* Data members
**************************************************************/
private:
WColor * _colorArray;
WBool _resetOnChange;
};
#ifndef _WNO_PRAGMA_PUSH
#pragma enum pop;
#pragma pack(pop);
#endif
#endif // _WWELL_HPP_INCLUDED