gCAD3D 2.35
gui_gtk2/gtk_lists.h File Reference

Go to the source code of this file.

Functions

MemObj GUI_list1__ (MemObj *o_par, char *fNam, char *mode, char *titLst[], void *funcnam, char *opts)
 
MemObj GUI_list2__ (MemObj *o_par, char *fNam, char *mode, char *titLst[], void *funcnam, char *opts)
 
int GUI_list1_clear (MemObj *mo)
 
int GUI_list1_add_f (MemObj *mo, char *fNam, char *mode)
 
int GUI_list2_add_f (MemObj *mo, char *fNam, char *mode)
 
int GUI_list1_h2__ (char *titP, char *titC, char *lButP, char *txtP, char *fnamP, void *funcP, void *funcC, char *opts)
 
int GUI_list1_dlg_w (char *sels, int sSiz, void *parWin, char *winTit, char *fNam, char *mode, char *titLst[], char *opts)
 
int GUI_list1_dlg__ (MemObj *o_par, char *winTit, char *fNam, char *mode, char *titLst[], void *funcnam, char *opts)
 
void GUI_list1_dlg_del ()
 
int GUI_list1_dlg_cbw (Obj_gui2 *go, void **data)
 
int GUI_list1_del (void *parent, void *data)
 
int GUI_list1_cbSel (void *selection, MemObj mo)
 
int GUI_list1_cbMouse (void *parent, void *event, MemObj mo)
 
int GUI_list1_cbKey (void *parent, void *event, MemObj mo)
 
int GUI_list1_f (void *list_store, char *fnam, char *mode)
 
int GUI_list1_cbw (void *parent, void **data)
 

Function Documentation

