TextHandle: fix mapping of touch position to handle position

Regardless of where the user drags on the mouse area (which
can be big for the user to hit it), you should continue dragging
on the selection where it is, not jump the location under the finger.

This patch will change offset to be the distance from the text position
under the handle to the touch point, so regardless where the user
touches the handle, the selection will not jump when the drag starts.

Change-Id: I849e42c5e94f44aec355224a9db146bcdf22d43f
TextHandle: disable the handles mousearea when no selection

Otherewise the handle will still be inside the scene, and eat
mouse events, even when not visible. The result will be that
you e.g cannot move the cursor to the place where you left the
handle, since you cannot touch the input field underneath

Change-Id: Id8c436964be1235bb7919f81659d0ead1b2c89df
TextHandle: only commit IM upon starting a drag

As an optimization, only commit current IM composing
when the handle drag starts. While dragging, there
should be no ongoing IM anyway.

Change-Id: Ibc57a708652ce853426e42961ad9bb258d37ff3d
Texthandle: prevent flickables from stealing drag

When starting a drag on the handles, you don't wan't
any flickable to cancel it. The handle should win
in this case.

Change-Id: If3c735acfe0aacab2fcc257c9a391511993b1990
TextHandle: align all handles pixel-perfect with text selection

Change-Id: I1319bf33c2ca41f47b4c1ee938b9a2f7766ba5ee
TextHandle: add clicked signal

Add a clicked signal to TextHandle that emits
if the handle is clicked without being dragged
(since the handle will move along with the drag, it
 will think it gets clicked also upon a drag).

The handle instances will use this signal to move the
cursor where the user clicked, making the handles
appear transparent for mouse clicks.

Change-Id: I4e611e73a6f76822e1008ccf75f0f5562fc673dc
TextSelection: improve logic that sync handles with selection

Since property 'selectionPosition' that depends on 'selectionStart'
gets updated after the call to 'onSelectionStartChanged', we cannot
depend on it inside the handler. Moreover, since selectionStart
gets updated before cursorPosition when selecting a new selection, we
need to update both selectionHandle and cursorHandle in both cases
to ensure that we base the logic on the latest values.

This will fix two bugs that causes the handles to jump to wrong
positions (and even wrong lines) once the user starts dragging.

Change-Id: I74919abb4169439659bd42952d5d5e6020f33853
TextArea: don't reparent handles out of flickable

Change-Id: Ie119c3a725dd0fc451fba83e390e2cbc93685cf3
TextArea: don't hide handles when there is a selection

Always show the handles when there is a selection, and hide them
otherwise. No need for extra calculation logic that currently has
bugs since we don't take into account the reparenting.

Change-Id: I2147824629c321096ebadf6252e41a88766dc527
Add new private control 'EditMenu'

This control will be used as a part of the different
text edit controls for controlling how the edit menu
should work.

Change-Id: Id3ed5795111c37269fce62a97cf4d9bde1b5f6b3
Add EditMenu to input controls

Add EditMenu to TextArea, TextField, ComboBox and
SpinBox.

Change-Id: Ic2fed55c467dde65334006d252f4052430f3f40c
update example

Change-Id: Id7abcc298e7b5586f0b328f431feae3ee7015698