Huge Collections of Software Manuals and Knowledgebase

GreatManuals.com
Huge Collections of Software Manuals and Knowledgebase

 
Home Contact Us Request to publish your help manuals Request to remove your help manuals
Introduction
» ArtSong
» System Requirement
» What's New
» Upgrading Projects
ArtSong Basics
» Overview
» ArtSong Workspace
» Project Editors
» Control Mechanisms
» How To...
Tutorials
» First ArtSong MIDI
» Orchestration and Performance
» Beginning ArtSong Projects
» Using Component Events
Advanced Topics
» Rhythm and Meter
» Harmony
» Melody and Counterpoint
» Harmonizing Melody
» Accompaniment Patterns
» Arranging
Scripting
» ArtSong Scripting
» Basic Syntax
» Pascal Syntax
» Complex Numbers
» Music Objects Model
» Script Functions
» Script Objects
Scripting Tutorials
» Getting Started with Scripts
» Scripts as Algorithm
» Using Scripts with Composition Engine
» Graphic User Interfaces
ArtSong References
» Glossary
» Algorithms
» Components
» Devices
» Editors
Support Information
» Refer
» Contact Us
 

Graphic User Interfaces

The GUI capabilities discussed here are provided for those instances where the simple user input prompts are inadequate. Since building GUIs can be a lengthy process only some some general guidelines are presented in this tutorial. Several code examples can be found under the Script Examples menus.

file recovery application how to recover data file recovery service
free windows undelete undelete data windows recovery software
photo recovery digital camera ipod recovery mode mobile phone forensic investigation

The ArtSong™ scripting engine provides access to the same visual component library that ArtSong™ uses for its windows and dialogs; Borland®’s Visual Component Library™ (VCL). Using script you can create many of the common VCL objects such as forms, buttons, labels, etc. and establish mouse and keyboard event-handling using syntax very similar to the Object Pascal syntax used in Borland®’s Delphi™.

Only general guidelines are presented here. More info can be found in the accompanying example projects.

Creating Components

IMPORTANT: When creating forms make sure to provide the ‘Self’ as the argument; this will help ensure that forms are cleaned up properly when the script stops executing. This is especially important for non-modal forms.

myForm := TForm.Create(Self); // create form – owner is the ‘Self’

myForm.Width := 200; // set form properties

myForm.Height := 200;

myForm.Top := 100;

myForm.Left := 300;

myForm.ShowModal(); // Shows modal form

When creating components for placement on a form the ‘owner’ property of the component should be the form itself; this will ensure that the components get freed with the form. In order to display the component you will need to set its ‘parent’ property to the windowed component that this component is to be displayed in. The ‘parent’ component is responsible for displaying all its child components.

The position properties of components are always relative to the parent components.

// for non-form components the ‘Owner’ should be the form itself

myLabel := TLabel.Create(myForm);

myLabel.Caption := ‘This is a label’;

myLabel.Parent := myForm;

myButton := TBitBtn.Create(myForm);

myButton.Caption := ‘This is a button’;

myButton.Parent := myForm;

If ‘Panels’ (or other container components) are used to group components, than the ‘Panel’ should be assigned to the ‘Parent’ property for all components displayed on that panel.

myPanel := TPanel.Create(myForm);

myPanel.parent := myForm;

myButton := TButton.Create(myForm);

myButton.parent := myPanel; // button is displayed on panel

Event Handling

Most of the controls can have ‘events’ which are trigger by mouse clicking, key pressing etc. Script event-handlers by creating a procedure / subroutine and assigning it to the appropriate component event:

procedure DoClick(Sender)

begin

ShowMessage(‘Clicked’);

end;

myButton := TBitBtn.Create(myForm);

myButton.Caption := ‘This is a button’;

myButton.Parent := myForm;

myButton.OnClick := ‘DoClick’; // assign

Home | Contact Us | Request to publish your help manuals | Request to remove your help manuals