OpendTect  7.0
Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
uiComboBox Class Reference

Combo box. More...

Inheritance diagram for uiComboBox:
[legend]

Public Member Functions

 uiComboBox (uiParent *, const BufferStringSet &, const char *nm)
 
 uiComboBox (uiParent *, const char **, const char *nm)
 
 uiComboBox (uiParent *, const char *nm)
 
 uiComboBox (uiParent *, const EnumDef &, const char *nm)
 
 uiComboBox (uiParent *, const uiString *, const char *nm)
 
 uiComboBox (uiParent *, const uiStringSet &, const char *nm)
 
virtual ~uiComboBox ()
 
void addItem (const char *s)
 
void addItem (const uiString &) override
 
void addItem (const uiString &, int id)
 
void addItems (const BufferStringSet &)
 
void addItems (const uiStringSet &)
 
void addSeparator ()
 
int currentItem () const
 
int currentItemID () const
 
int getItemID (int index) const
 
int getItemIndex (int id) const
 
void getItems (BufferStringSet &) const
 
void getItems (uiStringSet &) const
 
void getItemSize (int, int &h, int &w) const
 
bool handleLongTabletPress () override
 
int indexOf (const char *) const
 
void insertItem (const char *str, int index=-1, int id=-1)
 
void insertItem (const uiPixmap &, const uiString &, int index=-1, int id=-1)
 
void insertItem (const uiPixmap &pm, const char *str, int index=-1, int id=-1)
 
void insertItem (const uiString &, int index=-1, int id=-1)
 
bool isEditable () const
 
bool isEmpty () const override
 
bool isPresent (const char *) const
 
bool isReadOnly () const override
 
uiString itemText (int) const
 
void notifyHandler (bool selectionchanged)
 
void popupVirtualKeyboard (int globalx=-1, int globaly=-1)
 
void setColorIcon (int index, const OD::Color &)
 
void setCurrentItem (const char *)
 First match. More...
 
void setCurrentItem (const StringView &fs)
 
void setCurrentItem (int)
 
void setEditable (bool yn)
 
void setEmpty () override
 
void setIcon (int index, const char *icon_identifier)
 
void setItemID (int index, int id)
 
void setItemText (int, const uiString &)
 
void setPixmap (int index, const uiPixmap &)
 
void setReadOnly (bool yn=true) override
 
void setText (const char *) override
 
void setToolTip (const uiString &tt) override
 
void setValidator (const BufferString &regex)
 
int size () const
 
const char * text () const override
 
const char * textOfItem (int) const
 
bool update_ (const DataInpSpec &spec) override
 
- Public Member Functions inherited from uiObject
 ~uiObject ()
 
uiSize actualSize (bool include_border=true) const
 
void attach (constraintType, int margin=-1)
 attaches object to another In case the stretched... options are used, margin=-1 (default) stretches the object not to cross the border. margin=-2 stretches the object to fill the parent's border. This looks nice with separators. More...
 
void attach (constraintType, uiObject *, int margin=-1, bool reciprocal=true)
 
void attach (constraintType, uiParent *, int margin=-1, bool reciprocal=true)
 
virtual OD::Color backgroundColor () const
 
virtual const ObjectSet< uiBaseObject > * childList () const
 
void close ()
 
void deepRedraw ()
 
void disabFocus ()
 
void display (bool yn, bool shrink=false, bool maximized=false)
 
const uiFontfont () const
 
QWidget * getWidget () override
 
bool hasFocus () const
 
virtual int height () const
 Actual size in pixels. More...
 
bool isCursorInside () const
 
bool isDisplayed () const
 
bool isSensitive () const
 
uiMainWinmainwin ()
 
uiParentparent ()
 
const uiParentparent () const
 
int prefHNrPics () const
 
int prefVNrPics () const
 
QWidget * qwidget ()
 
const QWidget * qwidget () const
 
void reDraw (bool deep)
 
void reParent (uiParent *)
 
OD::Color roBackgroundColor () const
 
bool sensitive () const
 
virtual void setBackgroundColor (const OD::Color &)
 
