Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXHeader Class Reference

#include <FXHeader.h>

Inheritance diagram for FX::FXHeader:

FX::FXFrame FX::FXWindow FX::FXDrawable FX::FXId FX::FXObject List of all members.

Public Methods

 FXHeader (FXComposite *p, FXObject *tgt=NULL, FXSelector sel=0, FXuint opts=HEADER_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
 Construct new header control.

virtual void create ()
 Create server-side resources.

virtual void detach ()
 Detach server-side resources.

FXint getNumItems () const
 Return number of items.

virtual FXint getDefaultWidth ()
 Return default width.

virtual FXint getDefaultHeight ()
 Return default height.

FXHeaderItemgetItem (FXint index) const
 Return item at given index.

FXint setItem (FXint index, FXHeaderItem *item, FXbool notify=FALSE)
 Replace the item with a [possibly subclassed] item.

FXint setItem (FXint index, const FXString &text, FXIcon *icon=NULL, FXint size=0, void *ptr=NULL, FXbool notify=FALSE)
 Replace items text, icon, and user-data pointer.

FXint insertItem (FXint index, FXHeaderItem *item, FXbool notify=FALSE)
 Insert a new [possibly subclassed] item at the give index.

FXint insertItem (FXint index, const FXString &text, FXIcon *icon=NULL, FXint size=0, void *ptr=NULL, FXbool notify=FALSE)
 Insert item at index with given text, icon, and user-data pointer.

FXint appendItem (FXHeaderItem *item, FXbool notify=FALSE)
 Append a [possibly subclassed] item to the list.

FXint appendItem (const FXString &text, FXIcon *icon=NULL, FXint size=0, void *ptr=NULL, FXbool notify=FALSE)
 Append new item with given text and optional icon, and user-data pointer.

FXint prependItem (FXHeaderItem *item, FXbool notify=FALSE)
 Prepend a [possibly subclassed] item to the list.

FXint prependItem (const FXString &text, FXIcon *icon=NULL, FXint size=0, void *ptr=NULL, FXbool notify=FALSE)
 Prepend new item with given text and optional icon, and user-data pointer.

void removeItem (FXint index, FXbool notify=FALSE)
 Remove item at index.

void clearItems (FXbool notify=FALSE)
 Remove all items.

FXint getItemAt (FXint offset) const
 Return item-index given pixel-offset from left.

void setItemText (FXint index, const FXString &text)
 Change text label for item at index.

FXString getItemText (FXint index) const
 Get text of item at index.

void setItemIcon (FXint index, FXIcon *icon)
 Change icon of item at index.

FXIcongetItemIcon (FXint index) const
 Return icon of item at index.

void setItemSize (FXint index, FXint size)
 Change size of item at index.

FXint getItemSize (FXint index) const
 Return size of item at index.

FXint getItemOffset (FXint index) const
 Compute offset from the left side of item at index.

void setItemData (FXint index, void *ptr)
 Change data of item at index.

void * getItemData (FXint index) const
 Return data of item at index.

void setArrowDir (FXint index, FXbool dir=MAYBE)
 Change sort direction (FALSE, TRUE, MAYBE).

FXbool getArrowDir (FXint index) const
 Return sort direction (FALSE, TRUE, MAYBE).

void setFont (FXFont *fnt)
 Change text font.

FXFontgetFont () const
 return text font

FXColor getTextColor () const
 Return text color.

void setTextColor (FXColor clr)
 Change text color.

void setHeaderStyle (FXuint style)
 Set header style options.

FXuint getHeaderStyle () const
 Get header style options.

void setHelpText (const FXString &text)
 Set the status line help text for this header.

const FXStringgetHelpText () const
 Get the status line help text for this header.

virtual void save (FXStream &store) const
 Save header to a stream.

virtual void load (FXStream &store)
 Load header from a stream.

virtual ~FXHeader ()
 Destructor.


Detailed Description

Header control may be placed over a table or list to provide a resizable captions above a number of columns. Each caption comprises a label and an optional icon; in addition, an arrow may be shown to indicate whether the items in that column are sorted, and if so, whether they are sorted in increasing or decreasing order. Each caption can be interactively resized. During the resizing, if the HEADER_TRACKING was specified, the header control sends a SEL_CHANGED message to its target, with the message data set to the caption number being resized, of the type FXint. If the HEADER_TRACKING was not specified the SEL_CHANGED message is sent at the end of the resizing operation. Clicking on a caption causes a message of type SEL_COMMAND to be sent to the target, with the message data set to the caption number being clicked.

See also: