PDA

View Full Version : Bug when using stateframe drophover and dice



Dachannien
May 12th, 2007, 14:49
I found a bug that occurs when you use the <stateframe> tag and either the <hover> or <drophover> tag and then drag dice over the control in question.

Here's my code:


<!-- The Box -->

<?xml version="1.0" encoding="iso-8859-1"?>
<root version="2.0">

<framedef name="thebox_normal">
<bitmap>thebox/thebox_normal.png</bitmap>
<middle>0,0,120,80</middle>
</framedef>

<framedef name="thebox_drop">
<bitmap>thebox/thebox_drop.png</bitmap>
<middle>0,0,120,80</middle>
</framedef>

<windowclass name="thebox">
<sheetdata>
<genericcontrol>
<tooltip>
<text>The Box</text>
</tooltip>
<bounds>0,0,120,80</bounds>
<frame>
<name>thebox_normal</name>
</frame>
<droptypes>
<type>dice</type>
</droptypes>
<stateframe>
<drophover>
<name>thebox_drop</name>
<nobaseframe />
</drophover>
</stateframe>

<!-- <script file="thebox/thebox.lua" /> -->
</genericcontrol>
</sheetdata>
</windowclass>

<panel name="thebox" modes="host,client">
<class>thebox</class>
<bounds>
<anchored>
<left>
<parent>chat</parent>
<anchor>right</anchor>
<offset>20</offset>
</left>
<top>
<parent>chat</parent>
<anchor>top</anchor>
<offset>20</offset>
</top>
<size>
<width>120</width>
<height>80</height>
</size>
</anchored>
</bounds>
</panel>

</root>

What should happen is that when you hover some dice over the control, it should stop displaying the default frame and start displaying the special frame specified in the <drophover> tag. What actually happens is that part of the original frame is displayed and part of the special frame is displayed. The part of each that shows up changes depending on where you hold the dice. If you move the dice around over the control, you can see where some of each image gets displayed.

If you just use the plain old <hover> instead of <drophover>, it still has this problem, but only when you are dragging dice over the control. If you just hover the empty mouse cursor over it, it behaves correctly.

I guess it's possible that I'm doing something wrong here, so please let me know if this is a PIBCAK error ;)