gCAD3D 2.35
gui_gtk2/gtk_tree_it.h File Reference

Go to the source code of this file.

Data Structures

struct  TreeNode
 

Functions

MemObj GUI_tree1__ (MemObj *o_par, void *selCB, char *opts)
 
int GUI_tree1_row_add (TreeNode *nodeChd, MemObj *mo, TreeNode *nodePar, int icoNr, char *txt, int mode)
 
int GUI_tree1_row_set (MemObj *mo, TreeNode *row, int ico, char *txt, int mode)
 
int GUI_tree1_childs_set (MemObj *mo, TreeNode *it, int mode)
 
int GUI_tree1_childs_remove (MemObj *mo, TreeNode *it)
 
int GUI_tree1_iter_string (TreeNode *it, char *txt, TreeNode *itPar, MemObj *mo)
 
int GUI_tree1_expand__ (MemObj *mo, TreeNode *it)
 
int GUI_tree1_unselect_all (MemObj *mo)
 
int GUI_tree1_childNr (MemObj *mo, TreeNode *it)
 
int GUI_tree1_lev (MemObj *mo, TreeNode *it)
 
int GUI_tree1_par (TreeNode *itPar, MemObj *mo, TreeNode *itChild)
 
int GUI_tree1_ndPos (char *ndPos, MemObj *mo, TreeNode *it)
 
int GUI_tree1_cmp_row (MemObj *mo, TreeNode *it1, TreeNode *it2)
 
int GUI_tree1_cbSel (void *selection, MemObj mo)
 
int GUI_tree1_cbMouse (void *parent, void *ev, MemObj mo)
 
int GUI_tree1_remove__ (MemObj *mo, TreeNode *it)
 
int GUI_tree1_clear (MemObj *mo)
 
int GUI_tree1_decode (MemObj *mo)
 

Function Documentation

MemObj GUI_tree1__ ( MemObj o_par,
void *  selCB,
char *  opts 
)
create Tree with icon + text.
Icons must be loaded with GUI_Ico_init < iSizYIco_init
Input:
o_par parentBox
selCB callbackfunktion for the selection-event
opts options; (HorSiz,VertSiz)
HorSiz,VertSiz: size in characters; default is automatic size.
'e' = expand widget; default is fixed size.
Examples: "" or "10" or "10e,e"
"10e,e" horiz. size 10 chars, hor. and vert. expandable.
Output:
returns tree
prototyp selCB:
int selCB (void *parent, void **data);
// data=table of 6 pointers;
GUI_DATA_EVENT=*(int*)data[0]=TYP_EventPress|TYP_EventRelease
GUI_DATA_I1 =*(int*)data[1]=GUI_MouseL| left mousebutton
GUI_MouseM| mid mousebutton
GUI_MouseR| right mousebutton
(TreeNode*)data[2] =TreeNode of selected row
GUI_DATA_S3 =(char*)data[3]=text (col.1) of selected row
GUI_DATA_I4 =*(int*)data[4]=icon-nr of selected row
GUI_DATA_I5 =*(int*)data[5]=state of selected row 1=active, 0=passive
see also UI_mcl__ GUI_mList__
create Tree with icon + text.
Icons must be loaded with GUI_Ico_init < iSizYIco_init
Input:
o_par parentBox
selCB callbackfunktion for the selection-event
opts options; (HorSiz,VertSiz)
HorSiz,VertSiz: size in characters; default is automatic size.
'e' = expand widget; default is fixed size.
Examples: "" or "10" or "10e,e"
"10e,e" horiz. size 10 chars, hor. and vert. expandable.
Output:
returns tree
prototyp selCB:
int selCB (void *parent, void **data);
// data=table of 6 pointers;
GUI_DATA_EVENT=*(int*)data[0]=TYP_EventPress|TYP_EventRelease
GUI_DATA_I1 =*(int*)data[1]=GUI_MouseL| left mousebutton
GUI_MouseM| mid mousebutton
GUI_MouseR| right mousebutton
(TreeNode*)data[2] =TreeNode of selected row
GUI_DATA_S3 =(char*)data[3]=text (col.1) of selected row
GUI_DATA_I4 =*(int*)data[4]=icon-nr of selected row
GUI_DATA_I5 =*(int*)data[5]=state of selected row 1=active, 0=passive
see also UI_mcl__ GUI_mList__
int GUI_tree1_row_add ( TreeNode nodeChd,
MemObj mo,
TreeNode nodePar,
int  icoNr,
char *  txt,
int  mode 
)
add (one more) childnode to parentNode <rowPar>
Input:
mo tree-obj
nodePar parent-row-node; NULL for primary obj
icoNr index of icon; -1 = do not modify. see eg ICO_Var
txt text for row; NULL = do not modify.
mode -1 passive (icon & text dimmed)
0 normal (text colored)
1 active (text normal)
Output:
nodeChd child-row-node
add (one more) childnode to parentNode <rowPar>
Input:
mo tree-obj
nodePar parent-row-node; NULL for primary obj
icoNr index of icon; -1 = do not modify. see eg ICO_Var
txt text for row; NULL = do not modify.
mode -1 passive (icon & text dimmed)
0 normal (text colored)
1 active (text normal)
Output:
nodeChd child-row-node
int GUI_tree1_row_set ( MemObj mo,
TreeNode row,
int  ico,
char *  txt,
int  mode 
)
GUI_tree1_row_set change rowMode to active, normal, passive
Input:
ico index of icon; -1 = do not modify.
txt text for row; NULL = do not modify.
mode -2 unselected
-1 passive (icon & text dimmed)
0 do not modify
1 active (normal)
2 selected see GUI_tree1_set_selMode().
GUI_tree1_row_set change rowMode to active, normal, passive
Input:
ico index of icon; -1 = do not modify.
txt text for row; NULL = do not modify.
mode -2 unselected
-1 passive (icon & text dimmed)
0 do not modify
1 active (normal)
2 selected see GUI_tree1_set_selMode().
int GUI_tree1_childs_set ( MemObj mo,
TreeNode it,
int  mode 
)
modify mode (active|passive) of all childs of a row, but not of row.
mode -1=passive; 1=active
recursive.
modify mode (active|passive) of all childs of a row, but not of row.
mode -1=passive; 1=active
recursive.
int GUI_tree1_childs_remove ( MemObj mo,
TreeNode it 
)
remove all childs of node; but not node.
recursiv
remove all childs of node; but not node.
recursiv
int GUI_tree1_iter_string ( TreeNode it,
char *  txt,
TreeNode itPar,
MemObj mo 
)
get iter of row that starts with <txt> among childs of itPar.
Check only childs of one level.
Input:
txt objId + " " eg "M21 "
itPar parentNode; check only its childs; NULL for topLevel
Output:
it node found
RetCode: 0 = ok, found; row <it> starts with <txt>
-1 = not found
get iter of row that starts with <txt> among childs of itPar.
Check only childs of one level.
Input:
txt objId + " " eg "M21 "
itPar parentNode; check only its childs; NULL for topLevel
Output:
it node found
RetCode: 0 = ok, found; row <it> starts with <txt>
-1 = not found
int GUI_tree1_expand__ ( MemObj mo,
TreeNode it 
)

