Commit 0eea3541 authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

*tons of regression fixes for number2 in respect to scale/label handles.

Still need to fix the label reselection after it has been added/removed.
*fixed vu meter having bogus scale values when changing the label and some out-of-sync selection issues with the dialog. Needs to be vetted like number2.
parent 82a9f90b
......@@ -429,7 +429,6 @@ void iemgui_shouldvis(t_iemgui *x, int mode)
{
//fprintf(stderr,"draw erase %d\n", mode);
iemgui_draw_erase(x, x->x_glist);
x->x_vis = 0;
}
gop_redraw = 0;
}
......@@ -711,7 +710,7 @@ void scalehandle_draw_erase2(t_iemgui *x, t_glist *canvas) {
void scalehandle_draw(t_iemgui *x, t_glist *glist) {
if (x->x_glist == glist_getcanvas(glist)) {
if(x->x_selected == x->x_glist) scalehandle_draw_select2(x,glist);
else scalehandle_draw_erase2(x,glist);
else scalehandle_draw_erase2(x,glist);
}
}
......@@ -889,10 +888,13 @@ void iemgui_label_draw_config(t_iemgui *x, t_glist *canvas) {
"-fill #%6.6x -text {%s} \n",
canvas, x, iemgui_font(x),
x->x_lcol, x->x_lab!=s_empty?x->x_lab->s_name:"");
if (x->x_lab==s_empty && x->x_selected)
if (x->x_selected)
{
t_scalehandle *lh = (t_scalehandle *)(x->x_lhandle);
scalehandle_draw_erase(lh,canvas);
if (x->x_lab==s_empty)
scalehandle_draw_erase((t_scalehandle *)(x->x_lhandle),canvas);
else if (lh->h_vis == 0)
scalehandle_draw_select(lh,canvas,x->x_ldx,x->x_ldy);
}
}
......@@ -997,6 +999,7 @@ void iemgui_draw_erase(t_iemgui *x, t_glist *glist) {
sys_vgui(".x%lx.c delete x%lx\n", canvas, x);
sys_vgui(".x%lx.c dtag all x%lx\n", canvas, x);
scalehandle_draw_erase2(x,glist);
x->x_vis = 0;
}
void scrollbar_update(t_glist *glist) {
......
......@@ -202,7 +202,7 @@ static void my_numbox_draw_config(t_my_numbox* x,t_glist* glist)
int issel = x->x_gui.x_selected == canvas && x->x_gui.x_glist == canvas;
sys_vgui(".x%lx.c itemconfigure %lxNUMBER -font %s -fill %s\n",
canvas, x, iemgui_font(&x->x_gui), issel ? selection_color : fcol);
sys_vgui(".x%lx.c itemconfigure %lxBASE2 -fill %s\n",
sys_vgui(".x%lx.c itemconfigure %lxBASE2 -stroke %s\n",
canvas, x, issel ? selection_color : fcol);
iemgui_label_draw_config(&x->x_gui,canvas);
......@@ -477,6 +477,12 @@ static void my_numbox_dialog(t_my_numbox *x, t_symbol *s, int argc,
iemgui_draw_erase(&x->x_gui, x->x_gui.x_glist);
iemgui_shouldvis(&x->x_gui, IEM_GUI_DRAW_MODE_NEW);
scalehandle_draw(&x->x_gui, x->x_gui.x_glist);
iemgui_label_draw_new(&x->x_gui, x->x_gui.x_glist);
if (x->x_gui.x_selected)
{
scalehandle_draw(&x->x_gui,x->x_gui.x_glist);
iemgui_select((t_gobj *)x,x->x_gui.x_glist,1);
}
//canvas_restore_original_position(x->x_gui.x_glist, (t_gobj *)x,"bogus",-1);
scrollbar_update(x->x_gui.x_glist);
}
......
......@@ -209,7 +209,7 @@ static void vu_draw_config(t_vu* x, t_glist* glist)
{
int i;
t_canvas *canvas=glist_getcanvas(glist);
char lcol[8]; sprintf(lcol, "%6.6x", x->x_gui.x_lcol);
char lcol[8]; sprintf(lcol, "#%6.6x", x->x_gui.x_lcol);
for(i = 1; i <= IEM_VU_STEPS+1; i++)
{
if (i <= IEM_VU_STEPS)
......@@ -488,20 +488,20 @@ static void vu_properties(t_gobj *z, t_glist *owner)
static void vu_dialog(t_vu *x, t_symbol *s, int argc, t_atom *argv)
{
canvas_apply_setundo(x->x_gui.x_glist, (t_gobj *)x);
t_symbol *srl[3];
//t_symbol *srl[3];
int w = atom_getintarg(0, argc, argv);
int h = atom_getintarg(1, argc, argv);
int scale = !!atom_getintarg(4, argc, argv);
srl[0] = s_empty;
int sr_flags = iemgui_dialog(&x->x_gui, srl, argc, argv);
//srl[0] = s_empty;
int sr_flags = iemgui_dialog(&x->x_gui, argc, argv);
x->x_gui.x_loadinit = 0;
x->x_gui.x_w = iemgui_clip_size(w);
vu_check_height(x, h);
vu_scale(x, (t_float)scale);
x->x_gui.x_draw(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_CONFIG);
iemgui_draw_io(&x->x_gui, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_IO + sr_flags);
iemgui_shouldvis(&x->x_gui, IEM_GUI_DRAW_MODE_MOVE);
iemgui_draw_io(&x->x_gui, x->x_gui.x_glist, sr_flags);
scalehandle_draw(&x->x_gui, x->x_gui.x_glist);
iemgui_shouldvis(&x->x_gui, IEM_GUI_DRAW_MODE_MOVE);
scrollbar_update(x->x_gui.x_glist);
}
......
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