Defines | Functions

Attribute Environment
[Control SDK]

Collaboration diagram for Attribute Environment:

Defines

#define iupATTRIB_ISINTERNAL(_name)   ((_name[0] == '_' && _name[1] == 'I' && _name[2] == 'U' && _name[3] == 'P')? 1: 0)

Functions

IUP_SDK_API int iupAttribIsNotString (Ihandle *ih, const char *name)
IUP_SDK_API int iupAttribIsIhandle (Ihandle *ih, const char *name)
IUP_SDK_API void iupAttribSet (Ihandle *ih, const char *name, const char *value)
IUP_SDK_API void iupAttribSetStr (Ihandle *ih, const char *name, const char *value)
IUP_SDK_API void iupAttribSetStrf (Ihandle *ih, const char *name, const char *format,...)
IUP_SDK_API void iupAttribSetInt (Ihandle *ih, const char *name, int num)
IUP_SDK_API void iupAttribSetId (Ihandle *ih, const char *name, int id, const char *value)
IUP_SDK_API void iupAttribSetStrId (Ihandle *ih, const char *name, int id, const char *value)
IUP_SDK_API void iupAttribSetId2 (Ihandle *ih, const char *name, int lin, int col, const char *value)
IUP_SDK_API void iupAttribSetStrId2 (Ihandle *ih, const char *name, int lin, int col, const char *value)
IUP_SDK_API void iupAttribSetIntId (Ihandle *ih, const char *name, int id, int num)
IUP_SDK_API void iupAttribSetIntId2 (Ihandle *ih, const char *name, int lin, int col, int num)
IUP_SDK_API void iupAttribSetFloat (Ihandle *ih, const char *name, float num)
IUP_SDK_API void iupAttribSetFloatId (Ihandle *ih, const char *name, int id, float num)
IUP_SDK_API void iupAttribSetFloatId2 (Ihandle *ih, const char *name, int lin, int col, float num)
IUP_SDK_API void iupAttribSetDouble (Ihandle *ih, const char *name, double num)
IUP_SDK_API void iupAttribSetDoubleId (Ihandle *ih, const char *name, int id, double num)
IUP_SDK_API void iupAttribSetDoubleId2 (Ihandle *ih, const char *name, int lin, int col, double num)
IUP_SDK_API char * iupAttribGet (Ihandle *ih, const char *name)
IUP_SDK_API char * iupAttribGetStr (Ihandle *ih, const char *name)
IUP_SDK_API int iupAttribGetInt (Ihandle *ih, const char *name)
IUP_SDK_API int iupAttribGetIntInt (Ihandle *ih, const char *name, int *i1, int *i2, char sep)
IUP_SDK_API int iupAttribGetBoolean (Ihandle *ih, const char *name)
IUP_SDK_API float iupAttribGetFloat (Ihandle *ih, const char *name)
IUP_SDK_API double iupAttribGetDouble (Ihandle *ih, const char *name)
IUP_SDK_API char * iupAttribGetId (Ihandle *ih, const char *name, int id)
IUP_SDK_API int iupAttribGetIntId (Ihandle *ih, const char *name, int id)
IUP_SDK_API int iupAttribGetBooleanId (Ihandle *ih, const char *name, int id)
IUP_SDK_API float iupAttribGetFloatId (Ihandle *ih, const char *name, int id)
IUP_SDK_API double iupAttribGetDoubleId (Ihandle *ih, const char *name, int id)
IUP_SDK_API char * iupAttribGetId2 (Ihandle *ih, const char *name, int lin, int col)
IUP_SDK_API int iupAttribGetIntId2 (Ihandle *ih, const char *name, int lin, int col)
IUP_SDK_API int iupAttribGetBooleanId2 (Ihandle *ih, const char *name, int lin, int col)
IUP_SDK_API float iupAttribGetFloatId2 (Ihandle *ih, const char *name, int lin, int col)
IUP_SDK_API char * iupAttribGetInherit (Ihandle *ih, const char *name)
IUP_SDK_API char * iupAttribGetInheritNativeParent (Ihandle *ih, const char *name)
IUP_SDK_API char * iupAttribGetLocal (Ihandle *ih, const char *name)
IUP_SDK_API void iupAttribParse (Ihandle *ih, const char *str, int save_led_info)
IUP_SDK_API int iupAttribGetAllSaved (Ihandle *ih, char **names, int n)
IUP_SDK_API void iupAttribSetHandleName (Ihandle *ih)
IUP_SDK_API char * iupAttribGetHandleName (Ihandle *ih)
IUP_SDK_API void iupAttribSetClassObject (Ihandle *ih, const char *name, const char *value)

