Dachannien
March 15th, 2006, 19:01
I've been working on a modified CRS for d20, and decided to implement dual spell lists where one is for all known spells and the other is for prepared spells. The intention is that you should be able to drag spells from the known spell list over to the prepared spell list. Aside from that, the spell lists are like the one on the default CRS, using the windowlist control. Works great.
However, I haven't been able to figure out how to get the dragging and dropping to work. I figured out that you need at least a dummy control (like a windowopencontrol) on the nested window in order to grab hold of it. But when I drop the item, it doesn't get added.
Here's the relevant portions of my code:
<windowclass name="charsheet_spellentryk">
<frame name="charsheet_spellentryk" />
<datasource name="spellk" />
<defaultsize width="350" height="40" />
<sheetdata>
<windowopencontrol>
<bounds rect="3,3,35,35" />
</windowopencontrol>
<stringcontrol name="name">
...
</stringcontrol>
</sheetdata>
</windowclass>
<windowclass name="charsheet_spellentryp">
<frame name="charsheet_spellentryp" />
<datasource name="spellp" />
<defaultsize width="350" height="40" />
<sheetdata>
<windowopencontrol>
<bounds rect="3,3,35,35" />
</windowopencontrol>
<stringcontrol name="name">
...
</stringcontrol>
</sheetdata>
</windowclass>
<windowclass name="charsheet_spells">
<frame name="charsheet_spells" />
<datasource name="charsheet" />
<defaultsize width="720" height="720" />
<sheetdata>
<windowlist class="charsheet_spellentryk" name="spellsknown">
<allowcreate />
<allowdelete />
<nestdata />
<bounds rect="8,45,350,520" />
<sort fields="name,level" />
<acceptdrop class="charsheet_spellentryp" fields="name,level,school,savedc,prepared,shortdescription" />
<acceptdrop class="spelldesc" fields="name,level,shortdescription" />
</windowlist>
<scroller>
...
</scroller>
<windowlist class="charsheet_spellentryp" name="spelllist">
<allowcreate />
<allowdelete />
<nestdata />
<bounds rect="362,45,350,520" />
<sort fields="name,level" />
<acceptdrop class="charsheet_spellentryk" fields="name,level,school,savedc,prepared,shortdescription" />
<acceptdrop class="spelldesc" fields="name,level,shortdescription" />
</windowlist>
<scroller>
...
</scroller>
</sheetdata>
</windowclass>
Any ideas on this? I looked through the default d20_reference.xml for clues, since the default CRS supports dragging and dropping from the spell descriptions in the D20 reference, but I didn't see anything special there that would make a difference. Might be something subtle, though.
Thanks much! :)
However, I haven't been able to figure out how to get the dragging and dropping to work. I figured out that you need at least a dummy control (like a windowopencontrol) on the nested window in order to grab hold of it. But when I drop the item, it doesn't get added.
Here's the relevant portions of my code:
<windowclass name="charsheet_spellentryk">
<frame name="charsheet_spellentryk" />
<datasource name="spellk" />
<defaultsize width="350" height="40" />
<sheetdata>
<windowopencontrol>
<bounds rect="3,3,35,35" />
</windowopencontrol>
<stringcontrol name="name">
...
</stringcontrol>
</sheetdata>
</windowclass>
<windowclass name="charsheet_spellentryp">
<frame name="charsheet_spellentryp" />
<datasource name="spellp" />
<defaultsize width="350" height="40" />
<sheetdata>
<windowopencontrol>
<bounds rect="3,3,35,35" />
</windowopencontrol>
<stringcontrol name="name">
...
</stringcontrol>
</sheetdata>
</windowclass>
<windowclass name="charsheet_spells">
<frame name="charsheet_spells" />
<datasource name="charsheet" />
<defaultsize width="720" height="720" />
<sheetdata>
<windowlist class="charsheet_spellentryk" name="spellsknown">
<allowcreate />
<allowdelete />
<nestdata />
<bounds rect="8,45,350,520" />
<sort fields="name,level" />
<acceptdrop class="charsheet_spellentryp" fields="name,level,school,savedc,prepared,shortdescription" />
<acceptdrop class="spelldesc" fields="name,level,shortdescription" />
</windowlist>
<scroller>
...
</scroller>
<windowlist class="charsheet_spellentryp" name="spelllist">
<allowcreate />
<allowdelete />
<nestdata />
<bounds rect="362,45,350,520" />
<sort fields="name,level" />
<acceptdrop class="charsheet_spellentryk" fields="name,level,school,savedc,prepared,shortdescription" />
<acceptdrop class="spelldesc" fields="name,level,shortdescription" />
</windowlist>
<scroller>
...
</scroller>
</sheetdata>
</windowclass>
Any ideas on this? I looked through the default d20_reference.xml for clues, since the default CRS supports dragging and dropping from the spell descriptions in the D20 reference, but I didn't see anything special there that would make a difference. Might be something subtle, though.
Thanks much! :)