No announcement yet.

integrating EGrid32 and EZGUI

  • Filter
  • Time
  • Show
Clear All
new posts

  • integrating EGrid32 and EZGUI

    The MLG demo comes with a .ezc and sample project. Are there any sample projects for EGrid32? Also, does adding controls to cells work within a EZGUI project?
    Erich Schulman (KT4VOL/KTN4CA)
    Go Big Orange

  • #2
    The first thing is to create an EZC (custom control definition) file for EGrid.

    Here is an explanation of how to do it:

    Here is an example of an EZC file I created for EGrid:

    To make EGrid work with EZGUI, first make sure the EZC file is correctly defined (proper paths, etc.) and copied to the same folder as the designer (the folder you installed EZGUI too).

    Then copy the Egrid DLL to the same folder as the designer.

    In the designer make sure EGrid shows up in the list (combobox) of controls in the custom control property dialog (Create a custom control, double click it to see dialog). If it is there then the Designer successfully loaded the EGrid EZC file and DLL.

    In your project, go to the project properties dialog and there is an option for :


    set this property to "1 - On"

    This will generate the EZ_AllowNotifyEvents command in EZ_Main so your controls can get the %EZ_Notify event (this is for WM_NOTIFY messages EZGUI does not recognize).

    Also go to the property:

    "Copy Runtimes with Project"

    Set this to "3 - All" so all the runtime DLL's including Egrid will be copied to your projects source code folder.

    Now in your forms you can create your custom control and define it as Egrid. Make sure you select the event %EZ_Notify in the event list of the controls property dialog.

    Now when you generate code you should should get a generate event routine like this:

    SUB FORM2_EGRID1_Notify(BYVAL CVal&, Cancel&)
         LOCAL hCtrl&, ID&, NCode&
         EZ_GetNotify CVal&, hCtrl&, ID&, NCode&
         SELECT CASE NCode&   ' Notification Code
              CASE ELSE
         END SELECT
    This routine is specifically for the %EZ_Notify event (same as WM_NOTIFY in the API). The EZ_GetNotify command will return the controls handle (hCtrl&), ID number and the current notification message code (NCode&) which is the notification event generated by EGrid sent via WM_NOTIFY.

    The Designer will also generate a normal event routine for any non-WM_NOTIFY events the control may generate (or WM_NOTIFY which EZGUI recognizes like NM_CLICK). It will look like this:

    SUB FORM2_EGRID1_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click
              CASE ELSE
         END SELECT
    Most of your coding will be in the _Notify (ie. FORM2_EGRID1_Notify) routine, but Egrid may generate some other events in the normal event routine. For example if Egrid (or any custom control) generates the following WM_NOTIFY notification messagesm they are converted to EZGUI events and will be passed to the normal event routine:

    %NM_CLICK will be sent as %EZ_Click
    %NM_DBLCLK will be sent as %EZ_DClick
    %NM_SETFOCUS will be sent as %EZ_Focus
    %NM_KILLFOCUS will be sent as %EZ_NoFocus

    Also if the control is subclassed you will get other EZGUI events like %EZ_LButtonDown, %EZ_LButtonUp, %EZ_MButtonUp, %EZ_RButtonUp and some others which will be sent to the normal event routine.
    Chris Boss
    Computer Workshop
    Developer of "EZGUI"


    • #3
      It should be pointed out that in EZGUI when a control gets the %EZ_Notify event, the CVal& paramater holds the same value as lParam would for the WM_NOTIFY message (API). This means that CVal& holds a pointer to the NMHDR structure and can be used as such.


      hWnd& = @NM.hwndFrom
      Chris Boss
      Computer Workshop
      Developer of "EZGUI"


      • #4
        Here is a better description of how to use Egrid with EZGUI's designer (a complete tutorial with pictures):

        Here is a post by an EZGUI user with some support code he uses with Egrid which he posted for the benefit of others:

        Chris Boss
        Computer Workshop
        Developer of "EZGUI"


        • #5
          Egrid32 comes with an ezc file too. To download it, go to, in the
          Upgrade page, enter your registration information and, instead of a serial number,
          enter: EXTRAS

          You will be able to download a special ZIP file containing lots of useful things.
          I think Chris covered all the EZGUI's part, if you need help in the Egrid32's part,
          ill be glad to help.


          • #6
            Oh by the way, In the second link Chris posted, Jeffrey displays a pretty advanced
            Egrid32's example. He made some very good tweaks in Egrid32 (its very flexible) to
            allow some of M$ Excell behaviour.

            Dont be scared, Egrid32 doesnt require that much code unless you are an advanced
            user and know exactly what you want to do, like Jeffrey do.