MemObj GUI_list1__ ( MemObj o_par,
char *  fNam,
char *  mode,
char *  titLst[],
void *  funcnam,
char *  opts 
)
list from file; 1 or 2 columns; callback.
Values may not have blanks.
File with 2 columns: value1 - a single blank - value2
Input:
o_par parentBox
fNam filename of list to display; mode=nr of words per line
mode "1" selection returns 1 word;
"2" selection returns 2 words;
titLst 1 or 2 headertitles; NULL = none
funcnam callback - returns the selected line (as list of words)
opts options; (HorSiz,VertSiz)
HorSiz,VertSiz: size in characters; default is automatic size.
'e' = expand widget; default is fixed size.
negative values: size in pixels.
Examples: "" or "10" or "10e,e"
"10e,e" horiz. size 10 chars, hor. and vert. expandable.
funcnam prototype:
int funcnam (void *parent, void **data);
// data=table of 5 pointers;
0=TYP_EventPress|TYP_EventEnter GUI_DATA_EVENT
1=mouseButtonNr or keyCode GUI_DATA_I1
2=colNr(1|2) GUI_DATA_I2
3=sel.Text col.1 GUI_DATA_S3
4=sel.Text col.2 (only if colNr=2) GUI_DATA_S4
Cursorkeys (up,down), page-keys (up,down) provide a usercall of type
TYP_EventEnter; GUI_DATA_I1 gives the keyCode (eg GUI_KeyCurUp)
MousButtonClicks provide a usercall of type TYP_EventPress;
GUI_DATA_I1 gives the mouseButtonNr (GUI_MouseL|GUI_MouseM|GUI_MouseR)
DoubleClick provides 3 userCalls of type TYP_EventPress; first and second
with GUI_MouseL, the third call with GUI_Mouse2L.
The Enter-key provides a usercall of type TYP_EventPress;
GUI_DATA_I1 = GUI_Mouse2L
Example:
GUI_list1__ (Box, "list2.dat", "2", NULL, cb_list_sel, "60,10");
printf(" mouseButtNr=%d selColNr=%d\n",GUI_DATA_I1,GUI_DATA_I2);
printf(" txt sel |%s|%s|\n",GUI_DATA_S3,GUI_DATA_S4);
}
Example with titles:
char *tiTab[] = {"ID","Value"};
GUI_list1__ (Box, "list2.dat", "2", tiTab, cbl, "");
list from file; 1 or 2 columns; callback.
Values may not have blanks.
File with 2 columns: value1 - a single blank - value2
Input:
o_par parentBox
fNam filename of list to display; mode=nr of words per line
mode "1" selection returns 1 word;
"2" selection returns 2 words;
titLst 1 or 2 headertitles; NULL = none
funcnam callback - returns the selected line (as list of words)
opts options; (HorSiz,VertSiz)
HorSiz,VertSiz: size in characters; default is automatic size.
'e' = expand widget; default is fixed size.
negative values: size in pixels.
Examples: "" or "10" or "10e,e"
"10e,e" horiz. size 10 chars, hor. and vert. expandable.
funcnam prototype:
int funcnam (void *parent, void **data);
// data=table of 5 pointers;
0=TYP_EventPress|TYP_EventEnter GUI_DATA_EVENT
1=mouseButtonNr or keyCode GUI_DATA_I1
2=colNr(1|2) GUI_DATA_I2
3=sel.Text col.1 GUI_DATA_S3
4=sel.Text col.2 (only if colNr=2) GUI_DATA_S4
Cursorkeys (up,down), page-keys (up,down) provide a usercall of type
TYP_EventEnter; GUI_DATA_I1 gives the keyCode (eg GUI_KeyCurUp)
MousButtonClicks provide a usercall of type TYP_EventPress;
GUI_DATA_I1 gives the mouseButtonNr (GUI_MouseL|GUI_MouseM|GUI_MouseR)
DoubleClick provides 3 userCalls of type TYP_EventPress; first and second
with GUI_MouseL, the third call with GUI_Mouse2L.
The Enter-key provides a usercall of type TYP_EventPress;
GUI_DATA_I1 = GUI_Mouse2L
Example:
GUI_list1__ (Box, "list2.dat", "2", NULL, cb_list_sel, "60,10");
printf(" mouseButtNr=%d selColNr=%d\n",GUI_DATA_I1,GUI_DATA_I2);
printf(" txt sel |%s|%s|\n",GUI_DATA_S3,GUI_DATA_S4);
}
Example with titles:
char *tiTab[] = {"ID","Value"};
GUI_list1__ (Box, "list2.dat", "2", tiTab, cbl, "");
MemObj GUI_list2__ ( MemObj o_par,
char *  fNam,
char *  mode,
char *  titLst[],
void *  funcnam,
char *  opts 
)
list from file; 2 or 3 columns; callback.
Values may have blanks ..
Fileformat: csv ..
Input:
o_par parentBox
fNam filename of list to display; mode=nr of vals; NULL = none.
mode "2" selection returns 2 words;
"3" selection returns 3 words;
titLst 2 or 3 headertitles or NULL = no headers
funcnam callback - returns the selected line (as list of words)
opts options; (HorSiz,VertSiz)
HorSiz,VertSiz: size in characters; default is automatic size.
negative values: size in pixels.
'e' = expand widget; default is fixed size.
Examples: "" or "10" or "10e,e"
"10e,e" horiz. size 10 chars, hor. and vert. expandable.
funcnam prototype:
int funcnam (void *parent, void **data);
// data=table of 5 pointers;
0=TYP_EventPress|TYP_EventEnter GUI_DATA_EVENT
1=mouseButtonNr or keyCode GUI_DATA_I1
2=colNr(1|2) GUI_DATA_I2
3=sel.Text col.1 GUI_DATA_S3
4=sel.Text col.2 (only if colNr=2) GUI_DATA_S4
5=sel.Text col.2 (only if colNr=3) GUI_DATA_S5
Cursorkeys (up,down), page-keys (up,down) provide a usercall of type
TYP_EventEnter; GUI_DATA_I1 gives the keyCode (eg GUI_KeyCurUp)
MousButtonClicks or the Enter-key provide a usercall of type TYP_EventPress;
GUI_DATA_I1 gives the mouseButtonNr (1|2|3) or DoubleClick (4) or
ReturnKey (13).
DoubleClick provides 3 userCalls of type TYP_EventPress; first and second
with mouseButton 1, the third call with mouseButton=4.
Example:
GUI_list2__ (Box, "list3.csv", "3", NULL, cb_list_sel, "60,10");
..
int cb_list_sel (MemObj *mo, void **data) {
printf(" mouseButtNr=%d selColNr=%d\n",GUI_DATA_I1,GUI_DATA_I2);
printf(" txt sel |%s|%s|%s|\n",GUI_DATA_S3,GUI_DATA_S4,GUI_DATA_S5);
}
Example with titles:
char *tiTab[] = {"ID","Value","Info"};
GUI_list2__ (Box, "list2.dat", "3", tiTab, cbl, "60,10");
list from file; 2 or 3 columns; callback.
Values may have blanks ..
Fileformat: csv ..
Input:
o_par parentBox
fNam filename of list to display; mode=nr of vals; NULL = none.
mode "2" selection returns 2 words;
"3" selection returns 3 words;
titLst 2 or 3 headertitles or NULL = no headers
funcnam callback - returns the selected line (as list of words)
opts options; (HorSiz,VertSiz)
HorSiz,VertSiz: size in characters; default is automatic size.
negative values: size in pixels.
'e' = expand widget; default is fixed size.
Examples: "" or "10" or "10e,e"
"10e,e" horiz. size 10 chars, hor. and vert. expandable.
funcnam prototype:
int funcnam (void *parent, void **data);
// data=table of 5 pointers;
0=TYP_EventPress|TYP_EventEnter GUI_DATA_EVENT
1=mouseButtonNr or keyCode GUI_DATA_I1
2=colNr(1|2) GUI_DATA_I2
3=sel.Text col.1 GUI_DATA_S3
4=sel.Text col.2 (only if colNr=2) GUI_DATA_S4
5=sel.Text col.2 (only if colNr=3) GUI_DATA_S5
Cursorkeys (up,down), page-keys (up,down) provide a usercall of type
TYP_EventEnter; GUI_DATA_I1 gives the keyCode (eg GUI_KeyCurUp)
MousButtonClicks or the Enter-key provide a usercall of type TYP_EventPress;
GUI_DATA_I1 gives the mouseButtonNr (1|2|3) or DoubleClick (4) or
ReturnKey (13).
DoubleClick provides 3 userCalls of type TYP_EventPress; first and second
with mouseButton 1, the third call with mouseButton=4.
Example:
GUI_list2__ (Box, "list3.csv", "3", NULL, cb_list_sel, "60,10");
..
int cb_list_sel (MemObj *mo, void **data) {
printf(" mouseButtNr=%d selColNr=%d\n",GUI_DATA_I1,GUI_DATA_I2);
printf(" txt sel |%s|%s|%s|\n",GUI_DATA_S3,GUI_DATA_S4,GUI_DATA_S5);
}
Example with titles:
char *tiTab[] = {"ID","Value","Info"};
GUI_list2__ (Box, "list2.dat", "3", tiTab, cbl, "60,10");
int GUI_list1_clear ( MemObj mo)
int GUI_list1_add_f ( MemObj mo,
char *  fNam,
char *  mode 
)
add lines from file to list
fNam filename of list to display; mode=nr of words per line
mode "1" selection returns 1 word;
"2" selection returns 2 words;
add lines from file to list
fNam filename of list to display; mode=nr of words per line
mode "1" selection returns 1 word;
"2" selection returns 2 words;
int GUI_list2_add_f ( MemObj mo,
char *  fNam,
char *  mode 
)
add lines from file to list
fNam filename of list to display; mode=nr of words per line
mode "1" selection returns 1 word;
"2" selection returns 2 words;
add lines from file to list
fNam filename of list to display; mode=nr of words per line
mode "1" selection returns 1 word;
"2" selection returns 2 words;
int GUI_list1_h2__ ( char *  titP,
char *  titC,
char *  lButP,
char *  txtP,
char *  fnamP,
void *  funcP,
void *  funcC,
char *  opts 
)
make hierarchical SelectList. Select childObject or
select "Parents" with "<<--" -Button.
selecting parents-button changes childList -> parentList
selecting parentObject gets new childList by calling funcP
selecting childObject exits (provides parentText and childText by funcC)
Input:
titP titletext for selection of parent
titC titletext for selection of child
lButP caption parents-button
txtP active parent
fnamP Name of file for parents
funcP user has selected a parent; create childlist from selected parent.
funcC user has selected a child; exit and report selection -> user.
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:
RetCod:
1 - destroy HList;
0 - keep HList.
-2 file fnamP does not exist
funcP (char *fnamC, char *parentTxt) {}
funcC (char *parentTxt, char *childtxt) {}
make hierarchical SelectList. Select childObject or
select "Parents" with "<<--" -Button.
selecting parents-button changes childList -> parentList
selecting parentObject gets new childList by calling funcP
selecting childObject exits (provides parentText and childText by funcC)
the name of file with childs is the 1. parameter of funcP
Input:
titP titletext for selection of parent
titC titletext for selection of child
lButP caption parents-button
txtP active parent
fnamP Name of file with parents
funcP user has selected a parent; create childlist from selected parent.
funcC user has selected a child; exit and report selection -> user.
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:
RetCod:
1 - destroy HList;
0 - keep HList.
-2 file fnamP does not exist
funcP (char *fnamC, char *parentTxt) {}
funcC (char *parentTxt, char *childtxt) {}
int GUI_list1_dlg_w ( char *  sels,
int  sSiz,
void *  parWin,
char *  winTit,
char *  fNam,
char *  mode,
char *  titLst[],
char *  opts 
)
GUI_list1_dlg_w list from file in a new window, waiting.
Inputs:
sSiz size of sels in characters
parWin, parent-window; NULL for primary window
winTit window-title
fNam filename of list to display; mode=nr of words per line
mode "1" selection returns 1 word;
"2" selection returns 2 words;
titLst 1 or 2 headertitles; NULL = none
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:
sels selected string, 1 or 2 words, separated by \n
RetCod: 0 OK, data valid
-1 cancelled by user
TODO:
add option filter to GUI_List
GUI_list1_dlg_w list from file in a new window, waiting.
Inputs:
sSiz size of sels in characters
parWin, parent-window; NULL for primary window
winTit window-title
fNam filename of list to display; mode=nr of words per line
mode "1" selection returns 1 word;
"2" selection returns 2 words;
titLst 1 or 2 headertitles; NULL = none
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:
sels selected string, 1 or 2 words, separated by \n
RetCod: 0 OK, data valid
-1 cancelled by user
TODO:
add option filter to GUI_List
int GUI_list1_dlg__ ( MemObj o_par,
char *  winTit,
char *  fNam,
char *  mode,
char *  titLst[],
void *  funcnam,
char *  opts 
)
GUI_list1_dlg__ list from file in a new window, modal, callback.
Inputs:
o_par parent-window; NULL for primary window
winTit window-title
fNam filename of list to display; mode=nr of words per line
mode "1" selection returns 1 word;
"2" selection returns 2 words;
titLst 1 or 2 headertitles; NULL = none
funcnam callback-function of selection
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.
funcnam prototype:
int funcnam (MemObj *mo, void **data);
// data=table of 5 pointers;
0=TYP_EventPress|TYP_EventExit GUI_DATA_EVENT
1=mousButtonNr(1|2|3) GUI_DATA_I1
2=colNr(1|2) GUI_DATA_I2
3=sel.Text col.1; GUI_DATA_S3
4=sel.Text col.2 (only if colNr=2) GUI_DATA_S4
TYP_EventExit is returned from cancel list; no further data.
Example see GUI_list1__
GUI_list1_dlg__ list from file in a new window, modal, callback.
Inputs:
o_par parent-window; NULL for primary window
winTit window-title
fNam filename of list to display; mode=nr of words per line
mode "1" selection returns 1 word;
"2" selection returns 2 words;
titLst 1 or 2 headertitles; NULL = none
funcnam callback-function of selection
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.
funcnam prototype:
int funcnam (MemObj *mo, void **data);
// data=table of 5 pointers;
0=TYP_EventPress|TYP_EventExit GUI_DATA_EVENT
1=mousButtonNr(1|2|3) GUI_DATA_I1
2=colNr(1|2) GUI_DATA_I2
3=sel.Text col.1; GUI_DATA_S3
4=sel.Text col.2 (only if colNr=2) GUI_DATA_S4
TYP_EventExit is returned from cancel list; no further data.
Example see GUI_list1__
void GUI_list1_dlg_del ( )

