gCAD3D 2.35
gui_gtk2/gtk_dlg_std.h File Reference

Go to the source code of this file.

Functions

int GUI_DialogEntry (char *label, char *entry, int eSiz, char *buttons[], int border)
 
int GUI_Dialog_2b (char *txt, char *tb1, char *tb2)
 
int GUI_Dialog_e2b (char *txt, char *entry, int eSiz, char *tb1, char *tb2)
 
int GUI_Color_select (int *ir, int *ig, int *ib)
 
MemObj GUI_Slider__ (MemObj *o_par, int typ, void *funcnam, double valMin, double valMax, double valStart, char *opts)
 
double GUI_Slider_get (MemObj *wsl1)
 
void GUI_Slider_set (MemObj *wsl1, double newVal)
 
int GUI_Slider_cb1 (void *parent, MemObj mo)
 
int GUI_Slider_cb2 (void *parent, void *ev, void *data)
 
int GUI_DialogEntryCB (void *parent, void **data)
 

Function Documentation

int GUI_DialogEntry ( char *  label,
char *  entry,
int  eSiz,
char *  buttons[],
int  border 
)
GUI_DialogEntry text, 1-n buttons; entry optional; waits for return.
Input
label text
entry userinput - defaultText; NULL = no userinput (only buttons)
eSiz size of inputfield entry (max. nr of chars)
buttons pointerarray of buttontext, NULL-terminated.
border size around button
Output:
entry content of inputfield on exit
eSiz nr of chars in inputfield entry
RetCod nr of button pressed or -1 = dialog cancelled
0 means first button pressed, 1=second ..
Example without entry:
char *buttons[]={"YES","NO","Cancel",NULL}, s1[256];
irc = GUI_DialogEntry ("Save model -", NULL, 0, buttons, 2);
// YES returns 0, NO returns 1, Cancel returns 2; X returns UI_FuncKill.
Example with entry:
strcpy (s1, "myName");
irc = GUI_DialogEntry ("GUI_DialogEntry", s1, 250, buttons, 2);
GUI_DialogEntry text, 1-n buttons; entry optional; waits for return.
Input
label text
entry userinput - defaultText; NULL = no userinput (only buttons)
eSiz size of inputfield entry (max. nr of chars)
buttons pointerarray of buttontext, NULL-terminated.
border size around button
Output:
entry content of inputfield on exit
eSiz nr of chars in inputfield entry
RetCod nr of button pressed or -1 = dialog cancelled
0 means first button pressed, 1=second ..
Example without entry:
char *buttons[]={"YES","NO","Cancel",NULL}, s1[256];
irc = GUI_DialogEntry ("Save model -", NULL, 0, buttons, 2);
// YES returns 0, NO returns 1, Cancel returns 2; X returns UI_FuncKill.
Example with entry:
strcpy (s1, "myName");
irc = GUI_DialogEntry ("GUI_DialogEntry", s1, 250, buttons, 2);
int GUI_Dialog_2b ( char *  txt,
char *  tb1,
char *  tb2 
)
GUI_Dialog_2b dialogWindow w. 2 Buttons, waiting.
Input
txt text label
tb1 caption button 1
tb2 caption button 2
RetCod nr of button pressed or UI_FuncKill (delete window)
0 means first button pressed, 1=second ..
-1 = dialog cancelled
GUI_Dialog_2b dialogWindow w. 2 Buttons, waiting.
Input
txt text label
tb1 caption button 1
tb2 caption button 2
RetCod nr of button pressed or UI_FuncKill (delete window)
0 means first button pressed, 1=second ..
-1 = dialog cancelled
int GUI_Dialog_e2b ( char *  txt,
char *  entry,
int  eSiz,
char *  tb1,
char *  tb2 
)
GUI_Dialog_e2b dialogWindow w. entry, 2 Buttons, waiting.
Input
txt label
entry entrytext, in & out
eSiz size of inputfield entry (max. nr of chars)
tb1 caption button 1
tb2 caption button 2
Output:
entry entrytext
RetCod nr of button pressed or UI_FuncKill (delete window)
0 means first button pressed, 1=second ..
-1 = dialog cancelled
GUI_Dialog_e2b dialogWindow w. entry, 2 Buttons, waiting.
Input
txt label
entry entrytext, in & out
eSiz size of inputfield entry (max. nr of chars)
tb1 caption button 1
tb2 caption button 2
Output:
entry entrytext
RetCod nr of button pressed or UI_FuncKill (delete window)
0 means first button pressed, 1=second ..
-1 = dialog cancelled
int GUI_Color_select ( int *  ir,
int *  ig,
int *  ib 
)
GUI_Color_select select-color-Dialog. Modal (wait).
Returns 3 colors as 16-bit-integers.
Returncode 0=OK; -1=cancel.
GUI_Color_select select-color-Dialog. Modal (wait).
Returns 3 colors as 16-bit-integers.
Returncode 0=OK; -1=cancel.
MemObj GUI_Slider__ ( MemObj o_par,
int  typ,
void *  funcnam,
double  valMin,
double  valMax,
double  valStart,
char *  opts 
)
GUI_Slider__ Slider = AdjustmentControl
Input:
parent parentBox
typ 0=horizontal, 1=vertical.
funcnam callBack-function for moving the slider; NULL = no callback.
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_EventMove
TYP_EventPress (left mousebutton)
GUI_DATA_D1 = *(double*)data[1] = slider-value (only TYP_EventMove)
Example without callback:
wsl1 = GUI_Slider__ (&box1, 0, NULL, 0., 1., 0.5, "8");
// query slider-value
printf(" sliVal=%f\n",GUI_Slider_get(&wsl1));
// change slider-value
GUI_Slider_set (&wsl1, 0.75);
Example with callback:
wsl1 = GUI_Slider__ (&box1, 0, sl_CB, 0., 1., 0.5, "8");
int sl_CB (MemObj *mo, void **data) {
printf("sl_CB %lf\n",GUI_DATA_D1); // slider-value as double
}
GUI_Slider__ Slider = AdjustmentControl
Input:
parent parentBox
typ 0=horizontal, 1=vertical.
funcnam callBack-function for moving the slider; NULL = no callback.
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_EventMove or
TYP_EventPress (left mousebutton)
GUI_DATA_D1 = *(double*)data[1] = slider-value (only TYP_EventMove)
Example without callback:
wsl1 = GUI_Slider__ (&box1, 0, NULL, 0., 1., 0.5, "8");
// query slider-value
printf(" sliVal=%f\n",GUI_Slider_get(&wsl1));
// change slider-value
GUI_Slider_set (&wsl1, 0.75);
Example with callback:
wsl1 = GUI_Slider__ (&box1, 0, sl_CB, 0., 1., 0.5, "8");
int sl_CB (MemObj *mo, void **data) {
if(GUI_DATA_EVENT == TYP_EventMove) {
printf("sl_CB %lf\n",GUI_DATA_D1); // slider-value as double
}
}
double GUI_Slider_get ( MemObj wsl1)

query slider-value

query slider-value

void GUI_Slider_set ( MemObj wsl1,
double  newVal 
)

change slider-value

change slider-value

int GUI_Slider_cb1 ( void *  parent,
MemObj  mo 
)

GUI_Slider_cb INTERNAL slider callback

GUI_Slider_cb INTERNAL slider callback

int GUI_Slider_cb2 ( void *  parent,
void *  ev,
void *  data 
)

GUI_Slider_cb2 INTERNAL slider callback

GUI_Slider_cb2 INTERNAL slider callback

int GUI_DialogEntryCB ( void *  parent,
void **  data 
)

INTERNAL callback of GUI_DialogEntry

INTERNAL callback of GUI_DialogEntry