IUP: Iclass_ Struct Reference

IUP - Portable User Interface

Iclass_ Struct Reference
[Base Class]


Detailed Description

Base Class Structure


Data Fields

char * name
char * format
int nativetype
int childtype
int interactive
Itable * attrib_func
int(* Create )(Ihandle *, void **)
int(* Map )(Ihandle *)
void(* Destroy )(Ihandle *)
int(* Append )(Ihandle *)
int(* Detach )(Ihandle *)
void(* LayoutUpdate )(Ihandle *)
void(* DisplayUpdate )(Ihandle *)
void(* ComputeNaturalSize )(Ihandle *)
void(* SetCurrentSize )(Ihandle *, int, int, int)
void(* SetPosition )(Ihandle *, int, int)
int(* SetAttribute )(Ihandle *, const char *name, const char *value, int *inherit)
char *(* GetAttribute )(Ihandle *, const char *name, char **def_value, int *inherit)
int(* DlgPopup )(Ihandle *, int, int)

Field Documentation

char* Iclass_::name
 

class name

char* Iclass_::format
 

Creation parameters format of the class when specified.
It can have none, one or more of the following.

  • "b" = (unsigned char) - byte
  • "c" = (unsigned char*) - array of byte
  • "i" = (int) - integer
  • "j" = (int*) - array of integer
  • "f" = (float) - real
  • "s" = (char*) - string
  • "a" = (char*) - name of an action
  • "h" = (Ihandle*) - element handle
  • "g" = (Ihandle**) - array of element handle If upper case then it is optional.

int Iclass_::nativetype
 

native type enum

int Iclass_::childtype
 

children count enum: none, one, or many

int Iclass_::interactive
 

keyboard interactive boolean, true if the class can have the keyboard input focus

Itable* Iclass_::attrib_func
 

table of functions to handle attributes

int(* Iclass_::Create)(Ihandle *, void **)
 

Creates the element and process the creation parameters.
Can NOT be NULL.
Called only from IupCreate.
The parameters can be NULL for all the controls.
The control should also depend on attributes set before IupMap.

int(* Iclass_::Map)(Ihandle *)
 

Map the control to the native system.
Must return IUP_ERROR or IUP_NOERROR.
Called only from IupMap.

void(* Iclass_::Destroy)(Ihandle *)
 

Destroys the element and the object on the native system.
Called only from IupDestroy.

int(* Iclass_::Append)(Ihandle *)
 

Checks the object if an element can be append to its parent.
Called only from IupAppend.

int(* Iclass_::Detach)(Ihandle *)
 

Checks the object if an element can be detached from its parent.
Called only from IupDetach.

void(* Iclass_::LayoutUpdate)(Ihandle *)
 

Update size and position of the native control.
Called only from iupLayoutDisplay.

void(* Iclass_::DisplayUpdate)(Ihandle *)
 

Force a redraw of the native control.
Can NOT be NULL for dialogs.
Called only from IupUpdate and iupLayoutDisplay.

void(* Iclass_::ComputeNaturalSize)(Ihandle *)
 

Compute the natural size.
Should update expand and call it self for the children.
Can NOT be NULL.
Called only from iupLayoutCompute and itself on each child.

void(* Iclass_::SetCurrentSize)(Ihandle *, int, int, int)
 

Calculates and updates the current size based on the given size.
shrink is the dialog attribute passed here for optimization.
Can NOT be NULL.
Called only from iupLayoutCompute and itself on each child.

void(* Iclass_::SetPosition)(Ihandle *, int, int)
 

Calculates and updates the position relative to the native parent.
Can NOT be NULL.
Called only from iupLayoutCompute and itself on each child.

int(* Iclass_::SetAttribute)(Ihandle *, const char *name, const char *value, int *inherit)
 

Sets an attribute in the object.
If returns 0, the attribute will not be stored in the attribute environment.
The default implementation uses iupClassSetAttributeBase.
Can NOT be NULL.
Called from iupAttribUpdate (IupMap), IupStoreAttribute and IupSetAttribute.

char*(* Iclass_::GetAttribute)(Ihandle *, const char *name, char **def_value, int *inherit)
 

Retrieves an attribute from the object.
The default implementation uses iupClassGetAttributeBase.
Can NOT be NULL.
Called only from IupGetAttribute.

int(* Iclass_::DlgPopup)(Ihandle *, int, int)
 

Called only for some special dialogs.
Up to now used only by the Windows pre-defined dialogs.
The element does not needs to be mapped.
Must return IUP_ERROR or IUP_NOERROR.
Called only from iupDlgPopup.