virtual void setBackgroundPixmap (const uiPixmap &)
 
void setCaption (const uiString &)
 
virtual void setCursor (const MouseCursor &)
 
void setFocus ()
 
void setFont (const uiFont &)
 
void setHSzPol (SzPolicy)
 
void setMaximumHeight (int)
 
void setMaximumHeightInChar (int)
 
void setMaximumWidth (int)
 
void setMaximumWidthInChar (int)
 
void setMinimumHeight (int)
 
void setMinimumHeightInChar (int)
 
void setMinimumWidth (int)
 
void setMinimumWidthInChar (int)
 
virtual void setName (const char *) override
 
virtual void setPrefHeight (int)
 
void setPrefHeightInChar (float)
 
void setPrefHeightInChar (int)
 
virtual void setPrefWidth (int)
 
void setPrefWidthInChar (float)
 
void setPrefWidthInChar (int)
 
void setSensitive (bool yn=true)
 
void setStretch (int hor, int ver)
 Sets stretch factors for object If stretch factor is > 1, then object will already grow at pop-up. More...
 
virtual void setStyleSheet (const char *)
 
virtual void setTextColor (const OD::Color &)
 
void setToolTip (const uiString &)
 
void setVSzPol (SzPolicy)
 
void shallowRedraw ()
 
int stretch (bool hor) const
 
SzPolicy szPol (bool hor=true) const
 
const uiStringtoolTip () const
 
void translateText () override
 
bool visible () const
 
virtual int width () const
 Actual size in pixels. More...
 
- Public Member Functions inherited from uiBaseObject
 uiBaseObject (const char *nm, uiBody *=0)
 
virtual ~uiBaseObject ()
 
int beginCmdRecEvent (const BufferString &msg)
 
int beginCmdRecEvent (const char *msg=0)
 
int beginCmdRecEvent (od_uint64 id, const char *msg=0)
 
uiBodybody ()
 
const uiBodybody () const
 
void clear ()
 
void endCmdRecEvent (int refnr, const char *msg=0)
 
void endCmdRecEvent (od_uint64 id, int refnr, const char *msg=0)
 
void finalise ()
 
bool finalised () const
 
void finalize ()
 
bool finalized () const
 
const QWidget * getWidget () const
 
virtual Notifier< uiBaseObject > & postFinalise ()
 
virtual Notifier< uiBaseObject > & postFinalize ()
 
virtual Notifier< uiBaseObject > & preFinalise ()
 
virtual Notifier< uiBaseObject > & preFinalize ()
 
- Public Member Functions inherited from NamedCallBacker
 NamedCallBacker (const char *nm=0)
 
 NamedCallBacker (const NamedCallBacker &)
 
virtual Notifier< NamedCallBacker > & objectToBeDeleted () const
 
bool operator== (const NamedCallBacker &oth) const
 
bool operator== (const NamedObject &oth) const
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (const NotifierAccess &, const CallBack &, bool onlyifnew=false) const
 
bool attachCB (const NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) const
 
void detachAllNotifiers () const
 Call from the destructor of your inherited object. More...
 
void detachCB (const NotifierAccess &, const CallBack &) const
 
void detachCB (const NotifierAccess *notif, const CallBack &cb) const
 
virtual bool isCapsule () const
 
