| OpendTect 8.0

Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
uiUnitSel Class Reference
uiTools

Selector for UnitOfMeasure's. More...

`#include <uiunitsel.h>`

Inheritance diagram for uiUnitSel:
[legend]

## Classes
class | Setup

## Public Member Functions
| uiUnitSel (uiParent *, const Mnemonic *mn=nullptr)
| uiUnitSel (uiParent *, const Setup &)
| uiUnitSel (uiParent *, Mnemonic::StdType)
mDeprecatedDef | uiUnitSel (uiParent *p, const char *lbltxt=nullptr)
| ~uiUnitSel ()
void | fillPar (IOPar &, const char *altkey=nullptr) const
mDeprecatedDef double | getInternalValue (double uservalue) const
mDeprecatedDef float | getInternalValue (float uservalue) const
const UnitOfMeasure * | getUnit () const
const char * | getUnitName () const
mDeprecatedDef double | getUserValue (double internalval) const
mDeprecatedDef float | getUserValue (float internalval) const
bool | hasMnemonicSelection () const
const Mnemonic * | mnemonic () const
Mnemonic::StdType | propType () const
void | setFallbackKey (const char *)
void | setMnemonic (const Mnemonic &)
void | setPropType (Mnemonic::StdType)
mDeprecatedDef void | setUnit (const char *)
void | setUnit (const UnitOfMeasure *uom=nullptr)
const char * | tblKey () const
bool | usePar (const IOPar &, const char *altkey=nullptr)
Public Member Functions inherited from uiGroup
| uiGroup (uiParent *, const char *nm="uiGroup", bool manage=true)
virtual | ~uiGroup ()
void | adjustSize ()
uiObject * | attachObj ()
const uiObject * | attachObj () const
uiObject * | hAlignObj ()
uiObject * | hCenterObj ()
uiMainWin * | mainwin () override
| mOD_DisableCopy (uiGroup) inline operator const uiGroupObj *() const
| operator const uiObject & () const
| operator uiGroupObj * ()
| operator uiObject & ()
uiParent * | parent ()
const uiParent * | parent () const
Notifier< uiBaseObject > & | postFinalise () override
Notifier< uiBaseObject > & | postFinalize () override
Notifier< uiBaseObject > & | preFinalise () override
Notifier< uiBaseObject > & | preFinalize () override
void | setBorder (int l, int t, int r, int b)
void | setBorder (int)
void | setChildrenSensitive (bool)
void | setFrame (bool yn=true)
void | setHAlignObj (uiGroup *o)
void | setHAlignObj (uiObject *)
void | setHCenterObj (uiGroup *o)
void | setHCenterObj (uiObject *)
void | setHSpacing (int)
void | setIsMain (bool)
| internal use only. Tells the layout manager it's a toplevel mngr.
void | setNoBackGround ()
virtual void | setSize (const uiSize &)
void | setSpacing (int s=0)
void | setVSpacing (int)
Public Member Functions inherited from uiParent
uiSize | actualsize (bool inclborder=true) const
uiSize | actualSize (bool include_border) const
void | addChild (uiBaseObject &)
void | attach (ConstraintType, int margin=-1)
void | attach (ConstraintType, uiObject *oth, int margin=-1, bool reciprocal=true)
void | attach (ConstraintType, uiParent *oth, int margin=-1, bool reciprocal=true)
void | attachChild (ConstraintType tp, uiObject *child, uiObject *other, int margin, bool reciprocal)
OD::Color | backgroundColor () const
const ObjectSet< uiBaseObject > * | childList () const
void | deepRedraw (CallBacker *)
virtual void | display (bool yn, bool shrk=false, bool maximize=false)
const uiFont * | font () const
bool | hasFocus () const
bool | isDisplayed () const
uiObject * | mainObject ()
const uiObject * | mainObject () const
void | manageChild (uiBaseObject &, uiObjectBody &)
uiParentBody * | pbody ()
const uiParentBody * | pbody () const
int | prefHNrPics () const
int | prefVNrPics () const
virtual void | reDraw (bool deep)
OD::Color | roBackgroundColor () const
bool | sensitive () const
void | setBackgroundColor (const OD::Color &)
void | setCaption (const uiString &)
void | setCursor (const MouseCursor &)
void | setFocus ()
void | setFont (const uiFont &)
void | setPrefHeight (int h)
void | setPrefHeightInChar (float h)
void | setPrefHeightInChar (int h)
void | setPrefWidth (int w)
void | setPrefWidthInChar (float w)
void | setPrefWidthInChar (int w)
void | setSensitive (bool yn=true)
void | setStretch (int h, int v)
void | shallowRedraw (CallBacker *)
int | stretch (bool h) const
void | translateText () override
Public Member Functions inherited from uiBaseObject
virtual | ~uiBaseObject ()
int | beginCmdRecEvent (const BufferString &msg)
int | beginCmdRecEvent (const char *msg=0)
int | beginCmdRecEvent (od_uint64 id, const char *msg=0)
uiBody * | body ()
const uiBody * | body () 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
bool | finalized () const
virtual QWidget * | getWidget ()
const QWidget * | getWidget () const
| mOD_DisableCopy (uiBaseObject) void final ize()
Public Member Functions inherited from NamedCallBacker
| NamedCallBacker (const char *nm=nullptr)
| NamedCallBacker (const NamedCallBacker &)=delete
| ~NamedCallBacker ()
virtual Notifier< NamedCallBacker > & | objectToBeDeleted () const
NamedCallBacker & | operator= (const NamedCallBacker &)=delete
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.
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.
CallBacker & | operator= (const CallBacker &)=delete
void | stopReceivingNotifications () const
virtual CallBacker * | trueCaller ()
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_type & | name () const override
NamedObject & | operator= (const NamedObject &)
bool | operator== (const NamedObject &oth) const
virtual void | setName (const char *nm)
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

