Luc Tremblay
October 21st, 2007, 23:56
Hello!
I am new to Fantasy Grounds and I have been toying around with modding it for the last few days. I have to say it is pretty neat and I am having a lot of fun.
I have, though, stumbled on a little issue I think you guys can help me with.
As a little experiment, I am trying to create a window list of labels from a set of strings. To do this I have created a window class for an entry, containing a label...
<windowclass name="list_entry">
<sheetdata>
<stringcontrol name="label">
<bounds>0,0,50,20</bounds>
<font>sheetlabel</font>
<static />
<sizelimits>
<maximum>
<height>20</height>
<width>50</width>
</maximum>
</sizelimits>
</stringcontrol>
</sheetdata>
</windowclass>
Then I created a window list instanciating a bunch of these entries on its Init pass :
<windowclass name="list">
<sheetdata>
<windowlist name="list">
<bounds>0,0,300,300</bounds>
<frame>
<name>sheetgroup</name>
</frame>
<skipempty />
<class>list_entry</class>
<script>
function onInit()
local labelTest = createWindow();
labelTest.label.setValue("test1");
labelTest = createWindow();
labelTest.label.setValue("test2");
labelTest = createWindow();
labelTest.label.setValue("test3");
labelTest = createWindow();
labelTest.label.setValue("test4");
labelTest = createWindow();
labelTest.label.setValue("test5");
end
</script>
</windowlist>
</sheetdata>
</windowclass>
The problem is that each string is separated vertically by very large spacing, and it simply doesn't look right. I have tried many things to fix this, (see sizelimits settings I added, for example), but nothing seems to work.
https://www.tons-of-slack.net/windowlistbug.jpg
Any ideas from anyone on this?
It could be that onInit is too "early" for the formatting pass, but that sounds a bit far-fetched... please help me! :confused:
I am new to Fantasy Grounds and I have been toying around with modding it for the last few days. I have to say it is pretty neat and I am having a lot of fun.
I have, though, stumbled on a little issue I think you guys can help me with.
As a little experiment, I am trying to create a window list of labels from a set of strings. To do this I have created a window class for an entry, containing a label...
<windowclass name="list_entry">
<sheetdata>
<stringcontrol name="label">
<bounds>0,0,50,20</bounds>
<font>sheetlabel</font>
<static />
<sizelimits>
<maximum>
<height>20</height>
<width>50</width>
</maximum>
</sizelimits>
</stringcontrol>
</sheetdata>
</windowclass>
Then I created a window list instanciating a bunch of these entries on its Init pass :
<windowclass name="list">
<sheetdata>
<windowlist name="list">
<bounds>0,0,300,300</bounds>
<frame>
<name>sheetgroup</name>
</frame>
<skipempty />
<class>list_entry</class>
<script>
function onInit()
local labelTest = createWindow();
labelTest.label.setValue("test1");
labelTest = createWindow();
labelTest.label.setValue("test2");
labelTest = createWindow();
labelTest.label.setValue("test3");
labelTest = createWindow();
labelTest.label.setValue("test4");
labelTest = createWindow();
labelTest.label.setValue("test5");
end
</script>
</windowlist>
</sheetdata>
</windowclass>
The problem is that each string is separated vertically by very large spacing, and it simply doesn't look right. I have tried many things to fix this, (see sizelimits settings I added, for example), but nothing seems to work.
https://www.tons-of-slack.net/windowlistbug.jpg
Any ideas from anyone on this?
It could be that onInit is too "early" for the formatting pass, but that sounds a bit far-fetched... please help me! :confused: