where it will return the control handle, control ID and notification code for the event. CVal& is simply passed as the first parameter and EZGUI knows what to do with it.
There are normally no Dialog procedures in EZGUI apps, only events.
That said, EZGUI was designed for easy integration with common API techniques, so you can tell EZGUI to use a Dialog Procedure for a specific form (using the EZ_UseDialogProc command). EZGUI will preprocess all the forms messages and then pass any unprocessed messages to your dialog procedure
after EZGUI processes them. Each form can have one dialog procedure. If you want to override the GUI engine, you can also create a universal Dialog procedure (using EZ_HookDialogProc) for all forms and EZGUI will send all window messages for all forms to this one universal Dialog procedure
before EZGUI processes them internally. This allows you to override the engine to change its behavior.
Most apps can be created without any Dialog procedures at all.
Here is an example of a minimal EZGUI app which was hand coded:
Code:
#COMPILE EXE
#DIM ALL
' --------------------
#INCLUDE "..\includes\ezgui50.inc" ' Load EZGUI Include file
' --------------------
'
GLOBAL ListFont&
'
' --------------------
#INCLUDE "..\includes\ezwmain50.inc" ' EZGUI Include file for WinMain
' --------------------
'
SUB EZ_Main(VerNum&)
' This is where your app starts up and first form is created
EZ_Form "Window1", "", "Font Samples", 0,0, 60, 20, "C"
END SUB
'
SUB EZ_DesignWindow(FormName$)
' all forms generate one call to this routine when they are created
SELECT CASE FormName$
CASE "WINDOW1" ' or any Form Name you choose
EZ_Color 12, 7
EZ_DefFont 10, "Arial", 30, ""
EZ_UseFont 10
EZ_Label 100, 1, 1, 20, 8, "Arial 30 point", "C"
EZ_DefFont 11, "Courier New", 25, "BIU"
EZ_UseFont 11
EZ_Color 1, 7
EZ_Label 101, 1, 9, 20, 3, "Courier", "C"
EZ_Color -1, -1
EZ_DefFont 6, "Terminal", 14, "FB"
EZ_UseFont 6
EZ_ListBox 102, 23, 1, 30, 8, "Apples|Pears|Oranges|Peaches|Grapes|Watermellons|Lemons|Limes|", "SAJ"
EZ_UseFont -1
' define this font for later use
EZ_DefFont 7, "Times new Roman", 18, "B"
ListFont&=6
EZ_Button 103, 30, 10, 20, 1.5, "Change List Font", "T"
EZ_DefFont 8, "Wingdings", 24, "S"
EZ_UseFont 8
EZ_Color 1,15
EZ_Label 104, 1, 14, 58, 5.5, "123456789ABCD HIJKLEFOPQR", "CF"
EZ_Color -1, -1
EZ_UseFont -1
CASE ELSE
END SELECT
END SUB
'
SUB EZ_Events(FormName$, CID&, CMsg&, CVal&, Cancel&) EXPORT
LOCAL D$
SELECT CASE FormName$
CASE "WINDOW1"
SELECT CASE CID&
CASE %EZ_Window ' This is the EZGUI constant for Forms ID which is zero
CASE 103
IF CMsg&=%EZ_Click THEN
IF ListFont&=6 THEN
EZ_SetFont "WINDOW1", 102, 7
EZ_ResizeC "WINDOW1", 102, 23, 1, 30, 8
ListFont&=7
ELSE
EZ_SetFont "WINDOW1", 102, 6
EZ_ResizeC "WINDOW1", 102, 23, 1, 30, 8
ListFont&=6
END IF
END IF
CASE ELSE
END SELECT
CASE ELSE
END SELECT
END SUB
Attachment 8524