class MASKING_DLL_DECLSPEC Header

The listbox header widget.

Inheritance:

Header - Button - Label - Widget - Rect


Public Fields

[more]std::vector<Column> * columns
pointer to a vector of columns; the actual list is owned by the listbox

Protected Fields

[more]int mouseColumn
index of the column the mouse is currently hovering over
[more]int resizingColumn
index of the column that is being resized; -1 if no column is being resized
[more]int resizeOffset
the distance between the mouse x position and the border of the column at the time when resizing is initiated

Protected Methods

[more]void Draw(Bitmap &canvas)
draws the header
[more]void MsgMousemove(const Point &d)
updates mouseColumn on mouse move
[more]void OnResize()
handles resizing the columns with the mouse; called by MsgMousemove()
[more]void OnMousemove()
handles switching focus between header columns with the mouse; called by MsgMousemove()
[more]virtual void DrawItemBackground(Bitmap &dst, Column* item, int state, const Rect &dstRect)
Draws one background for one column header.
[more]virtual void DrawItemContents(Bitmap &dst, Column* item, int state, const Rect &dstRect)
Draws the contents of one column header (ie.
[more]virtual int PreferredHeight()
Returns the preferred height of the header.


Documentation

The listbox header widget. Draws all column headers and allows individual headers to be clicked. You can derive your own headers from it to implement custom drawing or behaviour.
ostd::vector<Column> * columns
pointer to a vector of columns; the actual list is owned by the listbox

oint mouseColumn
index of the column the mouse is currently hovering over

oint resizingColumn
index of the column that is being resized; -1 if no column is being resized

oint resizeOffset
the distance between the mouse x position and the border of the column at the time when resizing is initiated

ovoid Draw(Bitmap &canvas)
draws the header

ovoid MsgMousemove(const Point &d)
updates mouseColumn on mouse move

ovoid OnResize()
handles resizing the columns with the mouse; called by MsgMousemove()

ovoid OnMousemove()
handles switching focus between header columns with the mouse; called by MsgMousemove()

ovirtual void DrawItemBackground(Bitmap &dst, Column* item, int state, const Rect &dstRect)
Draws one background for one column header. Overload this to implement custom drawing of the header background. The default implementation draws the column header backgrounds using the bitmap normally used to skin buttons.

Parameters:
dst - destination bitmap
item - pointer to the item being drawn
state - status of the item (normal, selected, disabled or focused)
dstRect - rectangle into which the header should be rendered

ovirtual void DrawItemContents(Bitmap &dst, Column* item, int state, const Rect &dstRect)
Draws the contents of one column header (ie. the column title). Overload to implement custom drawing of the header contents (i.e. the header titles).

See Also:
DrawItemBackground

ovirtual int PreferredHeight()
Returns the preferred height of the header. The listbox may actually ignore this but will try to use it if possible. Overload this in a derived header class if you want a differently sized header.


This class has no child classes.
Friends:
class ListBoxEx

Alphabetic index Hierarchy of classes


Back to front page   |   page generated with DOC++