OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::THdrItem Class Reference

THdrItem contains information about an item in a header control. More...

#include <owl/colmnhdr.h>

Inheritance diagram for owl::THdrItem:

Public Types

enum  TAlign { aLeft = HDF_LEFT , aCenter = HDF_CENTER , aRight = HDF_RIGHT }
 Format flags that determines how the contents (text and/or bitmap) will be layed out. More...
 

Public Member Functions

void SetAlignment (TAlign)
 Methods to set the data members of the HD_ITEM structure.
 
void SetText (LPCTSTR str)
 Sets the text of the HeaderItem object.
 
void SetBitmap (HBITMAP hbm)
 Sets the bitmap handle of the HeaderItem object.
 
void SetWidth (int cx)
 Sets the width of the item.
 
void SetHeight (int cy)
 Sets the height of the item.
 
void SetItemData (TParam2 data)
 Sets the application-defined item data attached to this item object.
 
void SetMask (int msk)
 Updates the mask member of the structure.
 
void SetImage (int item)
 Version 4.70. Zero-based index of an image within the image list.
 
void SetOrder (int order)
 Version 4.70.
 
Constructors to be used for adding, inserting or updating a header control's item.

'str' specifies the title of the item.

Note: The string pointed to must outlive the object! 'hbm' specifies a handle to a bitmap to be used in the item.

 THdrItem (LPCTSTR str, TAlign=aLeft)
 Constructs a THdrItem object for an item which has a string Defaults to left alignment and the DefStringItemSize.
 
 THdrItem (LPCTSTR str, HBITMAP hbm, TAlign=aLeft)
 Constructs a THdrItem object for an item consisting of both a string and a bitmapped image.
 
 THdrItem (HBITMAP hbm, TAlign=aLeft)
 Constructs a THdrItem object for an item which has a bitmapped image Defaults to left alignment and DefBitmapItemSize.
 
 THdrItem (TCHAR *buffer, int len, uint msk=HDI_TEXT)
 Constructors used primarily to construct a 'THdrItem' structure which will be used to retrieve information about an item within a header control.
 
 THdrItem (uint msk=0)
 Constructs an 'empty' THdrItem with the specified 'msk' enabled.
 

Static Public Member Functions

static void SetDefStringSize (int size)
 API to allow user to update ObjectWindows' default string size.
 
static void SetDefBitmapSize (int size)
 API to allow the user to update ObjectWindows' default bitmap item size.
 

Static Protected Attributes

static int DefStringItemSize = 100
 Default size of string item.
 
static int DefBitmapItemSize = 32
 Default size of bitmap item.
 

Detailed Description

THdrItem contains information about an item in a header control.

Definition at line 40 of file colmnhdr.h.

Member Enumeration Documentation

◆ TAlign

Format flags that determines how the contents (text and/or bitmap) will be layed out.

Enumerator
aLeft 

Aligns the contents at the left edge of the item.

aCenter 

Aligns the contents horizontally at the center of the item.

aRight 

Aligns the contens at the right edge of the item.

Definition at line 46 of file colmnhdr.h.

Constructor & Destructor Documentation

◆ THdrItem() [1/5]

owl::THdrItem::THdrItem ( LPCTSTR str,
TAlign alignment = aLeft )
explicit

Constructs a THdrItem object for an item which has a string Defaults to left alignment and the DefStringItemSize.

Definition at line 68 of file colmnhdr.cpp.

References DefStringItemSize, SetText(), and SetWidth().

◆ THdrItem() [2/5]

owl::THdrItem::THdrItem ( LPCTSTR str,
HBITMAP hbm,
TAlign alignment = aLeft )

Constructs a THdrItem object for an item consisting of both a string and a bitmapped image.

Defaults to left alignment and the DefStringItemSize.

Definition at line 56 of file colmnhdr.cpp.

References DefStringItemSize, SetBitmap(), SetText(), and SetWidth().

◆ THdrItem() [3/5]

owl::THdrItem::THdrItem ( HBITMAP hbm,
TAlign alignment = aLeft )
explicit

Constructs a THdrItem object for an item which has a bitmapped image Defaults to left alignment and DefBitmapItemSize.

