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

FX::FXIconList Class Reference

A Icon List Widget displays a list of items, each with a text and optional icon. More...

#include <FXIconList.h>

Inheritance diagram for FX::FXIconList:
FX::FXScrollArea FX::FXComposite FX::FXWindow FX::FXDrawable FX::FXId FX::FXObject FX::FXFileList

List of all members.

Public Types

enum  {
  ID_LOOKUPTIMER = FXScrollArea::ID_LAST, ID_HEADER, ID_SHOW_DETAILS, ID_SHOW_MINI_ICONS,
  ID_SHOW_BIG_ICONS, ID_ARRANGE_BY_ROWS, ID_ARRANGE_BY_COLUMNS, ID_SELECT_ALL,
  ID_DESELECT_ALL, ID_SELECT_INVERSE, ID_LAST
}

Public Member Functions

long onPaint (FXObject *, FXSelector, void *)
long onEnter (FXObject *, FXSelector, void *)
long onLeave (FXObject *, FXSelector, void *)
long onUngrabbed (FXObject *, FXSelector, void *)
long onKeyPress (FXObject *, FXSelector, void *)
long onKeyRelease (FXObject *, FXSelector, void *)
long onLeftBtnPress (FXObject *, FXSelector, void *)
long onLeftBtnRelease (FXObject *, FXSelector, void *)
long onRightBtnPress (FXObject *, FXSelector, void *)
long onRightBtnRelease (FXObject *, FXSelector, void *)
long onMotion (FXObject *, FXSelector, void *)
long onQueryTip (FXObject *, FXSelector, void *)
long onQueryHelp (FXObject *, FXSelector, void *)
long onTipTimer (FXObject *, FXSelector, void *)
long onCmdSelectAll (FXObject *, FXSelector, void *)
long onCmdDeselectAll (FXObject *, FXSelector, void *)
long onCmdSelectInverse (FXObject *, FXSelector, void *)
long onCmdArrangeByRows (FXObject *, FXSelector, void *)
long onUpdArrangeByRows (FXObject *, FXSelector, void *)
long onCmdArrangeByColumns (FXObject *, FXSelector, void *)
long onUpdArrangeByColumns (FXObject *, FXSelector, void *)
long onCmdShowDetails (FXObject *, FXSelector, void *)
long onUpdShowDetails (FXObject *, FXSelector, void *)
long onCmdShowBigIcons (FXObject *, FXSelector, void *)
long onUpdShowBigIcons (FXObject *, FXSelector, void *)
long onCmdShowMiniIcons (FXObject *, FXSelector, void *)
long onUpdShowMiniIcons (FXObject *, FXSelector, void *)
long onChgHeader (FXObject *, FXSelector, void *)
long onClkHeader (FXObject *, FXSelector, void *)
long onFocusIn (FXObject *, FXSelector, void *)
long onFocusOut (FXObject *, FXSelector, void *)
long onClicked (FXObject *, FXSelector, void *)
long onDoubleClicked (FXObject *, FXSelector, void *)
long onTripleClicked (FXObject *, FXSelector, void *)
long onCommand (FXObject *, FXSelector, void *)
long onAutoScroll (FXObject *, FXSelector, void *)
long onLookupTimer (FXObject *, FXSelector, void *)
long onCmdSetValue (FXObject *, FXSelector, void *)
long onCmdGetIntValue (FXObject *, FXSelector, void *)
long onCmdSetIntValue (FXObject *, FXSelector, void *)
 FXIconList (FXComposite *p, FXObject *tgt=NULL, FXSelector sel=0, FXuint opts=ICONLIST_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0)
 Construct icon list with no items in it initially.
virtual void create ()
 Create server-side resources.
virtual void detach ()
 Detach server-side resources.
virtual void recalc ()
 Recalculate layout.
virtual void layout ()
 Perform layout.
virtual FXint getVisibleY () const
 Return visible area y position.
virtual FXint getVisibleHeight () const
 Return visible area height.
virtual FXint getContentWidth ()
 Compute and return content width.
virtual FXint getContentHeight ()
 Return content height.
virtual FXbool canFocus () const
 Icon list can receive focus.
virtual void setFocus ()
 Move the focus to this window.
virtual void killFocus ()
 Remove the focus from this window.
virtual void resize (FXint w, FXint h)
 Resize this window to the specified width and height.
virtual void position (FXint x, FXint y, FXint w, FXint h)
 Move and resize this window in the parent's coordinates.
FXint getNumItems () const
 Return number of items.
FXint getNumRows () const
 Return number of rows.
FXint getNumCols () const
 Return number of columns.
FXHeadergetHeader () const
 Return header control.
void setHeaders (const FXchar **strings, FXint size=1)
 Set headers from array of strings.
void setHeaders (const FXString &strings, FXint size=1)
 Set headers from newline separated strings.
void appendHeader (const FXString &text, FXIcon *icon=NULL, FXint size=1)
 Append header with given text and optional icon.
void removeHeader (FXint index)
 Remove header at index.
void setHeaderText (FXint index, const FXString &text)
 Change text of header at index.
FXString getHeaderText (FXint index) const
 Return text of header at index.
