Languages

Menu
Sites
Language
Drag and drop control or group of controls

Hi
I want allow moving of button on Form (drag and drop).
I just found one way:
I have registered IDragDropEventListener for button at first:
        pButton1->AddDragDropEventListener(*this);
        pButton1->SetDragEnabled(true);
and reimplement OnTouchDragged(...)
{
    if (source.GetName() == L"IDC_BUTTON1")
    {

        Rectangle button;
        Button* pButton1 = static_cast< Button* >(GetControl(IDC_BUTTON1));
        pButton1->GetBounds(button.x,button.y,button.width,button.height);
        button.x=button.x-(button.width/2)+currentPosition.x;
        button.y=button.y-(button.height/2)+currentPosition.y;
        pButton1->SetPosition(button.x,button.y);

    }
}
p.s. I did not use OnTouchDropped, currentPosition incoming params are equal with latest OnTouchDragged().

What known ways are presented in Tizen to drag and drop control or group of controls also?
Are there any properties for any custom elements(controls) to allow them be movable automatically?
Alexey.

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

2 Replies
kimi
Hi Alex, For moving around the controls in the form (drag and drop) you can also use IPropagatedTouchEventListener "https://developer.tizen.org/help/index.jsp?topic=%2Forg.tizen.native.apireference%2FclassTizen_1_1Ui_1_1IPropagatedTouchEventListener.html". Kimi.
Alex Dem
Thank you for info! Alexey.