footerbutton.lzx

<!--
* X_LZ_COPYRIGHT_BEGIN ****************************************************
* Copyright 2001-2008 Laszlo Systems, Inc.  All Rights Reserved.          *
* Use is subject to license terms.                                        *
* X_LZ_COPYRIGHT_END ******************************************************-->
<library>
    <class name="footerbutton" clickable="true" focusable="${clips.visible ? (this.parent != clips ? false : true) : true}">
        <attribute name="text" type="string" value=""/>
        <attribute name="xtext" value="-1"/>
        <attribute name="iconresource" type="string"/>
        <attribute name="defaultplacement" value="iconandtext" type="string"/>
        
        <basebutton resource="footer_button_rsc" stretches="width" width="100%">
            <handler name="onmousedown" reference="classroot">
                this.onmouseover.sendEvent();
                this.onmousedown.sendEvent();
            </handler>
            <handler name="onmouseup" reference="classroot">
                this.onmouseup.sendEvent();
            </handler>
            <handler name="onmousedown">
                classroot.onmousedown.sendEvent();
            </handler>
            <handler name="onmouseup">
                classroot.onmouseup.sendEvent();
            </handler>
        </basebutton>
        <view height="${parent.height}" width="1" bgcolor="white"/>
        <view height="${parent.height}" width="1" x="${parent.width - 1}" bgcolor="0x9d9feb"/>
        <view height="${parent.height}" width="${parent.width}" name="content"/>
        <view name="icon" x="${Math.round((parent.width - width)/2.0)}" y="${Math.round((parent.height - height)/2.0)}"/>
        <text text="${classroot.text}" fgcolor="0x1f13b1" x="${ classroot.xtext > 0 ? classroot.xtext : Math.round((parent.width - this.getTextWidth())/2.0) }" y="5" fontstyle="bold"/>
        <handler name="oninit">
            if (this['iconresource']) this.icon.setAttribute('resource', this.iconresource );
        </handler>
        
        
        <method name="findnext">
            
            if(this['next'] && this['next'].visible){
                return this.next;
            }
            
        </method>
        <method name="findprev">
            if(this['prev']){
                return this.prev;
            }
        </method>
        <method name="handlekeydown" args="k">
            if(k == 13){
                this.onmousedown.sendEvent();
            }
        </method>
        <method name="handlekeyup" args="k">
            if(k == 13){
                this.onmouseup.sendEvent();
                this.onclick.sendEvent();
            }
        </method>
        <method name="construct" args="parent, args">
            this.focusable = true;
            super.construct(parent, args);
            if(navmanager) navmanager.add(this);
        </method>
    </class>
</library>

Cross References

Classes