## Static Public Member Functions
static IOPar & | lastUsed ()
| == UnitOfMeasure::currentDefaults()
Static Public Member Functions inherited from uiGroup
static uiGroup * | gtDynamicCastToGrp (QWidget *)
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 ()

## Public Attributes
Notifier< uiUnitSel > | propSelChange
CNotifier< uiUnitSel, const UnitOfMeasure * > | selChange
| Returns previous unit.

## Private Member Functions
void | displayGroup (bool yn)
uiString | getSelTxt (const UnitOfMeasure *) const
const UnitOfMeasure * | gtUnit () const
void | init ()
void | initGrp (CallBacker *)
void | mnSelChg (CallBacker *)
void | propSelChg (CallBacker *)
void | selChg (CallBacker *)
void | setMnemFld (const Mnemonic *)
void | setPropFld (Mnemonic::StdType)
void | setUnFld (const UnitOfMeasure *)
void | update ()

## Private Attributes
uiComboBox * | inpfld_
uiLabel * | inplbl_ = nullptr
uiComboBox * | mnfld_ = nullptr
const UnitOfMeasure * | prevuom_ = nullptr
uiComboBox * | propfld_ = nullptr
Setup | setup_
BufferString | tblkey_
ObjectSet< const UnitOfMeasure > | units_

## Additional Inherited Members
Public Types inherited from ObjectWithName
typedef OD::String | name_type
Protected Member Functions inherited from uiGroup
void | attach_ (ConstraintType, uiObject *oth, int margin=-1, bool reciprocal=true) override
void | bodyDel (CallBacker *)
uiObject * | mainobject () override
virtual void | reDraw_ (bool deep)
void | reSizeChildren (const uiObject *, float, float)
void | setFrameStyle (int)
void | setShrinkAllowed (bool)
bool | shrinkAllowed ()
void | uiobjDel (CallBacker *)
Protected Member Functions inherited from uiParent
| uiParent (const char *nm, uiParentBody *)
| ~uiParent ()
| mOD_DisableCopy (uiParent) virtual void attach_(ConstraintType
Protected Member Functions inherited from uiBaseObject
| uiBaseObject (const char *nm, uiBody *=nullptr)
void | setBody (uiBody *b)
Protected Member Functions inherited from NamedCallBacker
void | sendDelNotif () const
Protected Attributes inherited from uiGroup
uiGroupParentBody * | body_
uiGroupObj * | grpobj_
Protected Attributes inherited from uiParent
uiObject int | margin =-1
uiObject * | oth
uiObject int bool | reciprocal =true)
Protected Attributes inherited from NamedCallBacker
Threads::Atomic< bool > | delalreadytriggered_
Notifier< NamedCallBacker > | delnotif_
Protected Attributes inherited from NamedObject
BufferString | name_

## Detailed Description

Selector for UnitOfMeasure's.

Uses the UnitOfMeasure::currentDefaults() to get/set a table of 'last used' unit of measure values. This list provides the start-up seletion. Therefore, make sure the values you display are converted to user values after the uiUnitSel is constructed.

The currentDefaults() key is taken from the label text, if you want no label then you probably want to set a key. If none is known then the name of the Property Type will be used.

<>

## Constructor & Destructor Documentation

## ◆ uiUnitSel() [1/4]

uiUnitSel::uiUnitSel | ( | uiParent * | ,
|  | const Setup & | )

## ◆ uiUnitSel() [2/4]

uiUnitSel::uiUnitSel | ( | uiParent * | ,
|  | Mnemonic::StdType | )

## ◆ uiUnitSel() [3/4]

uiUnitSel::uiUnitSel | ( | uiParent * | ,
|  | const Mnemonic * | mn = nullptr )

## ◆ ~uiUnitSel()

uiUnitSel::~uiUnitSel | ( |  | ) |

## ◆ uiUnitSel() [4/4]

