Data Fields

Iclass_ Struct Reference
[Ihandle Class]

Collaboration diagram for Iclass_:
Collaboration graph
[legend]

Data Fields

const char * name
const char * cons
const char * format
const char * format_attr
InativeType nativetype
int childtype
int is_interactive
int has_attrib_id
int is_internal
Iclassparent
Itable * attrib_func
Iclass *(* New )(void)
void(* Release )(Iclass *ic)
int(* Create )(Ihandle *ih, void **params)
int(* Map )(Ihandle *ih)
void(* UnMap )(Ihandle *ih)
void(* Destroy )(Ihandle *ih)
void *(* GetInnerNativeContainerHandle )(Ihandle *ih, Ihandle *child)
void(* ChildAdded )(Ihandle *ih, Ihandle *child)
void(* ChildRemoved )(Ihandle *ih, Ihandle *child, int pos)
void(* LayoutUpdate )(Ihandle *ih)
void(* ComputeNaturalSize )(Ihandle *ih, int *w, int *h, int *children_expand)
void(* SetChildrenCurrentSize )(Ihandle *ih, int shrink)
void(* SetChildrenPosition )(Ihandle *ih, int x, int y)
int(* DlgPopup )(Ihandle *ih, int x, int y)

Detailed Description

Ihandle Class Structure


Field Documentation

const char* Iclass_::name

class name. No default, must be initialized.

const char* Iclass_::cons

constructor name in C, if more than the first letter uppercase, or NULL.

const char* Iclass_::format

Creation parameters format of the class.
Used only for LED parsing.
It can have none (NULL), one or more of the following.

  • "b" = (unsigned char) - byte >> unused <<
  • "j" = (int*) - array of integer >> unused <<
  • "f" = (float) - real >> unused <<
  • "i" = (int) - integer >> used in IupImage* only <<
  • "c" = (unsigned char*) - array of byte >> used in IupImage* only <<
  • "s" = (char*) - string >> usually is for TITLE <<
  • "a" = (char*) - name of the ACTION callback
  • "h" = (Ihandle*) - element handle
  • "g" = (Ihandle**) - array of element handle (when used there are no other parameters)
const char* Iclass_::format_attr

attribute name of the first creation parameter when format[0] is 's' or 'a'

native type. Default is IUP_TYPEVOID.

children count enum: none, many, or n, as described in IchildType. Default is IUP_CHILDNONE.
This identifies a container that can be manipulated with IupReparent, IupAppend and IupInsert.
Used to control the allowed number of children and define its behavior in the layout processing.
The element can still have hidden children even if this is none.

keyboard interactive boolean, true if the class can have the keyboard input focus. Default is false.

indicate if any attribute is numbered. Default is not. Can be 1 or 2.

indicate an internal class initialized in IupOpen.

class parent to implement inheritance. Class name must be different.
Creation parameters should be the same or replace the parents creation function.
Native type should be the same.
Child type should be a more restrictive or equal type (many->one->none).
Attribute functions will have only one common table.
All methods can be changed, set to NULL, switched, etc.

table of functions to handle attributes, only one per class tree

Iclass*(* Iclass_::New)(void)

Method that allocates a new instance of the class.
Used by inherited classes in iupClassNew.

void(* Iclass_::Release)(Iclass *ic)

Method that release the memory allocated by the class. Called only once at iupClassRelease.

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

Method that creates the element and process the creation parameters.
Called only from IupCreate.
The parameters can be NULL for all the controls.
The control should also depend on attributes set before IupMap.
Must return IUP_NOERROR or IUP_ERROR.
Can be NULL, like all methods.

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

Method that map (create) the control to the native system.
Called only from IupMap.
Must return IUP_NOERROR or IUP_ERROR.

void(* Iclass_::UnMap)(Ihandle *ih)

Method that unmap (destroy) the control from the native system.
Called only from IupUnmap if the control is mapped.
Must return IUP_NOERROR or IUP_ERROR.

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

Method that destroys the element.
Called only from IupDestroy. Always called even if the control is not mapped.

void*(* Iclass_::GetInnerNativeContainerHandle)(Ihandle *ih, Ihandle *child)

Returns the internal native parent. The default implementation returns the handle of itself.
Called from iupChildTreeGetNativeParentHandle.
This allows native elements to have an internal container that will be the actual native parent, or in other words allows native elements to be a combination of other native elements in a single IUP element. The actual native parent may depend on the child tree (see IupTabs for an example).

void(* Iclass_::ChildAdded)(Ihandle *ih, Ihandle *child)

Notifies the element that a child was added to the child tree hierarchy.
Called only from IupAppend, IupInsert or IupReparent. The child is not mapped yet, but the parent can be mapped.

void(* Iclass_::ChildRemoved)(Ihandle *ih, Ihandle *child, int pos)

Notifies the element that a child was removed using IupDetach.
Called only from IupDetach or IupReparent. The child is already detached.

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

Method that update size and position of the native control.
Called only from iupLayoutUpdate and if the element is mapped.

void(* Iclass_::ComputeNaturalSize)(Ihandle *ih, int *w, int *h, int *children_expand)

Method that computes the natural size based on the user size and the actual natural size.
Should update expand if a container, but does NOT depends on expand to compute the natural size.
Must call the iupBaseComputeNaturalSize for each children. First calculate the native size for the children, then for the element.
Also called before the element is mapped, so it must be independent of the native control. First call done at iupLayoutCompute for the dialog.

void(* Iclass_::SetChildrenCurrentSize)(Ihandle *ih, int shrink)

Method that calculates and updates the current size of children based on the available size, the natural size and the expand configuration.
Called only if there is any children.
Must call iupBaseSetCurrentSize for each children. shrink is the dialog attribute passed here for optimization.
Also called before the element is mapped, so it must be independent of the native control. First call done at iupLayoutCompute for the dialog.

void(* Iclass_::SetChildrenPosition)(Ihandle *ih, int x, int y)

Method that calculates and updates the position relative to the parent.
Called only if there is any children.
Must call iupBaseSetPosition for each children. Also called before the element is mapped, so it must be independent of the native control. First call done at iupLayoutCompute for the dialog.

int(* Iclass_::DlgPopup)(Ihandle *ih, int x, int y)

Method that shows a popup dialog. Called only for native pre-defined dialogs.
The element is not mapped.
Must return IUP_ERROR or IUP_NOERROR.
Called only from iupDialogPopup.