PDA

View Full Version : Where The Hell Is...



dulux-oz
February 10th, 2019, 04:03
Hi Guys,

I need some help with collapsing and expanding lists, please.

I've got a two-layer windowlsit structure and a stock-standard button_expand and button_collapse (from CoreRPG:template_buttons.xml). I've also got a stock-standard <genericcontrol name="status"> construct copied verbatum from CoreRPG:utility_options.xml (line 157).

Everything is working fine - everything expands/collapses just as it should.

My issue, however, is that when I use the button_expand/button_collapse to expand/collapse the lists, the "status" icon goes from its normal <icon>button_collapse</icon>/<icon>button_expand</icon> to the white versions (ie button_collapse_w/button_expand_w). Of course, when I click on the "status" button/icon it changes to the non-white version of the relevant icon.

My problem is I can't find in the code where the white-versions are being set (so I can stop that from happening). Can anyone point me in the right direction?

Thanks

Moon Wizard
February 10th, 2019, 19:54
Where did you get the status icon templates from? In the examples I could quickly find any examples in the CoreRPG and 5E rulesets of a collapse icon usage, there are no examples of status icons for the collapsed sections, just font/frame changes to indicate collapsed state of headers.

Regards,
JPG

dulux-oz
February 11th, 2019, 04:39
Where did you get the status icon templates from? In the examples I could quickly find any examples in the CoreRPG and 5E rulesets of a collapse icon usage, there are no examples of status icons for the collapsed sections, just font/frame changes to indicate collapsed state of headers.

Regards,
JPG

The status icon structure isn't a template, is a generic control, and it came from the CoreRPG=>utility_options.xml file, starting at line 157. Here, I've copied it to below:


<genericcontrol name="status">
<anchored to="label" position="left" offset="-20" width="20" />
<icon>button_collapse</icon>
<script>
function onClickDown(button, x, y)
return true;
end

function onClickRelease(button, x, y)
window.toggle();
return true;
end
</script>
</genericcontrol>


As you can see, it uses the button_collapse icon (and the corresponding button_expand icon). Of course, I modified the anchored parameters and I had to write a custom window.toggle() function for my 2-layer windowlist structure, and its all working AOK (and nowhere did I substitue button_collapse_w for button_collapse nor button_expand_w for button_expand). The issue is (just to clarify) that when I click on the accompanying button_expand and button_collapse buttons (again, from CoreRPG:template_buttons.xml and reproduced below) is when the button_collapse/button_expand icons is replaced with the button_collapse_w/button_expand_w icons - and I can't find anywhere in the code where the "_w" versions of the icons are being set (on the "status" structure when the button is clicked, obviously - they are being set correctly to display on the buttons themselves, as the code shows).


<template name="button_expand">
<button_icon>
<icon normal="button_expand_w" />
<tooltip textres="tooltip_expand" />
<target>grouplist,list</target>
<expand />
<script file="common/scripts/button_expand_collapse.lua" />
</button_icon>
</template>
<template name="button_collapse">
<button_icon>
<icon normal="button_collapse_w" />
<tooltip textres="tooltip_collapse" />
<target>grouplist,list</target>
<collapse />
<script file="common/scripts/button_expand_collapse.lua" />
</button_icon>
</template>
<template name="button_icon">
<buttoncontrol>
<frame name="buttonup" offset="2,2,2,2" />
<stateframe>
<pressed name="buttondown" offset="2,2,2,2" nobaseframe="true" />
</stateframe>
<pressed offset="1,1" />
</buttoncontrol>
</template>