Page 1 of 1

Adding Controls at Runtime

Posted: Fri Jun 21, 2013 4:21 pm
by pungggi
Hello im evaluating runrev.

so, before looking to deep, im wonder if it is possibile
to write code for adding controls at runtime?

best regards

Re: Adding Controls at Runtime

Posted: Fri Jun 21, 2013 4:43 pm
by Klaus
Hi pungggi,

sure you can!
Check "create" and "templateXXX" in the dictionary, where XXX stands for button, field or any other LC control.

Example to create a field with font ARIAL, fontsize 14, at the topleft of the current card, 300 pixel wide, 400 pixel high:
...
set the textfont of the templateFIELD to "Arial"
set the textsize of the templateFIELD to 14
set the rect of the templatefield to 0,0,300,400
## Set whatever properties your new field should have...

## Now create a field with the above set props
create field
...

Best

Klaus

Re: Adding Controls at Runtime

Posted: Fri Jun 21, 2013 4:57 pm
by pungggi
Hi Klaus, danke for the quick answer..

and this way i could theratically build the entire layout of the app?

Exactly what I was looking for!

Re: Adding Controls at Runtime

Posted: Fri Jun 21, 2013 5:22 pm
by Klaus
Hi pungggi,

yes, that is possible! :-)

But remember that standalones have a "scriptlimit"!
Check "scriptlimits" in the dictionary for more info!


Best

Klaus