Exemple #1
0
// Touch Pressed
void JMChattControl::OnTouchPressed(const Tizen::Ui::Control &source, const Tizen::Graphics::Point &currentPosition, const Tizen::Ui::TouchEventInfo &touchInfo)
{


	if( touchInfo.GetPointId() != 0 )
		return;


	if( (int)__stScreenInfo.fSlideSpeed != 0 ) {
		__stScreenInfo.fSlideSpeed = 0.f;
		__pTimerAutoSlide->Cancel();
	}


	if( __pArrayNeedLoadImage->GetCount() > 0 ) {
		__pArrayNeedLoadImage->RemoveAll(false);
	}


	__stScreenInfo.nSelectedImageIndex = GetImageIndexByPoint(currentPosition);


	__stScreenInfo.pointTouchPrev = currentPosition;

}
Exemple #2
0
// Touch Moved
void JMChattControl::OnTouchMoved(const Tizen::Ui::Control &source, const Tizen::Graphics::Point &currentPosition, const Tizen::Ui::TouchEventInfo &touchInfo)
{

	if( touchInfo.GetPointId() != 0 )
		return;


	if( __stScreenInfo.nTotalElementHeight < __stScreenInfo.rtScreenNow.height ) {

		__stScreenInfo.pointTouchPrev = currentPosition;
		return;
	}


	SystemTime::GetTicks(__stScreenInfo.nTimeTickTouchMoved);


	__stScreenInfo.fSlideSpeed = __stScreenInfo.pointTouchPrev.y - currentPosition.y;

	__stScreenInfo.nSlideDistance += (int)(__stScreenInfo.fSlideSpeed);

	__stScreenInfo.pointTouchPrev = currentPosition;


	__stScreenInfo.bNeedRedraw = true;

}
Exemple #3
0
void JMChattControl::OnTouchReleased(const Tizen::Ui::Control &source, const Tizen::Graphics::Point &currentPosition, const Tizen::Ui::TouchEventInfo &touchInfo)
{

	if( touchInfo.GetPointId() != 0 )
		return;

	long long nTicks;

	SystemTime::GetTicks(nTicks);

	if( (nTicks - __stScreenInfo.nTimeTickTouchMoved) > 100 )

		__stScreenInfo.fSlideSpeed = 0.f;


	if(	(int)__stScreenInfo.fSlideSpeed != 0 ) {

		if( (__stScreenInfo.fSlideSpeed > 0.f && __stScreenInfo.fSlideSpeedDecrease < 0.f) ||
				(__stScreenInfo.fSlideSpeed < 0.f && __stScreenInfo.fSlideSpeedDecrease > 0.f) ) {
			__stScreenInfo.fSlideSpeedDecrease *= -1.f;
		}

		__pTimerAutoSlide->Start(DF_TIMER_INTERVAL_REDRAW);
	}

	else {

		__stScreenInfo.bNeedRedraw = true;
	}


	if( __stScreenInfo.nSelectedImageIndex >= 0 ) {

		long nSelectedIndex = GetImageIndexByPoint(currentPosition);

		if( __stScreenInfo.nSelectedImageIndex == nSelectedIndex ) {

			ArrayList* __pArraySelectedElement = new ArrayList();

			__pArraySelectedElement->Construct();

			__pArraySelectedElement->Add(*(new Long(nSelectedIndex)));

			Container* pParent = this->GetParent();
			pParent->SendUserEvent(REQUEST_JCHATT_SELECT_IMAGE, (IList*)__pArraySelectedElement);

		}
	}

}
Exemple #4
0
void GCubeApp::OnTouch (TouchAction type, const Tizen::Ui::Control &source, const Tizen::Graphics::Point &currentPosition, const Tizen::Ui::TouchEventInfo &touchInfo) {
	long long tick = 0;
	Tizen::System::SystemTime::GetTicks(tick);
	ApplicationController *controller = ApplicationController::SharedInstance();
	controller->onTouch(type, currentPosition.x, currentPosition.y, touchInfo.GetPointId(), tick);
}