PDA

View Full Version : Windowlists



drahkar
January 17th, 2011, 02:28
Ok. I know I must be missing something. What is wrong with this windowlist/windowclass set that would prevent it from displaying?




<windowclass name="charsheet_skills">
<placement>
<size>
<width>700</width>
<height>509</height>
</size>
</placement>
<nodelete />
<sheetdata>
<!-- Mental Skills Panel -->

<genericcontrol name="mentalskillsframe">
<bounds>33,33,310,441</bounds>
<frame>
<name>sheetgroup</name>
</frame>
</genericcontrol>

<panelheader>
<anchored>
<left>
<parent>mentalskillsframe</parent>
<anchor>left</anchor>
<offset>85</offset>
</left>
<top>
<parent>mentalskillsframe</parent>
<anchor>insidetop</anchor>
<offset>-5</offset>
</top>
</anchored>
<static>Mental Skills</static>
<font>sheetheadertext</font>
</panelheader>

<stringcontrol>
<anchored>
<to>mentalskillsframe</to>
<position>insideleft</position>
<offset>23,-35</offset>
<size>
<width>40</width>
</size>
</anchored>
<static>Name</static>
<font>sheetlabel</font>
</stringcontrol>

<stringcontrol>
<anchored>
<to>mentalskillsframe</to>
<position>insideleft</position>
<offset>225,-35</offset>
<size>
<width>40</width>
</size>
</anchored>
<static>Score</static>
<font>sheetlabel</font>
</stringcontrol>

<windowclass name="mentalskills">
<sizelimits>
<minimum>
<height>20</height>
</minimum>
</sizelimits>
<sheetdata>
<stringfield name="name">
<anchored>
<left>
<anchor>left</anchor>
<offset>5</offset>
</left>
<top>
<anchor>top</anchor>
<offset>2</offset>
</top>
<size>
<width>96</width>
<height>23</height>
</size>
</anchored>
<font>sheettextsmall</font>
<frame>
<name>textline</name>
<offset>0,1,0,0</offset>
</frame>
</stringfield>
</sheetdata>
</windowclass>

<windowlist name="mentalskillslist">
<anchored>
<top>
<parent>mentalskillsframe</parent>
<anchor>top</anchor>
</top>
<bottom>
<parent>mentalskillsframe</parent>
<anchor>bottom</anchor>
</bottom>
<left>
<parent>mentalskillsframe</parent>
<anchor>left</anchor>
</left>
<right>
<parent>mentalskillsframe</parent>
<anchor>right</anchor>
</right>
<bottom>
<parent>mentalskillsframe</parent>
<anchor>bottom</anchor>
</bottom>
</anchored>
<class>mentalskills</class>
<datasource>.</datasource>
<allowcreate />
<allowdelete />
<script>
function onInit()
checkEmpty();
end

function checkEmpty()
if #getWindows()==0 then
createWindow();
end
end
</script>
</windowlist>

</sheetdata>
</windowclass>

phantomwhale
January 17th, 2011, 04:36
The <windowlist> and <genericcontrol> elements should be inside the <sheetdata> element of the window class - otherwise they are floating outside with no defined parent class to appear in.

drahkar
January 17th, 2011, 05:10
This is a snippet that is inside a windowclass. I just cut the part out that relates to the windowlist.

phantomwhale
January 17th, 2011, 05:30
Ah - makes sense. Presume that the three snippets all sit separately then, with only the last one inside a sheetdata element ?

Hmmm... it all looks good on paper. Is datasource of "." OK ? Usually seen it as ".mentalskills" as "." would be the parent window node itself. Otherwise I'm not seeing anything straight away...

drahkar
January 17th, 2011, 05:48
I updated the code snippet to include the entire window class that the windowlist is contained within to clear up any confusion. What you see now is the entirety of the subwindow.

StuartW
January 17th, 2011, 06:33
You shouldn't defeine the windowclass 'mentalskills' *within* the windowclass 'charsheet_skills', it needs to be declared at the top level.

Stuart

drahkar
January 17th, 2011, 06:38
Wow. That works a whole lot better. Silly me.

Thanks!