Dali::Integration::SceneHolder::KeyEventGeneratedSignalType& KeyEventGeneratedSignal();
- Dali::Integration::SceneHolder::TouchSignalType& TouchSignal();
+ Dali::Integration::SceneHolder::TouchEventSignalType& TouchedSignal();
Dali::Integration::SceneHolder::WheelEventSignalType& WheelEventSignal();
return mScene.KeyEventGeneratedSignal();
}
-Dali::Integration::SceneHolder::TouchSignalType& SceneHolder::TouchSignal()
+Dali::Integration::SceneHolder::TouchEventSignalType& SceneHolder::TouchedSignal()
{
- return mScene.TouchSignal();
+ return mScene.TouchedSignal();
}
Dali::Integration::SceneHolder::WheelEventSignalType& SceneHolder::WheelEventSignal()
return GetImplementation( *this ).KeyEventGeneratedSignal();
}
-SceneHolder::TouchSignalType& SceneHolder::TouchSignal()
+SceneHolder::TouchEventSignalType& SceneHolder::TouchedSignal()
{
- return GetImplementation( *this ).TouchSignal();
+ return GetImplementation( *this ).TouchedSignal();
}
SceneHolder::WheelEventSignalType& SceneHolder::WheelEventSignal()
return GetImplementation( *this ).KeyEventSignal();
}
-Window::TouchSignalType& Window::TouchSignal()
+Window::TouchEventSignalType& Window::TouchedSignal()
{
- return GetImplementation( *this ).TouchSignal();
+ return GetImplementation( *this ).TouchedSignal();
}
namespace DevelWindow
{
public:
using KeyEventSignalType = Signal< void (const KeyEvent&) >;
- using TouchSignalType = Signal< void (const TouchEvent&) >;
+ using TouchEventSignalType = Signal< void (const TouchEvent&) >;
static Window New(PositionSize windowPosition, const std::string& name, bool isTransparent = false);
static Window New(PositionSize windowPosition, const std::string& name, const std::string& className, bool isTransparent = false);
void Hide();
FocusChangeSignalType& FocusChangeSignal();
KeyEventSignalType& KeyEventSignal();
- TouchSignalType& TouchSignal();
+ TouchEventSignalType& TouchedSignal();
public:
explicit Window( Internal::Adaptor::Window* window );
alignment.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
application.GetScene().Add(alignment);
- alignment.TouchSignal().Connect(&TouchCallback);
+ alignment.TouchedSignal().Connect(&TouchCallback);
application.Render();
application.SendNotification();
"\"orientation\": [10,10,10,10],"
"\"clippingBox\": [10,10,10,10],"
"\"signals\": [{"
- "\"name\": \"touch\","
+ "\"name\": \"touched\","
"\"action\": \"quit\""
"}]"
"}]"
" \"size\": [200, 200, 1],"
" \"orientation\": [0, 0, 30],"
" \"signals\": [{"
- " \"name\": \"touch\","
+ " \"name\": \"touched\","
" \"action\": \"play\","
" \"animation\": \"animate\""
" }]"
" \"size\": [200, 200, 1],"
" \"orientation\": [0, 0, 30],"
" \"signals\": [{"
- " \"name\": \"touch\","
+ " \"name\": \"touched\","
" \"action\": \"play\","
" \"animation\": \"animate\""
" }]"
" \"image\": { \"url\": \"dir/{IMAGE_PATH}\" },"
" \"sizeWidth\": \"{WIDTH}\","
" \"signals\": [{"
- " \"name\": \"touch\","
+ " \"name\": \"touched\","
" \"action\": \"quit\""
" }]"
"}]"
" \"name\": \"image\",\n"
" \"size\": \"{SIZE}\",\n"
" \"signals\": [{\n"
- " \"name\": \"touch\",\n"
+ " \"name\": \"touched\",\n"
" \"action\": \"quit\"\n"
" }],\n"
" \"actors\": [\n"
" \"name\": \"image\",\n"
" \"size\": \"{SIZE}\",\n"
" \"signals\": [{\n"
- " \"name\": \"touch\",\n"
+ " \"name\": \"touched\",\n"
" \"action\": \"quit\"\n"
" }],\n"
" \"actors\": [\n"
" \"name\": \"image\",\n"
" \"size\": [100,100,1],\n"
" \"signals\": [{\n"
- " \"name\": \"touch\",\n"
+ " \"name\": \"touched\",\n"
" \"action\": \"quit\"\n"
" }],\n"
" \"actors\": [\n"
" \"name\": \"subActor\"\n"
" }],\n"
" \"signals\": [{\n"
- " \"name\": \"touch\",\n"
+ " \"name\": \"touched\",\n"
" \"action\": \"hide\",\n"
" \"actor\": \"actor\",\n"
" \"childActor\": \"subActor\"\n"
" \"name\": \"subActor\"\n"
" }],\n"
" \"signals\": [{\n"
- " \"name\": \"touch\",\n"
+ " \"name\": \"touched\",\n"
" \"action\": \"set\",\n"
" \"actor\": \"subActor\",\n"
" \"property\": \"visible\",\n"
" \"name\": \"subActor\"\n"
" }],\n"
" \"signals\": [{\n"
- " \"name\": \"touch\",\n"
+ " \"name\": \"touched\",\n"
" \"action\": \"hide\"\n"
" }]\n"
" }]\n"
" \"name\": \"subActor\"\n"
" }],\n"
" \"signals\": [{\n"
- " \"name\": \"touch\",\n"
+ " \"name\": \"touched\",\n"
" \"action\": \"hide\"\n"
" }],\n"
" \"notifications\": [{\n"
" \"name\": \"image\",\n"
" \"size\": [100,100,1],\n"
" \"signals\": [{\n"
- " \"name\": \"touch\",\n"
+ " \"name\": \"touched\",\n"
" \"action\": \"quit\"\n"
" }],\n"
" \"properties\": {\n"
"\"parentOrigin\": \"TOP_LEFT\","
"\"anchorPoint\": \"TOP_LEFT\","
"\"signals\": [{"
- "\"name\": \"touch\","
+ "\"name\": \"touched\","
"\"action\": \"quit\""
"}]"
"}]"
" \"visible\": false\n"
" }],\n"
" \"signals\": [{\n"
- " \"name\": \"touch\",\n"
+ " \"name\": \"touched\",\n"
" \"action\": \"hide\",\n"
" \"actor\": \"actor\",\n"
" \"childActor\": \"subActor\"\n"
" \"name\": \"image\",\n"
" \"size\": [100,100,1],\n"
" \"signals\": [{\n"
- " \"name\": \"touch\",\n"
+ " \"name\": \"touched\",\n"
" \"action\": \"show\",\n"
" \"parameters\": {\n"
" \"property1\" : 10,\n"
application.Render();
view.GetNaturalSize();
- view.TouchSignal().Connect( &OnTouched );
+ view.TouchedSignal().Connect( &OnTouched );
// Touch event
Dali::Integration::TouchEvent event;
self.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
- self.TouchSignal().Connect( this, &Button::OnTouch );
+ self.TouchedSignal().Connect( this, &Button::OnTouch );
}
bool Button::OnAccessibilityActivated()
if( ! mTouchTransparent )
{
// Connect all the signals and set us up to consume all touch events
- mBacking.TouchSignal().Connect( this, &Popup::OnBackingTouched );
- mPopupBackgroundImage.TouchSignal().Connect( this, &Popup::OnDialogTouched );
- mPopupLayout.TouchSignal().Connect( this, &Popup::OnDialogTouched );
+ mBacking.TouchedSignal().Connect( this, &Popup::OnBackingTouched );
+ mPopupBackgroundImage.TouchedSignal().Connect( this, &Popup::OnDialogTouched );
+ mPopupLayout.TouchedSignal().Connect( this, &Popup::OnDialogTouched );
mLayer.SetProperty( Layer::Property::CONSUMES_TOUCH, true );
}
else
{
// We are touch transparent so disconnect all signals and ensure our layer does not consumed all touch events
- mBacking.TouchSignal().Disconnect( this, &Popup::OnBackingTouched );
- mPopupBackgroundImage.TouchSignal().Disconnect( this, &Popup::OnDialogTouched );
- mPopupLayout.TouchSignal().Disconnect( this, &Popup::OnDialogTouched );
+ mBacking.TouchedSignal().Disconnect( this, &Popup::OnBackingTouched );
+ mPopupBackgroundImage.TouchedSignal().Disconnect( this, &Popup::OnDialogTouched );
+ mPopupLayout.TouchedSignal().Disconnect( this, &Popup::OnDialogTouched );
mLayer.SetProperty( Layer::Property::CONSUMES_TOUCH, false );
}
}
Vector2 stageSize = Stage::GetCurrent().GetSize();
mWheelScrollDistanceStep = stageSize.y * DEFAULT_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION;
- self.TouchSignal().Connect( this, &ItemView::OnTouch );
+ self.TouchedSignal().Connect( this, &ItemView::OnTouch );
EnableGestureDetection(Gesture::Type(Gesture::Pan));
mWheelEventFinishedTimer = Timer::New( WHEEL_EVENT_FINISHED_TIME_OUT );
mGestureStackDepth = 0;
- self.TouchSignal().Connect( this, &ScrollView::OnTouch );
+ self.TouchedSignal().Connect( this, &ScrollView::OnTouch );
EnableGestureDetection( Gesture::Type( Gesture::Pan ) );
// By default we'll allow the user to freely drag the scroll view,
self.SetProperty( Actor::Property::SIZE, Vector2( DEFAULT_HIT_REGION.x, DEFAULT_HIT_REGION.y ) );
// Connect to the touch signal
- self.TouchSignal().Connect( this, &Slider::OnTouch );
+ self.TouchedSignal().Connect( this, &Slider::OnTouch );
}
void Slider::OnRelayout( const Vector2& size, RelayoutContainer& container )
Actor hitRegion = Actor::New();
hitRegion.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
hitRegion.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- hitRegion.TouchSignal().Connect( this, &Slider::OnTouch );
+ hitRegion.TouchedSignal().Connect( this, &Slider::OnTouch );
return hitRegion;
}
EnableGestureDetection( static_cast<Gesture::Type>( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) );
GetTapGestureDetector().SetMaximumTapsRequired( 2 );
- self.TouchSignal().Connect( this, &TextEditor::OnTouched );
+ self.TouchedSignal().Connect( this, &TextEditor::OnTouched );
// Set BoundingBox to stage size if not already set.
Rect<int> boundingBox;
EnableGestureDetection( static_cast<Gesture::Type>( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) );
GetTapGestureDetector().SetMaximumTapsRequired( 2 );
- self.TouchSignal().Connect( this, &TextField::OnTouched );
+ self.TouchedSignal().Connect( this, &TextField::OnTouched );
// Set BoundingBox to stage size if not already set.
Rect<int> boundingBox;
void WebView::OnInitialize()
{
Self().SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
- Self().TouchSignal().Connect( this, &WebView::OnTouchEvent );
+ Self().TouchedSignal().Connect( this, &WebView::OnTouchEvent );
if( mWebEngine )
{
}
}
mControls.push_back(control);
- control.TouchSignal().Connect(this, &DragAndDropDetector::OnDrag);
+ control.TouchedSignal().Connect(this, &DragAndDropDetector::OnDrag);
mFirstEnter.push_back(control.GetProperty< int >( Actor::Property::ID ));
mPanGestureDetector.Attach(control);
mPanGestureDetector.DetectedSignal().Connect(this, &DragAndDropDetector::OnPan);
if(match != mControls.end())
{
- match->TouchSignal().Disconnect(this, &DragAndDropDetector::OnDrag);
+ match->TouchedSignal().Disconnect(this, &DragAndDropDetector::OnDrag);
mPanGestureDetector.Detach(*match);
mFirstEnter.erase(std::find(mFirstEnter.begin(), mFirstEnter.end(), control.GetProperty< int >( Actor::Property::ID )));
mControls.erase(match);
auto iter = mControls.begin();
for(;iter != mControls.end();)
{
- iter->TouchSignal().Disconnect(this, &DragAndDropDetector::OnDrag);
+ iter->TouchedSignal().Disconnect(this, &DragAndDropDetector::OnDrag);
mPanGestureDetector.Detach(*iter);
iter = mControls.erase(iter);
}
for( auto iter = sceneHolders.begin(); iter != sceneHolders.end(); ++iter )
{
( *iter ).KeyEventSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnKeyEvent );
- ( *iter ).TouchSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnTouch );
+ ( *iter ).TouchedSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnTouch );
Dali::Window window = DevelWindow::DownCast( *iter );
if( window )
{
void KeyboardFocusManager::OnSceneHolderCreated( Dali::Integration::SceneHolder& sceneHolder )
{
sceneHolder.KeyEventSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnKeyEvent );
- sceneHolder.TouchSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnTouch );
+ sceneHolder.TouchedSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnTouch );
Dali::Window window = DevelWindow::DownCast( sceneHolder );
if( window )
{
grabHandle.actor.Add( grabHandle.grabArea );
grabHandle.actor.SetProperty( Actor::Property::COLOR, mHandleColor );
- grabHandle.grabArea.TouchSignal().Connect( this, &Decorator::Impl::OnGrabHandleTouched );
+ grabHandle.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnGrabHandleTouched );
// The grab handle's actor is attached to the tap and long press detectors in order to consume these events.
// Note that no callbacks are connected to any signal emitted by the tap and long press detectors.
primary.grabArea.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
primary.grabArea.SetProperty( Actor::Property::SIZE_MODE_FACTOR, DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
- primary.grabArea.TouchSignal().Connect( this, &Decorator::Impl::OnHandleOneTouched );
+ primary.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnHandleOneTouched );
// The handle's actor is attached to the tap and long press detectors in order to consume these events.
// Note that no callbacks are connected to any signal emitted by the tap and long press detectors.
secondary.grabArea.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
secondary.grabArea.SetProperty( Actor::Property::SIZE_MODE_FACTOR, DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
- secondary.grabArea.TouchSignal().Connect( this, &Decorator::Impl::OnHandleTwoTouched );
+ secondary.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnHandleTwoTouched );
// The handle's actor is attached to the tap and long press detectors in order to consume these events.
// Note that no callbacks are connected to any signal emitted by the tap and long press detectors.
mTagPropertyIndex = mImageView.RegisterProperty( TAG_PROPERTY_NAME, 0, Property::READ_WRITE /* Event-side only, i.e. not animatable */ );
// Connect to the touch-event
- mImageView.TouchSignal().Connect( this, &PropertyController::OnTouched );
+ mImageView.TouchedSignal().Connect( this, &PropertyController::OnTouched );
// Create text label
mTagText = Toolkit::TextLabel::New( "0" );
### Touch, Hover & Wheel Events {#creating-controls-events}
-+ A **touch** is when any touch occurs within the bounds of the custom actor. Connect to Dali::Actor::TouchSignal().
++ A **touch event** is when any touch occurs within the bounds of the custom actor. Connect to Dali::Actor::TouchedSignal().
+ A **hover event** is when a pointer moves within the bounds of a custom actor (e.g. mouse pointer or hover pointer).
+ A **wheel event** is when the mouse wheel (or similar) is moved while hovering over an actor (via a mouse pointer or hover pointer).
// Elsewhere
Dali::Actor actor = Actor::New();
-actor.TouchSignal().Connect( &OnTouch );
+actor.TouchedSignal().Connect( &OnTouch );
@endcode
The primary touch point is the first point that the user touches.
If this hit actor does not handle (consume) the event, then the event is offered to the hit actor's parent.
Again, if the parent does not handle this event, it is then offered to its parent and so on until the stage is reached or the event is consumed.
-If the TouchSignal of both a parent and child are connected to, then the touch event is first offered to the child's listener.
+If the TouchedSignal of both a parent and child are connected to, then the touch event is first offered to the child's listener.
If it is consumed by the child's listener, then the parent will not be informed.
<h2 class="pg">Gestures</h2>
stage.Add( mTextLabel );
// Respond to a click anywhere on the stage
- stage.GetRootLayer().TouchSignal().Connect( this, &HelloWorldController::OnTouch );
+ stage.GetRootLayer().TouchedSignal().Connect( this, &HelloWorldController::OnTouch );
}
bool OnTouch( Actor actor, const TouchEvent& touch )
Touch events are received via signals.
-For C++ API see Dali::Actor::TouchSignal() and Dali::Actor::HoveredSignal() for more details.
+For C++ API see Dali::Actor::TouchedSignal() and Dali::Actor::HoveredSignal() for more details.
### Hit Testing Rules Summary:
return true; // consume the touch event
}
...
-actor.TouchSignal().Connect( &OnPressed );
+actor.TouchedSignal().Connect( &OnPressed );
~~~
## JSON {#json-support}
"parentOrigin": "CENTER",
"signals" :
[
- { "name" : "touch", "action": "play", "animation": "move" }
+ { "name" : "touched", "action": "play", "animation": "move" }
]
}
]