Page 1 of 2
dc_autorestorebrowse
Posted: Thu Oct 30, 2014 7:39 am
by Koverhage
in some modules i use this function.
Up to build 254 i have no problem (except the problem with added cols)
I can resize the columns and the changes are stored and restored.
In build 259 and higher is i get the message
your saved browse configuration cannot be restored, even i not change anything.
What can i do to locate the problem ? (i can't make a sample the source is to complex)
I added the code for dc_autorestorebrowse to xsample4.prg (xsample_130) but there it worked.
(xsample_130 is similar my function)
Re: dc_autorestorebrowse
Posted: Thu Oct 30, 2014 7:53 am
by rdonnay
Klaus -
You have had build 259 for 10 months now.
I am not going to go back and work on problems with 259.
I will address all your open issues if you can prove that they exist in build 260.
Roger
Re: dc_autorestorebrowse
Posted: Thu Oct 30, 2014 7:58 am
by Tom
Hi, Klaus.
Looks like your'e using the same ID for two (or more) different browses.
Re: dc_autorestorebrowse
Posted: Thu Oct 30, 2014 9:18 am
by rdonnay
Code: Select all
IF nColumns # Len(aConfig[3])
IF Valtype(::configMessageBlock) == 'B'
Eval(::configMessageBlock,self)
ELSE
DCMSGBOX 'Your Saved Browse configuration cannot be restored:', ;
DC_AutoRestoreBrowse()[2]+'\'+::restoreProc ;
TIMEOUT 5
IF Valtype(DC_AutoRestoreBrowse()[1]) == 'B'
Eval(DC_AutoRestoreBrowse()[1],::restoreProc)
ELSE
DC_RegWrite(DC_AutoRestoreBrowse()[1],DC_AutoRestoreBrowse()[2], ;
::restoreProc, 0)
ENDIF
ENDIF
BREAK
ENDIF
The above code was added due to a customer request.
I don't remember who asked for it, but it has given me some grief over the past few years.
It's because some eXpress++ users don't understand exactly what it takes to restore a browse configuration.
When a browse configuration is saved in the registry, it is saved as an array of column info.
When it is restored, the column info is applied to the DC_XbpColumn() objects when they are created.
If you remove or add a column to your browse, then the registry information no longer matches the number of columns, thus causing eXpress++ to display the message. To remove the message, it's simply a matter of saving the new browse or deleting the browse configuration from the registry. I have tried to give eXpress++ user more tools for deleting registry entries with the new DC_Reg* functions. Some programmers have suggested that I just fail to restore the browse configuration if columns have been added or deleted. Others have said that they don't like this idea because then their users will complain when their browse configuration has been lost. No matter how I look at this issue, I cannot satisfy all eXpress++ programmers. It looks like it will require a much more sophisticated restoration routine that restores only columns that are in the registry. I ran the risk of breaking existing applications if I made such a radical change, so I thought I would forget about it unless it became a big issue. You are the first to bring it up in over a year, so I assumed it is not a big issue. I can put this on the list for the next major upgrade, but for now I only intend to deal with regression issues in build 260 and will give fixes that will eventually become the next build.
Re: dc_autorestorebrowse
Posted: Thu Oct 30, 2014 10:45 am
by Koverhage
Roger,
you should not go back to 259. I ask if any one give me a hint where or how i can find my error.
Re: dc_autorestorebrowse
Posted: Thu Oct 30, 2014 11:14 am
by rdonnay
You need to look at the registry where the browse configurations are saved.
If you delete the entry for that browse, the message will go away.
Re: dc_autorestorebrowse
Posted: Thu Oct 30, 2014 11:23 pm
by Koverhage
I have deleted the entry for this browse again and again.
true: at the first call no message is displayed,
false: after the first call, the message is always displayed.
Now, i will check the values (m,ust be the same)
Re: dc_autorestorebrowse
Posted: Fri Oct 31, 2014 7:04 am
by rdonnay
Can you please send me the source that contains the DCBROWSE and DCBROWSECOL commands? I only need to see the source code. I don't need to have a sample program.
Re: dc_autorestorebrowse
Posted: Fri Oct 31, 2014 8:36 am
by Koverhage
Ok, i send the source via E-Mail.
Re: dc_autorestorebrowse
Posted: Sun Nov 02, 2014 10:15 am
by rdonnay
I believe your problem is due to the conditional compiling which changes the number of columns.
I suspect that you have the problem only after re-compiling under a different condition.
By giving each condition a different ID, you will create multiple configurations in the registry and this should solve the problem.
Code: Select all
cID := 'GARAETEMIETER'
#ifndef RAUMFIX
cID := 'GARAETEMIETER_RAUMFIX'
#endif
@ (lastrow/2)+3, 0 DCBROWSE oBrowGer ALIAS 'ge' SIZE lastcol-4,(lastrow/2)-3 ;
PRESENTATION aPres ID cID SCOPE;
EDIT xbeBRW_ItemSelected MODE DCGUI_BROWSE_EDITDOWN ;
MKCOLOR { || YES }, { || sayfarbe() }