mDeprecatedDef uiUnitSel::uiUnitSel | ( | uiParent * | p,
|  | const char * | lbltxt = nullptr )

## Member Function Documentation

## ◆ displayGroup()

void uiUnitSel::displayGroup | ( | bool | yn | ) |
| private

## ◆ fillPar()

void uiUnitSel::fillPar | ( | IOPar & | ,
|  | const char * | altkey = nullptr ) const

## ◆ getInternalValue() [1/2]

mDeprecatedDef double uiUnitSel::getInternalValue | ( | double | uservalue | ) | const

## ◆ getInternalValue() [2/2]

mDeprecatedDef float uiUnitSel::getInternalValue | ( | float | uservalue | ) | const

## ◆ getSelTxt()

uiString uiUnitSel::getSelTxt | ( | const UnitOfMeasure * |  | ) | const
| private

## ◆ getUnit()

const UnitOfMeasure * uiUnitSel::getUnit | ( |  | ) | const

## ◆ getUnitName()

const char * uiUnitSel::getUnitName | ( |  | ) | const

## ◆ getUserValue() [1/2]

mDeprecatedDef double uiUnitSel::getUserValue | ( | double | internalval | ) | const

## ◆ getUserValue() [2/2]

mDeprecatedDef float uiUnitSel::getUserValue | ( | float | internalval | ) | const

## ◆ gtUnit()

const UnitOfMeasure * uiUnitSel::gtUnit | ( |  | ) | const
| private

## ◆ hasMnemonicSelection()

bool uiUnitSel::hasMnemonicSelection | ( |  | ) | const
| inline

## ◆ init()

void uiUnitSel::init | ( |  | ) |
| private

## ◆ initGrp()

void uiUnitSel::initGrp | ( | CallBacker * |  | ) |
| private

## ◆ lastUsed()

static IOPar & uiUnitSel::lastUsed | ( |  | ) |
| static

== UnitOfMeasure::currentDefaults()

## ◆ mnemonic()

const Mnemonic * uiUnitSel::mnemonic | ( |  | ) | const

## ◆ mnSelChg()

void uiUnitSel::mnSelChg | ( | CallBacker * |  | ) |
| private

## ◆ propSelChg()

void uiUnitSel::propSelChg | ( | CallBacker * |  | ) |
| private

## ◆ propType()

Mnemonic::StdType uiUnitSel::propType | ( |  | ) | const
| inline

## ◆ selChg()

void uiUnitSel::selChg | ( | CallBacker * |  | ) |
| private

## ◆ setFallbackKey()

void uiUnitSel::setFallbackKey | ( | const char * |  | ) |

## ◆ setMnemFld()

void uiUnitSel::setMnemFld | ( | const Mnemonic * |  | ) |
| private

## ◆ setMnemonic()

void uiUnitSel::setMnemonic | ( | const Mnemonic & |  | ) |

## ◆ setPropFld()

void uiUnitSel::setPropFld | ( | Mnemonic::StdType |  | ) |
| private

## ◆ setPropType()

void uiUnitSel::setPropType | ( | Mnemonic::StdType |  | ) |

## ◆ setUnFld()

void uiUnitSel::setUnFld | ( | const UnitOfMeasure * |  | ) |
| private

## ◆ setUnit() [1/2]

mDeprecatedDef void uiUnitSel::setUnit | ( | const char * |  | ) |

## ◆ setUnit() [2/2]

void uiUnitSel::setUnit | ( | const UnitOfMeasure * | uom = nullptr | ) |

## ◆ tblKey()

const char * uiUnitSel::tblKey | ( |  | ) | const

For UnitOfMeasure::currentDefaults() default is prop std nm, else lbltxt

## ◆ update()

void uiUnitSel::update | ( |  | ) |
| private

## ◆ usePar()

bool uiUnitSel::usePar | ( | const IOPar & | ,
|  | const char * | altkey = nullptr )

## Member Data Documentation

## ◆ inpfld_

uiComboBox* uiUnitSel::inpfld_
| private

## ◆ inplbl_

uiLabel* uiUnitSel::inplbl_ = nullptr
| private

## ◆ mnfld_

uiComboBox* uiUnitSel::mnfld_ = nullptr
| private

## ◆ prevuom_

const UnitOfMeasure* uiUnitSel::prevuom_ = nullptr
| mutable private

## ◆ propfld_

uiComboBox* uiUnitSel::propfld_ = nullptr
| private

## ◆ propSelChange

Notifier<uiUnitSel> uiUnitSel::propSelChange

## ◆ selChange

CNotifier<uiUnitSel,const UnitOfMeasure*> uiUnitSel::selChange

Returns previous unit.

## ◆ setup_

Setup uiUnitSel::setup_
| private

## ◆ tblkey_

BufferString uiUnitSel::tblkey_
| private

## ◆ units_

ObjectSet<const UnitOfMeasure> uiUnitSel::units_
| private

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