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

back to GUI elements

main page

 

Samples\ezy_text_box.ezy

See Text Entry for more information

predicates

    % SYSTEM ENTRY POINT
    initialize_gui: EZY_INITIALIZE_GUI
    % EVENT HANDLERS CODE
    initialize_event_handlers(WINDOW)
    single_line: EHANDLER
    multi_line: EHANDLER
    passworC: EHANDLER
    right_aligneC: EHANDLER
clauses




% START OF GUI INITIALIZE

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

    write("GUI Initialization completed"),nl,!.


initialize_gui(_):-
    write("GUI initialization failed"),nl,!.


/* EVENT HANDLERS INITIALIZE START*/

initialize_event_handlers(WINDOW):-
    VALUE_ADDR = ["TOP_FRAME","Single line","Value"],
    ezy_object_get(WINDOW,VALUE_ADDR,VALUE_WINDOW),
    ezy_object_handler(VALUE_WINDOW,single_line),
    fail.
initialize_event_handlers(WINDOW):-
    VALUE_ADDR = ["TOP_FRAME","Multi line","Value"],
    ezy_object_get(WINDOW,VALUE_ADDR,VALUE_WINDOW),
    ezy_object_handler(VALUE_WINDOW,multi_line),
    fail.
initialize_event_handlers(WINDOW):-
    VALUE_ADDR = ["TOP_FRAME","Password","Value"],
    ezy_object_get(WINDOW,VALUE_ADDR,VALUE_WINDOW),
    ezy_object_handler(VALUE_WINDOW,password),
    fail.
initialize_event_handlers(WINDOW):-
    VALUE_ADDR = ["TOP_FRAME","Right aligned","Value"],
    ezy_object_get(WINDOW,VALUE_ADDR,VALUE_WINDOW),
    ezy_object_handler(VALUE_WINDOW,right_aligned),
    fail.
initialize_event_handlers(_):-write("*** {EVENT HANDLERS Initialised}"),nl,!.
/* EVENT HANDLERS INITIALIZE END*/


single_line(_,e_control(_,_,TEXT_ENTRY_OBJECT,STATE),0):-
    ezy_object_address(TEXT_ENTRY_OBJECT,ADDRESS),
    ezy_object_text(TEXT_ENTRY_OBJECT,TEXT),
    /* CHECK ENTRY FIELD ADDRESS*/
    ADDRESS=["TOP_FRAME","Single line","Value"],!,
    write("Entry Field ",ADDRESS,", state (",STATE,"), TEXT=",TEXT),nl,!.
multi_line(_,e_control(_,_,TEXT_ENTRY_OBJECT,STATE),0):-
    ezy_object_address(TEXT_ENTRY_OBJECT,ADDRESS),
    ezy_object_text(TEXT_ENTRY_OBJECT,TEXT),
    /* CHECK ENTRY FIELD ADDRESS*/
    ADDRESS=["TOP_FRAME","Multi line","Value"],!,
    write("Entry Field ",ADDRESS,", state (",STATE,"), TEXT=",TEXT),nl,!.
password(_,e_control(_,_,TEXT_ENTRY_OBJECT,STATE),0):-
    ezy_object_address(TEXT_ENTRY_OBJECT,ADDRESS),
    ezy_object_text(TEXT_ENTRY_OBJECT,TEXT),
    /* CHECK ENTRY FIELD ADDRESS*/
    ADDRESS=["TOP_FRAME","Password","Value"],!,
    write("Entry Field ",ADDRESS,", state (",STATE,"), TEXT=",TEXT),nl,!.
right_aligned(_,e_control(_,_,TEXT_ENTRY_OBJECT,STATE),0):-
    ezy_object_address(TEXT_ENTRY_OBJECT,ADDRESS),
    ezy_object_text(TEXT_ENTRY_OBJECT,TEXT),
    /* CHECK ENTRY FIELD ADDRESS*/
    ADDRESS=["TOP_FRAME","Right aligned","Value"],!,
    write("Entry Field ",ADDRESS,", state (",STATE,"), TEXT=",TEXT),nl,!.
goal

    true.

Copyright 1997-2013 EDMGROUP (Australia)