To Nages : xbrowse and Language error

To Nages : xbrowse and Language error

Postby Silvio.Falconi » Sun Feb 09, 2014 11:25 am

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 ?
Last edited by Silvio.Falconi on Wed Mar 05, 2014 9:08 am, edited 1 time in total.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6867
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse and Language error

Postby James Bott » Mon Feb 10, 2014 5:33 pm

Maybe after the language is changed, open the browse in a hidden window, then save it's state, then close the hidden window.
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: xbrowse and Language error

Postby Silvio.Falconi » Wed Feb 12, 2014 1:37 am

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 ...
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6867
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse and Language error

Postby James Bott » Wed Feb 12, 2014 1:16 pm

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: xbrowse and Language error

Postby FranciscoA » Wed Feb 12, 2014 3:12 pm

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 J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2132
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: xbrowse and Language error

Postby James Bott » Wed Feb 12, 2014 5:08 pm

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: xbrowse and Language error

Postby Silvio.Falconi » Fri Feb 14, 2014 8:18 am

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!!
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6867
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse and Language error

Postby Silvio.Falconi » Mon Feb 17, 2014 12:21 pm

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 !!
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6867
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse and Language error

Postby Silvio.Falconi » Tue Feb 18, 2014 4:03 pm

Nages,
any solution ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6867
Joined: Thu Oct 18, 2012 7:17 pm

Re: To Nages : xbrowse and Language error

Postby Silvio.Falconi » Wed Mar 05, 2014 9:09 am

Nages,
any solution ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6867
Joined: Thu Oct 18, 2012 7:17 pm

Re: To Nages : xbrowse and Language error

Postby Silvio.Falconi » Sun Mar 16, 2014 3:15 pm

Antonio, Possible there is not a solutuon ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6867
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 133 guests