Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends

uiListBox Class Reference

Inheritance diagram for uiListBox:
uiObject uiBaseObject NamedObject CallBacker

List of all members.

Public Member Functions

 uiListBox (uiParent *parnt=0, const char *nm="uiListBox", bool isMultiSelect=false, int preferredNrLines=0, int preferredFieldWidth=0)
 uiListBox (uiParent *, const BufferStringSet &, const char *txt="uiListBox", bool isMultiSelect=false, int preferredNrLines=0, int preferredFieldWidth=0)
virtual ~uiListBox ()
void setLines (int, bool adaptvstretch)
 set preferred number of lines. If set to 0, then it is determined by the number of items in list. If set to 1, then the list has a fixed height of 1 textline and therefore should not be able to grow/shrink vertically.
void setNotSelectable ()
void setMultiSelect (bool yn=true)
int maxSelectable () const
int size () const
bool isEmpty () const
int nextSelected (int prev=-1) const
bool isPresent (const char *) const
bool isSelected (int) const
int nrSelected () const
void setSelected (int, bool yn=true)
void selectAll (bool yn=true)
void clearSelection ()
void sort (bool asc=true)
void setEmpty ()
void removeItem (int)
void addItem (const char *, bool embedded=false)
 embedded = put [...] around text
void addItem (const char *, const ioPixmap &)
void addItem (const char *, const Color &)
void addItems (const char **)
void addItems (const BufferStringSet &)
void insertItem (const char *, int idx=-1, bool embedded=false)
void insertItem (const char *, const ioPixmap &, int idx=-1)
void insertItem (const char *, const Color &, int)
void setPixmap (int, const Color &)
void setPixmap (int, const ioPixmap &)
ioPixmap pixmap (int) const
void setColor (int, const Color &)
Color getColor (int) const
void setItemText (int, const char *)
int currentItem () const
const char * getText () const
const char * textOfItem (int, bool disembed=false) const
 disembed = remove [...] from text
bool isEmbedded (int) const
 check for [...] around text
void setCurrentItem (int)
void setCurrentItem (const char *)
 First match.
int indexOf (const char *) const
 First match.
void setItemsCheckable (bool)
 Sets all items.
void setItemCheckable (int, bool)
void setItemsChecked (bool)
 Sets all items.
void setItemChecked (int, bool)
bool isItemCheckable (int) const
bool isItemChecked (int) const
int nrChecked () const
void setSelectedItems (const BufferStringSet &)
void setSelectedItems (const TypeSet< int > &)
void setCheckedItems (const BufferStringSet &)
void setCheckedItems (const TypeSet< int > &)
void getSelectedItems (BufferStringSet &) const
void getSelectedItems (TypeSet< int > &) const
void getCheckedItems (BufferStringSet &) const
void getCheckedItems (TypeSet< int > &) const
void setFieldWidth (int)
int optimumFieldWidth (int minwdth=20, int maxwdth=40) const
Alignment::HPos alignment () const
void setAlignment (Alignment::HPos)
bool handleLongTabletPress ()

Public Attributes

Notifier< uiListBoxselectionChanged
Notifier< uiListBoxdoubleClicked
Notifier< uiListBoxrightButtonClicked
Notifier< uiListBoxleftButtonClicked
Notifier< uiListBoxdeleteButtonPressed
Notifier< uiListBoxitemChecked
 or un-checked

Protected Member Functions

void menuCB (CallBacker *)
void handleCheckChange (QListWidgetItem *)

Protected Attributes

BufferString rettxt
OD::ButtonState buttonstate_
Alignment::HPos alignment_
bool itemscheckable_
uiPopupMenurightclickmnu_

Private Member Functions

uiListBoxBody & mkbody (uiParent *, const char *, bool, int, int)
bool validIndex (int) const

Private Attributes

uiListBoxBody * body_

Friends

class i_listMessenger
class uiListBoxBody

Constructor & Destructor Documentation

uiListBox::uiListBox ( uiParent parnt = 0,
const char *  nm = "uiListBox",
bool  isMultiSelect = false,
int  preferredNrLines = 0,
int  preferredFieldWidth = 0 
)
uiListBox::uiListBox ( uiParent ,
const BufferStringSet ,
const char *  txt = "uiListBox",
bool  isMultiSelect = false,
int  preferredNrLines = 0,
int  preferredFieldWidth = 0 
)
virtual uiListBox::~uiListBox (  )  [virtual]

Member Function Documentation

void uiListBox::addItem ( const char *  ,
bool  embedded = false 
)

embedded = put [...] around text