Detailed Description

When attributes are not stored at the control they are stored in a hash table (see Hash Table).
As a general rule use:
  • IupGetAttribute, IupSetAttribute, ... : when care about control implementation, hash table, inheritance and default value
  • iupAttribGetStr,Int,Float: when care about inheritance, hash table and default value
  • iupAttribGet,... : ONLY access the hash table These different functions have very different performances and results. So use them wiselly.
See iup_attrib.h

Define Documentation

#define iupATTRIB_ISINTERNAL (   _name  )     ((_name[0] == '_' && _name[1] == 'I' && _name[2] == 'U' && _name[3] == 'P')? 1: 0)

Returns true if the attribute name if in the internal format "_IUP...".


Function Documentation

IUP_SDK_API int iupAttribIsNotString ( Ihandle *  ih,
const char *  name 
)

Returns true if the attribute name is a known pointer.

IUP_SDK_API int iupAttribIsIhandle ( Ihandle *  ih,
const char *  name 
)

Returns true if the attribute name is a known Ihandle*.

IUP_SDK_API void iupAttribSet ( Ihandle *  ih,
const char *  name,
const char *  value 
)

Sets the attribute only in the hash table as a pointer.
Only generic pointers and constant strings can be set as value.
It ignores children.

IUP_SDK_API void iupAttribSetStr ( Ihandle *  ih,
const char *  name,
const char *  value 
)

Sets the attribute only in the hash table as a string.
The string is internally duplicated.
It ignores children.

IUP_SDK_API void iupAttribSetStrf ( Ihandle *  ih,
const char *  name,
const char *  format,
  ... 
)

Sets the attribute only in the hash table as a string.
Use same format as sprintf.
It ignores children.
This is not supposed to be used for very large strings, just for combinations of numeric data or constant strings.

IUP_SDK_API void iupAttribSetInt ( Ihandle *  ih,
const char *  name,
int  num 
)

Sets an integer attribute only in the hash table.
It will be stored as a string.
It ignores children.

IUP_SDK_API void iupAttribSetId ( Ihandle *  ih,
const char *  name,
int  id,
const char *  value 
)

Same as iupAttribSet with an id.

IUP_SDK_API void iupAttribSetStrId ( Ihandle *  ih,
const char *  name,
int  id,
const char *  value 
)

Same as iupAttribSetStr with an id.

IUP_SDK_API void iupAttribSetId2 ( Ihandle *  ih,
const char *  name,
int  lin,
int  col,
const char *  value 
)

Same as iupAttribSet with lin and col.

IUP_SDK_API void iupAttribSetStrId2 ( Ihandle *  ih,
const char *  name,
int  lin,
int  col,
const char *  value 
)

Same as iupAttribSetStr with lin and col.

IUP_SDK_API void iupAttribSetIntId ( Ihandle *  ih,
const char *  name,
int  id,
int  num 
)

Same as iupAttribSetInt with an id.

IUP_SDK_API void iupAttribSetIntId2 ( Ihandle *  ih,
const char *  name,
int  lin,
int  col,
int  num 
)

Same as iupAttribSetInt with lin and col.

IUP_SDK_API void iupAttribSetFloat ( Ihandle *  ih,
const char *  name,
float  num 
)

Sets an floating point attribute only in the hash table.
It will be stored as a string.
It ignores children.

IUP_SDK_API void iupAttribSetFloatId ( Ihandle *  ih,
const char *  name,
int  id,
float  num 
)

Same as iupAttribSetFloat with an id.

IUP_SDK_API void iupAttribSetFloatId2 ( Ihandle *  ih,
const char *  name,
int  lin,
int  col,
float  num 
)

Same as iupAttribSetFloat with lin and col.

IUP_SDK_API void iupAttribSetDouble ( Ihandle *  ih,
const char *  name,
double  num 
)

Sets an floating point attribute only in the hash table.
It will be stored as a string.
It ignores children.

IUP_SDK_API void iupAttribSetDoubleId ( Ihandle *  ih,
const char *  name,
int  id,
double  num 
)

Same as iupAttribSetDouble with an id.

IUP_SDK_API void iupAttribSetDoubleId2 ( Ihandle *  ih,
const char *  name,
int  lin,
int  col,
double  num 
)

Same as iupAttribSetDouble with lin and col.

IUP_SDK_API char* iupAttribGet ( Ihandle *  ih,
const char *  name 
)

Returns the attribute from the hash table only.
NO inheritance, NO control implementation, NO defalt value here.

