PDA

View Full Version : button icon cycler



earthworm3
March 10th, 2016, 17:59
hello, how can change icon in this button from "boxempty" to "boxasterisk" (without use "boxemptyred").

"boxemptyred" is just use when i open a sheet.



<button_iconcycler name="health1">
<anchored position="insidetopright" offset="183,16" width="12" height="12" />
<parameters>
<icons>boxempty|boxslash|boxcross|boxasterisk</icons>
<values>boxempty|boxslash|boxcross|boxasterisk</values>
<defaulticon>boxemptyred</defaulticon>
</parameters>
</button_iconcycler>


Thanks

earthworm3
March 10th, 2016, 20:05
I have found cycleIcon function in button_iconcycler.lua and i have changed "cycleindex = 0" by "cycleindex = 1" and it's working.

Next, i need to enable / disable the button. How can i do that ? there is a setEnabled function but it's not working on a database node...

Thanks

Moon Wizard
March 10th, 2016, 20:39
SetEnabled only works on window controls, not database nodes.

JPG

earthworm3
March 10th, 2016, 20:46
Thanks for your reply.

So how can i enable / disable my button ?

earthworm3
March 10th, 2016, 21:02
problem solved :



window.health1.setEnabled(false);


or



window.health1.setEnabled(true);