Posted by kappamus on Tue, 17 Jan 2012 01:28:56
In the section "Creating a Close Button Using Templates" in Chapter 12, pg's 213-214 should there be code to register for the OnClick event? I checked the inherited frame but couldn't see anything. Related to this, how would the button number and click type be described in the xml file? (ie. MiddleButtonDown)
Thanks. Love the book.
Posted by jnwhiteh on Tue, 17 Jan 2012 08:57:13
When you inherit from the close button template, you get the following code:
<Button name="UIPanelCloseButton" virtual="true"> <Size> <AbsDimension x="32" y="32"/> </Size> <Scripts> <OnClick> HideParentPanel(self); </OnClick> </Scripts> <DisabledTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Disabled"/> <NormalTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Up"/> <PushedTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Down"/> <HighlightTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Highlight" alphaMode="ADD"/> </Button>
This includes registration for the OnClick event. Also, all buttons are automatically registered to receive the left-click events, so nothing further is necessary.