Пример #1
0
void
Seq24PerfInput::activate_adding (bool adding, perfroll & roll)
{
    if (adding)
        roll.get_window()->set_cursor(Gdk::Cursor(Gdk::PENCIL));
    else
        roll.get_window()->set_cursor(Gdk::Cursor(Gdk::LEFT_PTR));

    set_adding(adding);
}
Пример #2
0
/* popup menu calls this */
void Seq24PerfInput::set_adding( bool a_adding, perfroll& ths )
{
    if ( a_adding )
    {
        ths.get_window()->set_cursor(  Gdk::Cursor( Gdk::PENCIL ));
        m_adding = true;
    }
    else
    {
        ths.get_window()->set_cursor( Gdk::Cursor( Gdk::LEFT_PTR ));
        m_adding = false;
    }
}
void
FruityPerfInput::update_mouse_pointer (perfroll & roll)
{
    perform & p = roll.perf();
    midipulse droptick;
    int dropseq;
    roll.convert_xy(m_current_x, m_current_y, droptick, dropseq);
    sequence * seq = p.get_sequence(dropseq);
    if (p.is_active(dropseq))
    {
        midipulse start;
        midipulse end;
        if (seq->intersect_triggers(droptick, start, end))
        {
            int wscalex = s_perfroll_size_box_click_w * c_perf_scale_x;
            int ymod = m_current_y % c_names_y;
            if
            (
                start <= droptick && droptick <= (start + wscalex) &&
                (ymod <= s_perfroll_size_box_click_w + 1)
            )
            {
                roll.get_window()->set_cursor(Gdk::Cursor(Gdk::RIGHT_PTR));
            }
            else if
            (
                droptick <= end && (end - wscalex) <= droptick &&
                ymod >= (c_names_y - s_perfroll_size_box_click_w - 1)
            )
            {
                roll.get_window()->set_cursor(Gdk::Cursor(Gdk::LEFT_PTR));
            }
            else
                roll.get_window()->set_cursor(Gdk::Cursor(Gdk::CENTER_PTR));
        }
        else
            roll.get_window()->set_cursor(Gdk::Cursor(Gdk::PENCIL));
    }
    else
        roll.get_window()->set_cursor(Gdk::Cursor(Gdk::CROSSHAIR));
}
Пример #4
0
void FruityPerfInput::updateMousePtr( perfroll& ths )
{
    // context sensitive mouse
    long drop_tick;
    int drop_sequence;
    ths.convert_xy( m_current_x, m_current_y, &drop_tick, &drop_sequence );
    if (ths.m_mainperf->is_active( drop_sequence ))
    {
        long start, end;
        if (ths.m_mainperf->get_sequence(drop_sequence)->intersectTriggers( drop_tick, start, end ))
        {
            if (start <= drop_tick && drop_tick <= start + (c_perfroll_size_box_click_w * c_perf_scale_x) &&
                    (m_current_y % c_names_y) <= c_perfroll_size_box_click_w + 1)
            {
                ths.get_window()->set_cursor( Gdk::Cursor( Gdk::RIGHT_PTR ));
            }
            else if (end - (c_perfroll_size_box_click_w * c_perf_scale_x) <= drop_tick && drop_tick <= end &&
                    (m_current_y % c_names_y) >= c_names_y - c_perfroll_size_box_click_w - 1)
            {
                ths.get_window()->set_cursor( Gdk::Cursor( Gdk::LEFT_PTR ));
            }
            else
            {
                ths.get_window()->set_cursor( Gdk::Cursor( Gdk::CENTER_PTR ));
            }
        }
        else
        {
            ths.get_window()->set_cursor( Gdk::Cursor( Gdk::PENCIL ));
        }
    }
    else
    {
        ths.get_window()->set_cursor( Gdk::Cursor( Gdk::CROSSHAIR ));
    }
}