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

FXListBox Class Reference

List Box.

#include <FXListBox.h>

Inheritance diagram for FXListBox:

FXPacker FXComposite FXWindow FXDrawable FXId FXObject FXDriveBox List of all members.

Public Types

enum  {
  ID_LIST = FXPacker::ID_LAST,
  ID_FIELD,
  ID_LAST
}

Public Methods

 FXListBox (FXComposite *p, FXint nvis, FXObject *tgt=NULL, FXSelector sel=0, FXuint opts=FRAME_SUNKEN|FRAME_THICK|LISTBOX_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)
 Constructor.

virtual void create ()
 Create server-side resources.

virtual void detach ()
 Detach server-side resources.

virtual void destroy ()
 Destroy server-side resources.

virtual void enable ()
 Enable drive box.

virtual void disable ()
 Disable drive box.

virtual FXint getDefaultWidth ()
 Return default width.

virtual FXint getDefaultHeight ()
 Return default height.

FXint getNumItems () const
 Return the number of items in the list.

FXint getNumVisible () const
 Return the number of visible items.

void setNumVisible (FXint nvis)
 Set the number of visible items.

FXbool isItemCurrent (FXint index) const
 Return true if current item.

void setCurrentItem (FXint index)
 Set the current item (index is zero-based).

FXint getCurrentItem () const
 Get the current item's index.

FXString retrieveItem (FXint index) const
 Return the item at the given index.

void replaceItem (FXint index, const FXString &text, FXIcon *icon=NULL, void *ptr=NULL)
 Replace the item at index.

void insertItem (FXint index, const FXString &text, FXIcon *icon=NULL, void *ptr=NULL)
 Insert a new item at index.

void appendItem (const FXString &text, FXIcon *icon=NULL, void *ptr=NULL)
 Add an item to the end of the list.

void prependItem (const FXString &text, FXIcon *icon=NULL, void *ptr=NULL)
 Prepend an item to the list.

void removeItem (FXint index)
 Remove this item from the list.

void clearItems ()
 Remove all items from the list.

FXint findItem (const FXString &text, FXint start=-1, FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const
void setItemText (FXint index, const FXString &text)
 Set text for specified item.

FXString getItemText (FXint index) const
 Get text for specified item.

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

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

void setItemData (FXint index, void *ptr) const
 Set data pointer for specified item.

void * getItemData (FXint index) const
 Get data pointer for specified item.

FXbool isPaneShown () const
 Is the pane shown.

void sortItems ()
 Sort items using current sort function.

void setFont (FXFont *fnt)
 Set text font.

FXFontgetFont () const
 Get text font.

virtual void setBackColor (FXColor clr)
 Set window background color.

FXColor getBackColor () const
 Get background color.

void setTextColor (FXColor clr)
 Change text color.

FXColor getTextColor () const
 Return text color.

void setSelBackColor (FXColor clr)
 Change selected background color.

FXColor getSelBackColor () const
 Return selected background color.

void setSelTextColor (FXColor clr)
 Change selected text color.

FXColor getSelTextColor () const
 Return selected text color.

FXListSortFunc getSortFunc () const
 Return sort function.

void setSortFunc (FXListSortFunc func)
 Change sort function.

void setHelpText (const FXString &txt)
 Set the combobox help text.

void setTipText (const FXString &txt)
 Set the tool tip message for this combobox.

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

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

virtual ~FXListBox ()
 Destructor.


Public Attributes

FXString getHelpText () const
 Get the combobox help text.

FXString getTipText () const
 Get the tool tip message for this combobox.


Member Function Documentation

FXint FXListBox::findItem const FXString   text,
FXint    start = -1,
FXuint    flags = SEARCH_FORWARD|SEARCH_WRAP
const
 

Search items for item by name, starting from start item; the flags argument controls the search direction, and case sensitivity.