

NxTile6 demo
------------

This is a more complete demonstration program than usual. By itself, the NxTile6 component does very little; therefore in order to make the demo interesting, it features:

* the NxTile6 objects are created within a TFlowPanel container.  The TFlowPanel was introduced in Delphi 2006, and it automatically manages the position of its objects. Definitely worth a look if you haven't see this before.

* an exercise in the ability to both drag and drop a component, and to be able to click it. This is not trivial work, and complicates the code significantly. However, it is likely that this would be required by the developers using the NxTile6 component and therefore this demo shows one approach to achieve this.

Using the demo program is intuitive; various radio buttons, checkboxes and button slides in the header panel provide access to the properties of the NxTile and TFlowPanel components. New tiles can be created in either of the two flowpanels, and tiles can be dragged and dropped either within the same flowpanel, or to the other flowpanel.

Enjoy.

PhilW,
November 2018.
 

Note: Drag and drop in Delphi XE
--------------------------------
There are two reasons why combining drag and drop and a functioning OnClick event is difficult:

* The Delphi implementation of drag and drop (BeginDrag) automatically triggers the OnClick event, so, instead, the click has to be managed manually via the MouseDown/MouseUp events.

*  In Delphi 2007, 2009, 2010 and Delphi XE (and perhaps later versions) there is a bug in the BeginDrag code which immediately triggers a OnStartDrag event irrespective of the BeginDrag parameters. 

