Beispiel #1
0
//
// Label - Handles the mouse up event.
//
int EZ_label_OnMouseUp(ez_control_t *self, mouse_state_t *ms)
{
	int mouse_handled = false;
	ez_label_t *label = (ez_label_t *)self;

	// Call the super class first.
	mouse_handled = EZ_control_OnMouseUp(self, ms);

	// Find at what index in the text where the mouse was released.
	if ((self->int_flags & control_focused) && (label->int_flags & label_selecting))
	{
		label->select_end = EZ_label_FindMouseTextIndex(label, ms);
		
		EZ_label_SetCaretPosition(label, label->select_end);
	}
	else
	{
		label->select_start		= -1;
		label->select_end		= -1;
		EZ_label_SetCaretPosition(label, -1);
	}

	// We've stopped selecting.
	label->int_flags &= ~label_selecting;

	CONTROL_EVENT_HANDLER_CALL(&mouse_handled, self, ez_control_t, OnMouseUp, ms);

	return mouse_handled;
}
Beispiel #2
0
//
// Button - OnMouseDown event.
//
int EZ_button_OnMouseUp(ez_control_t *self, mouse_state_t *mouse_state)
{
	ez_button_t *button = (ez_button_t *)self;
	EZ_control_OnMouseUp(self, mouse_state);

	if (!(button->ext_flags & button_is_toggleable))
	{
		EZ_button_SetColorOrBackground(self, button->hover_image, button->color_hover);
	}

	CONTROL_EVENT_HANDLER_CALL(NULL, button, ez_control_t, OnMouseUp, NULL);
	return 1;
}