void setHeaderIcon (FXint index, FXIcon *icon)
 Change icon of header at index.
FXIcongetHeaderIcon (FXint index) const
 Return icon of header at index.
void setHeaderSize (FXint index, FXint size)
 Change size of header at index.
FXint getHeaderSize (FXint index) const
 Return width of header at index.
FXint getNumHeaders () const
 Return number of headers.
FXIconItemgetItem (FXint index) const
 Return the item at the given index.
FXint setItem (FXint index, FXIconItem *item, FXbool notify=false)
 Replace the item with a [possibly subclassed] item.
FXint setItem (FXint index, const FXString &text, FXIcon *big=NULL, FXIcon *mini=NULL, void *ptr=NULL, FXbool notify=false)
 Replace items text, icons, and user-data pointer.
FXint fillItems (const FXchar **strings, FXIcon *big=NULL, FXIcon *mini=NULL, void *ptr=NULL, FXbool notify=false)
 Fill list by appending items from array of strings.
FXint fillItems (const FXString &strings, FXIcon *big=NULL, FXIcon *mini=NULL, void *ptr=NULL, FXbool notify=false)
 Fill list by appending items from newline separated strings.
FXint insertItem (FXint index, FXIconItem *item, FXbool notify=false)
 Insert a new [possibly subclassed] item at the give index.
FXint insertItem (FXint index, const FXString &text, FXIcon *big=NULL, FXIcon *mini=NULL, void *ptr=NULL, FXbool notify=false)
 Insert item at index with given text, icons, and user-data pointer.
FXint appendItem (FXIconItem *item, FXbool notify=false)
 Append a [possibly subclassed] item to the end of the list.
FXint appendItem (const FXString &text, FXIcon *big=NULL, FXIcon *mini=NULL, void *ptr=NULL, FXbool notify=false)
 Append new item with given text and optional icons, and user-data pointer.
FXint prependItem (FXIconItem *item, FXbool notify=false)
 Prepend a [possibly subclassed] item to the end of the list.
FXint prependItem (const FXString &text, FXIcon *big=NULL, FXIcon *mini=NULL, void *ptr=NULL, FXbool notify=false)
 Prepend new item with given text and optional icons, and user-data pointer.
FXint moveItem (FXint newindex, FXint oldindex, FXbool notify=false)
 Move item from oldindex to newindex.
FXIconItemextractItem (FXint index, FXbool notify=false)
 Extract item from list.
void removeItem (FXint index, FXbool notify=false)
 Remove item from list.
void clearItems (FXbool notify=false)
 Remove all items from list.
FXint getItemWidth () const
 Return item width.
FXint getItemHeight () const
 Return item height.
virtual FXint getItemAt (FXint x, FXint y) const
 Return index of item at x,y, or -1 if none.