expand row or all (if it == NULL)

expand row or all (if it == NULL)

int GUI_tree1_unselect_all ( MemObj mo)

unselect all objects of tree

unselect all objects of tree

int GUI_tree1_childNr ( MemObj mo,
TreeNode it 
)

GUI_tree1_childNr get nr of childs of it

GUI_tree1_childNr get nr of childs of it

int GUI_tree1_lev ( MemObj mo,
TreeNode it 
)
get level of a node;
level=0=topNode; level=1 is a child of the topNode;
level=2 is a child of a child of the topNode.
level is the nr of ':'-chars in the treePosString;
"0"=0; "0:2"=1; "0:2:1"=2;
get level of a node;
level=0=topNode; level=1 is a child of the topNode;
level=2 is a child of a child of the topNode.
level is the nr of ':'-chars in the treePosString;
"0"=0; "0:2"=1; "0:2:1"=2;
int GUI_tree1_par ( TreeNode itPar,
MemObj mo,
TreeNode itChild 
)
get parentNode of node.
Retcode:
0 NO PARENT EXIST
else OK
get parentNode of node.
Retcode:
0 NO PARENT EXIST
else OK
int GUI_tree1_ndPos ( char *  ndPos,
MemObj mo,
TreeNode it 
)
get position of a node; returns string.
Output:
ndPos char[40]
returns string; eg "0" or "0:2" or "0:2:1" ..
nodeName: "0" first group
"0:0" first subObj of first group
get position of a node; returns string.
Output:
ndPos char[40]
returns string; eg "0" or "0:2" or "0:2:1" ..
nodeName: "0" first group
"0:0" first subObj of first group
int GUI_tree1_cmp_row ( MemObj mo,
TreeNode it1,
TreeNode it2 
)

compare 2 rows if identical;

compare 2 rows if identical;

int GUI_tree1_cbSel ( void *  selection,
MemObj  mo 
)

INTERNAL

INTERNAL

int GUI_tree1_cbMouse ( void *  parent,
void *  ev,
MemObj  mo 
)

INTERNAL

INTERNAL

int GUI_tree1_remove__ ( MemObj mo,
TreeNode it 
)

remove node it and its childs

remove node it and its childs

int GUI_tree1_clear ( MemObj mo)

clear whole tree

clear whole tree