Max 5 API Reference
A box in the patcher. More...
![]() |
Data Structures | |
struct | t_jboxdrawparams |
The t_jboxdrawparams structure. More... | |
Defines | |
#define | JBOX_DRAWFIRSTIN (1<<0) |
draw first inlet | |
#define | JBOX_NODRAWBOX (1<<1) |
don't draw the frame | |
#define | JBOX_DRAWINLAST (1<<2) |
draw inlets after update method | |
#define | JBOX_TRANSPARENT (1<<3) |
don't make transparent unless you need it (for efficiency) | |
#define | JBOX_NOGROW (1<<4) |
don't even draw grow thingie | |
#define | JBOX_GROWY (1<<5) |
can grow in y direction by dragging | |
#define | JBOX_GROWBOTH (1<<6) |
can grow independently in both x and y | |
#define | JBOX_IGNORELOCKCLICK (1<<7) |
box should ignore a click if patcher is locked | |
#define | JBOX_HILITE (1<<8) |
flag passed to jbox_new() to tell max that the UI object can receive the focus when clicked on -- may be replaced by JBOX_FOCUS in the future | |
#define | JBOX_BACKGROUND (1<<9) |
immediately set box into the background | |
#define | JBOX_NOFLOATINSPECTOR (1<<10) |
no floating inspector window | |
#define | JBOX_TEXTFIELD (1<<11) |
save/load text from textfield, unless JBOX_BINBUF flag is set | |
#define | JBOX_FIXWIDTH (1<<19) |
give the box a textfield based fix-width (bfixwidth) method | |
#define | JBOX_FONTATTR (1<<18) |
if you want font related attribute you must add this to jbox_initclass() | |
#define | JBOX_BINBUF (1<<14) |
save/load text from b_binbuf | |
#define | JBOX_MOUSEDRAGDELTA (1<<12) |
hides mouse cursor in drag and sends mousedragdelta instead of mousedrag (for infinite scrolling like number) | |
#define | JBOX_COLOR (1<<13) |
support the "color" method for color customization | |
#define | JBOX_DRAWIOLOCKED (1<<15) |
draw inlets and outlets when locked (default is not to draw them) | |
#define | JBOX_DRAWBACKGROUND (1<<16) |
set to have box bg filled in for you based on getdrawparams method or brgba attribute | |
#define | JBOX_NOINSPECTFIRSTIN (1<<17) |
flag for objects such as bpatcher that have a different b_firstin, | |
#define | JBOX_DEFAULTNAMES (1<<18) |
flag instructing jbox_new to attach object to the defaults object for live defaults updating | |
#define | JBOX_FOCUS (1<<20) |
more advanced focus support (passed to jbox_initclass() to add "nextfocus" and "prevfocus" attributes to the UI object). Not implemented as of 2009-05-11 | |
Enumerations | |
enum | { JBOX_FONTFACE_REGULAR = 0, JBOX_FONTFACE_BOLD = 1, JBOX_FONTFACE_ITALIC = 2, JBOX_FONTFACE_BOLDITALIC = 3 } |
actual numerical values of the b_fontface attribute; use jbox_fontface() to weight More... | |
enum | HitTestResult { HitNothing = 0, HitBox = 1, HitInlet = 2, HitOutlet = 3, HitGrowBox = 4, HitLine = 5 } |
enumerations used for box decorators More... | |
Functions | |
t_max_err | jbox_get_rect_for_view (t_object *box, t_object *patcherview, t_rect *rect) |
Find the rect for a box in a given patcherview. | |
t_max_err | jbox_set_rect_for_view (t_object *box, t_object *patcherview, t_rect *rect) |
Change the rect for a box in a given patcherview. | |
t_max_err | jbox_get_rect_for_sym (t_object *box, t_symbol *which, t_rect *pr) |
Find the rect for a box with a given attribute name. | |
t_max_err | jbox_set_rect_for_sym (t_object *box, t_symbol *which, t_rect *pr) |
Change the rect for a box with a given attribute name. | |
t_max_err | jbox_set_rect (t_object *box, t_rect *pr) |
Set both the presentation rect and the patching rect. | |
t_max_err | jbox_get_patching_rect (t_object *box, t_rect *pr) |
Retrieve the patching rect of a box. | |
t_max_err | jbox_set_patching_rect (t_object *box, t_rect *pr) |
Change the patching rect of a box. | |
t_max_err | jbox_get_presentation_rect (t_object *box, t_rect *pr) |
Retrieve the presentation rect of a box. | |
t_max_err | jbox_set_presentation_rect (t_object *box, t_rect *pr) |
Change the presentation rect of a box. | |
t_max_err | jbox_set_position (t_object *box, t_pt *pos) |
Set the position of a box for both the presentation and patching views. | |
t_max_err | jbox_get_patching_position (t_object *box, t_pt *pos) |
Fetch the position of a box for the patching view. | |
t_max_err | jbox_set_patching_position (t_object *box, t_pt *pos) |
Set the position of a box for the patching view. | |
t_max_err | jbox_get_presentation_position (t_object *box, t_pt *pos) |
Fetch the position of a box for the presentation view. | |
t_max_err | jbox_set_presentation_position (t_object *box, t_pt *pos) |
Set the position of a box for the presentation view. | |
t_max_err | jbox_set_size (t_object *box, t_size *size) |
Set the size of a box for both the presentation and patching views. | |
t_max_err | jbox_get_patching_size (t_object *box, t_size *size) |
Fetch the size of a box for the patching view. | |
t_max_err | jbox_set_patching_size (t_object *box, t_size *size) |
Set the size of a box for the patching view. | |
t_max_err | jbox_get_presentation_size (t_object *box, t_size *size) |
Fetch the size of a box for the presentation view. | |
t_max_err | jbox_set_presentation_size (t_object *box, t_size *size) |
Set the size of a box for the presentation view. | |
t_symbol * | jbox_get_maxclass (t_object *b) |
Retrieve the name of the class of the box's object. | |
t_object * | jbox_get_object (t_object *b) |
Retrieve a pointer to the box's object. | |
t_object * | jbox_get_patcher (t_object *b) |
Retrieve a box's patcher. | |
char | jbox_get_hidden (t_object *b) |
Retrieve a box's 'hidden' attribute. | |
t_max_err | jbox_set_hidden (t_object *b, char c) |
Set a box's 'hidden' attribute. | |
t_symbol * | jbox_get_fontname (t_object *b) |
Retrieve a box's 'fontname' attribute. | |
t_max_err | jbox_set_fontname (t_object *b, t_symbol *ps) |
Set a box's 'fontname' attribute. | |
double | jbox_get_fontsize (t_object *b) |
Retrieve a box's 'fontsize' attribute. | |
t_max_err | jbox_set_fontsize (t_object *b, double d) |
Set a box's 'fontsize' attribute. | |
t_max_err | jbox_get_color (t_object *b, t_jrgba *prgba) |
Retrieve a box's 'color' attribute. | |
t_max_err | jbox_set_color (t_object *b, t_jrgba *prgba) |
Set a box's 'color' attribute. | |
t_symbol * | jbox_get_hint (t_object *b) |
Retrieve a box's hint text as a symbol. | |
t_max_err | jbox_set_hint (t_object *b, t_symbol *s) |
Set a box's hint text using a symbol. | |
char * | jbox_get_hintstring (t_object *bb) |
Retrieve a box's hint text as a C-string. | |
void | jbox_set_hintstring (t_object *bb, char *s) |
Set a box's hint text using a C-string. | |
char * | jbox_get_annotation (t_object *bb) |
Retrieve a box's annotation string, if the user has given it an annotation. | |
void | jbox_set_annotation (t_object *bb, char *s) |
Set a box's annotation string. | |
t_object * | jbox_get_nextobject (t_object *b) |
The next box in the patcher's (linked) list of boxes. | |
t_object * | jbox_get_prevobject (t_object *b) |
The previous box in the patcher's (linked) list of boxes. | |
t_symbol * | jbox_get_varname (t_object *b) |
Retrieve a box's scripting name. | |
t_max_err | jbox_set_varname (t_object *b, t_symbol *ps) |
Set a box's scripting name. | |
t_symbol * | jbox_get_id (t_object *b) |
Retrieve a boxes unique id. | |
char | jbox_get_canhilite (t_object *b) |
Retrieve a box flag value from a box. | |
char | jbox_get_background (t_object *b) |
Determine whether a box is located in the patcher's background layer. | |
t_max_err | jbox_set_background (t_object *b, char c) |
Set whether a box should be in the background or foreground layer of a patcher. | |
char | jbox_get_ignoreclick (t_object *b) |
Determine whether a box ignores clicks. | |
t_max_err | jbox_set_ignoreclick (t_object *b, char c) |
Set whether a box ignores clicks. | |
char | jbox_get_drawfirstin (t_object *b) |
Determine whether a box draws its first inlet. | |
char | jbox_get_outline (t_object *b) |
Determine whether a box draws an outline. | |
t_max_err | jbox_set_outline (t_object *b, char c) |
Set whether a box draws an outline. | |
char | jbox_get_growy (t_object *b) |
Retrieve a box flag value from a box. | |
char | jbox_get_growboth (t_object *b) |
Retrieve a box flag value from a box. | |
char | jbox_get_nogrow (t_object *b) |
Retrieve a box flag value from a box. | |
char | jbox_get_drawinlast (t_object *b) |
Retrieve a box flag value from a box. | |
t_object * | jbox_get_textfield (t_object *b) |
Retrieve a pointer to a box's textfield. | |
char | jbox_get_presentation (t_object *b) |
Determine if a box is included in the presentation view. | |
t_max_err | jbox_set_presentation (t_object *b, char c) |
Determine if a box is included in the presentation view. | |
t_max_err | jbox_new (t_jbox *b, long flags, long argc, t_atom *argv) |
Set up your UI object's t_jbox member. | |
void | jbox_free (t_jbox *b) |
Tear down your UI object's t_jbox member. | |
void | jbox_ready (t_jbox *b) |
Mark the box ready to be accessed and drawn by Max. | |
void | jbox_redraw (t_jbox *b) |
Request that your object/box be re-drawn by Max. | |
t_max_err | jbox_notify (t_jbox *b, t_symbol *s, t_symbol *msg, void *sender, void *data) |
Send a notification to a box. |
A box in the patcher.
#define JBOX_NOINSPECTFIRSTIN (1<<17) |
flag for objects such as bpatcher that have a different b_firstin,
but the attrs of the b_firstin should not be shown in the inspector
Definition at line 1648 of file jpatcher_api.h.
anonymous enum |
actual numerical values of the b_fontface attribute; use jbox_fontface() to weight
JBOX_FONTFACE_REGULAR |
normal |
JBOX_FONTFACE_BOLD |
bold |
JBOX_FONTFACE_ITALIC |
italic |
JBOX_FONTFACE_BOLDITALIC |
bold and italic |
Definition at line 1659 of file jpatcher_api.h.
enum HitTestResult |
enumerations used for box decorators
HitNothing |
a hole in the box |
HitBox |
the body of the box |
HitInlet |
an inlet |
HitOutlet |
an outlet |
HitGrowBox |
the grow handle |
HitLine |
a line |
Definition at line 1672 of file jpatcher_api.h.
void jbox_free | ( | t_jbox * | b | ) |
char* jbox_get_annotation | ( | t_object * | bb | ) |
Retrieve a box's annotation string, if the user has given it an annotation.
bb | The box to query. |
char jbox_get_background | ( | t_object * | b | ) |
Determine whether a box is located in the patcher's background layer.
b | The box to query. |
char jbox_get_canhilite | ( | t_object * | b | ) |
Retrieve a box flag value from a box.
b | The box to query. |
Retrieve a box's 'color' attribute.
b | The box to query. | |
prgba | The address of a valid t_rect whose values will be filled-in upon return. |
char jbox_get_drawfirstin | ( | t_object * | b | ) |
Determine whether a box draws its first inlet.
b | The box to query. |
char jbox_get_drawinlast | ( | t_object * | b | ) |
Retrieve a box flag value from a box.
b | The box to query. |
Retrieve a box's 'fontname' attribute.
b | The box to query. |
double jbox_get_fontsize | ( | t_object * | b | ) |
Retrieve a box's 'fontsize' attribute.
b | The box to query. |
char jbox_get_growboth | ( | t_object * | b | ) |
Retrieve a box flag value from a box.
b | The box to query. |
char jbox_get_growy | ( | t_object * | b | ) |
Retrieve a box flag value from a box.
b | The box to query. |
char jbox_get_hidden | ( | t_object * | b | ) |
Retrieve a box's 'hidden' attribute.
b | The box to query. |
Retrieve a box's hint text as a symbol.
b | The box to query. |
char* jbox_get_hintstring | ( | t_object * | bb | ) |
Retrieve a box's hint text as a C-string.
bb | The box to query. |
Retrieve a boxes unique id.
b | The box to query. |
char jbox_get_ignoreclick | ( | t_object * | b | ) |
Determine whether a box ignores clicks.
b | The box to query. |
Retrieve the name of the class of the box's object.
b | The box to query. |
The next box in the patcher's (linked) list of boxes.
b | The box to query. |
char jbox_get_nogrow | ( | t_object * | b | ) |
Retrieve a box flag value from a box.
b | The box to query. |
Retrieve a pointer to the box's object.
b | The box to query. |
char jbox_get_outline | ( | t_object * | b | ) |
Determine whether a box draws an outline.
b | The box to query. |
Retrieve a box's patcher.
b | The box to query. |
Fetch the position of a box for the patching view.
box | The box whose position will be retrieved. | |
pos | The address of a valid t_pt whose x and y values will be filled in. |
Retrieve the patching rect of a box.
box | The box whose rect values will be retrieved. | |
pr | The address of a valid t_rect whose values will be filled in. |
Fetch the size of a box for the patching view.
box | The box whose size will be retrieved. | |
size | The address of a valid t_size whose width and height values will be filled in. |
char jbox_get_presentation | ( | t_object * | b | ) |
Determine if a box is included in the presentation view.
b | The box to query. |
Fetch the position of a box for the presentation view.
box | The box whose position will be retrieved. | |
pos | The address of a valid t_pt whose x and y values will be filled in. |
Retrieve the presentation rect of a box.
box | The box whose rect values will be retrieved. | |
pr | The address of a valid t_rect whose values will be filled in. |
Fetch the size of a box for the presentation view.
box | The box whose size will be retrieved. | |
size | The address of a valid t_size whose width and height values will be filled in. |
The previous box in the patcher's (linked) list of boxes.
b | The box to query. |
Find the rect for a box with a given attribute name.
box | The box whose rect will be fetched. | |
which | The name of the rect attribute to be fetched, for example _sym_presentation_rect or _sym_patching_rect . | |
pr | The address of a valid t_rect whose members will be filled in by this function. |
Find the rect for a box in a given patcherview.
box | The box whose rect will be fetched. | |
patcherview | A patcherview in which the box exists. | |
rect | The address of a valid t_rect whose members will be filled in by this function. |
Retrieve a pointer to a box's textfield.
b | The box to query. |
Retrieve a box's scripting name.
b | The box to query. |
Set up your UI object's t_jbox member.
This should be called from your UI object's free method.
b | The address of your UI object's t_jbox member (which should be the first member of the object's struct). | |
flags | Flags to set the box's behavior, such as JBOX_NODRAWBOX. | |
argc | The count of atoms in the argv parameter. | |
argv | The address of the first in an array of atoms to be passed to the box constructor. Typically these are simply the argument passed to your object when it is created. |
Send a notification to a box.
This is the same as calling object_notify() for a box.
b | The address of your object's t_jbox member. | |
s | The name of the send object. | |
msg | The notification name. | |
sender | The sending object's address. | |
data | A pointer to some data passed to the box's notify method. |
void jbox_ready | ( | t_jbox * | b | ) |
Mark the box ready to be accessed and drawn by Max.
This should typically be called at the end of your UI object's new method.
b | The address of your object's t_jbox member. |
void jbox_redraw | ( | t_jbox * | b | ) |
Request that your object/box be re-drawn by Max.
b | The address of your object's t_jbox member. |
void jbox_set_annotation | ( | t_object * | bb, | |
char * | s | |||
) |
Set a box's annotation string.
bb | The box to query. | |
s | The annotation string for the box. |
Set whether a box should be in the background or foreground layer of a patcher.
b | The box to query. | |
c | Pass zero to tell the box to appear in the foreground, or non-zero to indicate that the box should be in the background layer. |
Set a box's 'color' attribute.
b | The box to query. | |
prgba | The address of a t_rect containing the desired color for the box/object. |
Set a box's 'fontname' attribute.
b | The box to query. | |
ps | The font name. Note that the font name may be case-sensitive. |
Set a box's 'fontsize' attribute.
b | The box to query. | |
d | The fontsize in points. |
Set a box's 'hidden' attribute.
b | The box to query. | |
c | Set to true to hide the box, otherwise false. |
Set a box's hint text using a symbol.
b | The box to query. | |
s | The new text to use for the box's hint. |
void jbox_set_hintstring | ( | t_object * | bb, | |
char * | s | |||
) |
Set a box's hint text using a C-string.
bb | The box to query. | |
s | The new text to use for the box's hint. |
Set whether a box ignores clicks.
b | The box to query. | |
c | Pass zero to tell the box to respond to clicks, or non-zero to indicate that the box should ignore clicks. |
Set whether a box draws an outline.
b | The box to query. | |
c | Pass zero to hide the outline, or non-zero to indicate that the box should draw the outline. |
Set the position of a box for the patching view.
box | The box whose positon will be changed. | |
pos | The address of a t_pt with the new x and y values. |
Change the patching rect of a box.
box | The box whose rect will be changed. | |
pr | The address of a t_rect with the new rect values. |
Set the size of a box for the patching view.
box | The box whose size will be changed. | |
size | The address of a t_size with the new width and height values. |
Set the position of a box for both the presentation and patching views.
box | The box whose position will be changed. | |
pos | The address of a t_pt with the new x and y values. |
Determine if a box is included in the presentation view.
b | The box to query. | |
c | Pass zero to remove a box from the presention view, or non-zero to add it to the presentation view. |
Set the position of a box for the presentation view.
box | The box whose rect will be changed. | |
pos | The address of a t_pt with the new x and y values. |
Change the presentation rect of a box.
box | The box whose rect will be changed. | |
pr | The address of a t_rect with the new rect values. |
Set the size of a box for the presentation view.
box | The box whose size will be changed. | |
size | The address of a t_size with the new width and height values. |
Set both the presentation rect and the patching rect.
box | The box whose rect will be changed. | |
pr | The address of a t_rect with the new rect values. |
Change the rect for a box with a given attribute name.
box | The box whose rect will be changed. | |
which | The name of the rect attribute to be changed, for example _sym_presentation_rect or _sym_patching_rect . | |
pr | The address of a valid t_rect that will replace the current values used by the box. |
Change the rect for a box in a given patcherview.
box | The box whose rect will be changed. | |
patcherview | A patcherview in which the box exists. | |
rect | The address of a valid t_rect that will replace the current values used by the box in the given view. |
Set the size of a box for both the presentation and patching views.
box | The box whose size will be changed. | |
size | The address of a t_size with the new size values. |