Delphi Script Components

www.kxcad.net Home > Electronic Index > Altium(Protel) Index


Your Ad Here

Delphi script handles two types of components: Visual and Nonvisual components. The visual components are the ones you use to build the user interface, and the nonvisual components are used for different tasks such as these Timer, OpenDialog and MainMenu components. You use the Timer nonvisual component to activate specific code at scheduled intervals and it is never seen by the user. The Button, Edit and Memo components are visual components for example.

Both types of components appear at design time, but non visual components are not visible at runtime. Basically components from the Toolbox panel are object orientated and all these components have the three following items:

A property is a characteristic of an object that influence either the visible behaviour or the operations of this object. For example the Visible property determines whether this objet can be seen or not on a script form.

An event is an action or occurrence detected by the script. In a script the programmer writes code for each event handler which is designed to capture a specific event such as a mouse click.

A method is a procedure that is always associated with an object and define the behavior of an object.

All Delphi Script forms have one or more components. Components usually display information or allow the user to perform an action. For example a Label is used to display static text, an Edit box is used to allow user to input some data, a Button can be used to initiate actions.

Any combination of components can be placed on a form, and while your script is running a user can interact with any component on a form, it is your task, as a programmer, to decide what happens when a user clicks a button or changes a text in an Edit box.

Delphi Script supplies a number of components for you to create complex user interfaces for your scripts. You can find all the components you can place on a form from the Toolbox palette.

To place a component on a form, locate its icon on the ToolBox panel and double-click it. This action places a component on the active form. Visual representation of most components is set with their set of properties. When you first place a component on a form, it is placed in a default position, with default width and height however you can resize or re-position this component. You can also change the size and position later, by using the Object Inspector.

When you drop a component onto a form, Delphi Script automatically generates code necessary to use the component and updates the script form. You only need to set properties, put code in event handlers and use methods as necessary to get the component on the form working.

See also

Writing Scripts

Designing script forms

Writing Event Handlers

Delphi Script Component Reference

Your Ad Here