bool isNotifierAttached (const NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 
void stopReceivingNotifications () const
 
virtual CallBackertrueCaller ()
 
- Public Member Functions inherited from NamedObject
 NamedObject (const char *nm=nullptr)
 
 NamedObject (const NamedObject &oth)
 
virtual ~NamedObject ()
 
virtual BufferString getName () const
 
bool getNameFromPar (const IOPar &)
 
const name_typename () const override
 
NamedObjectoperator= (const NamedObject &)
 
bool operator== (const NamedObject &oth) const
 
- Public Member Functions inherited from ObjectWithName
virtual ~ObjectWithName ()
 
bool hasName (const char *nm) const
 
bool hasName (const name_type &nm) const
 
void putNameInPar (IOPar &) const
 
- Public Member Functions inherited from UserInputObjImpl< int >
bool getBoolValue () const override
 
double getDValue () const override
 
float getFValue () const override
 
od_int64 getInt64Value () const override
 
int getIntValue () const override
 
void setEmpty () override
 
void setText (const char *s) override
 
void setValue (bool b) override
 
void setValue (const char *s) override
 
void setValue (double d) override
 
void setValue (float f) override
 
void setValue (int i) override
 
void setValue (od_int64 i) override
 
const char * text () const override
 
- Public Member Functions inherited from UserInputObj
 UserInputObj ()
 
virtual ~UserInputObj ()
 
double getdValue () const
 
float getfValue () const
 
bool notifyUpdateRequested (const CallBack &cb)
 
bool notifyValueChanged (const CallBack &cb)
 value change complete cq. commited More...
 
bool notifyValueChanging (const CallBack &cb)
 intermediate value available More...
 
bool update (const DataInpSpec &s)
 return false if not updated for whatever reason. More...
 

Public Attributes

Notifier< uiComboBoxeditTextChanged
 
Notifier< uiComboBoxselectionChanged
 
- Public Attributes inherited from uiObject
Notifier< uiObjectclosed
 Triggered when object closes. More...
 
CNotifier< uiObject, uiRect & > setGeometry
 triggered when getting a new geometry A reference to the new geometry is passed which can be manipulated, before the geometry is actually set to the QWidget. More...
 

Protected Member Functions

int getvalue_ () const override
 
bool notifyUpdateRequested_ (const CallBack &) override
 
bool notifyValueChanged_ (const CallBack &cb) override
 return false if not available More...
 
bool notifyValueChanging_ (const CallBack &) override
 return false if not available More...
 
void setvalue_ (int i) override
 
void translateText () override
 
- Protected Member Functions inherited from uiObject
 uiObject (uiParent *, const char *nm)
 
 uiObject (uiParent *, const char *nm, uiObjectBody &)
 
virtual bool closeOK ()
 hook. Accepts/denies closing of window. More...
 
uiObjectBodyobjBody ()
 
const uiObjectBodyobjBody () const
 
void triggerSetGeometry (const i_LayoutItem *, uiRect &)
 setGeometry should be triggered by this's layoutItem More...
 
void updateToolTip (CallBacker *=nullptr)
 
- Protected Member Functions inherited from uiBaseObject
void setBody (uiBody *b)
 
- Protected Member Functions inherited from NamedCallBacker
void sendDelNotif () const
 
- Protected Member Functions inherited from UserInputObjImpl< int >
virtual bool setEmpty_ ()
 

Private Member Functions

void adjustWidth (const uiString &)
 
uiComboBoxBody & mkbody (uiParent *, const char *)
 

Private Attributes

uiComboBoxBody * body_
 
int curwidth_
 
const EnumDefenumdef_
 
TypeSet< int > itemids_
 
uiStringSet itemstrings_
 
int oldcuritem_
 
int oldnritems_
 
BufferString rettxt_
 

Additional Inherited Members

- Public Types inherited from uiObject
enum  SzPolicy {
  Undef , Small , Medium , Wide ,
  SmallVar , MedVar , WideVar , SmallMax ,
  MedMax , WideMax
}
 How should the object's size behave? Undef : use default. Small : 1 base sz. Medium : 2* base sz + 1. Wide : 4* base sz + 3. The xxVar options specify that the element may have a bigger internal preferred size. In that case, the maximum is taken. The xxMax options specify that the element should take all available space ( stretch = 2 ) More...
 
- Public Types inherited from ObjectWithName
typedef OD::String name_type
 
- Static Public Member Functions inherited from uiObject
static int baseFldSize ()
 
static int iconSize ()
 
static void setTabOrder (uiObject *first, uiObject *second)
 
static void updateToolTips ()
 
- Static Public Member Functions inherited from uiBaseObject
static void addCmdRecorder (const CallBack &)
 
static void removeCmdRecorder (const CallBack &)
 
- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 
- Protected Attributes inherited from uiObject
uiString tooltip_
 
uiObjEventFilter * uiobjeventfilter_
 
- Protected Attributes inherited from NamedCallBacker
Threads::Atomic< bool > delalreadytriggered_
 
Notifier< NamedCallBackerdelnotif_
 
- Protected Attributes inherited from NamedObject
BufferString name_
 

Detailed Description

Combo box.

The user can select an item from a drop-down list. Sometimes, you can allow the user entering a new string there, use setReadOnly(false). In that case the result of text() can be different from textOfItem(currentItem()). Also, setText will do something is if the given string is not in the list.

<>

Constructor & Destructor Documentation

◆ uiComboBox() [1/6]

uiComboBox::uiComboBox ( uiParent ,
const char *  nm 
)

◆ uiComboBox() [2/6]

uiComboBox::uiComboBox ( uiParent ,
const BufferStringSet ,
const char *  nm 
)

◆ uiComboBox() [3/6]

uiComboBox::uiComboBox ( uiParent ,
const uiStringSet ,
const char *  nm 
)

◆ uiComboBox() [4/6]

uiComboBox::uiComboBox ( uiParent ,
const char **  ,
const char *  nm 
)

◆ uiComboBox() [5/6]

uiComboBox::uiComboBox ( uiParent ,
const uiString ,
const char *  nm 
)

Similar to const char** Adds strings until an empty string is found.

◆ uiComboBox() [6/6]

uiComboBox::uiComboBox ( uiParent ,
const EnumDef ,
const char *  nm 
)

EnumDef is assumed to remain in mem

◆ ~uiComboBox()

virtual uiComboBox::~uiComboBox ( )
virtual

Member Function Documentation

◆ addItem() [1/3]

void uiComboBox::addItem ( const char *  s)
inline

◆ addItem() [2/3]

void uiComboBox::addItem ( const uiString )
overridevirtual

Reimplemented from UserInputObj.

◆ addItem() [3/3]

void uiComboBox::addItem ( const uiString ,
int  id 
)

◆ addItems() [1/2]

void uiComboBox::addItems ( const BufferStringSet )

◆ addItems() [2/2]

void uiComboBox::addItems ( const uiStringSet )

◆ addSeparator()

void uiComboBox::addSeparator ( )

◆ adjustWidth()

void uiComboBox::adjustWidth ( const uiString )
private

◆ currentItem()

int uiComboBox::currentItem ( ) const

◆ currentItemID()

int uiComboBox::currentItemID ( ) const

◆ getItemID()

int uiComboBox::getItemID ( int  index) const

◆ getItemIndex()

int uiComboBox::getItemIndex ( int  id) const

◆ getItems() [1/2]

void uiComboBox::getItems ( BufferStringSet ) const

◆ getItems() [2/2]

void uiComboBox::getItems ( uiStringSet ) const

◆ getItemSize()

void uiComboBox::getItemSize ( int  ,
int &  h,
int &  w 
) const

◆ getvalue_()

int uiComboBox::getvalue_ ( ) const
inlineoverrideprotectedvirtual

◆ handleLongTabletPress()

bool uiComboBox::handleLongTabletPress ( )
overridevirtual

Reimplemented from uiObject.

◆ indexOf()

int uiComboBox::indexOf ( const char *  ) const

◆ insertItem() [1/4]

void uiComboBox::insertItem ( const char *  str,
int  index = -1,
int  id = -1 
)
inline

◆ insertItem() [2/4]

void uiComboBox::insertItem ( const uiPixmap ,
const uiString ,
int  index = -1,
int  id = -1 
)

◆ insertItem() [3/4]

void uiComboBox::insertItem ( const uiPixmap pm,
const char *  str,
int  index = -1,
int  id = -1 
)
inline

◆ insertItem() [4/4]

void uiComboBox::insertItem ( const uiString ,
int  index = -1,
int  id = -1 
)

◆ isEditable()

bool uiComboBox::isEditable ( ) const

◆ isEmpty()

bool uiComboBox::isEmpty ( ) const
inlineoverridevirtual

Reimplemented from uiObject.

◆ isPresent()

bool uiComboBox::isPresent ( const char *  ) const

◆ isReadOnly()

bool uiComboBox::isReadOnly ( ) const
overridevirtual

Implements UserInputObj.

◆ itemText()

uiString uiComboBox::itemText ( int  ) const

◆ mkbody()

uiComboBoxBody& uiComboBox::mkbody ( uiParent ,
const char *   
)
private

◆ notifyHandler()

void uiComboBox::notifyHandler ( bool  selectionchanged)

◆ notifyUpdateRequested_()

bool uiComboBox::notifyUpdateRequested_ ( const CallBack )
inlineoverrideprotectedvirtual

Implements UserInputObj.

◆ notifyValueChanged_()

bool uiComboBox::notifyValueChanged_ ( const CallBack )
inlineoverrideprotectedvirtual

return false if not available

Implements UserInputObj.

◆ notifyValueChanging_()

bool uiComboBox::notifyValueChanging_ ( const CallBack )
inlineoverrideprotectedvirtual

return false if not available

Implements UserInputObj.

◆ popupVirtualKeyboard()

void uiComboBox::popupVirtualKeyboard ( int  globalx = -1,
int  globaly = -1 
)

◆ setColorIcon()

void uiComboBox::setColorIcon ( int  index,
const OD::Color  
)

◆ setCurrentItem() [1/3]

void uiComboBox::setCurrentItem ( const char *  )

First match.

◆ setCurrentItem() [2/3]

void uiComboBox::setCurrentItem ( const StringView fs)
inline

◆ setCurrentItem() [3/3]

void uiComboBox::setCurrentItem ( int  )

◆ setEditable()

void uiComboBox::setEditable ( bool  yn)

◆ setEmpty()

void uiComboBox::setEmpty ( )
overridevirtual

Implements UserInputObj.

◆ setIcon()

void uiComboBox::setIcon ( int  index,
const char *  icon_identifier 
)

◆ setItemID()

void uiComboBox::setItemID ( int  index,
int  id 
)

◆ setItemText()

void uiComboBox::setItemText ( int  ,
const uiString  
)

◆ setPixmap()

void uiComboBox::setPixmap ( int  index,
const uiPixmap  
)

◆ setReadOnly()

void uiComboBox::setReadOnly ( bool  yn = true)
overridevirtual

Implements UserInputObj.

◆ setText()

void uiComboBox::setText ( const char *  )
overridevirtual

Implements UserInputObj.

◆ setToolTip()

void uiComboBox::setToolTip ( const uiString tt)
inlineoverridevirtual

Implements UserInputObj.

◆ setValidator()

void uiComboBox::setValidator ( const BufferString regex)

◆ setvalue_()

void uiComboBox::setvalue_ ( int  i)
inlineoverrideprotectedvirtual

◆ size()

int uiComboBox::size ( ) const

◆ text()

const char* uiComboBox::text ( ) const
overridevirtual

Implements UserInputObj.

◆ textOfItem()

const char* uiComboBox::textOfItem ( int  ) const

◆ translateText()

void uiComboBox::translateText ( )
overrideprotectedvirtual

Triggers translation of object and all members to current language.

Reimplemented from uiBaseObject.

◆ update_()

bool uiComboBox::update_ ( const DataInpSpec spec)
overridevirtual

Implements UserInputObj.

Member Data Documentation

◆ body_

uiComboBoxBody* uiComboBox::body_
private

◆ curwidth_

int uiComboBox::curwidth_
private

◆ editTextChanged

Notifier<uiComboBox> uiComboBox::editTextChanged

◆ enumdef_

const EnumDef* uiComboBox::enumdef_
private

◆ itemids_

TypeSet<int> uiComboBox::itemids_
private

◆ itemstrings_

uiStringSet uiComboBox::itemstrings_
private

◆ oldcuritem_

int uiComboBox::oldcuritem_
private

◆ oldnritems_

int uiComboBox::oldnritems_
private

◆ rettxt_

BufferString uiComboBox::rettxt_
mutableprivate

◆ selectionChanged

Notifier<uiComboBox> uiComboBox::selectionChanged

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2024