Attribute Environment
[Control SDK]

Collaboration diagram for Attribute Environment:

Defines

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

Functions

int iupAttribIsPointer (Ihandle *ih, const char *name)
void iupAttribSetStr (Ihandle *ih, const char *name, const char *value)
void iupAttribStoreStr (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 iupAttribSetFloat (Ihandle *ih, const char *name, float num)
char * iupAttribGet (Ihandle *ih, const char *name)
char * iupAttribGetInherit (Ihandle *ih, const char *name)
char * iupAttribGetInheritNativeParent (Ihandle *ih, const char *name)
char * iupAttribGetStr (Ihandle *ih, const char *name)
int iupAttribGetInt (Ihandle *ih, const char *name)
int iupAttribGetBoolean (Ihandle *ih, const char *name)
float iupAttribGetFloat (Ihandle *ih, const char *name)
void iupAttribSetHandleName (Ihandle *ih)

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 iupAttribIsInternal ( _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 iupAttribIsPointer ( Ihandle *  ih,
const char *  name 
)

Returns true if the attribute name is a known pointer.

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

Sets the attribute only in the hash table as a pointer. It ignores children.

void iupAttribStoreStr ( 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. The string is internally duplicated. Use same format as sprintf. It ignores children.

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 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.

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

Returns the attribute from the hash table only.

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.

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* 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.

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

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

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.

void iupAttribSetHandleName ( Ihandle *  ih  ) 

Set an internal name to a handle.


Generated on Thu Oct 1 14:02:32 2009 for IUP by  doxygen 1.6.1