GUI_list1_dlg_del delete list-window GUI_list1_dlg

GUI_list1_dlg_del delete list-window GUI_list1_dlg

int GUI_list1_dlg_cbw ( Obj_gui2 go,
void **  data 
)
INTERNAL
INTERNAL
int GUI_list1_del ( void *  parent,
void *  data 
)
int GUI_list1_cbSel ( void *  selection,
MemObj  mo 
)
GUI_list1_cbSel INTERNAL callback list selection (list1 & list2)
sig changed: from mouse-select, key-blank, key-PageDwn !
isel always 0
calls user with 0=TYP_EventPress|TYP_EventEnter GUI_DATA_EVENT
1=mousButtonNr(1|2|3)Return(13) GUI_DATA_I1
2=columnNr(1|2|3) GUI_DATA_I2
3=sel.Text column.1; GUI_DATA_S3
4=sel.Text col.2 (only if colNr=2) GUI_DATA_S4
5=sel.Text col.3 (only if colNr=3) GUI_DATA_S5
GUI_list1_cbSel INTERNAL callback list selection (list1 & list2)
sig changed: from mouse-select, key-blank, key-PageDwn !
isel always 0
calls user with 0=TYP_EventPress|TYP_EventEnter GUI_DATA_EVENT
1=mousButtonNr(1|2|3)Return(13) GUI_DATA_I1
2=columnNr(1|2|3) GUI_DATA_I2
3=sel.Text column.1; GUI_DATA_S3
4=sel.Text col.2 (only if colNr=2) GUI_DATA_S4
5=sel.Text col.3 (only if colNr=3) GUI_DATA_S5
int GUI_list1_cbMouse ( void *  parent,
void *  event,
MemObj  mo 
)
INTERNAL
INTERNAL
int GUI_list1_cbKey ( void *  parent,
void *  event,
MemObj  mo 
)
INTERNAL
INTERNAL
int GUI_list1_f ( void *  list_store,
char *  fnam,
char *  mode 
)

GUI_list1_f INTERNAL populate list 1 or 2 columns from file (sep = blank)

GUI_list1_f INTERNAL populate list
1 or 2 columns from file (sep = blank)
int GUI_list1_cbw ( void *  parent,
void **  data 
)