Container to store values used in container related methods.
uiTableValue objects are immutable.
uiTable and uiTableModel methods take ownership of the uiTableValue objects when passed as parameter. Exception: uiNewTableValueImage().
uiTable and uiTableModel methods retain ownership when returning uiTableValue objects. Exception: uiTableValueImage().
#include <ui.h>
◆ uiFreeTableValue()
◆ uiNewTableValueColor()
uiTableValue * uiNewTableValueColor |
( |
double | r, |
|
|
double | g, |
|
|
double | b, |
|
|
double | a ) |
|
static |
Creates a new table value to store a color in.
- Parameters
-
r | Red. Double in range of [0, 1.0]. |
g | Green. Double in range of [0, 1.0]. |
b | Blue. Double in range of [0, 1.0]. |
a | Alpha. Double in range of [0, 1.0]. |
- Returns
- A new uiTableValue instance.
◆ uiNewTableValueImage()
Creates a new table value to store an image.
- Parameters
-
img | Image.
Data is NOT copied and needs to kept alive. |
- Returns
- A new uiTableValue instance.
- Warning
- Unlike other uiTableValue constructors, uiNewTableValueImage() does NOT copy the image to save time and space. Make sure the image data stays valid while in use by the library. As a general rule: if the constructor is called via the uiTableModelHandler, the image is safe to free once execution returns to ANY of your code.
◆ uiNewTableValueInt()
Creates a new table value to store an integer.
This value type can be used in conjunction with properties like column editable [TRUE
, FALSE
] or controls like progress bars and checkboxes. For these, consult uiProgressBar and uiCheckbox for the allowed integer ranges.
- Parameters
-
- Returns
- A new uiTableValue instance.
◆ uiNewTableValueString()
Creates a new table value to store a text string.
- Parameters
-
str | String value.
A valid, NUL terminated UTF-8 string.
Data is copied internally. Ownership is not transferred. |
- Returns
- A new uiTableValue instance.
◆ uiTableValueColor()
void uiTableValueColor |
( |
const uiTableValue * | v, |
|
|
double * | r, |
|
|
double * | g, |
|
|
double * | b, |
|
|
double * | a ) |
Returns the color value held internally.
To be used only on uiTableValue objects of type uiTableValueTypeColor.
- Parameters
-
| v | Table value. |
[out] | r | Red. Double in range of [0, 1.0]. |
[out] | g | Green. Double in range of [0, 1.0]. |
[out] | b | Blue. Double in range of [0, 1.0]. |
[out] | a | Alpha. Double in range of [0, 1.0]. |
◆ uiTableValueGetType()
Gets the uiTableValue type.
- Parameters
-
- Returns
- Table value type.
◆ uiTableValueImage()
Returns a reference to the image contained.
To be used only on uiTableValue objects of type uiTableValueTypeImage.
- Parameters
-
- Returns
- Image.
Data is owned by the caller of uiNewTableValueImage().
- Warning
- The image returned is not owned by the object
v
, hence no lifetime guarantees can be made.
◆ uiTableValueInt()
Returns the integer value held internally.
To be used only on uiTableValue objects of type uiTableValueTypeInt.
- Parameters
-
- Returns
- Integer value.
◆ uiTableValueString()
Returns the string value held internally.
To be used only on uiTableValue objects of type uiTableValueTypeString.
- Parameters
-
- Returns
- String value.
A NUL
terminated UTF-8 string.
Data remains owned by v
, do NOT call uiFreeText()
.
The documentation for this struct was generated from the following file: