Page 1 of 4 123 ... LastLast
Results 1 to 10 of 38

Thread: EZGUI - getting nosy...

  1. #1
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,529
    Rep Power
    170

    EZGUI - getting nosy...

    Hi Chris,

    I tried some of your examples like EZGUI-TestWin8-package and became a little... "interested". I read you have a lot of basic-language-experience so you certainly know MS Visual Basic previous .net - vb-Versions 2.0 up to 6.something I also used - and 6 was my favourite but sadly not fully functional on Win8 but I hope creating and using a GUI in thinBasic one day will work as easy as this...

    Now back to topic:
    Your EZGUI is made primarily to be used from Powerbasic? Is that right? Since the close relations of tB-roots to PB it would not be much effort to get it running in tB? Could tB possibly interpret the code created with EZGUI-Code-Generator even without to compile?

    And now the important questions: Do the controls and windows raise own events on user-side - or does one also have to struggle with this weird callback-stuff which I'm not a friend of? Is there maybe an older and outdated version for trying out?
    I think there are missing some Forum-sections as beta-testing and support

  2. #2
    I looked into this a little and from what I gather, EZGUI would not work well with ThinBasic.

    EZGUI's runtimes are not a bunch of standalone library functions. Instead it is an integrated GUI framework, which literally takes over your app.

    It was designed specifically for PowerBasic, but in theory it would work with any compiler which supported OLE strings for variable lengths strings. PowerBasic uses the OLE API's for handling variable length strings.

    So how does it work ?

    Windows applications start in the winmain procedure. In PowerBasic, this can also be PBMain.

    When the app starts up, the EZGUI runtime is called and the apps message loop is in the runtime. This first call never exits until the app is terminated.

    The runtime now calls an alternate starting point in your app called EZ_Main where you can call any command in the runtime. This is where you would create your first form (using EZ_Form). Unlike ThinBasics syntax, similar to PowerBasic DDT, when a form is created (Dialog) it is immediately created and there is no need to call a Show command. The form can be defined as hidden if you like and later shown, but by default the form is created and displayed immediately.

    All window classes get the WM_CREATE message when they are created. EZGUI's Form Class, when it gets the WM_CREATE message internally generates an event which the runtime forwards to the EZ_DesignWindow procedure in your app. The procedure is for all the forms in the app and the form name is passed to this procedure for the specific form just created. Here you can add controls to your form using any control creation commands in the runtime. At this point, the form exists but is not visible yet.

    So how do you deal with events ?

    Every EZGUI app must have three core procedures:

    EZ_Main (where the app starts)

    EZ_DesignWindow (one call made for each form in the forms WM_CREATE message, so you can add controls here)

    and

    EZ_Events

    The runtime is in control of the app and only when it generates an event, does code in your app get called. All events for all forms and controls are sent to this one routine. Some EZGUI users who prefer to hand code their apps rather than use the visual designer, may actually handle everything in this one event routine for all forms/controls. The Designer generates code though which makes it more modular and parses out the events for forms and controls from this procedure to separate procedures for each form and control. The parameter is this universal event routine are:

    SUB EZ_Events (FormName$, ControlID&, CMsg&, CVal&, Cancel&)

    The event will get the forms name which generated the event.

    It will get the ID for the specific control which generated the event (Forms have an ID of zero, so form only events have the ID of zero) (form scrollbars have IDs of -1 and -2)

    UI defined events (ie. %EZ_Click, %EZ_DClick, %EZ_Change, %EZ_Selected). The runtime preprocesses all the window messages internally and converts them to EZGUI events.

    CVal& contains a single LONG value associated with the event. For example when you scroll a scrollbar it sends the %EZ_Change event and the new position is passed on the CVal& parameter. Another example would be when you select an item in a listbox control (single choice) it gets the %EZ_Change event and the newly selected items index is passed in Cval&).

    In cases where more data needs to be passed than what can be contained in one LONG value, CVal& contains a pointer instead. For every event which generates a pointer for CVal&, there will be a companion function in the runtime which can be used to get all the data. The first parameter of the command will be CVal& where you pass this value and the return values will be other parameters which are BYREF so they can return values. You never have to actually use pointers in your code for any EZGUI built in events. Any time an event passes a pointer in CVal& there is a companion command to retrieve the data.

    For example, if EZGUI does not recognize a specific WM_NOTIFY notification message and can't preprocess it and convert it to an event, it will generate the %EZ_Notify event and pass a pointer in Cval&. You can then handle it like this:

    CASE %EZ_Notify
        EZ_GetNotify CVal&, hCtrl&, ID&, NCode&
    
    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:

    #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
    

    ezapp1.png

  3. #3
    So the code above makes sense some explanations about EZGUI are needed:

    Forms are defined by Names (using a string constant or even in a variable), rather than using a handle. If you need a forms actual window handle there is a function to get it (EZ_Handle), but most EZGUI commands don't require a window handle, but use the form name instead.

    Colors (for Pens or Brushes in the API) are defined by index and no handles are used. The first 16 colors are predefined using the DOS Basic colors (0 to 15). The next 16 colors are predefined as pastel versions of the first 16 (16 to 31). You can then define as many custom colors as you like. This is why the EZ_Color command will be familiar to DOS Basic programmers. EZ_Color 0, 15 is black (FG) on white (BG).

    Fonts also are defined by index, just like colors, so no handles are required. The first six fonts (0 to 5) are predefined as the system stock fonts. The rest you can define your own custom fonts.

    Coordinates for forms and controls are NOT pixels and are also NOT Dialog Units !

    They are character coordinates, based on the average size of the default system font (which usually will come out to 8 x 16 pixels). They are scalable based on the end users font setting (DPI). You can also force the size to any custom size you want.

    What makes these character units (similar to DOS Basic) different is that they are floating point rather than whole numbers. In DOS Basic you can only have complete character positions. In EZGUI you can define a decimal value of a character unit (ie. 10.5) which is how it can have pixel perfect accuracy, despite using character units.

    Where did this concept of character units come from ?

    Actually it was based on the Windows API Dialog unit concept. Dialog units are actually calculated based on the average size of characters of the system font too. But instead of using character units, a Dialog unit is defined as:

    Horizontal unit (X) is 1/4 of a character unit
    Vertical unit (Y) is 1/8 of a character unit

    In 16 bit windows, the default character unit used for Dialogs came out to be 8 x 16 pixels , so 1/4 of 8 is 2 pixels and 1/8 of 16 is also 2 pixels, so in 16 bit Windows dialog units came out to a nice clean 2 x 2 pixels. DPI settings though mess this up.

    EZGUI character units are scalable (based on DPI) and because they are floating point they can accurately define done to the pixel level. You get the benefits of Dialogs units (scalability), but the accuracy of pixels.

    Also because character units are used, it is easier to hand code apps (even though there is a designer) because character units are easier to visualize in your mind than pixels.

  4. #4
    If Eros ever wanted to create an EZGUI like command set for forms, controls, colors, fonts, drawing and events for ThinBasic, I would be happy to provide some help.

    This core GUI command set is so easy for hand coding it would definitely make Thinbasic easier to use for defining forms and controls. I could provide him with the docs for EZGUI 1.0 which would cover much of the basic GUI stuff.

    For example notice how easy it is to define a Toolbar using this syntax:

    EZ_Toolbar 50, "#LargeSTD", "BBBBBBBBB|{New File |Open|Save|Close|Cut|Copy|Paste|Print|Redo}", "LONF24X24T"
    
    The first parameter is the toolbar ID. Each button on the toolbar is simply that ID plus the position of the button, so if the toolbar has an ID of 50 the buttons would have IDs of 51,52,53, ....

    The next parameter is a string which passes the bitmap (ezgui stores load bitmap reference names in a string). Built in bitmaps like the standard bitmap are defined with a string constant in this case #LargeSTD.

    The next parameter is a string which defines the buttons. The BBBBBBBBB stands for 9 buttons in a row. A space when be a button separator, an X would be a checkbox button, an R would be a radio button, a D would be a drop down button and an A would be a drop down button with an arrow. Then comes the strings for the buttons between {} characters.

    The last parameter is a property string which defines the properties of the toolbar control. In this above example, the follow properties are used:

    L - display buttons in list form with text to left of icon
    O - open edge toolbar
    N - no divider line
    F - flat explorer style toolbar
    24X24 - size of icons in pixels
    T - tabstop style

    It would be interesting to create an EZGUI style GUI command syntax for use with ThinBasic.

  5. #5
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,529
    Rep Power
    170
    Thanks for the explanation.

    So if I understand right, all controls that are created within the current "active" window without having explicitely to specify to which window that control belongs- it just goes to the current one - that's pretty cool.

    But somehow it does not create Events that call Functions(-if-exist) from the Forms name immediately, like "Window1_Label1_Click..." - I was hoping more for that kind of clear arrangement instead of having to select case and if these. In your example it looks still overviewable - but somehow the EZ_Events-Procedure reminds me of callbacks that I want to avoid because they are barely readable - so I don't understand what Case 103 means and why there's nothing in Case %EZ_Window.

    Anyway- the Testwin8-code-example from your site looks convincing - but the handling in code seems not to be made for my kind of a lazy guy as I am.

    Edit: I needed more than 20 minutes to study and answer the first post - I just saw two more now...
    Last edited by ReneMiner; 06-09-2013 at 18:58.
    I think there are missing some Forum-sections as beta-testing and support

  6. #6
    The EZGUI Designer handles all the extra coding to make it all more modular and readable.

    Here is an example:

    ' Portions: Copyright Christopher R. Boss, 2003 to 2011 , All Rights Reserved !
    ' Registered EZGUI 5.0 users may use this code Royalty Free !
    '
    ' ======================================
    ' [PROTECTED CODE]         Do NOT Edit !
    ' ======================================
    '
    #COMPILE EXE
    #DIM ALL        '   This is helpful to prevent errors in coding
    '
    #INCLUDE "C:\ezgui45beta\includes\ezgui50.inc"                          ' EZGUI Include file for Declares
    #RESOURCE ".\rcdata\proto1.pbr"
    '
    %FORM1_BUTTON1            = 100
    %FORM1_BUTTON2            = 105
    %FORM1_BUTTON3            = 110
    %FORM1_BUTTON4            = 115
    %FORM1_BUTTON5            = 120
    %FORM1_BUTTON6            = 125
    %FORM1_MCI1               = 130
    %FORM1_BUTTON10           = 135
    %FORM1_BUTTON11           = 140
    %FORM1_PLISTBOX1          = 145
    %FORM1_FLISTBOX1          = 150
    '
    #INCLUDE "C:\ezgui45beta\includes\ezwmain50.inc"                          ' EZGUI Include file for WinMain
    '
    SUB EZ_Main(VerNum&)     ' (PROTECTED)
         EZ_Reg %EZ_CUSTID,%EZ_REGNUM
         InitAppScale
    REM
         EZ_DefImageFolder "Graphics"
         EZ_AllowCommandEvents  0
         EZ_DefFont 6, "Arial", 10, "V"
         EZ_DefFont 7, "Courier New", 10, "F"
         EZ_DefFont 8, "Times New Roman", 10, "V"
         EZ_DefFont 9, "Modern", 10, "V"
         EZ_DefSystemColor 32, 4
         EZ_DefSystemColor 33, 5
         EZ_DefSystemColor 34, 15
         EZ_DefSystemColor 35, 24
         EZ_DefColorL 36, &H00FFB164
         EZ_DefColorL 37, &H0014AB9F
         EZ_DefColorL 38, &H0047A7FF
         EZ_DefColorL 39, &H00D2AACF
         EZ_DefColorL 40, &H001CD5E3
         EZ_DefColorL 41, &H00BC8943
         EZ_DefColorL 42, &H006C6AB7
         EZ_DefColorL 43, &H00DD4489
         IF Main_Initialize(VerNum&) THEN
              EZ_FORM1_Display ""
         END IF
    END SUB
    '
    SUB InitAppScale()
         EZ_DefCharSizeA 8,16
    END SUB
    '
    SUB EZ_DesignWindow(FormName$)     ' (PROTECTED)
         SELECT CASE FormName$
              CASE "FORM1"
                   EZ_FORM1_Design
              CASE ELSE
                   OtherForm_Design FormName$
         END SELECT
    END SUB
    '
    SUB EZ_Events(FormName$, CID&, CMsg&, CVal&, Cancel&)     ' (PROTECTED)
         IF PreProcess_Events(FormName$, CID&, CMsg&, CVal&, Cancel&) THEN EXIT SUB
         SELECT CASE FormName$
              CASE "FORM1"
                   EZ_FORM1_ParseEvents CID&, CMsg&, CVal&, Cancel&
              CASE ELSE
                   OtherForm_Events FormName$, CID&, CMsg&, CVal&, Cancel&
         END SELECT
    END SUB
    '
    ' ======================================
    ' [USER ACCESSABLE CODE]  You may Edit !
    ' ======================================
    '
    FUNCTION Main_Initialize(BYVAL VerNum&) AS LONG
         LOCAL RV&
         RV&=1
         FUNCTION=RV&
    END FUNCTION
    '
    SUB OtherForm_Design(FormName$)
         SELECT CASE FormName$
              CASE ELSE
         END SELECT
    END SUB
    '
    SUB OtherForm_Events(FormName$, CID&, CMsg&, CVal&, Cancel&)
         SELECT CASE FormName$
              CASE "{OPENDLG}", "{SAVEDLG}", "{OPENDLGX}", "{SAVEDLGX}", "{COLORDLG}", "{FONTDLG}", "{PRINTDLG}", "{PAGEDLG}", "{FINDDLG}"
              CASE "{ABORTDLG}"
              CASE "{MSGBOX}"
              CASE "{APP}"      ' Not a Form
                   SELECT CASE CMsg&
                        CASE %EZ_NoTheme
                        CASE %EZ_Terminate
                   END SELECT
              CASE ELSE
         END SELECT
    END SUB
    '
    FUNCTION PreProcess_Events(FormName$, CID&, CMsg&, CVal&, Cancel&) AS LONG
         LOCAL RV&
         RV&=0
         FUNCTION=RV&
    END FUNCTION
    '
    '<<BEGINFORM>> "FORM1"
    '
    ' ======================================
    ' [PROTECTED CODE]         Do NOT Edit !
    ' ======================================
    '
    SUB EZ_FORM1_Display(BYVAL FParent$)     ' (PROTECTED)
         EZ_Color 0, 25
         EZ_Form "FORM1", FParent$, "Test app", 0, 0, 111, 45, "CF"
    END SUB
    '
    SUB EZ_FORM1_Design()     ' (PROTECTED)
         LOCAL CText$
         EZ_Color 1, 25
         EZ_UseIFont "Tahoma", 12,"BV"
         EZ_ODButton %FORM1_BUTTON1, 1.625, .8125, 16, 4, "Button", "T"
         EZ_Color 1, 25
         EZ_UseIFont "Tahoma", 12,"BV"
         EZ_ODButton %FORM1_BUTTON2, 2, 5.8125, 16, 4, "Button", "T"
         EZ_SetRegion "Form1", %FORM1_BUTTON2,-2,0
         EZ_Color 1, 25
         EZ_UseIFont "Tahoma", 12,"BV"
         EZ_ODButton %FORM1_BUTTON3, 1.625, 10.8125, 16, 4, "Button", "T"
         EZ_SetRegion "Form1", %FORM1_BUTTON3, 1,0
         EZ_Color 0, 20
         EZ_UseIFont "Tahoma", 12,"BV"
         EZ_ODButton %FORM1_BUTTON4, 20.625, .8125, 16, 4, "Button", "T"
         EZ_Color 0, 20
         EZ_UseIFont "Tahoma", 12,"BV"
         EZ_ODButton %FORM1_BUTTON5, 20.625, 5.8125, 16, 4, "Button", "T"
         EZ_SetRegion "Form1", %FORM1_BUTTON5,-2,0
         EZ_Color 0, 20
         EZ_UseIFont "Tahoma", 12,"BV"
         EZ_ODButton %FORM1_BUTTON6, 21, 10.8125, 16, 4, "Button", "T"
         EZ_SetRegion "Form1", %FORM1_BUTTON6, 1,0
         EZ_Color-1,-1
         EZ_UseFont 4
         EZ_MCIControl %FORM1_MCI1, 2, 23, 46, 18, "S"
         FORM1_MCI1_Set ""
         EZ_Color 1, 25
         EZ_UseIFont "Tahoma", 12,"BV"
         EZ_ODButton %FORM1_BUTTON10, 2, 15.75, 16, 4, "{{BIG_SAME_ARROWDN}}", "T"
         EZ_SetRegion "Form1", %FORM1_BUTTON10,-2,0
         EZ_Color 0, 20
         EZ_UseIFont "Tahoma", 12,"BV"
         EZ_ODButton %FORM1_BUTTON11, 20.5, 15.75, 16, 4, "{{BIG_DOUBLE_SAME_RRECT}}", "T"
         EZ_SetRegion "Form1", %FORM1_BUTTON11,-2,0
         EZ_Color-1,-1
         EZ_UseFont 9
         CText$ = "Category 1|Text{T}OK|Color{C}&HFF0080|Drop Down List{D}One[One;Two;Three;Four;Five]|File{F}myproject.bmp[Bitmap Files;*.bmp;]|Dr"_
                + "op Down{D}Item 1[Item 1;Item 2]"
         EZ_PListBox %FORM1_PLISTBOX1, 54, 5, 50, 9, CText$, "STV"
         EZ_Color-1,-1
         EZ_UseFont 9
         EZ_FListBox %FORM1_FLISTBOX1, 54, 18, 52, 23.5, "", "STV"
         FORM1_FLISTBOX1_Init "Form1", %FORM1_FLISTBOX1
    END SUB
    '
    SUB EZ_FORM1_ParseEvents(CID&, CMsg&, CVal&, Cancel&)     ' (PROTECTED)
         SELECT CASE CID&
              CASE %EZ_Window
                   FORM1_Events CID&, CMsg&, CVal&, Cancel&
              CASE  %FORM1_BUTTON1
                   FORM1_BUTTON1_Events CID&, CMsg&, CVal&, Cancel&
                   IF CMsg&=%EZ_OwnerDraw THEN
                        EZ_Draw3DButton "Form1", %FORM1_BUTTON1, CVal&, 25, 1,  EZ_ODIFont
                   END IF
              CASE  %FORM1_BUTTON2
                   FORM1_BUTTON2_Events CID&, CMsg&, CVal&, Cancel&
                   IF CMsg&=%EZ_OwnerDraw THEN
                        EZ_Draw3DButtonRR "Form1", %FORM1_BUTTON2, CVal&, 25, 1,  EZ_ODIFont
                   END IF
              CASE  %FORM1_BUTTON3
                   FORM1_BUTTON3_Events CID&, CMsg&, CVal&, Cancel&
                   IF CMsg&=%EZ_OwnerDraw THEN
                        EZ_Draw3DButtonE "Form1", %FORM1_BUTTON3, CVal&, 25, 1,  EZ_ODIFont
                   END IF
              CASE  %FORM1_BUTTON4
                   FORM1_BUTTON4_Events CID&, CMsg&, CVal&, Cancel&
                   IF CMsg&=%EZ_OwnerDraw THEN
                        EZ_Draw3DButton "Form1", %FORM1_BUTTON4, CVal&, 20, 0,  EZ_ODIFont
                   END IF
              CASE  %FORM1_BUTTON5
                   FORM1_BUTTON5_Events CID&, CMsg&, CVal&, Cancel&
                   IF CMsg&=%EZ_OwnerDraw THEN
                        EZ_Draw3DButtonRR "Form1", %FORM1_BUTTON5, CVal&, 20, 0,  EZ_ODIFont
                   END IF
              CASE  %FORM1_BUTTON6
                   FORM1_BUTTON6_Events CID&, CMsg&, CVal&, Cancel&
                   IF CMsg&=%EZ_OwnerDraw THEN
                        EZ_Draw3DButtonE "Form1", %FORM1_BUTTON6, CVal&, 20, 0,  EZ_ODIFont
                   END IF
              CASE  %FORM1_MCI1
                   FORM1_MCI1_Events CID&, CMsg&, CVal&, Cancel&
              CASE  %FORM1_BUTTON10
                   FORM1_BUTTON10_Events CID&, CMsg&, CVal&, Cancel&
                   IF CMsg&=%EZ_OwnerDraw THEN
                        EZ_Draw3DButtonRR "Form1", %FORM1_BUTTON10, CVal&, 25, 1,  EZ_ODIFont
                   END IF
              CASE  %FORM1_BUTTON11
                   FORM1_BUTTON11_Events CID&, CMsg&, CVal&, Cancel&
                   IF CMsg&=%EZ_OwnerDraw THEN
                        EZ_Draw3DButtonRR "Form1", %FORM1_BUTTON11, CVal&, 20, 0,  EZ_ODIFont
                   END IF
              CASE  %FORM1_PLISTBOX1
                   FORM1_PLISTBOX1_Events CID&, CMsg&, CVal&, Cancel&
              CASE  %FORM1_FLISTBOX1
                   FORM1_FLISTBOX1_Events CID&, CMsg&, CVal&, Cancel&
              CASE ELSE
                   FORM1_Events CID&, CMsg&, CVal&, Cancel&
         END SELECT
    END SUB
    '
    ' ======================================
    ' [USER ACCESSABLE CODE]  You may Edit !
    ' ======================================
    '
    SUB FORM1_Events(CID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CID&
              CASE %EZ_Window
                   SELECT CASE CMsg&
                        CASE %EZ_Loading
                        CASE %EZ_Loaded
                        CASE %EZ_Started
                        CASE %EZ_Close
                        CASE ELSE
                   END SELECT
              CASE ELSE
         END SELECT
    END SUB
    '
    SUB FORM1_BUTTON1_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click
              CASE ELSE
         END SELECT
    END SUB
    '
    SUB FORM1_BUTTON2_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click
              CASE ELSE
         END SELECT
    END SUB
    '
    SUB FORM1_BUTTON3_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click
              CASE ELSE
         END SELECT
    END SUB
    '
    SUB FORM1_BUTTON4_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click
              CASE ELSE
         END SELECT
    END SUB
    '
    SUB FORM1_BUTTON5_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click
              CASE ELSE
         END SELECT
    END SUB
    '
    SUB FORM1_BUTTON6_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click
              CASE ELSE
         END SELECT
    END SUB
    '
    SUB FORM1_MCI1_Set(BYVAL C$)
    END SUB
    '
    SUB FORM1_MCI1_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click
              CASE ELSE
         END SELECT
    END SUB
    '
    SUB FORM1_BUTTON10_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click
              CASE ELSE
         END SELECT
    END SUB
    '
    SUB FORM1_BUTTON11_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click
              CASE ELSE
         END SELECT
    END SUB
    '
    SUB FORM1_PLISTBOX1_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Change
              CASE ELSE
         END SELECT
    END SUB
    '
    SUB FORM1_FLISTBOX1_Init(BYVAL FormName$, BYVAL IDNum&)
         LOCAL P$
         STATIC FirstFlag&, ImgListNum&
         IF FirstFlag&=0 THEN
              ImgListNum&=-1
              FirstFlag&=1
         END IF
         EZ_FLUseImageList FormName$,IDNum&, ImgListNum&
         EZ_FLSetStyle FormName$,IDNum&, "DSF"
         EZ_SetText FormName$,IDNum&, EZ_AppPath+"*.*"
    END SUB
    '
    SUB FORM1_FLISTBOX1_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Updated
              CASE ELSE
         END SELECT
    END SUB
    
    ezsamp.png

    The above example contains a number of ownerdraw buttons, a property listbox control, a files listbox control and an MCI control.

  7. #7
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,529
    Rep Power
    170
    Now this looks much better- especially the code below line 230 is much closer to the kind of basic that I like. Still the stuff in the user-editeable sections above which confuses me a little - but in general pleases much more to read than win32-gibberish-callbacks
    I think there are missing some Forum-sections as beta-testing and support

  8. #8
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,529
    Rep Power
    170
    The generated basic code - propably powerbasic - seems to work without any change on the first sight.

    EZ sounds like fun to me and fast results when it comes to create some windows-app with some controls - and also easy if it comes to change maybe just the position and size of a button to squeeze another one in or fast re-arrange the whole stuff when I think - the graphics-display might look better on the left instead right and the buttons above instead of below etc.

    Now EZGUI needs some entry-point - some tB-function-Pointer to EZ_Main that gets passed when TBMain-Function launches EZGUI-Runtimes?

    Where's the hook? Why do you think it won't work? Does the script have to be compiled?

    I'm just some hobbyist that codes for fun and not a professional programmer so I have not that big insight - especially not when it comes to win32 and other crimes MS commited at their users
    Last edited by ReneMiner; 07-09-2013 at 07:00.
    I think there are missing some Forum-sections as beta-testing and support

  9. #9
    In Internet slang, a troll (/ˈtrl/, /ˈtrɒl/) is a person who sows discord on the Internet by starting arguments or upsetting people,[1] by posting inflammatory,[2] extraneous, or off-topic messages in an online community (such as a forum, chat room, or blog), either accidentally[3][4] or with the deliberate intent of provoking readers into an emotional response[5] or of otherwise disrupting normal on-topic discussion.[6]

  10. #10
    I think I talked to Eros about this in the past and Thinbasic because it is a scripting language , it would not interface with the EZGUI runtimes properly. If EZGUI was just a set of API wrappers, it might have been possible to port some of it to thinbasic modules, but it isn't.

    Now a better solution would be to create an EZGUI emulation as a thinbasic module.

    I don't have this listed on my web site anymore, but you can download this DDT based Visual Designer for use with PowerBasic:

    (Link Removed !)

    It generates PowerBasic code and uses DDT for the GUI stuff. There is an include file which has an emulation layer to make it more like EZGUI, including event generation. The source code should be portable to ThinBasic and could be used as the basis of a ThinBasic - EZGUI module for easier coding.

    Why not download it and take a look at the code. While it is only rudimentary, it could be the basis of an open source project to build an EZGUI like command set for ThinBasic. Because it is uses PowerBasic DDT commands (which is how ThinBasic current handles GUI stuff), a thinbasic module built using it would be compatible with the current GUI command set in thinbasic too.


    Download the designer ASAP, since I will leave it available for only a short time. I don't want this designer distibuted enmass. At minimum you can use it and make a copy available to Eros and Petr and see if it could become the basis of a ThinBasic EZGUI module. If you are interested and it would work I would be willing to open source the include file.
    Last edited by Chris Boss; 06-09-2013 at 21:32.

Page 1 of 4 123 ... LastLast

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •