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

EZY GUI Forms

New in EZY Prolog Tutorials Download EZY Prolog main page

 

EZY Prolog stores GUI declarations together with associated GUI code in EZY FORMS.

EZY Forms can be dialog or window:

EZY_FORM_TYPE  =
        ezy_form_window(RCT);
        ezy_form_dialog(RCT)
 

EZY Prolog forms has items, which describe GUI layout and Program code:

EZY_GUI_ITEM =
        src_gui(STRING DCL_FILE,EZY_WINDOW_LIST);
        src_pro(STRING PRO_FILE,STRING SOURCE);
        ezy_no_file
 

as well as information about program author, company name, copyright statement:

EZY_FORM = ezy_form(
        EZY_FORM_TYPE FORM_TYPE,
        STRING FORM_NAME,
        EZY_GUI_ITEM PROGRAM
        EZY_GUI_ITEM GUI_DECLARATIONS,
        STRING CREATED_BYSTRING COMPANY_NAMESTRING COPYRIGHT,
        INTEGER CRC_GUI, INTEGER CRC_PROGRAM)

EZY Prolog forms can be loaded by the following way:

predicates
    initialize_gui: EZY_INITIALIZE_GUI
    initialize_event_handlers(WINDOW)
clauses

initialize_gui(WINDOW):-
    write("GUI initialization started\n"),
    initialize_event_handlers(WINDOW),
% END OF GUI INITIALIZE

    write("GUI Initialization completed\n"),
    !.
initialize_event_handlers(WINDOW):-
    % code to initialize GUI elements
    !.
goal
:-
    syspath(EXEPATH,_),
    concat(EXEPATH,"ezy_sample.ezy",FORMNAME),
    ezy_form_open(FORMNAME,initialize_gui,EZY_GUI_RESULT),
    write(EZY_GUI_RESULT),nl,
    !.