Are Scrollables allowed inside Scrollables?

xienwolf

Deity
Joined
Oct 4, 2007
Messages
10,589
Location
Location! Location!
Working with the joys of interface screens once again, and I was wondering if there is an inbuilt limitation against placing something scrollable inside of something else which is scrollable.

I seem to be able to use the command attachMultilineText without issue as long as I am placing the text in the background, but as soon as I try to change the AttachID to something which has a scrollable area, I start getting C++ exceptions.

So:

screen.attachMultilineText(self.TITLE_TOP_PANEL, szPaneIDHelp, szHelpText, WidgetTypes.WIDGET_GENERAL, -1, -1, CvUtil.FONT_LEFT_JUSTIFY)


Works fine, with self.TITLE_TOP_PANEL having been created using:

screen.addPanel( self.TITLE_TOP_PANEL, u"", u"", True, False, 0, 0, self.W_SCREEN, self.PANEL_HEIGHT, PanelStyles.PANEL_STYLE_TOPBAR )


But:

screen.attachMultilineText(self.self.QUICKVIEW_ADD, szPaneIDHelp, szHelpText, WidgetTypes.WIDGET_GENERAL, -1, -1, CvUtil.FONT_LEFT_JUSTIFY)


Doesn't work, with self.QUICKVIEW_ADD having been created using:

screen.addScrollPanel( self.QUICKVIEW_ADD, u"", 0, 0, self.W_SCREEN, self.PANEL_HEIGHT-20, PanelStyles.PANEL_STYLE_EXTERNAL )



Is there any way around this? Something else I can add to the scrollable area which will move with it and be capable of holding another scrollable within itself maybe?

Alternatively, if anyone even knows somewhere in Civ where a scrollable appears inside a scrollable I can figure things out from there.
 
I want to set up the Scrollable Civics Screen to still use MultiLine Text so that I don't have to write a new function for each and every line, or figure out a nice way to write up the Building Happiness and other naturally multi-line text outputs.
 
Seems, that it can't be done.
If you look at all other screens, they'll just cut of the text, if it's too long.




What instead about using the onMouseOver function (there is one...isn't it?) to expand the panel, when you move on it?
 
I could probably set something like that up, or just re-define some widgets so that they carry the normal mouse-over help information.

I was considering making a dropdown list for the main window (choose which Civic Category to view) and then see if I can place a scrollable inside of that. But I probably cannot as the dropdown list itself will be scrollable if I can make it hold everything I am trying to show right now.
 
I'm not quite understanding the part about creating a function for each line of text. You can get the whole multi-line text string from the DLL, right? You could then just split it and add a text label for each line.

Give some more technical details of what you want and maybe we can help.
 
MultiLine Text is by default a scrollable item, so it refuses to allow me to add a MultiLine Text item inside another scrollable item. I have to use normal screen.setTextAt commands to do a line-by-line data entry.

Do you know a set of string commands that might be able to scan a text string for carriage returns and split the string into separate elements? Then I could just use parseCivicInfo to get a lot of lines, then run a loop which splits each line off and adds it to the display one at a time until no lines remain. That would work beautifully (could still exceed the bounds of my text box, but would at least display everything in minimal lines and not have to update so many areas if I add a new XML tag to Civics)

EDIT: And that was the answer I needed :) Python command "splitlines()" does exactly what I wanted done.
 
Glad you found it. Python is pretty great for string processing, and it has regular expressions for heavy lifting. BTW, since your building all these panels in a scrollable area, couldn't you make the panels expand vertically to allow for longer text blocks?
 
Top Bottom