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

FX::FXHeader Class Reference

Header control may be placed over a table or list to provide a resizable captions above a number of columns. More...

#include <FXHeader.h>

Inheritance diagram for FX::FXHeader:

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

Public Member Functions

 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)
virtual void create ()
virtual void detach ()
virtual void layout ()
FXint getNumItems () const
FXint getTotalSize () const
virtual FXint getDefaultWidth ()
virtual FXint getDefaultHeight ()
void setPosition (FXint pos)
FXint getPosition () const
FXint getItemAt (FXint coord) const
FXHeaderItemgetItem (FXint index) const
FXint setItem (FXint index, FXHeaderItem *item, FXbool notify=FALSE)
FXint setItem (FXint index, const FXString &text, FXIcon *icon=NULL, FXint size=0, void *ptr=NULL, FXbool notify=FALSE)
FXint fillItems (const FXchar **strings, FXIcon *icon=NULL, FXint size=0, void *ptr=NULL, FXbool notify=FALSE)
FXint fillItems (const FXString &strings, FXIcon *icon=NULL, FXint size=0, void *ptr=NULL, FXbool notify=FALSE)
FXint insertItem (FXint index, FXHeaderItem *item, FXbool notify=FALSE)
FXint insertItem (FXint index, const FXString &text, FXIcon *icon=NULL, FXint size=0, void *ptr=NULL, FXbool notify=FALSE)
FXint appendItem (FXHeaderItem *item, FXbool notify=FALSE)
FXint appendItem (const FXString &text, FXIcon *icon=NULL, FXint size=0, void *ptr=NULL, FXbool notify=FALSE)
FXint prependItem (FXHeaderItem *item, FXbool notify=FALSE)
FXint prependItem (const FXString &text, FXIcon *icon=NULL, FXint size=0, void *ptr=NULL, FXbool notify=FALSE)
FXHeaderItemextractItem (FXint index, FXbool notify=FALSE)
void removeItem (FXint index, FXbool notify=FALSE)
void clearItems (FXbool notify=FALSE)
void setItemText (FXint index, const FXString &text)
FXString getItemText (FXint index) const
void setItemIcon (FXint index, FXIcon *icon)
FXIcongetItemIcon (FXint index) const
void setItemSize (FXint index, FXint size)
FXint getItemSize (FXint index) const
FXint getItemOffset (FXint index) const
void setItemData (FXint index, void *ptr)
void * getItemData (FXint index) const
void setArrowDir (FXint index, FXbool dir=MAYBE)
FXbool getArrowDir (FXint index) const
void setItemJustify (FXint index, FXuint justify)
FXuint getItemJustify (FXint index) const
void setItemIconPosition (FXint index, FXuint mode)
FXuint getItemIconPosition (FXint index) const
void setItemPressed (FXint index, FXbool pressed=TRUE)
FXbool isItemPressed (FXint index) const
void makeItemVisible (FXint index)
void updateItem (FXint index) const
void setFont (FXFont *fnt)
FXFontgetFont () const
FXColor getTextColor () const
void setTextColor (FXColor clr)
void setHeaderStyle (FXuint style)
FXuint getHeaderStyle () const
void setHelpText (const FXString &text)
const FXStringgetHelpText () const
virtual void save (FXStream &store) const
virtual void load (FXStream &store)
virtual ~FXHeader ()

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. A single click on a split causes a message of type SEL_CLICKED to be sent to the target; a typical response to this message would be to adjust the size of the split to fit the contents displayed underneath it. The contents may be scrolled by calling setPosition().

See also:


Constructor & Destructor Documentation

FX::FXHeader::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 FX::FXHeader::~FXHeader  )  [virtual]
 

Destructor.


Member Function Documentation

virtual void FX::FXHeader::create  )  [virtual]
 

Create server-side resources.

Reimplemented from FX::FXWindow.

virtual void FX::FXHeader::detach  )  [virtual]
 

Detach server-side resources.

Reimplemented from FX::FXWindow.

virtual void FX::FXHeader::layout  )  [virtual]
 

Perform layout.

Reimplemented from FX::FXWindow.

FXint FX::FXHeader::getNumItems  )  const [inline]
 

Return number of items.

FXint FX::FXHeader::getTotalSize  )  const
 

Return total size of all items.

virtual FXint FX::FXHeader::getDefaultWidth  )  [virtual]
 

Return default width.

Reimplemented from FX::FXFrame.

virtual FXint FX::FXHeader::getDefaultHeight  )  [virtual]
 

Return default height.

Reimplemented from FX::FXFrame.

void FX::FXHeader::setPosition FXint  pos  ) 
 

Set the current position.

FXint FX::FXHeader::getPosition  )  const [inline]
 

Return the current position.

FXint FX::FXHeader::getItemAt FXint  coord  )  const
 

Return item-index given coordinate offset, or -1 if coordinate is before first item in header, or nitems if coordinate is after last item in header.

FXHeaderItem* FX::FXHeader::getItem FXint  index  )  const
 

Return item at given index.

FXint FX::FXHeader::setItem FXint  index,
FXHeaderItem item,
FXbool  notify = FALSE
 

Replace the item with a [possibly subclassed] item.

