home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
hpp.z
/
WHEADER.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-18
|
7KB
|
217 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. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
/*************************************************************************
*
* WColumnHeading -- Wrapper for the Windows 95 Header control.
*
*
* Events:
*
* Change -- Occurs whenever an item changes state (i.e., is
* selected/deselected).
*
* Click -- When an item is clicked.
*
* DoubleClick -- When an item is double-clicked.
*
*************************************************************************/
#ifndef _WHEADER_HPP_INCLUDED
#define _WHEADER_HPP_INCLUDED
#ifndef _WNO_PRAGMA_PUSH
#pragma pack(push,8);
#pragma enum int;
#endif
#ifndef _WCONTROL_HPP_INCLUDED
# include "wcontrol.hpp"
#endif
#ifndef _WWINDOW_HPP_INCLUDED
# include "wwindow.hpp"
#endif
#ifndef _WLLIST_HPP_INCLUDED
# include "wllist.hpp"
#endif
class WColumnHeading;
enum WColumnHeadingItemType {
WColumnHeadingString,
WColumnHeadingBitmap
};
enum WColumnHeadingAlignment {
WColumnHeadingLeft,
WColumnHeadingCenter,
WColumnHeadingRight
};
enum WMouseButtonNumber {
WLeftMouseButton = 0,
WRightMouseButton = 1,
WMiddleMouseButton = 2,
};
enum WColumnHeadingHitTest {
WColumnHeadingHitTestNoWhere = 0x0001,
WColumnHeadingHitTestOnHead = 0x0002,
WColumnHeadingHitTestOnDivider = 0x0004,
WColumnHeadingHitTestOnHiddenItem = 0x0008,
WColumnHeadingHitTestAbove = 0x0100,
WColumnHeadingHitTestBelow = 0x0200,
WColumnHeadingHitTestToRight = 0x0400,
WColumnHeadingHitTestToLeft = 0x0800
};
struct WColumnHeadingEventData : public WEventData {
WInt itemNumber;
WMouseButtonNumber buttonNumber;
};
//
// ColumnHeading styles
//
#define WHSDefault ((WStyle)0x50000002L) // WS_VISIBLE|WS_CHILD|HDS_HORZ|HDS_BUTTONS
#define WHSHorizontal ((WStyle)0x00000000L) // HDS_HORZ
#define WHSButtons ((WStyle)0x00000002L) // HDS_BUTTONS
#define WHSHidden ((WStyle)0x00000008L) // HDS_HIDDEN
class WCMCLASS WColumnHeading : public WControl {
WDeclareSubclass( WColumnHeading, WControl );
public:
/**********************************************************
* Constructors and Destructors
*********************************************************/
WColumnHeading();
~WColumnHeading();
/**********************************************************
* Properties
*********************************************************/
// Count -- Gets the number of items in the header.
WInt GetCount() const;
/**********************************************************
* Methods
*********************************************************/
// Add
//
// Add a new item. Items start at 0. If you set itemNumber to
// 0, the new item is added at the beginning. If you set
// itemNumber to be greater than or equal to the number of items in
// the control, the new item is added at the end.
WInt Add( WInt itemNumber, WColumnHeadingItemType type,
const WBitmapHandle & bmpHandle, const WChar * text,
WLong width,
WColumnHeadingAlignment align=WColumnHeadingLeft,
void * data=NULL );
WInt Add( WInt itemNumber, const WChar * text, WLong width,
WColumnHeadingAlignment align=WColumnHeadingLeft,
void * data=NULL );
WInt Add( WInt itemNumber, const WBitmapHandle & bmpHandle,
WLong width,
WColumnHeadingAlignment align=WColumnHeadingLeft,
void * data=NULL );
// Delete
//
// Delete an item.
WBool Delete( WInt itemNumber );
/**********************************************************
* Item Properties
*********************************************************/
// Retrive -- Get item number on base of point and
// if flags != 0 the additional info about
// the hit test
//
WInt Retrieve( const WPoint & point, WInt * flags = NULL ) const;
// Alignment -- Gets/sets the alignment of the given column.
// Choices are left, center or right.
WBool SetAlignment( WInt itemNumber,
WColumnHeadingAlignment alignment );
WColumnHeadingAlignment GetAlignment( WInt itemNumber ) const;
// BitmapHandle -- Gets/sets the bitmap handle of the given column.
// Choose NULLHBMP for no bitmap.
WBool SetBitmapHandle( WInt itemNumber, WBitmapHandle bmpHandle );
WBitmapHandle GetBitmapHandle( WInt itemNumber ) const;
// ColumnWidth -- Sets/gets the width of the given column.
WBool SetColumnWidth( WInt itemNumber, WLong width );
WLong GetColumnWidth( WInt itemNumber ) const;
// Text -- Gets/sets the caption of an item/subitem. If no parm
// is given, defaults to column 0 which is the item label.
WBool SetText( WInt itemNumber, const WString & str );
WString GetText( WInt itemNumber ) const;
// Type -- Gets/sets the type of the item, whether as a bitmap or
// string.
WBool SetType( WInt itemNumber, WColumnHeadingItemType type );
WColumnHeadingItemType GetType( WInt itemNumber ) const;
// UserData -- Gets/sets the per-item data.
WBool SetUserData( WInt itemNumber, void *itemUserData );
void * GetUserData( WInt itemNumber ) const;
/**********************************************************
* Overrides
*********************************************************/
virtual WBool SetText( const WString & str );
virtual WString GetText() const;
virtual WBool SetUserData( void * userData );
virtual void * GetUserData() const;
virtual const WChar * InitializeClass();
virtual WStyle GetDefaultStyle() const;
virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
void * data=NULL );
protected:
virtual WBool ProcessNotify( WUInt id, WNotify code, WNotifyInfo info,
WLong & returns );
};
#ifndef _WNO_PRAGMA_PUSH
#pragma enum pop;
#pragma pack(pop);
#endif
#endif // _WHEADER_HPP_INCLUDED