Page 1 of 1

Tab Merge - a new feature in eXpress++

Posted: Mon Jun 04, 2012 10:28 am
by rdonnay
Before releasing build 257, I am hoping to get some feedback on a new feature I have added to eXpress++.

Many of you are familiar with DC_MergeGetLists() and the need for this function.
This was added as a necessity after Tom Liehr visited me in Boise, ID about 11 years ago.

It solved a lot of performance problems for eXpress++ users, but it was a bit cumbersome to use for some because it often required passing a lot of local variables by reference.

I got an idea a few days ago after working on a customer's app that took far too long to create a dialog. He had hundreds of objects on 6 tabpages. His code was written in such a way that it would take longer than I wanted to move code around and use DC_MergeGetLists(). Also, there was a problem with resizing. If a tabpage is resized before being clicked on, then the objects on that tabpage are not placed properly.

I believe that I have developed a much simpler solution to both problems.

I have added a new MERGECHILDREN clause to the @..DCTABPAGE command.
This causes DCREAD GUI to ignore creating items in the GetList which are children of a tabpage that uses this clause. The child objects will be created only after the tab is clicked on for the first time. A new ::createChildren() method calls DCREAD GUI to build the child objects on the tabpage if they are not already created.

The advantage of this feature is that a simple clause can be added to exisiting applications to give them improved performance when creating dialogs with tabpages.

To test this feature, here is a download that contains a new DCLIPX.DLL (compiled in build 355) and a DCDIALOG.CH file. The download also contains a sample program.

http://donnay-software.com:8080/donnay/tabmerge.zip

Unzip the tabmerge.zip in your \exp19\samples\tabpage folder and run TABMERGE.EXE.

Look at the below code. It is a sample program that demonstrates this new feature. If you comment out the MERGECHILDREN clauses and rebuild TABMERGE.XPJ, you will see that the load time is much longer.

#INCLUDE "dcdialog.CH"

Code: Select all

FUNCTION Main()

LOCAL GetList[0], oTab1, oTab2, oTab3, oTab4, aData[25,18], i, j, ;
      GetOptions

FOR i := 1 TO 25
  FOR j := 1 TO 18
    aData[i,j] := Space(10)
  NEXT
NEXT

@ 0,0 DCTABPAGE oTab1 CAPTION 'Tab 1' SIZE 190, 30 ;
      RESIZE DCGUI_RESIZE_RESIZEONLY

CreateGets(@oTab1,GetList,aData)

@ 0,0 DCTABPAGE oTab2 CAPTION 'Tab 2' RELATIVE oTab1 ;
      MERGECHILDREN ;
      RESIZE DCGUI_RESIZE_RESIZEONLY

CreateGets(@oTab2,GetList,aData)

@ 0,0 DCTABPAGE oTab3 CAPTION 'Tab 3' RELATIVE oTab2 ;
      MERGECHILDREN ;
      RESIZE DCGUI_RESIZE_RESIZEONLY

CreateGets(@oTab3,GetList,aData)

@ 0,0 DCTABPAGE oTab4 CAPTION 'Tab 4' RELATIVE oTab3 ;
      MERGECHILDREN ;
      RESIZE DCGUI_RESIZE_RESIZEONLY

CreateGets(@oTab4,GetList,aData)

DCGETOPTIONS RESIZE RESIZEDEFAULT DCGUI_RESIZE_REPOSONLY

DCREAD GUI FIT TITLE 'Tab Merge Sample' OPTIONS GetOptions

RETURN nil

* ------------

PROC appsys ; RETURN

* -------------

STATIC FUNCTION CreateGets( oTab, GetList, aData )

LOCAL i, j, oStatic

@ 2,5 DCSTATIC TYPE XBPSTATIC_TYPE_RECESSEDBOX SIZE 170,25 OBJECT oStatic PARENT oTab

FOR i := 1 TO 20
  FOR j := 1 TO 15
    @ i+2,j*10 DCGET aData[i,j] PARENT oStatic
  NEXT
NEXT

RETURN nil

Re: Tab Merge - a new feature in eXpress++

Posted: Mon Jun 04, 2012 11:51 am
by Tom
Looks like a great improvement! Will give it a try asap. :)

Re: Tab Merge - a new feature in eXpress++

Posted: Mon Jun 04, 2012 12:21 pm
by rdonnay
Here's an updated _DCCLASS.PRG and DCLIPX.DLL.

I forgot to apply GetOptions to the merge. Now it works.

http://donnay-software.com:8080/donnay/tabmerge.zip

Re: Tab Merge - a new feature in eXpress++

Posted: Mon Jun 04, 2012 12:28 pm
by bwolfsohn
Roger,

This sounds great... if i'm reading it correctly, it will solve a lot of performance issues with the opening up of our dialogs.

I'll try it out when i get home from the music festival in kerrville tx...

Re: Tab Merge - a new feature in eXpress++

Posted: Mon Jun 04, 2012 1:30 pm
by rdonnay
Brian -

You are reading it correctly.
I expect that you will see performance improvements.

Roger

Re: Tab Merge - a new feature in eXpress++

Posted: Mon Jun 04, 2012 11:21 pm
by c-tec
Hello Roger,
I have also very complex tab dialogs and use the old version with merging getlists for tabs since many years, it works perfect. The new version now can save a lot of coding and so prevent failures.
regards
Rudolf

Re: Tab Merge - a new feature in eXpress++

Posted: Tue Jun 05, 2012 6:59 pm
by RDalzell
Roger,

Attached are screen captures of a dialog before (original) and after (MergeTab).

As you can see, the screen is not rendered as before.

Rick

Re: Tab Merge - a new feature in eXpress++

Posted: Tue Jun 05, 2012 9:03 pm
by rdonnay
I will need to see your code.

Will you be available tomorrow afternoon for a Teamviewer session?

Re: Tab Merge - a new feature in eXpress++

Posted: Wed Jun 06, 2012 2:22 pm
by rdonnay
Rick -

I would like to understand your problem so I can get this working correctly and get build 257 out the door. Let me know when we can work together online.

Roger