Discussion:
Changing text in all fields in all forms to uppercase
(too old to reply)
Prem
2008-04-24 13:12:01 UTC
Permalink
Hi, does anyone know of a global property or any other way of achieving this?

I know there is the changecase property for Form controls and for string
EDTs but I need this behavior system wide and changing it for individual
fields will be too tedious.

Any suggestions appreciated. Thanks!
Mathias
2008-04-28 14:23:01 UTC
Permalink
This post might be inappropriate. Click to display it.
Prem
2008-04-29 05:51:01 UTC
Permalink
Hi Mathias,

Thanks a lot! Your solution is a big step forward and it works! What could
make it better is if it could loop through the labels of enums and change
them to uppercase too, any idea how to do that?

I also noticed that while typing into the fields in the form it accepts
input in any case (lower or upper) and when it saves it displays in upper
case. However if you change the changeCase property of the string form
control at design time to upper case then it accepts input in only upper
case. Any idea how to achieve this in your code during run time? Please let
me know if the question is not clear.

Thanks again!

Prem
Post by Mathias
Hello,
you can change the class syssetupfromrun to modify all forms on runtime.
write your method which will iterator through all formcontrols on the
current design and set the property changecase to uppercase.
it have to look like this.
void change2uppercase(Object _parentControl)
{
counter ctrlCnt;
FormStringcontrol control;
FormBuildcontrol c;
;
for (ctrlCnt = 1; ctrlCnt <= _parentControl.controlCount(); ctrlCnt++)
{
c = _parentControl.controlNum(ctrlCnt);
if (SysFormRun::controlType(classidget(c)) == FormcontrolType::String)
{
control = _parentControl.controlNum(ctrlCnt);
control.changeCase(2);
}
else if (c.isContainer())
{
this.change2uppercase(c);
}
}
}
this method will change the property changecase to uppercase on all
formstringcontrols.
now you only have to call this method on the init() method after super()
this.change2uppercase(this.design());
I hope this is what you are looking for.
Kind regards
--
Mathias Füßler
my blog: http://starside.eu
Post by Prem
Hi, does anyone know of a global property or any other way of achieving this?
I know there is the changecase property for Form controls and for string
EDTs but I need this behavior system wide and changing it for individual
fields will be too tedious.
Any suggestions appreciated. Thanks!
Mathias
2008-04-29 07:45:00 UTC
Permalink
This post might be inappropriate. Click to display it.
Prem
2008-04-29 08:49:00 UTC
Permalink
Hi Mathias,

It works great! Don't worry about the enums, not really needed anymore.

Thanks again!

Prem
Post by Mathias
Hello Prem,
with some minor modifications you will can fix the string problem.
you will need to change the new method "change2uppercase" from
FormStringcontrol control;
to
FormBuildStringControl control;
Now you will have to change the init method to
public void init()
{
this.change2uppdercase(this.form().design());
super();
SysSecurityFormSetup::loadSecurity(this);
}
That should do it, because you will change the control before they got
initialised.
I hope this works.
I dont know about the enums yet...
Regards
--
Mathias Füßler
my blog: http://starside.eu
Post by Prem
Hi Mathias,
Thanks a lot! Your solution is a big step forward and it works! What could
make it better is if it could loop through the labels of enums and change
them to uppercase too, any idea how to do that?
I also noticed that while typing into the fields in the form it accepts
input in any case (lower or upper) and when it saves it displays in upper
case. However if you change the changeCase property of the string form
control at design time to upper case then it accepts input in only upper
case. Any idea how to achieve this in your code during run time? Please let
me know if the question is not clear.
Thanks again!
Prem
Post by Mathias
Hello,
you can change the class syssetupfromrun to modify all forms on runtime.
write your method which will iterator through all formcontrols on the
current design and set the property changecase to uppercase.
it have to look like this.
void change2uppercase(Object _parentControl)
{
counter ctrlCnt;
FormStringcontrol control;
FormBuildcontrol c;
;
for (ctrlCnt = 1; ctrlCnt <= _parentControl.controlCount(); ctrlCnt++)
{
c = _parentControl.controlNum(ctrlCnt);
if (SysFormRun::controlType(classidget(c)) == FormcontrolType::String)
{
control = _parentControl.controlNum(ctrlCnt);
control.changeCase(2);
}
else if (c.isContainer())
{
this.change2uppercase(c);
}
}
}
this method will change the property changecase to uppercase on all
formstringcontrols.
now you only have to call this method on the init() method after super()
this.change2uppercase(this.design());
I hope this is what you are looking for.
Kind regards
--
Mathias Füßler
my blog: http://starside.eu
Post by Prem
Hi, does anyone know of a global property or any other way of achieving this?
I know there is the changecase property for Form controls and for string
EDTs but I need this behavior system wide and changing it for individual
fields will be too tedious.
Any suggestions appreciated. Thanks!
Loading...