GrimmSpector
February 23rd, 2016, 16:49
modifying the corerpg set into a new ruleset, still learning.
Look at this piece of code:
<template name="string_labeled">
<stringfield>
<font>sheettext</font>
<lineoffset default="on">1</lineoffset>
<script>
labelwidget = nil;
function onInit()
if labelres then
labelwidget = addTextWidget("sheetlabelinline", string.upper(Interface.getString(labelres[1])));
else
labelwidget = addTextWidget("sheetlabelinline", string.upper(label[1]));
end
if labelwidget then
local w,h = labelwidget.getSize();
labelwidget.setPosition("bottomleft", w/2, h/2-4);
end
end
</script>
</stringfield>
</template>
Can't find any documentaton on addTextWidget, hoping someone can point me in the right direction.
In addition, this template is being used to implement strings, I just want to confirm that with the inheritance, when you implement this as a control, that the database node would be parent.name, where parent is the databasenode attached to the window class, and the name is the name property of the string_labeled element we're using. Excuse me if my terminology is imperfect.
Thanks!
Look at this piece of code:
<template name="string_labeled">
<stringfield>
<font>sheettext</font>
<lineoffset default="on">1</lineoffset>
<script>
labelwidget = nil;
function onInit()
if labelres then
labelwidget = addTextWidget("sheetlabelinline", string.upper(Interface.getString(labelres[1])));
else
labelwidget = addTextWidget("sheetlabelinline", string.upper(label[1]));
end
if labelwidget then
local w,h = labelwidget.getSize();
labelwidget.setPosition("bottomleft", w/2, h/2-4);
end
end
</script>
</stringfield>
</template>
Can't find any documentaton on addTextWidget, hoping someone can point me in the right direction.
In addition, this template is being used to implement strings, I just want to confirm that with the inheritance, when you implement this as a control, that the database node would be parent.name, where parent is the databasenode attached to the window class, and the name is the name property of the string_labeled element we're using. Excuse me if my terminology is imperfect.
Thanks!