void uiListBox::addItem ( const char *  ,
const ioPixmap  
)
void uiListBox::addItem ( const char *  ,
const Color  
)
void uiListBox::addItems ( const char **   ) 
void uiListBox::addItems ( const BufferStringSet  ) 
Alignment::HPos uiListBox::alignment (  )  const [inline]
void uiListBox::clearSelection (  ) 
int uiListBox::currentItem (  )  const
void uiListBox::getCheckedItems ( BufferStringSet  )  const
void uiListBox::getCheckedItems ( TypeSet< int > &   )  const
Color uiListBox::getColor ( int   )  const
void uiListBox::getSelectedItems ( BufferStringSet  )  const
void uiListBox::getSelectedItems ( TypeSet< int > &   )  const
const char* uiListBox::getText (  )  const [inline]
void uiListBox::handleCheckChange ( QListWidgetItem *   )  [protected]
bool uiListBox::handleLongTabletPress (  )  [virtual]

Reimplemented from uiObject.

int uiListBox::indexOf ( const char *   )  const

First match.

void uiListBox::insertItem ( const char *  ,
int  idx = -1,
bool  embedded = false 
)
void uiListBox::insertItem ( const char *  ,
const ioPixmap ,
int  idx = -1 
)
void uiListBox::insertItem ( const char *  ,
const Color ,
int   
)
bool uiListBox::isEmbedded ( int   )  const

check for [...] around text

bool uiListBox::isEmpty (  )  const [inline]
bool uiListBox::isItemCheckable ( int   )  const
bool uiListBox::isItemChecked ( int   )  const
bool uiListBox::isPresent ( const char *   )  const
bool uiListBox::isSelected ( int   )  const
int uiListBox::maxSelectable (  )  const
void uiListBox::menuCB ( CallBacker  )  [protected]
uiListBoxBody& uiListBox::mkbody ( uiParent ,
const char *  ,
bool  ,
int  ,
int   
) [private]
int uiListBox::nextSelected ( int  prev = -1  )  const
int uiListBox::nrChecked (  )  const
int uiListBox::nrSelected (  )  const
int uiListBox::optimumFieldWidth ( int  minwdth = 20,
int  maxwdth = 40 
) const
ioPixmap uiListBox::pixmap ( int   )  const
void uiListBox::removeItem ( int   ) 
void uiListBox::selectAll ( bool  yn = true  ) 
void uiListBox::setAlignment ( Alignment::HPos   ) 
void uiListBox::setCheckedItems ( const TypeSet< int > &   ) 
void uiListBox::setCheckedItems ( const BufferStringSet  ) 
void uiListBox::setColor ( int  ,
const Color  
)
void uiListBox::setCurrentItem ( int   ) 
void uiListBox::setCurrentItem ( const char *   ) 

First match.

void uiListBox::setEmpty (  ) 
void uiListBox::setFieldWidth ( int   ) 
void uiListBox::setItemCheckable ( int  ,
bool   
)
void uiListBox::setItemChecked ( int  ,
bool   
)
void uiListBox::setItemsCheckable ( bool   ) 

Sets all items.

void uiListBox::setItemsChecked ( bool   ) 

Sets all items.

void uiListBox::setItemText ( int  ,
const char *   
)
void uiListBox::setLines ( int  ,
bool  adaptvstretch 
)

set preferred number of lines. If set to 0, then it is determined by the number of items in list. If set to 1, then the list has a fixed height of 1 textline and therefore should not be able to grow/shrink vertically.

adaptVStretch specifies wether or not the vertical stretch should be set to 0 if nrlines == 1 or 2 otherwise.

void uiListBox::setMultiSelect ( bool  yn = true  ) 
void uiListBox::setNotSelectable (  ) 
void uiListBox::setPixmap ( int  ,
const Color  
)
void uiListBox::setPixmap ( int  ,
const ioPixmap  
)
void uiListBox::setSelected ( int  ,
bool  yn = true 
)
void uiListBox::setSelectedItems ( const BufferStringSet  ) 
void uiListBox::setSelectedItems ( const TypeSet< int > &   ) 
int uiListBox::size (  )  const
void uiListBox::sort ( bool  asc = true  ) 
const char* uiListBox::textOfItem ( int  ,
bool  disembed = false 
) const

disembed = remove [...] from text

bool uiListBox::validIndex ( int   )  const [private]

Friends And Related Function Documentation

friend class i_listMessenger [friend]
friend class uiListBoxBody [friend]

Member Data Documentation

uiListBoxBody* uiListBox::body_ [private]

Reimplemented from uiBaseObject.

OD::ButtonState uiListBox::buttonstate_ [protected]
bool uiListBox::itemscheckable_ [protected]
BufferString uiListBox::rettxt [mutable, protected]