Пример #1
0
	void ButtonViewImpl::on_pointer_release(PointerEvent &e)
	{
		_state_pressed = false;
		if (_state_disabled)
			return;
		update_state();
		if (_func_clicked)
		{
			if (button->geometry().border_box().contains(e.local_pos()))	// Only allow click when mouse released over component
				_func_clicked();
		}
	}
Пример #2
0
	void CheckBoxView_Impl::on_pointer_release(PointerEvent &e)
	{
		_state_pressed = false;
		if (_state_disabled)
			return;
		if (checkbox->geometry().border_box().contains(e.local_pos()))	// Only allow click when mouse released over component
		{
			_checked_state = !_checked_state;
			if (_func_state_changed)
				_func_state_changed();
		}
		update_state();
	}