gCAD3D 2.40
gui_gtk2/gtk_multichoice.h File Reference

Go to the source code of this file.

Functions

MemObj GUI_radiobutt__ (MemObj *o_par, char *ltxt, int ii, void *funcnam, void *data, char *siz)
 
int GUI_radiobutt_get (MemObj *mo)
 
void GUI_radiobutt_set (MemObj *mo)
 
int GUI_radiobutt_press (void *parent, MemObj mo)
 
int GUI_popup__ (char *optLst[], char *tipLst[], int itip, void *funcnam, void *dataLst[])
 
int GUI_popup_cb1 (void *parent, void *data)
 
int GUI_popup_cb2 (void *parent, void *event, void *data)
 
MemObj GUI_optmen__ (MemObj *o_par, char *mtxt, char *optLst[], char *tipLst[], void *funcnam, char *opts)
 
int GUI_optmen_set (MemObj *mo, int mode, void *data)
 
int GUI_optmen_chg (MemObj *mo, char *optLst[], char *tipLst[])
 
int GUI_optmen_go (void *parent, void *event, MemObj mo)
 
void GUI_optmen_pos (void *menu, int *x, int *y, int *ii, void *data)
 
void GUI_optmen_sel (void *parent, void *data)
 

Function Documentation

MemObj GUI_radiobutt__ ( MemObj o_par,
char *  ltxt,
int  ii,
void *  funcnam,
void *  data,
char *  siz 
)
* Radiobuttons.
* The callbackfunctions provides signal "activated" and "disactivated"
*
* Input:
* o_par parentBox
* ii 0=start new radioButtonChain; 1=add button to existing chain
* ltxt caption
* funcnam callback-function or NULL; returns data of selected RB
* data this data will be provided by the callback-function
* 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 prototyp:
* int funcnam (MemObj *mo, void **data);
* // data=table of 2 pointers;
* GUI_DATA_EVENT =*(int*)data[0]=TYP_EventPress|TYP_EventRelease
* GUI_DATA_I1=*(int*)data[1] or GUI_DATA_S1=(char*)data[1] user-data
*
* Example:
* GUI_RadButt__ (&box0, "button1", 0, cb_rb1, (void*)"rb1", "");
* GUI_RadButtAdd (&box0, "button2", 1, cb_rb1, (void*)"rb2", "");
* GUI_RadButtAdd (&box0, "button3", 1, cb_rb1, (void*)"rb3", "");
*
* int cb_rb1 (void *parent, void **data) {
* // skip disactivation
* if(GUI_DATA_EVENT == TYP_EventRelease) return 0;
* printf(" being activated: |%s|\n",GUI_DATA_S1;
* }
*
* activate: GUI_radiobutt_set
* check state: GUI_radiobutt_get
*
* Radiobuttons.
* The callbackfunctions provides signal "activated" and "disactivated"
*
* Input:
* o_par parentBox
* ii 0=start new radioButtonChain; 1=add button to existing chain
* ltxt caption
* funcnam callback-function or NULL; returns data of selected RB
* data this data will be provided by the callback-function
* 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 prototyp:
* int funcnam (MemObj *mo, void **data);
* // data=table of 2 pointers;
* GUI_DATA_EVENT =*(int*)data[0]=TYP_EventPress|TYP_EventRelease
* GUI_DATA_I1=*(int*)data[1] or GUI_DATA_S1=(char*)data[1] user-data
*
* Example:
* GUI_RadButt__ (&box0, "button1", 0, cb_rb1, (void*)"rb1", "");
* GUI_RadButtAdd (&box0, "button2", 1, cb_rb1, (void*)"rb2", "");
* GUI_RadButtAdd (&box0, "button3", 1, cb_rb1, (void*)"rb3", "");
*
* int cb_rb1 (void *parent, void **data) {
* // skip disactivation
* if(GUI_DATA_EVENT == TYP_EventRelease) return 0;
* printf(" being activated: |%s|\n",GUI_DATA_S1;
* }
*
* activate: GUI_radiobutt_set
* check state: GUI_radiobutt_get
*
int GUI_radiobutt_get ( MemObj mo)

test a radiobutton if it is active. 1=active, 0=not active.

test a radiobutton if it is active. 1=active, 0=not active.

void GUI_radiobutt_set ( MemObj mo)

set a radiobutton to state = active.

set a radiobutton to state = active.

int GUI_radiobutt_press ( void *  parent,
MemObj  mo 
)
* INTERNAL
* RadButt: activate UND disactivate
*
* INTERNAL
* RadButt: activate UND disactivate
*
int GUI_popup__ ( char *  optLst[],
char *  tipLst[],
int  itip,
void *  funcnam,
void *  dataLst[] 
)
* create popup-window with multiple-choice-comboBox.
*
* Inputs:
* optLst list of options (a menu)
* tipLst list of tooltips or NULL;
* itip 0=tooltips from tipLst, 1=tooltips from dataLst (using MSG_Tip)
* funcnam callback-function (provides the Enter,Leave,Select-events)
* dataLst (void**) get this (static) data from the callbackfunktion;
* NULL for none
*
* prototyp funcnam:
* int funcnam (void *parent, void **data);
* // data=table of 2 pointers;
* GUI_DATA_EVENT =*(int*)data[0]=TYP_EventEnter|TYP_EventLeave|
* TYP_EventPress selection
* TYP_EventUnmap cancel menu, no selection
* GUI_DATA_I1 =*(int*)data[1]=line-nr; first is 0 (TYP_EventPress)
* GUI_DATA_S2 =(char*)data[2] user-data of selected item (TYP_EventPress)
*
* Example:
* char *popTxt[]={"txt pop1", "txt pop2", "txt pop3", NULL};
* char *popTip[]={"tip pop1", "tip pop2", "tip pop3", NULL};
* static char *popDat[]={"pop1", "pop2", "pop3", NULL};
*
* GUI_popup__ (popTxt, popTip, 0, CB_popup, popDat);
*
* int CB_popup (void *parent, void **data) {
* // callback popup-window
* int iEv, lNr;
* // printf("cb_pop1 event=%d device=%d lNr=%d\n",
* // GUI_DATA_EVENT, *(int*)data[0] TYP_EventEnter cursor over menu-item
* // TYP_EventLeave leave menu-item
* // TYP_EventPress selection
* // TYP_EventUnmap cancel menu
* // GUI_DATA_I1, *(int*)data[1] line-nr of selected menu-item
* // GUI_DATA_S2); (char*)data[2] text of selected menu-item
* lNr = GUI_DATA_I1;
* if(iEv == TYP_EventEnter) printf(" enter popup-%d\n",lNr);
* if(iEv == TYP_EventLeave) printf(" leave popup-%d\n",lNr);
* if(iEv == TYP_EventPress) printf(" select popup-%d\n",lNr);
*
*
* create popup-window with multiple-choice-comboBox.
*
* Inputs:
* optLst list of options (a menu)
* tipLst list of tooltips or NULL;
* itip 0=tooltips from tipLst, 1=tooltips from dataLst (using MSG_Tip)
* funcnam callback-function (provides the Enter,Leave,Select-events)
* dataLst (void**) get this (static) data from the callbackfunktion;
* NULL for none
*
* prototyp funcnam:
* int funcnam (void *parent, void **data);
* // data=table of 2 pointers;
* GUI_DATA_EVENT =*(int*)data[0]=TYP_EventEnter|TYP_EventLeave|
* TYP_EventPress selection
* TYP_EventMap no selection
* TYP_EventUnmap cancel menu, no selection
* GUI_DATA_I1 =*(int*)data[1]=line-nr; first is 0 (TYP_EventPress)
* GUI_DATA_S2 =(char*)data[2] user-data of selected item (TYP_EventPress)
*
* Example:
* char *popTxt[]={"txt pop1", "txt pop2", "txt pop3", NULL};
* char *popTip[]={"tip pop1", "tip pop2", "tip pop3", NULL};
* static char *popDat[]={"pop1", "pop2", "pop3", NULL};
*
* GUI_popup__ (popTxt, popTip, 0, CB_popup, popDat);
*
* int CB_popup (void *parent, void **data) {
* // callback popup-window
* int iEv, lNr;
* // printf("cb_pop1 event=%d device=%d lNr=%d\n",
* // GUI_DATA_EVENT, *(int*)data[0] TYP_EventEnter cursor over menu-item
* // TYP_EventLeave leave menu-item
* // TYP_EventPress selection
* // TYP_EventUnmap cancel menu
* // GUI_DATA_I1, *(int*)data[1] line-nr of selected menu-item
* // GUI_DATA_S2); (char*)data[2] text of selected menu-item
* lNr = GUI_DATA_I1;
* if(iEv == TYP_EventEnter) printf(" enter popup-%d\n",lNr);
* if(iEv == TYP_EventLeave) printf(" leave popup-%d\n",lNr);
* if(iEv == TYP_EventPress) printf(" select popup-%d\n",lNr);
*
*
int GUI_popup_cb1 ( void *  parent,
void *  data 
)

INTERNAL callback of GUI_Popup

INTERNAL callback of GUI_Popup

int GUI_popup_cb2 ( void *  parent,
void *  event,
void *  data 
)

INTERNAL unmap popup-window callback

INTERNAL unmap popup-window callback

MemObj GUI_optmen__ ( MemObj o_par,
char *  mtxt,
char *  optLst[],
char *  tipLst[],
void *  funcnam,
char *  opts 
)
* GUI_OptMen__ option-menu (combo-box)
* disactivation with GUI_optmen_set (do not use GUI_set_enable)
*
* Input:
* o_par parentBox
* mtxt primary labeltext
* optLst items; a null-terminated list of words (must not be static)
* tipLst list of tooltips or NULL.
* funcnam callback-function for selection (returns lNr & selected text)
* 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 3 pointers;
* GUI_DATA_EVENT =*(int*)data[0]=TYP_EventPress selection
* GUI_DATA_I1 =*(int*)data[1]=line-nr; first is 0
* GUI_DATA_S2 =(char*)data[2]=text of selected menu-item
*
*
* Example:
* static GIO_OptMen om1;
* char *optLst[]={"Jaenner","Februar","Maerz",NULL};
*
* GUI_OptMen__ (&om1, box0, optLst, NULL, OptMen_CB, "");
* ..
* int OptMen_CB (void *parent, void **data) {
* printf("OptMen_CB sel. Line = %d |%s|\n",GUI_DATA_I1,GUI_DATA_S2);
* GUI_OptMenSet (parent, 1, GUI_DATA_S2); // change text of basic item
* return 0;
* }
*
* GUI_OptMen__ option-menu (combo-box)
* disactivation with GUI_optmen_set (do not use GUI_set_enable)
*
* Input:
* o_par parentBox
* mtxt primary labeltext
* optLst items; a null-terminated list of words (must not be static)
* tipLst list of tooltips or NULL.
* funcnam callback-function for selection (returns lNr & selected text)
* 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 3 pointers;
* GUI_DATA_EVENT =*(int*)data[0]=TYP_EventPress selection
* GUI_DATA_I1 =*(int*)data[1]=line-nr; first is 0
* GUI_DATA_S2 =(char*)data[2]=text of selected menu-item
*
*
* Example:
* static GIO_OptMen om1;
* char *optLst[]={"Jaenner","Februar","Maerz",NULL};
*
* GUI_optmen__ (&om1, box0, optLst, NULL, OptMen_CB, "");
* ..
* int OptMen_CB (void *parent, void **data) {
* printf("GUI_optmen__ sel. Line = %d |%s|\n",GUI_DATA_I1,GUI_DATA_S2);
* GUI_OptMenSet (parent, 1, GUI_DATA_S2); // change text of basic item
* return 0;
* }
*
int GUI_optmen_set ( MemObj mo,
int  mode,
void *  data 
)
* GUI_OptMenSet modify the basic option-menu-item
* Input:
* mo the option-menu
* mode 1=set background-color=activated;
* 0=set to standard background-color, normal.
* 2=disactivate
* 3=reactivate
* data text to display; NULL=do not change.
*
* Example see GUI_OptMen__
*
* GUI_OptMenSet modify the basic option-menu-item
* Input:
* mo the option-menu
* mode 1=set background-color=activated;
* 0=set to standard background-color, normal.
* 2=disactivate
* 3=reactivate
* data text to display; NULL=do not change.
*
* Example see GUI_OptMen__
*
int GUI_optmen_chg ( MemObj mo,
char *  optLst[],
char *  tipLst[] 
)

GUI_optmen_chg populate / Change the menu of existing OptionMenu.

GUI_optmen_chg populate / Change the menu of existing OptionMenu.

int GUI_optmen_go ( void *  parent,
void *  event,
MemObj  mo 
)
* INTERNAL callback selection OptionMenu
* activate & place popup (OptionMenu).
*
* INTERNAL callback selection OptionMenu
* activate & place popup (OptionMenu).
*
void GUI_optmen_pos ( void *  menu,
int *  x,
int *  y,
int *  ii,
void *  data 
)

INTERNAL callback OptionMenu - set the position of the popup

INTERNAL callback OptionMenu - set the position of the popup

void GUI_optmen_sel ( void *  parent,
void *  data 
)

INTERNAL; see GUI_popup_cb1

INTERNAL; see GUI_popup_cb1