PDA

View Full Version : Table Footnote and Scrolling Issue



Veldehar
March 13th, 2010, 14:17
I have recently been making all of the RMC Character law equipment lists drag and drop and ran into an interesting issue on longer tables. First, here is the base piece of code I am working with:


<windowlist name="wpnlist">
<bounds>15,52,-19,-15</bounds>
<class>referenceweaponlist_entry</class>
<datasource>.list</datasource>
<script>
function onListRearranged()
local alt = true;
--[[ set row shading ]]
for i,win in ipairs(getWindows()) do
if alt then
win.setFrame("rowshade");
end
alt = not alt;
end
end
</script>
</windowlist>

Now if I insert a footnote after the windowlist like so:


<formattedtextfield name="footnote">
<anchored>
<top>
<anchor>bottom</anchor>
<offset>-60</offset>
</top>
<left>
<anchor>left</anchor>
</left>
<right>
<anchor>right</anchor>
</right>
</anchored>
<font>
<normal>chatfont</normal>
<bold>narratorfont</bold>
<italic>chatitalicfont</italic>
<bolditalic>chatbolditalicfont</bolditalic>
<title>defaultstringcontrol</title>
</font>
<linkicon>
<link>button_openwindow</link>
<emptylink>button_emptytarget</emptylink>
</linkicon>
<selectioncolor>#FFD296</selectioncolor>
</formattedtextfield>

I get a footnote statically attached to the bottom and the window, and the data will still scroll, but naturally this isn't how I want the footnote attached. So, then I go ahead and change the:


<bounds>15,52,-19,-15</bounds>

to


<anchored>
<top>
<parent>lblInum</parent>
<offset>1</offset>
<anchor>bottom</anchor>
</top>
<left>
<offset>15</offset>
<anchor>left</anchor>
</left>
<right>
<offset>-19</offset>
<anchor>right</anchor>
</right>
</anchored>

At this point, my footnote is still in the wrong place, and the data will still scroll. So, to get the footnote into the correct position, attached to the bottom of the table's data, I simply change the footnotes anchor to "wpnlist" or "lblInum" and!

the table no longer scrolls, so if the table is a long one, you can't see it all.

Hopefully this makes sense to someone, so they can let me know how to fix this, or to drop it, because it is just that way, LOL.

Veldehar

ragamer
March 13th, 2010, 14:43
I found some weirdness like that and the solution I found is the following:

- I make all my windows/windowlists transparent (by not including a frame on the class).

- I create a simple generic control with a frame to match the background of my window and place it in the same possition as my window/windowlist. Usually it's slightly larger to include space for headers, footnotes and scrollling controls.

- Controls I dont want to be moved I anchor to the generic control.

- Controls I want to be moved I anchor to the window/windowlist.

That way you get everything under control.

Moon Wizard
March 13th, 2010, 17:26
Based on my understanding of what you are doing, you would like the footnote to only be displayed below the last of the windowlist entries.

Essentially, the challenge you are facing is that the windowlist is the object which supports scrolling. Therefore, any controls you define outside of the windowlist are outside of the scrolling view.

What you want to do is define a subwindow that allows scrolling at the top level, then within the subwindow, define the windowlist with a noscroll tag and the footnote attached to the bottom of the list.

Cheers,
JPG

Foen
March 14th, 2010, 07:52
If you are happy to have the scrolling list sit above the footnote, and for the footnote not to be part of the scrolling effect, you could try:


<windowlist name="wpnlist">
<bounds>15,52,-19,-61</bounds>
... etc ...
</windowlist>

<formattedtextfield name="footnote">
<anchored>
<top>
<anchor>bottom</anchor>
<offset>-60</offset>
</top>
<left>
<anchor>left</anchor>
</left>
<right>
<anchor>right</anchor>
</right>
</anchored>
... etc ...
</formattedtextfield>

The footnote sits below the scrolling area, not over it.

Foen

Foen
March 14th, 2010, 07:58
Alternatively, if the footnote will be of varying height, place it first and anchor the bottom of the windowlist to the top of the footnote:


<formattedtextfield name="footnote">
<anchored>
<bottom>
<anchor>bottom</anchor>
<offset>-15</offset>
</bottom>
<left>
<anchor>left</anchor>
</left>
<right>
<anchor>right</anchor>
</right>
</anchored>
... etc ...
</formattedtextfield>

<windowlist name="wpnlist">
<anchored>
<top>
<anchor>top</anchor>
<offset>52</offset>
</top>
<bottom>
<parent>footnote</parent>
<anchor>bottom</anchor>
</bottom>
<left>
<anchor>left</anchor>
<offset>15</offset>
</left>
<right>
<anchor>right</anchor>
<offset>-19</offset>
</right>
</anchored>
... etc ...
</windowlist>

The order of definition must be as shown (footnote first). This will allow the footnote to be of variable height and the list will always anchor just above it.

Foen

Veldehar
March 14th, 2010, 14:57
Thank you everyone! Great ideas here. I will certainly be able to experiment and come up with something that works now.

Veldehar

Veldehar
March 15th, 2010, 16:30
This worked beautifully, Foen! Thanks a bunch. Looks real slick.

Veldehar


If you are happy to have the scrolling list sit above the footnote, and for the footnote not to be part of the scrolling effect, you could try:


<windowlist name="wpnlist">
<bounds>15,52,-19,-61</bounds>
... etc ...
</windowlist>

<formattedtextfield name="footnote">
<anchored>
<top>
<anchor>bottom</anchor>
<offset>-60</offset>
</top>
<left>
<anchor>left</anchor>
</left>
<right>
<anchor>right</anchor>
</right>
</anchored>
... etc ...
</formattedtextfield>

The footnote sits below the scrolling area, not over it.

Foen

Foen
March 15th, 2010, 21:12
My pleasure!