Esempio n. 1
0
int SynthNote::cursor_motion_event()
{
	int result = 0;
	if(window->current_note > -1)
	{
		int cursor_x = get_relative_cursor_x();
		int cursor_y = get_relative_cursor_y();
		if(cursor_x >= 0 && cursor_x < get_w() &&
			cursor_y >= 0 && cursor_y < get_h())
		{
			if(window->starting_notes)
			{
				start_note();
			}
			else
			{
				stop_note();
			}

			window->current_note = number;
			result = 1;
		}
	}
	return result;
}
void VWindowGUI::drag_motion()
{
// Window hidden
	if(get_hidden()) return;
	if(mwindow->session->current_operation != DRAG_ASSET) return;

	int old_status = mwindow->session->vcanvas_highlighted;

	int cursor_x = get_relative_cursor_x();
	int cursor_y = get_relative_cursor_y();
	
	mwindow->session->vcanvas_highlighted = (get_cursor_over_window() &&
		cursor_x >= canvas->x &&
		cursor_x < canvas->x + canvas->w &&
		cursor_y >= canvas->y &&
		cursor_y < canvas->y + canvas->h);


printf("VWindowGUI::drag_motion 1 %d %d %d %d %d\n", 
__LINE__, 
mwindow->session->vcanvas_highlighted,
get_cursor_over_window(),
cursor_x,
cursor_y);


	if(old_status != mwindow->session->vcanvas_highlighted)
		canvas->draw_refresh();
}