how to create a Custom Control

Richard Gaskin ambassador at fourthworld.com
Wed Apr 27 11:38:49 EDT 2016


Todd Fabacher wrote:

 > I have a simple question. Sorry for my ignorance, but how does one
 > create a Custom Control from a group? It seems to be just a group,
 > but somehome there is a way to set the group to be a Custom Control.
 > Is a "Custom Control" a defined stack in the Plugins folder?

A custom control is just a group of other controls put together to 
provide something, well, custom.

In many (if not most) cases it's helpful to set the group's 
selectGroupedControls property to false, so that the user can interact 
with it using the pointer tool without touching its interior controls, 
even if the global selectGroupedControls property may be true (the group 
property effectively overrides the global property).

Most custom controls benefit from using a behavior script, so you can 
use copied of the control anywhere and keep the code in one place for 
simpler maintenance and enhancement.

Depending on the nature of the control, it can be useful to take 
advantage of before and after message types in the behavior script, so 
the functionality the behavior provides can be reliably performed 
regardless whether the user traps the same message with a simple "on".

That's it.  Not much to them, and that's the beauty of custom controls: 
  they make great ad hoc solutions for a wide range of reusable 
components in an app because they can be built with all the development 
efficiencies LiveCode script provides.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com





More information about the use-livecode mailing list