Copyright (1997-2013) EDMGROUP Pty Ltd - EZY Prolog Reference

  EZY Programing

New in EZY Prolog

Tutorials

Download EZY Prolog

main page

EZY Designing

EZY Prolog basics

EZY GUI and Visual Prolog

EZY Debugger

EZY Code Generator

EZY DLL

EZY Read/Write

EZY Lists

EZY Dialogs

EZY Menu

EZY GUI

EZY Programming

EZY Samples

EZY_XML

EZY ODBC

EZY Tree and XTree

EZY Regular expressions

EZY DDE (Dynamic Data Exchange)

Data type checking/conversion

Execution control

Term unification

Operators

File system

Operating system

Date/Time functions

String operations

Built-in WEB Browser

Internal Databases

Debugging

HTML support

EZY Prolog Domains

EZY Prolog Functions

EZY Prolog versions

One of the goal of the EZY Prolog is to make  programming easy. To achieve this goal we created set of tools, which hides complexity of visual interface programming and allows programmer to concentrate on their goals.

This topic covers only how to create applications, which have uses GUI.

Step1 -

create visual components using EZY Designer. When finished - save GUI layout into the file.

To display created layout - call ezy_form_open to display layout and ezy_form_close to close layout. We included small sample which demonstrates how to open/close forms and analyze form controls structure via ezy_get_control_tree.

Click here to view sample program

Click here to view sample program GUI layout

Step 2 -

Once form file loaded - you can access GUI elements via their symbolic address.

The control address is important part of GUI programming using EZY Prolog.

EZY Designer provides powerful interface to create a hierarchy of controls. Each control has name (symbolic) and address, which is list of parent GUI elements.

The easiest way to get control address is to use EZY Designer's control tree view. Use mouse right button click to popup menu and select Control Address to Clipboard. The address of selected control will be placed to the clipboard.

EZY Prolog has set of predicates, which allows to:

  • For given object locate child by it's address

  • For given child object locate parent by it's address.

This set of navigation predicates

EZY Prolog

 

EZY Designer allows to build hierarchy of the controls, which can be easily addressed by symbolic address of the control.

% getting CHILD OBJECT by given parent OBJECT

ezy_window_create ( "nested_frames.dcl" , WINDOW ),

GRID_ADDR =[ "a" , "b" , "c" , "e" , "mygrid" ],

ezy_get_object ( WINDOW , GRID_ADDR , GRID_OBJECT),

/*

Now variable GRID_OBJECT can be used to access properties of the grid

EZY Prolog uses symbolic address for elements - child object can be accessed via it's parent and symbolic address (list of strings)

*/

 

If you need to navigate between controls (for example, access grid from tree), you can use it via common parent.

 

% getting CHILD OBJECT via COMMON PARENT

GRID_ADDR =[ "a" , "b" , "c" , "e" , "mygrid" ],

ezy_get_object ( WINDOW , GRID_ADDR , GRID_OBJECT ),

ezy_get_parent ( GRID_OBJECT , "a" , FIRST_WINDOW ),

TREE_ADDR =[ "a" , "b" , "d" , "tree_view" ],

ezy_get_object ( FIRST_WINDOW , TREE_ADDR , TREE_OBJECT ).

/*

For given OBJECT you can find parent via it's symbolic name and after that use parent OBJECT to obtain address of child.

*/

Step 3 -

EZY Prolog can pass control to user-defined functions from GUI elements. To do so, you need to define event handlers and/or callback predicates, which will be called by EZY Prolog.

This sample demonstrates how to assign event handler for the button.

When event handler is activated (user presses button), you can get symbolic name of the button pressed and execute necessary code.

...

ezy_window_create ( "nested_frames.dcl" , WINDOW ),

BUTTON_ADDR =[ "a" , "b" , "d" , "Load Tree" ],

ezy_get_object ( FIRST_WINDOW , BUTTON_ADDR ,

BUTTON_OBJECT ),

ezy_object_handler ( BUTTON_OBJECT , my_button_handler ),

! .

my_button_handler( _ ,e_control( _ , _ , BUTTON_OBJECT , _ )):-

ezy_object_name ( BUTTON_OBJECT , NAME ),

write ( "Button pressed: " , NAME , "\n" ),

! .

 

 

 

Copyright 1997-2013 EDMGROUP (Australia)