PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → Write text into a control within a class
Write text into a control within a class
Started by J. Flietstra, Feb., 09 2004 10:55 PM - 8 replies
Posted on February, 09 2004 - 10:55 PM
Hello folks!
We are trying to make a translation Class. Sofar we have a loop where we loop through all controls But now we would like to write our own text into the controls.
Our source is now:
PROCEDURE TranslateWindow(WindowName,Language)
i is int = 1
ResControl is string
LOOP
ResControl = EnumControl(WindowName, i)
IF ResControl = "" THEN BREAK
Info(ResControl)
WindowName.ResControl..Text = "bla"
i++
END
We thought that WindowName.ResControl..Text would work but it doesn't.
Anyone any idea??

Kind Regards,

J. Flietstra

Kwik-Bit Automatisering
Posted on February, 10 2004 - 1:21 AM
Try this:
PROCEDURE TranslateWindow(WindowName,Language)
i is int = 1
ResControl is string
LOOP
ResControl = WindowName + "." + EnumControl(WindowName, i)
IF {ResControl} = "" THEN BREAK
Info(ResControl)
{ResControl} = "bla"
i++
END
//Be aware of ResControl dataType of ResControl...
Regs,
King
Hello folks!
We are trying to make a translation Class. Sofar we have a loop where we loop through all controls But now we would like to write our own text into the controls.
Our source is now:
PROCEDURE TranslateWindow(WindowName,Language)
i is int = 1
ResControl is string
LOOP
ResControl = EnumControl(WindowName, i)
IF ResControl = "" THEN BREAK
Info(ResControl)
WindowName.ResControl..Text = "bla"
i++
END
We thought that WindowName.ResControl..Text would work but it doesn't.
Anyone any idea??

Kind Regards,

J. Flietstra
Posted on February, 10 2004 - 1:24 AM
One more thing: Info({ResControl})
Try this:
PROCEDURE TranslateWindow(WindowName,Language)
i is int = 1
ResControl is string
LOOP
ResControl = WindowName + "." + EnumControl(WindowName, i)
IF {ResControl} = "" THEN BREAK
Info(ResControl)
{ResControl} = "bla"
i++
END
//Be aware of ResControl dataType of ResControl...
Regs,
King
Hello folks!
We are trying to make a translation Class. Sofar we have a loop where we loop through all controls But now we would like to write our own text into the controls.
Our source is now:
PROCEDURE TranslateWindow(WindowName,Language)
i is int = 1
ResControl is string
LOOP
ResControl = EnumControl(WindowName, i)
IF ResControl = "" THEN BREAK
Info(ResControl)
WindowName.ResControl..Text = "bla"
i++
END
We thought that WindowName.ResControl..Text would work but it doesn't.
Anyone any idea??

Kind Regards,

J. Flietstra
Posted on February, 10 2004 - 10:15 AM
Your code gerenate some errors...
When i change the code as below its works fine
Thanks and regards
Jonathan Flietstr
----------------------------
PROCEDURE Translation(WindowName,TranslationNumber)
i is int = 1
ResControl is string
LOOP
ResControl = EnumControl(WindowName, i)
IF ResControl = "" THEN BREAK
Info(ResControl)
{ResControl}..Text = "bla"
i++
END
Posted on February, 10 2004 - 10:40 AM
Hi,
just curious, why do you write your own translation class?
Raimund
Hello folks!
We are trying to make a translation Class. Sofar we have a loop where we loop through all controls But now we would like to write our own text into the controls.
Our source is now:
PROCEDURE TranslateWindow(WindowName,Language)
i is int = 1
ResControl is string
LOOP
ResControl = EnumControl(WindowName, i)
IF ResControl = "" THEN BREAK
Info(ResControl)
WindowName.ResControl..Text = "bla"
i++
END
We thought that WindowName.ResControl..Text would work but it doesn't.
Anyone any idea??

Kind Regards,

J. Flietstra



http://www.invitec.com
Posted on February, 10 2004 - 12:15 PM
>just curious, why do you write your own translation class?
Reasons
1. I want to learn Windev (classes/methods/components etc.)
2. I have to buy WDMSG OR WDINT (probably french language)
3. I do not want to translate button's on every screen (think about OK/Cancel)
4. I want translate the messages in the INFO("some text")
5. I want to write the translations in a database (hFile or SQl)
6. I want my own extern translation programm and reports
If you still curious, please tell me a better way?
Kind regards
Jonathan Flietstra
Posted on February, 10 2004 - 3:30 PM
Jonathan,
>1. I want to learn Windev (classes/methods/components etc.)
OK
2. I have to buy WDMSG OR WDINT (probably french language)

Available with 7 languages.
>3. I do not want to translate button's on every screen (think about OK/Cancel)
We use WDMSG for this. There are two scenarios where we use it:
1. OK/Cancel translations -> I click on the button "Copy trans." and all reference entries identical to the current one are translated.
2. We have translations for EN-US, EN-GB and EN-AU. The are some - little -differences (Steriliser in EN-GB, but Sterilizer in EN-US). We finish the translation in EN-GB, export then to text and import to EN-US.
4. I want translate the messages in the INFO("some text")

Where is the problem? Write
Info("Translated Text")
and place the curor somewhere in the text and hit Ctrl+T
>5. I want to write the translations in a database (hFile or SQl)
OK
6. I want my own extern translation programm and reports

We (will) use the translation button to translate from the DB field (say ExtrnDesc) to all languages. This is a point on my PC SOFT wish list. I want to have a way to insert from the clipboard into a multi-language caption. This would be a big steep for us on our way to standardize our translation issues.
Best regards


http://www.invitec.com
Posted on February, 10 2004 - 4:06 PM
Jonathan,
4. I want translate the messages in the INFO("some text")
Where is the problem? Write

Info("Translated Text")
and place the curor somewhere in the text and hit Ctrl+T

That's my point. This is on develop time. We want to do this after develop time
(at runtime)
We develop in dutch, and if a customers ask us for a german version we only want to start our external translaton programm (that's access our database written by the translation class)
A other question:
Can i automaticly declare something when i add a component to my project?
Kind Regards
Jonathan Flietstra
Posted on February, 11 2004 - 10:02 AM
Can i automaticly declare something when i add a component to my project?
Kind Regards

AFAIK no.