dc_autorestorebrowse

This forum is for eXpress++ general support.
Message
Author
Koverhage
Posts: 151
Joined: Mon Feb 01, 2010 8:45 am

dc_autorestorebrowse

#1 Post 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)
Klaus

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dc_autorestorebrowse

#2 Post 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
The eXpress train is coming - and it has more cars.

User avatar
Tom
Posts: 1234
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: dc_autorestorebrowse

#3 Post by Tom »

Hi, Klaus.

Looks like your'e using the same ID for two (or more) different browses.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dc_autorestorebrowse

#4 Post 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.
The eXpress train is coming - and it has more cars.

Koverhage
Posts: 151
Joined: Mon Feb 01, 2010 8:45 am

Re: dc_autorestorebrowse

#5 Post 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.
Klaus

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dc_autorestorebrowse

#6 Post 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.
The eXpress train is coming - and it has more cars.

Koverhage
Posts: 151
Joined: Mon Feb 01, 2010 8:45 am

Re: dc_autorestorebrowse

#7 Post 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)
Klaus

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dc_autorestorebrowse

#8 Post 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.
The eXpress train is coming - and it has more cars.

Koverhage
Posts: 151
Joined: Mon Feb 01, 2010 8:45 am

Re: dc_autorestorebrowse

#9 Post by Koverhage »

Ok, i send the source via E-Mail.
Klaus

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dc_autorestorebrowse

#10 Post 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() }
The eXpress train is coming - and it has more cars.

Post Reply