Example #1
0
static void incdec_clock(t_incdec *x)
{
    if(x->f_mouse_down == 1)
    {
        incdec_inc(x);
        clock_delay(x->f_clock, 50.);
    }
    else if(x->f_mouse_down == -1)
    {
        incdec_dec(x);
        clock_delay(x->f_clock, 50.);
    }
}
Example #2
0
void incdec_mousedown(t_incdec *x, t_object *patcherview, t_pt pt, long modifiers)
{
    if(pt.y < x->j_box.b_rect.height / 2.)
    {
        incdec_inc(x);
        x->f_mouse_down = 1;
    }
    else
    {
        incdec_dec(x);
        x->f_mouse_down = -1;
    }
    ebox_invalidate_layer((t_ebox *)x, gensym("background_layer"));
    ebox_redraw((t_ebox *)x);
}
Example #3
0
static void incdec_mousedown(t_incdec *x, t_object *patcherview, t_pt pt, long modifiers)
{
    t_rect rect;
    ebox_get_rect_for_view((t_ebox *)x, &rect);
    if(pt.y - 2.f < rect.height * 0.5f)
    {
        incdec_inc(x);
        x->f_mouse_down = 1;
    }
    else
    {
        incdec_dec(x);
        x->f_mouse_down = -1;
    }
    clock_delay(x->f_clock, 250.);
    ebox_invalidate_layer((t_ebox *)x, cream_sym_background_layer);
    ebox_redraw((t_ebox *)x);
}