<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css">
<title>
Gambas Documentation - Drag &amp; Drop
</title>
</head>
<table class="none" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td align="left">
<font size="-1">
<a href="../../help+en"><img class="flag" alt="Home" border="0" src="../../img/lang/en.png" align="center"></a>&nbsp;
<a href="../doc+en">Up</a>&nbsp;
<a href="diffvb+en">Previous</a>&nbsp;
<a href="drawingarea+en">Next</a>&nbsp;
</td></tr></table>
<div class="notab">
<h1>
Drag &amp; Drop
</h1>
To implement Drag & Drop, you have to:
<ul>
<li>Set the <a href="../comp/gb.qt/control/drop+en">Drop</a> property on controls that could accept drops.
<li>Start a Drag & Drop operation by using the <a href="../comp/gb.qt/drag+en">Drag</a> class.
<li>Implement one of the <a href="../comp/gb.qt/control/_drag+en">Drag</a>, <a href="../comp/gb.qt/control/_dragmove+en">DragMove</a> or <a href="../comp/gb.qt/control/_drop+en">Drop</a> event handlers.
<p>
</ul>

The behaviour of the control that receives a drop is the following:
<ol>
<li>If you don't implement the <a href="../comp/gb.qt/control/_drag+en">Drag</a> event handler, nor the <a href="../comp/gb.qt/control/_dragmove+en">DragMove</a> event handler, then:
<ul>
<li>If the <a href="../comp/gb.qt/control/_drop+en">Drop</a> event handler is implemented, then the drop is accepted.
<li>Otherwise, it is rejected.
</ul>
<li>If you implement the <a href="../comp/gb.qt/control/_drag+en">Drag</a> event handler, and if the event is stopped, then the drop is rejected and no <a href="../comp/gb.qt/control/_dragmove+en">DragMove</a> event is raised.
<li>If you implement the <a href="../comp/gb.qt/control/_dragmove+en">DragMove</a> event handler, and if the event is stopped, then the drop is rejected.
</ol>

</div>
</body>
</html>

