Thread: string_labeled
-
June 29th, 2017, 08:46 #1
- Join Date
- Apr 2009
- Location
- Fullerton, CA.
- Posts
- 625
string_labeled
I am using the Options manager to set the visibility of a few stringcontrols, it works fine for most of what I am changing, except for the strings that use the xml tag "string_labeled". The control shows/hides, well the line shows/hides, but the label does not. The label, when the line is shown, is missing.
I am using this:
Code:function updateDisplay() local bShow = OptionsManager.isOption("CGS", "dh1"); setVisible(bShow); end
-
June 29th, 2017, 11:05 #2
We'll need a bit more information than that. Where are you putting that function? Are you setting the visibility of the control and the label separately? Are you affecting the string_labeled template or the instance of it?
I never claimed to be sane. Besides, it's more fun this way.
-
June 29th, 2017, 15:32 #3
- Join Date
- Apr 2009
- Location
- Fullerton, CA.
- Posts
- 625
"string_labeled" is an xml tag that contains its own label. The function is in the control in the xml sheet. It works, with the exception of suppressing the "label" of the "string_labeled" tag. I see the line, can enter text, but the label below the line is removed. I am just reaching out to see if anyone has any experience with the string_labeled tag and its properties.
-
June 29th, 2017, 15:46 #4
Is that code you're using set as a <script> entry within the XML of the control based on the template? I'm guessing you are, as you are using setVisible without the control name. If so, that will override the <script> in the template, which is used to construct the label text widget:
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>
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!
-
June 30th, 2017, 02:33 #5
- Join Date
- Apr 2009
- Location
- Fullerton, CA.
- Posts
- 625
Thank you. That is exactly what is happening. I had a feeling it was the string_labeled template, so I went looking for it to check. I couldn't find it in CORErpg. That is when I came here to question what string_label was doing.
Was it in CORE and I missed it?
-
June 30th, 2017, 02:46 #6
CoreRPG\campaign\template_char.xml
I never claimed to be sane. Besides, it's more fun this way.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks