Copyright ® ( 1997-2008) EDMGROUP Pty Ltd - EZY Prolog Reference

EZY Reply Domain

This domains describes values of the GUI element and layouts.

EZY_REPLY = ezy_reply(
         
SLIST ADDRESS/* address of GUI element */
         EZY_ITEM /* GUI element data */) 
EZY_RESULTS
 = EZY_REPLY*

Briefly, this domain stores addressing information of the GUI element and it's data. What is important, it can be used for individual GUI elements as well as for complex GUI layouts.

EZY_REPLY is the main "communication" bridge between prolog program and GUI elements in form of EZY_ITEM.

Every GUI element has it's corresponding EZY_ITEM domain:

 
EZY_ITEM
 =
    % Strings: text editor, edit field
    ezy_string(STRING);
    % Integers: selected item of the radio buttons
    ezy_integer(INTEGER);
    % describes data from compound GUI elements
    ezy_tab(INTEGER TABIDSTRING TABNAME,EZY_RESULTS);
    ezy_caption(EZY_TEXT,EZY_RESULTS);
    % data from external EZY form
    ezy_form(STRING FORM_FILENAMEEZY_RESULTS);
    % GRID
    ezy_grid(EZY_GRID_INIT_LIST);
    % List Boxes
    ezy_slist(SLIST ITEMSILIST SELECTED_ITEMS);
    % List Edit
    ezy_slist_edit(STRINGSLIST ITEMSILIST SELECTED_ITEMS);
    % Complex List
    ezy_complex_list(INTEGER SELECTED_ITEMINTEGER ITEM_SIZEEZY_LIST_ITEM,EZY_LIST);
    % Property Sheet
    ezy_property(Property_Sheet);
    % Tree
    ezy_tree(ILIST POSITION_SELECTEDSLIST MEMBERS_SELECTEDBROWSELIST_ITEM);
    % Xtree
    ezy_xtree(EZY_LIST_ITEM SELECTEDEZY_XTREE);
    % Toolbar
    ezy_toolbar(control_list);
    % empty reply
    ezy_none

How to use EZY_REPLY?

syspath(EXEPATH,_),
format
(FORM_FILE,"%ssamples\\ezy_forms_test.ezy",EXEPATH),
ezy_dialog_create
(FORM_FILE,IN,OUT),

handler_ok(_,e_control(_,_,CTRLWIN,activated),0):-
    TOP_FRAME_ADDRESS = ["TOP_FRAME"],
    ezy_object_data(CTRLWIN,TOP_FRAME_ADDRESS,VALUE_TOP_FRAME),
    % Destroy dialog and return Values
    ezy_dialog_destroy([VALUE_TOP_FRAME]),!.

How to construct EZY_REPLY domain?

The structure of the domain could be very complex and EZY Prolog has tools to make it very EZY...

Use EZY GUI Expert to generate EZY_REPLY domain for selected GUI element:

System will open text editor with generated prolog code, which has EZY_REPLY for the selected control. Generated code will have necessary comments for easy interpretation of the term.

Example of initialization code, generated by EZY Prolog for list box:

/* USE THIS CODE TO SET VALUES OF {list box} ELEMENT */
    ADDRESS_list_box = ["TOP_FRAME","list box"],
    INIT_list_box =
    ezy_reply(["TOP_FRAME","list box"],
         ezy_slist(
            ["Item1","Item2","Item3"],/* SLIST */
            []/* ILIST_SELECTED */
         ) /* EZY_ITEM */
    ) /* end of the ezy_reply */,
    ezy_object_data(CTRLWIN,ADDRESS_list_box,INIT_list_box),

Use text editor to modify code and paste this code into your program.

How to get information from EZY_REPLY domain?

Use EZY GUI Expert to generate EZY_REPLY domain for selected GUI element:

System will open text editor with generated prolog code, which has EZY_REPLY term for the selected control. Generated code will have necessary comments for easy interpretation of the term.

Example:

/* USE THIS CODE TO RECEIVE VALUES FROM {list box} ELEMENT */
    ADDRESS_list_box = ["TOP_FRAME","list box"],
    ezy_object_data(CTRLWIN,ADDRESS_list_box,INIT_list_box),
    INIT_list_box =
    ezy_reply(["TOP_FRAME","list box"]/*ADDRESS*/,
         ezy_slist(
            SLIST_0/* SLIST */,
            SELECTED_0/* ILIST_SELECTED */
         ) /* EZY_ITEM */
    ) /* end of the ezy_reply */,

Note: after term unification variable SLIST_0 will be bound to the values of list box, and SELECTED_0 will be bound to the list of selected indexes of the list box.

Use text editor to modify code and paste this code into your program.

Copyright © 1997-2008 EDMGROUP (Australia)