Definition at line 79 of file colmnhdr.cpp.

References DefBitmapItemSize, SetBitmap(), and SetWidth().

◆ THdrItem() [4/5]

owl::THdrItem::THdrItem ( TCHAR * buffer,
int len,
uint msk = HDI_TEXT )

Constructors used primarily to construct a 'THdrItem' structure which will be used to retrieve information about an item within a header control.

Constructs an 'empty' THdrItem with the specified 'msk' enabled.

'buffer' specifies the location to receive the item's title and 'len' indicates the size of that buffer. The 'msk' flags indicates which members of the structure should be updated.

This flavour of the constructor is mainly used to construct an object which is used to retrieve information about an existing item. 'buffer' specifies a location which will receive the text of the item and 'len' specifies the size of the buffer.

Definition at line 102 of file colmnhdr.cpp.

◆ THdrItem() [5/5]

owl::THdrItem::THdrItem ( uint msk = 0)
explicit

Constructs an 'empty' THdrItem with the specified 'msk' enabled.

This flavour of the constructor is mainly used to construct an object which is used to retrieve information about an existing item.

Definition at line 91 of file colmnhdr.cpp.

Member Function Documentation

◆ SetAlignment()

void owl::THdrItem::SetAlignment ( TAlign alignment)

Methods to set the data members of the HD_ITEM structure.

Sets the alignment of the contents of the item.

Definition at line 109 of file colmnhdr.cpp.

◆ SetBitmap()

void owl::THdrItem::SetBitmap ( HBITMAP bitmap)

Sets the bitmap handle of the HeaderItem object.

Note
The format flags is not updated to contain any alignment flags

Definition at line 134 of file colmnhdr.cpp.

◆ SetDefBitmapSize()

void owl::THdrItem::SetDefBitmapSize ( int size)
static

API to allow the user to update ObjectWindows' default bitmap item size.

Note
Since the variable maintaining that information is shared by every instance of this class, use this function with caution.

Definition at line 46 of file colmnhdr.cpp.

References DefBitmapItemSize.

◆ SetDefStringSize()

void owl::THdrItem::SetDefStringSize ( int size)
static

API to allow user to update ObjectWindows' default string size.

Note
Since the variable maintaining that information is shared by every instance of this class, use this function with caution.

Definition at line 34 of file colmnhdr.cpp.

References DefStringItemSize.

◆ SetHeight()

void owl::THdrItem::SetHeight ( int cy)

Sets the height of the item.

Definition at line 156 of file colmnhdr.cpp.

◆ SetImage()

void owl::THdrItem::SetImage ( int item)

Version 4.70. Zero-based index of an image within the image list.

Definition at line 177 of file colmnhdr.cpp.

◆ SetItemData()

void owl::THdrItem::SetItemData ( TParam2 data)

Sets the application-defined item data attached to this item object.

Definition at line 167 of file colmnhdr.cpp.

◆ SetMask()

void owl::THdrItem::SetMask ( int msk)
inline

Updates the mask member of the structure.

The latter indicates which other members of the structure contain valid data.

Definition at line 333 of file colmnhdr.h.

◆ SetOrder()

void owl::THdrItem::SetOrder ( int order)

Version 4.70.

Order in which the item appears within the header control, from left to right.

Definition at line 189 of file colmnhdr.cpp.

◆ SetText()

void owl::THdrItem::SetText ( LPCTSTR str)

Sets the text of the HeaderItem object.

Note
The format flags is not updated to contain any alignment flags

Definition at line 120 of file colmnhdr.cpp.

References _tcslen, and CONST_CAST.

◆ SetWidth()

void owl::THdrItem::SetWidth ( int cx)

Sets the width of the item.

Definition at line 145 of file colmnhdr.cpp.

Member Data Documentation

◆ DefBitmapItemSize

int owl::THdrItem::DefBitmapItemSize = 32
staticprotected

Default size of bitmap item.

Definition at line 94 of file colmnhdr.h.

◆ DefStringItemSize

int owl::THdrItem::DefStringItemSize = 100
staticprotected

Default size of string item.

Definition at line 93 of file colmnhdr.h.


The documentation for this class was generated from the following files: