-
February 23rd, 2016, 16:49 #1
- Join Date
- Dec 2015
- Location
- Canada
- Posts
- 207
addTextWidget, and database for fields...
modifying the corerpg set into a new ruleset, still learning.
Look at this piece of code:
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>
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!Ultimate License Holder
-
February 23rd, 2016, 17:00 #2
https://www.fantasygrounds.com/refdo...#addTextWidget
Assuming the string_labeled control is directly in the window instance (i.e. not in a subwindow or a windowlist) then yes.Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
February 23rd, 2016, 17:23 #3
- Join Date
- Dec 2015
- Location
- Canada
- Posts
- 207
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks