Page 1 of 1

To Nages : xbrowse and Language error

PostPosted: Sun Feb 09, 2014 11:25 am
by Silvio.Falconi
If I save the state of a Xbrowse the class save the header of the columns of a table made with xbrowse,

it save the state on a Ini file and then can be call when the user open that table

If I wish change the language ( Italian to english, or to French, or to spanish ) with fwsetlanguage() function it change everything of my app but not the state of xbrowse saved because

the restore method of the xbrowse restore the name of the columns of the xbrowse before the changed language...



I found a solution bad:
I can erase the line of ini where I save the state but then I lose all the info as width of columns or if a column is showed or hided

How I can resolve this problem ?

Re: xbrowse and Language error

PostPosted: Mon Feb 10, 2014 5:33 pm
by James Bott
Maybe after the language is changed, open the browse in a hidden window, then save it's state, then close the hidden window.

Re: xbrowse and Language error

PostPosted: Wed Feb 12, 2014 1:37 am
by Silvio.Falconi
James,


1. the user open the xbrowse and I have Italian language
when I open the xbrowse the procedure create the columns and restore the state if the user saved it
you must think ... on a application i have mant and many xbrowses....
you must think another .. on a state I can save the width of columns and if a column is hide or show ,creation order, rowheight width ...

a sample of a state can be : ( Iwrote on blod the headers)

ESState=XS1:{{"_nCreationOrders",{1,2,3,4,5,6,7,8}},{"_nRowHeight",28},{"_nWidths",{40,80,80,80,80,80,80,80}},{"_lHides",{.F.,.F.,.F.,.F.,.F.,.F.,.F.,.F.}},{"_cGrpHdrs",{,,,,,,,}},{"_cHeaders",{"Attivo","Anno Esercizio","Cartella DATA","Cartella ZIP","Cartella XML","Cartella PDF","Cartella DOC","Cartella XLS"}}}
 

2. the user close the xbrowse and set english language
and cal the same xbrowse ....
the procedure restore that state ESState not translate anithing and restore the same header name


you sad I can open in a hide window ...good but I have allways the state ... I can erase the state but I lose all data info ...

Re: xbrowse and Language error

PostPosted: Wed Feb 12, 2014 1:16 pm
by James Bott
I understand what the problem is, I was just putting out a simple suggested solution. If you have lots of browses, then maybe the hidden window idea would be too slow and memory intensive.

How about creating a database of all the browse's fieldnames. You could then update all the INI file info using search-and-replace. Granted, it would be somewhat complicated but it should be fast once you figure out the programming.

James

Re: xbrowse and Language error

PostPosted: Wed Feb 12, 2014 3:12 pm
by FranciscoA
I have not an effective answer, because my fwh version is a bit old, and for that, I don't know how this function works..
I think if you change the language (without to close xbrowser), by using an option on the xbrowser's dialog, this would must change the headers, and then, when you get out the browser, changes will saved on ini file.

Just an idea.

Re: xbrowse and Language error

PostPosted: Wed Feb 12, 2014 5:08 pm
by James Bott
Francisco,

I think that would work, but as Silvio pointed out, the app has lots of browses. And you don't want the language change to be dependent on any browse being opened at the time of the change. So he needs a system that will change all of the INI file data at once, even when none of the browses are open.

James

Re: xbrowse and Language error

PostPosted: Fri Feb 14, 2014 8:18 am
by Silvio.Falconi
FranciscoA wrote:I have not an effective answer, because my fwh version is a bit old, and for that, I don't know how this function works..
I think if you change the language (without to close xbrowser), by using an option on the xbrowser's dialog, this would must change the headers, and then, when you get out the browser, changes will saved on ini file.

Just an idea.



Francisco,
I have an application with many and many xbrowses.
the user from a menu pulldown (utility ) can change the language.
the procedure must change the language on all the application.

for a sample I can change the main menu with

//refresh the Menu
::oWndMain:SetMenu( ::BuildMenu() )

If I insert a button on only one xbrowse as you sad the user have tha lnguage changed for that xbrowse but not for all xbrowses of application.

the error in on fwsetlanguage functions or on savestate method of xbrowse thet must control the cuurent language of application and set the right words!!!!!!


Now I resolve with

//refresh the header of the xbrowse
WritePProString("Browse","CuState","",::cIniUser)

and it for all xbrowses...

but it is wrong because I lose all setups of CuState
on custate there are some arrays

_nCreationOrders
_nWidths
_lHides
_cGrpHdrs
_cHeaders

if the language is change the savestate must rewrite of state for the array _cHeaders ..just an idea!!

Re: xbrowse and Language error

PostPosted: Mon Feb 17, 2014 12:21 pm
by Silvio.Falconi
we can try :

create a new data on xbrowse class sample xLang and save the lang into state (savestate method )

then to call the function HB_I18NGetLanguageName()

before to save a restore a state

and see if the current language is the same of the xlang data
and chane the arrays
_cGrpHdrs
_cHeaders

just an idea !!

Re: xbrowse and Language error

PostPosted: Tue Feb 18, 2014 4:03 pm
by Silvio.Falconi
Nages,
any solution ?

Re: To Nages : xbrowse and Language error

PostPosted: Wed Mar 05, 2014 9:09 am
by Silvio.Falconi
Nages,
any solution ?

Re: To Nages : xbrowse and Language error

PostPosted: Sun Mar 16, 2014 3:15 pm
by Silvio.Falconi
Antonio, Possible there is not a solutuon ?