FXint findItem (const FXString &text, FXint start=-1, FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const
 Search items by name, beginning from item start.
FXint findItemByData (const void *ptr, FXint start=-1, FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const
 Search items by associated user data, beginning from item start.
virtual void makeItemVisible (FXint index)
 Scroll to make item at index visible.
void setItemText (FXint index, const FXString &text)
 Change item text.
FXString getItemText (FXint index) const
 Return item text.
void setItemBigIcon (FXint index, FXIcon *icon, FXbool owned=false)
 Change item big icon.
FXIcongetItemBigIcon (FXint index) const
 Return big icon of item at index.
void setItemMiniIcon (FXint index, FXIcon *icon, FXbool owned=false)
 Change item mini icon.
FXIcongetItemMiniIcon (FXint index) const
 Return mini icon of item at index.
void setItemData (FXint index, void *ptr)
 Change item user-data pointer.
void * getItemData (FXint index) const
 Return item user-data pointer.
FXbool isItemSelected (FXint index) const
 Return true if item at index is selected.
FXbool isItemCurrent (FXint index) const
 Return true if item at index is current.
FXbool isItemVisible (FXint index) const
 Return true if item at index is visible.
FXbool isItemEnabled (FXint index) const
 Return true if item at index is enabled.
FXint hitItem (FXint index, FXint x, FXint y, FXint ww=1, FXint hh=1) const
 Return item hit code: 0 outside, 1 icon, 2 text.
void updateItem (FXint index) const
 Repaint item at index.
virtual FXbool enableItem (FXint index)
 Enable item at index.
virtual FXbool disableItem (FXint index)
 Disable item at index.
virtual FXbool selectItem (FXint index, FXbool notify=false)
 Select item at index.
virtual FXbool deselectItem (FXint index, FXbool notify=false)
 Deselect item at index.
virtual FXbool toggleItem (FXint index, FXbool notify=false)
 Toggle item at index.
virtual FXbool selectInRectangle (FXint x, FXint y, FXint w, FXint h, FXbool notify=false)
 Select items in rectangle.
virtual FXbool extendSelection (FXint index, FXbool notify=false)
 Extend selection from anchor index to index.
virtual FXbool killSelection (FXbool notify=false)
 Deselect all items.
virtual void setCurrentItem (FXint index, FXbool notify=false)
 Change current item index.
FXint getCurrentItem () const
 Return current item index, or -1 if none.
void setAnchorItem (FXint index)
 Change anchor item index.
FXint getAnchorItem () const
 Return anchor item index, or -1 if none.
void sortItems ()
 Sort items.
FXIconListSortFunc getSortFunc () const
 Return sort function.
void setSortFunc (FXIconListSortFunc func)
 Change sort function.
void setFont (FXFont *fnt)
 Change text font.
FXFontgetFont () const
 Return text font.
FXColor getTextColor () const
 Return normal text color.
void setTextColor (FXColor clr)
 Change normal text color.
FXColor getSelBackColor () const
 Return selected text background.
void setSelBackColor (FXColor clr)
 Change selected text background.
FXColor getSelTextColor () const
 Return selected text color.
void setSelTextColor (FXColor clr)
 Change selected text color.
void setItemSpace (FXint s)
 Change maximum item space for each item.
FXint getItemSpace () const
 Return maximum item space.
FXuint getListStyle () const
 Get the current icon list style.
void setListStyle (FXuint style)
 Set the current icon list style.
void setHelpText (const FXString &text)
 Set the status line help text for this widget.
const FXStringgetHelpText () const
 Get the status line help text for this widget.
virtual void save (FXStream &store) const
 Save list to a stream.
virtual void load (FXStream &store)
 Load list from a stream.
virtual ~FXIconList ()
 Destructor.

Static Public Member Functions

static FXint ascending (const FXIconItem *a, const FXIconItem *b)
static FXint descending (const FXIconItem *a, const FXIconItem *b)
static FXint ascendingCase (const FXIconItem *a, const FXIconItem *b)
static FXint descendingCase (const FXIconItem *a, const FXIconItem *b)

Protected Member Functions

void recompute ()
void startLasso (FXint ax, FXint ay)
void updateLasso (FXint cx, FXint cy)
void endLasso ()
void getrowscols (FXint &nr, FXint &nc, FXint w, FXint h) const
void lassoChanged (FXint ox, FXint oy, FXint ow, FXint oh, FXint nx, FXint ny, FXint nw, FXint nh, FXbool notify)
virtual void moveContents (FXint x, FXint y)
virtual FXIconItemcreateItem (const FXString &text, FXIcon *big, FXIcon *mini, void *ptr)

Static Protected Member Functions

static FXint compareSection (const FXchar *p, const FXchar *q, FXint s)
static FXint compareSectionCase (const FXchar *p, const FXchar *q, FXint s)

Protected Attributes

FXHeaderheader
FXIconItemList items
FXint nrows
FXint ncols
FXint anchor
FXint current
FXint extent
FXint viewable
FXFontfont
FXIconListSortFunc sortfunc
FXColor textColor
FXColor selbackColor
FXColor seltextColor
FXint itemSpace
FXint itemWidth
FXint itemHeight
FXint anchorx
FXint anchory
FXint currentx
FXint currenty
FXint grabx
FXint graby
FXString lookup
FXString help
FXbool state

Detailed Description

A Icon List Widget displays a list of items, each with a text and optional icon.

Icon List can display its items in essentially three different ways; in big-icon mode, the bigger of the two icons is used for each item, and the text is placed underneath the icon. In mini- icon mode, the icons are listed in rows and columns, with the smaller icon preceding the text. Finally, in detail mode the icons are listed in a single column, and all fields of the text are shown under a header control with one button for each subfield. When an item's selected state changes, the icon list sends a SEL_SELECTED or SEL_DESELECTED message. A change of the current item is signified by the SEL_CHANGED message. The icon list sends SEL_COMMAND messages when the user clicks on an item, and SEL_CLICKED, SEL_DOUBLECLICKED, and SEL_TRIPLECLICKED when the user clicks once, twice, or thrice, respectively. When items are inserted or removed, the icon list sends messages of the type SEL_INSERTED or SEL_DELETED. In each of these cases, the index to the item, if any, is passed in the 3rd argument of the message. The text in each item is a string separated by tabs for each column; in mini- or big-icon mode, only the text before the first tab is shown. In detail-mode, the text before the first tab is shown in the first column, the text between the first and second tab is shown in the second column, and so on.


Member Function Documentation

FXint FX::FXIconList::findItem ( const FXString text,
FXint  start = -1,
FXuint  flags = SEARCH_FORWARD|SEARCH_WRAP 
) const

Search items by name, beginning from item start.

If the start item is -1 the search will start at the first item in the list. Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control the search direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP to control whether the search wraps at the start or end of the list. The option SEARCH_IGNORECASE causes a case-insensitive match. Finally, passing SEARCH_PREFIX causes searching for a prefix of the item name. Return -1 if no matching item is found.

FXint FX::FXIconList::findItemByData ( const void *  ptr,
FXint  start = -1,
FXuint  flags = SEARCH_FORWARD|SEARCH_WRAP 
) const

Search items by associated user data, beginning from item start.

If the start item is -1 the search will start at the first item in the list. Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control the search direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP to control whether the search wraps at the start or end of the list.


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

Copyright © 1997-2011 Jeroen van der Zijp