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

int iupAttribIsNotString (Ihandle *ih, const char *name)
int iupAttribIsIhandle (Ihandle *ih, const char *name)
void iupAttribSet (Ihandle *ih, const char *name, const char *value)
void iupAttribSetStr (Ihandle *ih, const char *name, const char *value)
void iupAttribSetStrf (Ihandle *ih, const char *name, const char *format,...)
void iupAttribSetInt (Ihandle *ih, const char *name, int num)
void iupAttribSetId (Ihandle *ih, const char *name, int id, const char *value)
void iupAttribSetStrId (Ihandle *ih, const char *name, int id, const char *value)
void iupAttribSetId2 (Ihandle *ih, const char *name, int lin, int col, const char *value)
void iupAttribSetStrId2 (Ihandle *ih, const char *name, int lin, int col, const char *value)
void iupAttribSetIntId (Ihandle *ih, const char *name, int id, int num)
void iupAttribSetIntId2 (Ihandle *ih, const char *name, int lin, int col, int num)
void iupAttribSetFloat (Ihandle *ih, const char *name, float num)
void iupAttribSetFloatId (Ihandle *ih, const char *name, int id, float num)
void iupAttribSetFloatId2 (Ihandle *ih, const char *name, int lin, int col, float num)
void iupAttribSetDouble (Ihandle *ih, const char *name, double num)
void iupAttribSetDoubleId (Ihandle *ih, const char *name, int id, double num)
void iupAttribSetDoubleId2 (Ihandle *ih, const char *name, int lin, int col, double num)
char * iupAttribGet (Ihandle *ih, const char *name)
char * iupAttribGetStr (Ihandle *ih, const char *name)
int iupAttribGetInt (Ihandle *ih, const char *name)
int iupAttribGetIntInt (Ihandle *ih, const char *name, int *i1, int *i2, char sep)
int iupAttribGetBoolean (Ihandle *ih, const char *name)
float iupAttribGetFloat (Ihandle *ih, const char *name)
double iupAttribGetDouble (Ihandle *ih, const char *name)
char * iupAttribGetId (Ihandle *ih, const char *name, int id)
int iupAttribGetIntId (Ihandle *ih, const char *name, int id)
int iupAttribGetBooleanId (Ihandle *ih, const char *name, int id)
float iupAttribGetFloatId (Ihandle *ih, const char *name, int id)
char * iupAttribGetId2 (Ihandle *ih, const char *name, int lin, int col)
int iupAttribGetIntId2 (Ihandle *ih, const char *name, int lin, int col)
int iupAttribGetBooleanId2 (Ihandle *ih, const char *name, int lin, int col)
float iupAttribGetFloatId2 (Ihandle *ih, const char *name, int lin, int col)
char * iupAttribGetInherit (Ihandle *ih, const char *name)
char * iupAttribGetInheritNativeParent (Ihandle *ih, const char *name)
char * iupAttribGetLocal (Ihandle *ih, const char *name)
void iupAttribSetHandleName (Ihandle *ih)
char * iupAttribGetHandleName (Ihandle *ih)
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

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

Returns true if the attribute name is a known pointer.

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

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

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.

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.

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.

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.

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

Same as iupAttribSet with an id.

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

Same as iupAttribSetStr with an id.

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

Same as iupAttribSet with lin and col.

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

Same as iupAttribSetStr with lin and col.

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

Same as iupAttribSetInt with an id.

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

Same as iupAttribSetInt with lin and col.

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.

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

Same as iupAttribSetFloat with an id.

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

Same as iupAttribSetFloat with lin and col.

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.

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

Same as iupAttribSetDouble with an id.

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

Same as iupAttribSetDouble with lin and col.

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

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

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.

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

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

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.

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

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

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

Same as iupAttribGetStr but returns an floating point number.

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

Same as iupAttribGetStr but returns an floating point number.

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

Same as iupAttribGet but with an id.

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

Same as iupAttribGetInt but with an id.

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

Same as iupAttribGetBoolean but with an id.

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

Same as iupAttribGetFloat but with an id.

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

Same as iupAttribGet but with an lin and col.

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

Same as iupAttribGetInt but with lin and col.

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

Same as iupAttribGetBoolean but with lin and col.

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

Same as iupAttribGetFloat but with lin and col.

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.

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.

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.

void iupAttribSetHandleName ( Ihandle *  ih  ) 

Set an internal name to a handle.

char* iupAttribGetHandleName ( Ihandle *  ih  ) 

Returns the internal name if set.

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.