Charles,
I just sent you an email with a Free License for EZGUI 5.0 Pro. Please feel free to email me any questions, especially those specific to using EZGUI with the O2 compiler. I can provide extra details about how the framework works under the hood so you can better work with it using O2.
Also if you find it works well, then I will seriously consider making a "lite" version specific for O2 which I could offer as freeware. This would increase the capabilities of O2, since it would make it much easier for O2 users to do all the GUI stuff. EZGUI is much easier to work with than Powerbasic's DDT and it also is well designed for even hand coding apps.
EZGUI uses a unique approach to Form design:
(1) It uses a character based coordinate system. DOS Basic programmers will find It easy to work with. The Windows Dialog technically is based on Character Units, but a dialog unit is 1/4 of the width of the system font and 1/8 height of the system font. In older versions of Windows this came out exactly to an 8 x 16 pixel character, so a dialog unit was always 2 pixels in size. In later versions of Windows this changed, which is why Dialog units are a pain. EZGUI uses the variable width system font (rather the Dialog units fixed width) and averages the size of a characters to define its character unit size. You define coordinates using Character units, rather than dialog units. But what makes it unique is that you can define character units using floating point numbers. This means you could define a character coordinate of say 1.5 units. This allows exact positioning and sizing down to the pixel level.
(2) A number of resources are handles similar to DOS. For example, colors are defined using index numbers rather than handles for brushes and pens. EZGUI predefines 32 colors at startup, which are the 16 standard DOS colors and 16 more which are pastel (lighter) versions of the previous 16. You can then define as many more colors as you desire. So to define the colors for a form or control you would do this:
EZ_Color FGColorIndex&, BGColorIndex&
and all the forms or controls created after this will get those colors, until you execute another EZ_Color command. So to make a control black text on white BG, you would:
EZ_Color 0, 15
Now that is just like DOS.
EZGUI handles the creation of brushes and pens in the background and then deletes then when the app terminates or when the EZ_FreeColor command. You can define hundreds of colors in EZGUI and free then on demand if you want to use different ones.
Fonts are handles just like colors. You define them with an Index and then you can simply select them as needed like this:
EZ_UseFont FontIndex&
No handles required and EZGUI cleans up when your app terminates.
To see how simple it is to code using EZGUI, here is an example of hand coding an app and you can see how little code it requires:
#COMPILE EXE
#DIM ALL
#INCLUDE "..\includes\ezgui50.inc"
#INCLUDE "..\includes\ezwmain50.inc"
' ********************* Application Constants and Declares ***************************
DECLARE SUB Form1_Events(CID&, CMsg&, CVal&, Cancel&)
%FORM1_LABEL1 = 100
%FORM1_BUTTON1 = 105
DECLARE SUB FORM1_BUTTON1_Click()
' *************************************************************************************
%UnitFlag = 0 ' set to 1 to test unit width change
SUB EZ_Main(VerNum&)
EZ_Color -1, -1
EZ_Form "FORM1", "", "Your Dialog", 0, 0, 50, 18, "CK"
END SUB
SUB EZ_DesignWindow(FormName$)
SELECT CASE FormName$
CASE "FORM1"
EZ_Color 0, 15
EZ_DefFont 99, "Tahoma", 72, "BV"
EZ_UseFont 99
EZ_Label %FORM1_LABEL1, 1, 1, 48, 9, "Label 1", "CF"
EZ_Color-1,-1
EZ_UseFont -1
EZ_Button %FORM1_BUTTON1, 12, 12, 27, 3, "Change Font Size", "T"
CASE ELSE
END SELECT
END SUB
SUB EZ_Events(FormName$, CID&, CMsg&, CVal&, Cancel&)
SELECT CASE FormName$
CASE "FORM1"
SELECT CASE CID&
CASE %EZ_Window
IF CMsg&=%EZ_Close THEN
END IF
CASE %FORM1_BUTTON1
IF CMsg&=%EZ_Click THEN
FORM1_BUTTON1_Click
END IF
CASE ELSE
END SELECT
CASE ELSE
END SELECT
END SUB
SUB FORM1_BUTTON1_Click()
LOCAL M$, MT$
STATIC FW&
IF %UnitFlag THEN
M$="#"
MT$="Units"
ELSE
M$="%"
MT$="Percent"
END IF
IF FW&=0 THEN FW&=10
IF FW&>=150 THEN FW&=10
EZ_FreeFont 99
EZ_DefFont 99, "Tahoma", 72, "BV["+TRIM$(STR$(FW&))+M$+"]"
EZ_SetFont "Form1",%FORM1_LABEL1, 99
EZ_SetText "Form1",0, CHR$(34)+EZ_GetFontName(99)+CHR$(34)+" "+STR$(FW&)+" "+MT$+" width"
FW&=FW&+10
END SUB
Unlike the Windows SDK or even DDT, EZGUI often uses simple text strings to define properties rather than use a bunch of bit flags in constants.
For example in the code above the EZ_Form command has a property string as the last parameter:
"CK"
The properties are usually just one capital character. In this case C stands for "Center Form" and K stands for Clipping (the controls) (C was already used for Center window, so I used K for Clipping).
For example a Textbox control would use the E character for Edit (meaning you can edit the text).
Once you get used to using these simple characters for properties one can almost memorize many commands.
Defining Fonts is similar. The line of code:
EZ_DefFont 99, "Tahoma", 72, "BV"
Means define a new font with an index of 99, using Tahoma font at 72 point size and the property string "BV" means Boldface and Variable width.