Commit 9aa49f52 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

update open dialog window height/width/font/fontsize for iemguis as they are...

update open dialog window height/width/font/fontsize for iemguis as they are resized/repositioned with the mouse
parent f9face87
......@@ -3201,6 +3201,11 @@ function gui_iemgui_dialog(did, attr_array) {
attr_array_to_object(attr_array));
}
function gui_dialog_set_field(did, field_name, value) {
var elem = dialogwin[did].window.document.getElementsByName(field_name)[0];
elem.value = value;
}
function gui_create_array(did, count) {
var attr_array = [{
array_gfxstub: did,
......
......@@ -795,8 +795,14 @@ void scalehandle_free(t_scalehandle *h) {
}
void properties_set_field_int(long props, const char *gui_field, int value) {
sys_vgui(".gfxstub%lx.%s delete 0 end\n", props, gui_field);
sys_vgui(".gfxstub%lx.%s insert 0 %d\n", props, gui_field, value);
//sys_vgui(".gfxstub%lx.%s delete 0 end\n", props, gui_field);
//sys_vgui(".gfxstub%lx.%s insert 0 %d\n", props, gui_field, value);
char tagbuf[MAXPDSTRING];
sprintf(tagbuf, ".gfxstub%lx", props);
gui_vmess("gui_dialog_set_field", "ssi",
tagbuf,
gui_field,
value);
};
void scalehandle_dragon_label(t_scalehandle *h, float mouse_x, float mouse_y) {
......@@ -813,8 +819,8 @@ void scalehandle_dragon_label(t_scalehandle *h, float mouse_x, float mouse_y) {
{
int new_x = x->x_ldx + h->h_dragx;
int new_y = x->x_ldy + h->h_dragy;
properties_set_field_int(properties,"label.xy.x_entry",new_x);
properties_set_field_int(properties,"label.xy.y_entry",new_y);
properties_set_field_int(properties, "x-offset", new_x);
properties_set_field_int(properties, "y-offset", new_y);
}
x->x_ldx += dx;
x->x_ldy += dy;
......
......@@ -202,7 +202,7 @@ static void bng__motionhook(t_scalehandle *sh,
if (properties)
{
int new_w = x->x_gui.x_w + sh->h_dragx;
properties_set_field_int(properties,"dim.w_ent",new_w);
properties_set_field_int(properties,"size",new_w);
}
}
scalehandle_dragon_label(sh,mouse_x, mouse_y);
......
......@@ -369,9 +369,9 @@ static void my_numbox__motionhook(t_scalehandle *sh,
int properties = gfxstub_haveproperties((void *)x);
if (properties)
{
properties_set_field_int(properties,"dim.w_ent",x->x_scalewidth);
properties_set_field_int(properties,"dim.h_ent",x->x_scaleheight);
properties_set_field_int(properties,"label.fontsize_entry",x->x_tmpfontsize);
properties_set_field_int(properties,"width",x->x_scalewidth);
properties_set_field_int(properties,"height",x->x_scaleheight);
properties_set_field_int(properties,"font-size",x->x_tmpfontsize);
}
}
scalehandle_dragon_label(sh,mouse_x, mouse_y);
......
......@@ -190,7 +190,7 @@ static void radio__motionhook(t_scalehandle *sh, t_floatarg mouse_x, t_floatarg
int properties = gfxstub_haveproperties((void *)x);
if (properties)
{
properties_set_field_int(properties,"dim.w_ent", x->x_orient ?
properties_set_field_int(properties,"size", x->x_orient ?
x->x_gui.x_h + sh->h_dragy :
x->x_gui.x_w + sh->h_dragx);
}
......
......@@ -183,8 +183,8 @@ static void slider__motionhook(t_scalehandle *sh, t_floatarg mouse_x, t_floatarg
{
int new_w = x->x_gui.x_w + sh->h_dragx;
int new_h = x->x_gui.x_h + sh->h_dragy;
properties_set_field_int(properties,"dim.w_ent",new_w);
properties_set_field_int(properties,"dim.h_ent",new_h);
properties_set_field_int(properties,"width",new_w);
properties_set_field_int(properties,"height",new_h);
}
}
scalehandle_dragon_label(sh,mouse_x, mouse_y);
......
......@@ -159,13 +159,12 @@ static void toggle__motionhook(t_scalehandle *sh, t_floatarg mouse_x, t_floatarg
if (properties)
{
int new_w = x->x_gui.x_w + sh->h_dragx;
properties_set_field_int(properties,"dim.w_ent",new_w);
properties_set_field_int(properties,"size",new_w);
}
}
scalehandle_dragon_label(sh,mouse_x, mouse_y);
}
void toggle_draw(t_toggle *x, t_glist *glist, int mode)
{
if(mode == IEM_GUI_DRAW_MODE_UPDATE) sys_queuegui(x, x->x_gui.x_glist, toggle_draw_update);
......
......@@ -354,8 +354,8 @@ static void vu__motionhook(t_scalehandle *sh, t_floatarg mouse_x, t_floatarg mou
{
int new_w = x->x_gui.x_w + sh->h_dragx;
int new_h = x->x_gui.x_h + sh->h_dragy;
properties_set_field_int(properties,"dim.w_ent",new_w);
properties_set_field_int(properties,"dim.h_ent",new_h);
properties_set_field_int(properties,"width",new_w);
properties_set_field_int(properties,"height",new_h);
}
}
scalehandle_dragon_label(sh,mouse_x, mouse_y);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment