<?macrodef "dbtnImageStyle3State"
	<ImageStyle name="$(name)">
		<raster source ="sonical.psd|$(norm)" 
			alignment ="entire"
			blendmode ="COPY|RGB|ALPHA_SRCALPHA"
			source_offset ="sonical.psd|$(norm) @ sonical.psd|$(base)" 
			belowparent="false"
		/>

		<raster state ="HIT" 
			source ="sonical.psd|$(hit)" 
			source_offset ="sonical.psd|$(hit) @ sonical.psd|$(base)" 
			alignment ="entire"
			blendmode ="COPY|RGB|ALPHA_SRCALPHA" 
			belowparent="false"
		/>
	</ImageStyle>
?>

<?macrodef dbtn_start
	<window name="$(name)" type="button" transparent="false" belowparent="false" offset = "sonical.psd|$(name)i @ sonical.psd|frameb" hitstyle="ACTIVE" >
	<property default_delay = "150" hover="true" hoverhint="$(hint)" />
	<?macroins "dbtnImageStyle3State" name="state0" norm="$(name)i" hit="$(name)h" base="frameb" ?$>
?>

<?macrodef btn_end </window> ?>

<?macrodef num_btn
	<?macroins dbtn_start name="b$(name)" hint="$(name)" ?$>
		<property belowparent="false" popout="true" transparent="true"/>
		<script name=OnClick >
			if($(name)!="0"){ 
				if(makenum()&&){myvar[myvar.ArraySize()-1]|="$(name)";}
				else if(myvar[myvar.ArraySize()-1]=="0"){myvar|={"$(name)"};}
				else{myvar|={"$(name)"};}
				ascreen.SetText(display());
			}
			if($(name)=="0" and myvar.ArraySize()>1){
				if(makenum()){myvar[myvar.ArraySize()-1]|="$(name)";}
				else{myvar|={"$(name)"};}
				ascreen.SetText(display());
			}
			</script>
	<?macroins btn_end ?$> 
?>

