5E Product Walkthrough Playlist
  1. #1

    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>
    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!
    Ultimate License Holder

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    Quote Originally Posted by GrimmSpector View Post
    Can't find any documentaton on addTextWidget, hoping someone can point me in the right direction.
    https://www.fantasygrounds.com/refdo...#addTextWidget

    Quote Originally Posted by GrimmSpector View Post
    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.
    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!

  3. #3
    Quote Originally Posted by Trenloe View Post
    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.
    Didn't think to look in widgetcontainer...thanks so much Trenloe, seems I'm on the right path!
    Ultimate License Holder

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Starfinder Playlist

Log in

Log in