Posts: 151
Threads: 90
Joined: Aug 2014
I want to be able to change more than one language in my program.
Ex: english, Japanese and etc
I would like to use a combo box to separate the languages and change the language of the tooltip, button, Static etc.
Please advise which command should be used.
Posts: 12,065
Threads: 140
Joined: Dec 2002
Function
Dialog205
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;1 Button 0x54030001 0x4 116 116 48 14 "`OK"
;2 Button 0x54030000 0x4 168 116 48 14 "`Cancel" "`ttCancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040400 "*" "" "" ""
ARRAY(lpstr) aLang.create(2)
lpstr lang
lang=
;OK, OK 1
;Cancel, Cancel 1
;ttCancel, Tooltip 1
aLang[0]=lang
lang=
;OK, OK 2
;Cancel, Cancel 2
;ttCancel, Tooltip 2
aLang[1]=lang
int iLang=ListDialog("Language 1[]Language 2")-1
if(iLang<0) ret
IStringMap m._create
m.AddList(aLang[iLang] "csv")
REPLACERX r.frepl=&sub.Callback_str_replacerx; r.paramr=&m
dd.replacerx("(?<='')(`.+?)(?='')" r)
;out dd
if(!ShowDialog(dd 0 0)) ret
#sub Callback_str_replacerx
function# REPLACERXCB&x
IStringMap& m=+x.rrx.paramr
lpstr repl=m.Get(x.match+1)
if(repl) x.match=repl
Posts: 151
Threads: 90
Joined: Aug 2014
It has been able to change the language, thank you very much.
Can not change string in combo box?
Function
Function12
\Dialog_Editor
out
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 ComboBox 0x54230243 0x0 16 28 96 213 ""
;1 Button 0x54030001 0x4 116 116 48 14 "`OK"
;2 Button 0x54030000 0x4 168 116 48 14 "`Cancel" "`ttCancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040202 "*" "" "" ""
ARRAY(lpstr) aLang.create(2)
lpstr lang
lang=
;OK, OK 1
;Cancel, Cancel 1
;ttCancel, Tooltip 1
aLang[0]=lang
lang=
;OK, OK 2
;Cancel, Cancel 2
;ttCancel, Tooltip 2
aLang[1]=lang
int iLang=ListDialog("Language 1[]Language 2")-1
if(iLang<0) ret
IStringMap m._create
m.AddList(aLang[iLang] "csv")
REPLACERX r.frepl=&sub.Callback_str_replacerx; r.paramr=&m
dd.replacerx("(?<='')(`.+?)(?='')" r)
out dd
;if(!ShowDialog(dd 0 0)) ret
str controls = "3"
str cb3="&Default[]test1[]test2[]test3"
if(!ShowDialog(dd 0 &controls)) ret
#sub Callback_str_replacerx
function# REPLACERXCB&x
IStringMap& m=+x.rrx.paramr
lpstr repl=m.Get(x.match+1)
if(repl) x.match=repl
Posts: 12,065
Threads: 140
Joined: Dec 2002
Macro
Macro2732
sel iLang
,case 0
,cb3="&Default A[]test1 A"
,
,case 1
,cb3="&Default B[]test1 B"
,