FXint FX::FXHeader::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 FX::FXHeader::fillItems const FXchar **  strings,
FXIcon icon = NULL,
FXint  size = 0,
void *  ptr = NULL,
FXbool  notify = FALSE
 

Fill header by appending items from array of strings.

FXint FX::FXHeader::fillItems const FXString strings,
FXIcon icon = NULL,
FXint  size = 0,
void *  ptr = NULL,
FXbool  notify = FALSE
 

Fill header by appending items from newline separated strings.

FXint FX::FXHeader::insertItem FXint  index,
FXHeaderItem item,
FXbool  notify = FALSE
 

Insert a new [possibly subclassed] item at the give index.

FXint FX::FXHeader::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 FX::FXHeader::appendItem FXHeaderItem item,
FXbool  notify = FALSE
 

Append a [possibly subclassed] item to the list.

FXint FX::FXHeader::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 FX::FXHeader::prependItem FXHeaderItem item,
FXbool  notify = FALSE
 

Prepend a [possibly subclassed] item to the list.

FXint FX::FXHeader::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.

FXHeaderItem* FX::FXHeader::extractItem FXint  index,
FXbool  notify = FALSE
 

Extract item from list.

void FX::FXHeader::removeItem FXint  index,
FXbool  notify = FALSE
 

Remove item at index.

void FX::FXHeader::clearItems FXbool  notify = FALSE  ) 
 

Remove all items.

void FX::FXHeader::setItemText FXint  index,
const FXString text
 

Change text label for item at index.

FXString FX::FXHeader::getItemText FXint  index  )  const
 

Get text of item at index.

void FX::FXHeader::setItemIcon FXint  index,
FXIcon icon
 

Change icon of item at index.

FXIcon* FX::FXHeader::getItemIcon FXint  index  )  const
 

Return icon of item at index.

void FX::FXHeader::setItemSize FXint  index,
FXint  size
 

Change size of item at index.

FXint FX::FXHeader::getItemSize FXint  index  )  const
 

Return size of item at index.

FXint FX::FXHeader::getItemOffset FXint  index  )  const
 

Compute offset from the left side of item at index.

void FX::FXHeader::setItemData FXint  index,
void *  ptr
 

Change data of item at index.

void* FX::FXHeader::getItemData FXint  index  )  const
 

Return data of item at index.

void FX::FXHeader::setArrowDir FXint  index,
FXbool  dir = MAYBE
 

Change sort direction (FALSE, TRUE, MAYBE).

FXbool FX::FXHeader::getArrowDir FXint  index  )  const
 

Return sort direction (FALSE, TRUE, MAYBE).

void FX::FXHeader::setItemJustify FXint  index,
FXuint  justify
 

Change item justification.

Horizontal justification is controlled by passing FXHeaderItem::RIGHT, FXHeaderItem::LEFT, or FXHeaderItem::CENTER_X. Vertical justification is controlled by FXHeaderItem::TOP, FXHeaderItem::BOTTOM, or FXHeaderItem::CENTER_Y. The default is a combination of FXHeaderItem::LEFT and FXHeaderItem::CENTER_Y.

FXuint FX::FXHeader::getItemJustify FXint  index  )  const
 

Return item justification.

void FX::FXHeader::setItemIconPosition FXint  index,
FXuint  mode
 

Change relative position of icon and text of item.

Passing FXHeaderItem::BEFORE or FXHeaderItem::AFTER places the icon before or after the text, and passing FXHeaderItem::ABOVE or FXHeaderItem::BELOW places it above or below the text, respectively. The default of FXHeaderItem::BEFORE places the icon in front of the text.

FXuint FX::FXHeader::getItemIconPosition FXint  index  )  const
 

Return relative icon and text position.

void FX::FXHeader::setItemPressed FXint  index,
FXbool  pressed = TRUE
 

Changed button item's pressed state.

FXbool FX::FXHeader::isItemPressed FXint  index  )  const
 

Return TRUE if button item is pressed in.

void FX::FXHeader::makeItemVisible FXint  index  ) 
 

Scroll to make given item visible.

void FX::FXHeader::updateItem FXint  index  )  const
 

Repaint header at index.

void FX::FXHeader::setFont FXFont fnt  ) 
 

Change text font.

FXFont* FX::FXHeader::getFont  )  const [inline]
 

return text font

FXColor FX::FXHeader::getTextColor  )  const [inline]
 

Return text color.

void FX::FXHeader::setTextColor FXColor  clr  ) 
 

Change text color.

void FX::FXHeader::setHeaderStyle FXuint  style  ) 
 

Set header style options.

FXuint FX::FXHeader::getHeaderStyle  )  const
 

Get header style options.

void FX::FXHeader::setHelpText const FXString text  ) 
 

Set the status line help text for this header.

const FXString& FX::FXHeader::getHelpText  )  const [inline]
 

Get the status line help text for this header.

virtual void FX::FXHeader::save FXStream store  )  const [virtual]
 

Save header to a stream.

Reimplemented from FX::FXFrame.

virtual void FX::FXHeader::load FXStream store  )  [virtual]
 

Load header from a stream.

Reimplemented from FX::FXFrame.

Copyright © 1997-2005 Jeroen van der Zijp