PDA

View Full Version : Windowlist columns... can someone explain the use?



celestian
July 17th, 2019, 06:14
I'm trying to figure out what the column/width/fill down/width is suppose to do but not really finding it useful.

What I expected was I could say "fill this width with an entry and then make a new column (window) and add the next".

So if I said width of 3 then it would do this.

[Longsword] [Dagger] [Bow]
[Dart]

(4 database objects. sword, dagger, bow and dart)

But either im doing something wrong or completely misunderstanding the use of it.

https://www.fantasygrounds.com/refdoc/windowlist.xcp



The XML bits say "pixels" for width.... but setColumnWidth doesn't mention pixels so I was thinking it was columns, literal.

Am I barking up the wrong tree entirely and have to code the controls manually or will it actually generate a type of windowlist like the example I used? I've tried various options and none of them seem to result in anything useful.

celestian
July 17th, 2019, 06:23
So, I tried one last thing and this seems to get the effect I wanted.



setColumnWidth(130);


https://i.imgur.com/0Apwa0h.png

LordEntrails
July 17th, 2019, 06:33
Severed limbs was the effect you wanted?

Brutal dude! Or should I say Vorpal?

celestian
July 17th, 2019, 06:37
I managed to get it cleaned up a bit and working. Was just a bit confused on the documentation.

Looks pretty decent and it expands as the window changes.

https://i.imgur.com/FxOPFY2.png

The only part that I don't like is the overlapping shading (marked in red) which I couldn't seem to resolve with margin controls for the entries.

celestian
July 17th, 2019, 06:38
Severed limbs was the effect you wanted?

Brutal dude! Or should I say Vorpal?

Trolls are easy to chop up! I guess they lost that in 5e?

Moon Wizard
July 17th, 2019, 16:53
My guess is that the overlapping shading is due to the column width not being wide enough for how the windows are defined. (i.e. windows are defined in a way that makes them wider than 130.) There's no auto-sizing of columns, just pixel-based specification.

Regards,
JPG

celestian
July 17th, 2019, 17:17
My guess is that the overlapping shading is due to the column width not being wide enough for how the windows are defined. (i.e. windows are defined in a way that makes them wider than 130.) There's no auto-sizing of columns, just pixel-based specification.

Regards,
JPG

My suspicion is that it's the <child><backcolor>1A40301E</backcolor></child> sets a frame within the windowlist. The current definition of the windowlist and it's class are:



<windowlist name="mini_combat_window">
<anchored>
<top parent="columnanchor" anchor="bottom" relation="relative" offset="7" />
<left offset="10" />
<right offset="-5" />
</anchored>
<child></child>
<child><backcolor>1A40301E</backcolor></child>
<noscroll />
<columns><width>130</width></columns>
<datasource>.abilitynoteslist</datasource>
<class>cta_abilitynotes_host</class>
<sortby><control>name</control></sortby>
<noscroll />
<frame name="ct_subgroupbox" offset="4,5,1,1" />
</windowlist>

------------------------------

<windowclass name="cta_abilitynotes_host">
<sheetdata>
<stringfield name="name">
<script>
function onInit()
local node = window.getDatabaseNode();
local sText = DB.getValue(node,"text","");
local sCleaned = UtilityManagerADND.stripFormattedText(sText);
setTooltipText(sCleaned);
end
function onHover(oncontrol)
if oncontrol then
setColor("ffffff");
else
setColor(nil);
end
end
function onClickDown(button, x, y)
local w = Interface.openWindow('quicknote',window.getDatabas eNode());
if w then
return true;
end
end
</script>
<anchored>
<top anchor="top" offset="2" />
<left anchor="left" offset="4"/>
</anchored>
<multilinespacing>20</multilinespacing>
<readonly />
</stringfield>

</sheetdata>
</windowclass>



I tried tweaking the margins on the class entry trying to clean it up but it didn't seem to help.

Moon Wizard
July 17th, 2019, 17:44
Background colors are independent of frames; and are actually drawn under frames. Try adding a fixed width of 120 to your name field to see if that helps.

Regards,
JPG

celestian
July 17th, 2019, 18:04
Background colors are independent of frames; and are actually drawn under frames. Try adding a fixed width of 120 to your name field to see if that helps.

Regards,
JPG

That got it, perfect.

https://i.imgur.com/oudeOB6.png

I tend to not use static width when I can, didn't think to try, thanks!