IUP_SDK_API char* iupAttribGetStr ( Ihandle *  ih,
const char *  name 
)

Returns the attribute from the hash table as a string, but if not defined then checks in its parent tree if allowed by the control implementation, if still not defined then returns the registered default value if any. NO control implementation, only checks inheritance and default value from it.

IUP_SDK_API int iupAttribGetInt ( Ihandle *  ih,
const char *  name 
)

Same as iupAttribGetStr but returns an integer number. Checks also for boolean values.

IUP_SDK_API int iupAttribGetIntInt ( Ihandle *  ih,
const char *  name,
int *  i1,
int *  i2,
char  sep 
)

Same as iupAttribGetInt but returns two integer numbers.
Returns the number of valid integers: 0, 1 or 2.

IUP_SDK_API int iupAttribGetBoolean ( Ihandle *  ih,
const char *  name 
)

Same as iupAttribGetStr but checks for boolean values. Use iupStrBoolean.

IUP_SDK_API float iupAttribGetFloat ( Ihandle *  ih,
const char *  name 
)

Same as iupAttribGetStr but returns an floating point number.

IUP_SDK_API double iupAttribGetDouble ( Ihandle *  ih,
const char *  name 
)

Same as iupAttribGetStr but returns an floating point number.

IUP_SDK_API char* iupAttribGetId ( Ihandle *  ih,
const char *  name,
int  id 
)

Same as iupAttribGet but with an id.

IUP_SDK_API int iupAttribGetIntId ( Ihandle *  ih,
const char *  name,
int  id 
)

Same as iupAttribGetInt but with an id.

IUP_SDK_API int iupAttribGetBooleanId ( Ihandle *  ih,
const char *  name,
int  id 
)

Same as iupAttribGetBoolean but with an id.

IUP_SDK_API float iupAttribGetFloatId ( Ihandle *  ih,
const char *  name,
int  id 
)

Same as iupAttribGetFloat but with an id.

IUP_SDK_API double iupAttribGetDoubleId ( Ihandle *  ih,
const char *  name,
int  id 
)

Same as iupAttribGetDouble but with an id.

Same as iupAttribGetDouble but with lin and col.

IUP_SDK_API char* iupAttribGetId2 ( Ihandle *  ih,
const char *  name,
int  lin,
int  col 
)

Same as iupAttribGet but with an lin and col.

IUP_SDK_API int iupAttribGetIntId2 ( Ihandle *  ih,
const char *  name,
int  lin,
int  col 
)

Same as iupAttribGetInt but with lin and col.

IUP_SDK_API int iupAttribGetBooleanId2 ( Ihandle *  ih,
const char *  name,
int  lin,
int  col 
)

Same as iupAttribGetBoolean but with lin and col.

IUP_SDK_API float iupAttribGetFloatId2 ( Ihandle *  ih,
const char *  name,
int  lin,
int  col 
)

Same as iupAttribGetFloat but with lin and col.

IUP_SDK_API char* iupAttribGetInherit ( Ihandle *  ih,
const char *  name 
)

Returns the attribute from the hash table only, but if not defined then checks in its parent tree.
NO control implementation, NO defalt value here.
Used for EXPAND and internal attributes inside a dialog.

IUP_SDK_API char* iupAttribGetInheritNativeParent ( Ihandle *  ih,
const char *  name 
)

Returns the attribute from the hash table of a native parent. Don't check for default values. Don't check at the element. Used for BGCOLOR and BACKGROUND attributes.

IUP_SDK_API char* iupAttribGetLocal ( Ihandle *  ih,
const char *  name 
)

Returns the attribute from the hash table as a string, but if not defined then checks in the control implementation, if still not defined then returns the registered default value if any.
NO inheritance here. Used only in the IupLayoutDialog.

IUP_SDK_API void iupAttribParse ( Ihandle *  ih,
const char *  str,
int  save_led_info 
)

Parse a string of attributes.

IUP_SDK_API int iupAttribGetAllSaved ( Ihandle *  ih,
char **  names,
int  n 
)

Return all saved attributes.

IUP_SDK_API void iupAttribSetHandleName ( Ihandle *  ih  ) 

Set an internal name to a handle.

IUP_SDK_API char* iupAttribGetHandleName ( Ihandle *  ih  ) 

Returns the internal name if set.

IUP_SDK_API void iupAttribSetClassObject ( Ihandle *  ih,
const char *  name,
const char *  value 
)

Sets the attribute only at the element.
If set method is not defined will not be set, neither will be stored in the hash table.
Only generic pointers and constant strings can be set as value.
It ignores children.