gCAD3D 2.35
gui_gtk2/gtk_container.h File Reference

Go to the source code of this file.

Functions

MemObj GUI_frame__ (MemObj *o_par, char *ltxt, int border)
 
MemObj GUI_toolbox__ (MemObj *o_par)
 
MemObj GUI_toolbox_del (MemObj *mo)
 
MemObj GUI_notebook__ (MemObj *o_par, void *funcnam)
 
MemObj GUI_notebook_add (MemObj *o_ntb, char *title)
 
int GUI_notebook_get (MemObj *o_ntb)
 
void GUI_notebook_set (MemObj *o_ntb, int pgNr)
 
MemObj GUI_box_paned__ (MemObj *box1, MemObj *box2, MemObj *o_par, int mode, int resi, int siz1)
 
int GUI_notebook_CB (void *ntb, void *nbp, int pgNr, MemObj mo)
 

Function Documentation

MemObj GUI_frame__ ( MemObj o_par,
char *  ltxt,
int  border 
)
draws a frame around 1-n widgets. Parent & child must be a box.
ltxt no Text: set to NULL
border outside frame in pixels
Example:
w1 = GUI_box_h (&win, 1, "");
w2 = GUI_frame__ (&w1, "FrameTitel", 1);
w3 = GUI_box_h (&w2, "");
w_info = GUI_label__(&w3, "text", "");
draws a frame around 1-n widgets. Parent & child must be a box.
ltxt no Text: set to NULL
border outside frame in pixels
Example:
w1 = GUI_box_h (&win, 1, "");
w2 = GUI_frame__ (&w1, "FrameTitel", 1);
w3 = GUI_box_h (&w2, "");
w_info = GUI_label__(&w3, "text", "");
MemObj GUI_toolbox__ ( MemObj o_par)
GUI_toolbox__ removable container for widgets
parent and child must be a box.
Example:
tb = GUI_toolbar__ (&parentBox);
box0 = GUI_box_h (&tb, "");
GUI_button__ (&box0, ..);
GUI_set_show (&tb, 1);
hide / restore toolbox: GUI_set_show
GUI_toolbar__ can be used after activating its parent-window (GUI_Win_go)

GUI_toolbar__ removable container for widgets parent and child must be a box. From plugins remove toolbar with GUI_toolbox_del; in core can keep with GUI_set_show (&tb, 1);

Example: tb = GUI_toolbox__ (&parentBox); box0 = GUI_box_h (&tb, ""); GUI_button__ (&box0, ..); GUI_set_show (&tb, 1);

hide / restore toolbox: GUI_set_show

MemObj GUI_toolbox_del ( MemObj mo)
MemObj GUI_notebook__ ( MemObj o_par,
void *  funcnam 
)
Create a new Notebook.
Add Pages with GUI_notebook_add.
funcnam is called when noteBook-pages change; first Page has Nr 0.
Input:
o_par parentBox
funcnam callbackfunktion for noteBook-pages changes.
funcnam prototyp:
int funcnam (MemObj *mo, void **data);
// data=table of 2 pointers;
GUI_DATA_I1 = pageNumber
Example:
MemObj ntb, box1, box2;
ntb = GUI_notebook__ (&box, my_Notebook_CB);
box1 = GUI_notebook_add (&ntb, "Page 1");
box2 = GUI_notebook_add (&ntb, "Page 2");
..
int my_Notebook_CB (MemObj *mo, void **data) {
int iTyp;
if(GUI_DATA_EVENT == TYP_EventRelease) return 0; // skip disactivate
iTyp = GUI_OBJ_TYP (mo);
if(iTyp == TYP_GUI_Notebook)
printf(" page %d selected\n",GUI_DATA_I1);
}
}
change page:
GUI_notebook_set (&ntb, iPagNr);
Create a new Notebook.
Add Pages with GUI_notebook_add.
funcnam is called when noteBook-pages change; first Page has Nr 0.
Input:
o_par parentBox
funcnam callbackfunktion for noteBook-pages changes.
funcnam prototyp:
int funcnam (MemObj *mo, void **data);
// data=table of 2 pointers;
GUI_DATA_I1 = pageNumber
Example:
MemObj ntb, box1, box2;
ntb = GUI_notebook__ (&box, my_Notebook_CB);
box1 = GUI_notebook_add (&ntb, "Page 1");
box2 = GUI_notebook_add (&ntb, "Page 2");
..
int my_Notebook_CB (MemObj *mo, void **data) {
int iTyp;
if(GUI_DATA_EVENT == TYP_EventRelease) return 0; // skip disactivate
iTyp = GUI_OBJ_TYP (mo);
if(iTyp == TYP_GUI_Notebook)
printf(" page %d selected\n",GUI_DATA_I1);
}
}
change page:
GUI_notebook_set (&ntb, iPagNr);
MemObj GUI_notebook_add ( MemObj o_ntb,
char *  title 
)
create new page in Notebook.
returns a VBOX in the new Notebook-Page.
Notebook-Page cannot be disabled (all its widgets are disabled)
only hidden
create new page in Notebook.
returns a VBOX in the new Notebook-Page.
Notebook-Page cannot be disabled (all its widgets are disabled)
only hidden
int GUI_notebook_get ( MemObj o_ntb)

GUI_notebook_get query active page

GUI_notebook_get query active page

void GUI_notebook_set ( MemObj o_ntb,
int  pgNr 
)

activate notebook-page; first=0, next=1 ..

activate notebook-page; first=0, next=1 ..

MemObj GUI_box_paned__ ( MemObj box1,
MemObj box2,
MemObj o_par,
int  mode,
int  resi,
int  siz1 
)
GUI_box_paned__ get 2 boxes with movable separation-line
Input:
o_par parentBox
mode 0 = vertical separation-line, returns 2 horizontal boxes
1 = horizontal separation-line, returns 2 vertical boxes
resi 0 = make box1 fixed, box2 resizable
1 = make box1 resizable, box2 fixed.
siz1 initial size of box1 in pixels
Output:
box1
box2
GUI_box_paned__ get 2 boxes with movable separation-line
Input:
o_par parentBox
mode 0 = vertical separation-line, returns 2 horizontal boxes
1 = horizontal separation-line, returns 2 vertical boxes
resi 0 = make box1 fixed, box2 resizable
1 = make box1 resizable, box2 fixed.
siz1 initial size of box1 in pixels
Output:
box1
box2
int GUI_notebook_CB ( void *  ntb,
void *  nbp,
int  pgNr,
MemObj  mo 
)

INTERNAL callback of switch-notebook-page

INTERNAL callback of switch-notebook-page