Page 1 of 2

method to building a screen with many objects

Posted: Wed Feb 16, 2022 10:53 am
by Maxz
what is the elegant method to build a screen full of GETs, TABPAGES, ecc. and avoid the sequential display (slow refresh) of the objects that you are populating ?

it would be possible to display an hourglass or a bitmap like 'wait...' in center of the drawingarea that hides the preparation of everything ?
it is terrible to show the composition of a screen piece by piece

max

Re: method to building a screen with many objects

Posted: Wed Feb 16, 2022 2:14 pm
by Auge_Ohr
hi Max,

every Xb-Part have Parameter <lVisible> at New() / Create() which is DEFAULT .T.

use Dialog with .F. and when all finsh "just" oDialog:Show()
remember to "fill" Listbox() ComboBox() or "Browse" before "Show" Dialog

p.s. opposite of o:Show() is o:Hide()

Re: method to building a screen with many objects

Posted: Wed Feb 16, 2022 3:53 pm
by rdonnay

Code: Select all

DCGETOPTIONS ;
  BUSYMESSAGE 'Building Screen Objects. Please wait..'   COLOR GRA_CLR_DARKGREEN  

Re: method to building a screen with many objects

Posted: Wed Feb 16, 2022 11:27 pm
by Tom
Take a look at DC_MergeGetlists(), which still is a good way to create objects on tabpages only if they are needed.

Jimmy ("Auge_ohr") doesn't use eXpress++, so forget what he mentions here.

Re: method to building a screen with many objects

Posted: Thu Feb 17, 2022 12:45 am
by Maxz
I solved the problem by creating the dialog window with Visible = .F. and after building all GETs, TABPAGE, etc. i used:

DCGETOPTIONS EVAL {||dialog:show()}

If I've more time I will try Tom's solution using DC_MergeGetlists(), which sould be more efficient


Thanks to all for the help

Re: method to building a screen with many objects

Posted: Thu Feb 17, 2022 12:56 am
by skiman
Hi Maxz,

Just wondering how many objects you have in a screen? It looks as you are concerned about speed, while I never had issues with it in 'normal' screens in my application.

When using tabpages, you only create the objects if that tabpages gets focus. WIth DC_MergeGetlists you add the new tab-content to the getlist.

Since a few months there is also a modification in eXpress++ so 'non-visible' objects are not refreshed with a dc_getrefresh(). Also with dc_getrefresh() you can define which objects needs to be refreshed. In a lot of cases you don't need to refresh everything.

See the sample in XDemo - Sample program 5 - MergeGets 2.

Re: method to building a screen with many objects

Posted: Thu Feb 17, 2022 1:15 am
by Auge_Ohr
hi Tom,

to "hide" Control when build Screen is not only for Xbase++ / Express++ :naughty:
it is for all GUI Apps while "paint" Control need much Time.

Marx is a new User and he should know what Xbase++ Original "can do"
Express++ is based on Xbase++ so all what Xbase++ "can do" will work with Express++

i agree that Express++ have many Things which are more "Powerfull"
as Marx have a Express++ License (?) he should use it.

Re: method to building a screen with many objects

Posted: Thu Feb 17, 2022 3:22 am
by Tom
Hi, Jimmy.

The HIDE clause does that for eXpress++-users. It just maybe confusing to talk about object properties while this is wrapped by the tool used here. Besides, object properties can and should be used although they are created with eXpress++!

Anyway, hiding objects does not improve the speed of building a dialog.

Maxz: There is a HIDE option in DCGET OPTIONS, which does that for you. You don't need to set an o:Visible := .F. at every object.

Re: method to building a screen with many objects

Posted: Thu Feb 17, 2022 3:50 am
by Maxz
Yes Tom, I understood your suggestion perfectly but my quick and acceptable solution was this:

- I create always an XbpDialog (oDialog) to generate the screen where to build the GETs [ XbpDialog():New(oMainWindow, , aPos, aSize, , .F. ) ]
- only this part is in :hide() state during the process of population of the GETs
- all GETs are parent of oDialog
- when the DCREAD GUI loop starts I put the dialog box in :Show() state

The result is that the user waits 1 or 2 seconds and the screen appears complete with everything

for me this is already a success!! - What do you think?

ps. maybe it would be better if I did an intensive course with you ... :D

Re: method to building a screen with many objects

Posted: Fri Feb 18, 2022 6:21 am
by Maxz
Tom, I would like to experiment with your suggestion for creating screens as the user tries to access a TABPAGE
if I understand correctly, the technique is to populate the next TABPAGE only when the object is made active his focus, right ?

for example:
@ 0,0 DCTABPAGE oTabPage2 CAPTION 'tabpage2' ;
RELATIVE oTabPage1 ;
GOTFOCUS {||PreparePage2()}

@ 0,0 DCTABPAGE oTabPage3 CAPTION 'tabpage3' ;
RELATIVE oTabPage2 ;
GOTFOCUS {||PreparePage3()}

within the PreparePageN() routine it is sufficient to create the GETs and use DC_MergeGetlists ?