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

back to main page

Download EZY Prolog

Visual Prolog DLL as custom control

You can use Visual Prolog DLL to implement various custom controls inside EZY Prolog programs.

For more information please see ezy_dll_custom_control.ezy file.

Click here to load Visual Prolog DLL sources

Program source:

/*EZY Prolog. Copyright (C) 2001-2004 EDMGROUP (Australia)
http://www.ezy-software.com
Code Automatically Generated by EZY Design Center

EZY Prolog - Unregistered version
Program author:Serguei Penkov
Copyright (C) 2004ezy-software
*/

predicates


    % SYSTEM ENTRY POINT()
    initialize_gui: EZY_INITIALIZE_GUI
    % EVENT HANDLERS CODE
    checkbox_ehandler: EHANDLER
clauses


% START OF GUI INITIALIZE

initialize_gui(WINDOW):-
    write("GUI Initialization completed"),nl,!.


/* CHECK BUTTON - EVENT HANDLER
TOP_FRAME.CREATE CUSTOM CONTROL */

checkbox_ehandler(_,e_control(_,_,CHECK_OBJECT,STATE),0):-
    ezy_object_address(CHECK_OBJECT,ADDRESS),
    ezy_checkbox_value(CHECK_OBJECT,VALUE),
    VALUE = 1,!,
    DLL_NAME = "ezy_dll_test.dll",
    syspath(EXEPATH,_),
    format(DLL_FULL_NAME,"%s%s",EXEPATH,DLL_NAME),
    ezy_object_parent(CHECK_OBJECT,"TOP_FRAME",FORM_WINDOW),
    FRAME_ADDRESS = ["TOP_FRAME","TEST"],
    ezy_object_get(FORM_WINDOW,FRAME_ADDRESS,FRAME_WINDOW),
    term_str(window,FRAME_WINDOW,STR_IN),
    ezy_dll_call(DLL_FULL_NAME,"ezy_custom_create",STR_IN,STR_OUT).
checkbox_ehandler(_,e_control(_,_,CHECK_OBJECT,STATE),0):-
    ezy_object_address(CHECK_OBJECT,ADDRESS),
    ezy_checkbox_value(CHECK_OBJECT,VALUE),
    VALUE = 0,!,
    DLL_NAME = "ezy_dll_test.dll",
    syspath(EXEPATH,_),
    format(DLL_FULL_NAME,"%s%s",EXEPATH,DLL_NAME),
    ezy_object_parent(CHECK_OBJECT,"TOP_FRAME",FORM_WINDOW),
    FRAME_ADDRESS = ["TOP_FRAME","TEST"],
    ezy_object_get(FORM_WINDOW,FRAME_ADDRESS,FRAME_WINDOW),
    term_str(window,FRAME_WINDOW,STR_IN),
    ezy_dll_call(DLL_FULL_NAME,"ezy_custom_destroy",STR_IN,STR_OUT),
    ezy_dll_free(DLL_FULL_NAME).

goal

    true.

Copyright 1997-2013 EDMGROUP (Australia)