export45010_0	= IncDecButton

CharButton::init:
		pushi	$25		; 37, '%', fore
		push1
		lsg	global[$54]
		pushi	$1e7		; 487, normalColor
		push1
		lsg	global[$54]
		pushi	$1e8		; 488, selectColor
		push1
		lsg	global[$61]
		pushi	$1e9		; 489, chosenColor
		push1
		pushi	$ff		; 255, asInteger
		pushi	$27		; 39, ''', mode
		push1
		push1
		pushi	$1f6		; 502, setText
		push1
		pTos	text
		pushi	$1ef		; 495, textOffsetX
		push1
		push2
		pushi	$1f0		; 496, textOffsetY
		push1
		push2
		self	$30
		bnot
		pushi	$94		; 148, init
		push0
		&rest	$1
		super	Button, $4
		bnot
		ret

CharButton::hide:
		pushi	$69		; 105, 'i', hide
		push1
		push0
		super	Button, $6
		bnot
		ret

CharButton::draw:
		ldi	$ff		; 255, asInteger
		aTop	lastState
		pushi	$57		; 87, 'W', draw
		push0
		&rest	$1
		super	Button, $4
		bnot
		ret

NextPrevButton::choose:
		pushi	$1cb		; 459, choose
		push0
		&rest	$1
		super	Button, $4
		bnot
		pTos	pDirection
		ldi	$0
		gt?
		bnt	code_0393
		pushi	$3a2		; 930, nextFeature
		push1
		pTos	pFeature
		lag	global[$9f]
		send	$6
		bnot
		jmp	code_039e

code_0393:	pushi	$3a3		; 931, prevFeature
		push1
		pTos	pFeature
		lag	global[$9f]
		send	$6
		bnot
code_039e:	pToa	pCenterButton
		bnt	code_03a9
		pushi	$1cb		; 459, choose
		push0
		send	$4
		bnot
code_03a9:	ret

GroupedButton::init:
		pushi	$94		; 148, init
		push0
		&rest	$1
		super	CharButton, $4
		bnot
		pToa	pMakeButtons
		bnt	code_03e1
		pushi	$5ca		; 1482, pCenterButton
		push1
		pTos	pCenterButton
		pushi	$8d		; 141, new
		push0
		pToa	pButtonType
		send	$4
		bnot
		aTop	pLeftButton
		send	$6
		bnot
		pushi	$5ca		; 1482, pCenterButton
		push1
		pTos	pCenterButton
		pushi	$8d		; 141, new
		push0
		pToa	pButtonType
		send	$4
		bnot
		aTop	pRightButton
		send	$6
		bnot
code_03e1:	ret

GroupedButton::show:
		pushi	$75		; 117, 'u', show
		push0
		super	CharButton, $4
		bnot
		pushi	$75		; 117, 'u', show
		push0
		pToa	pLeftButton
		send	$4
		bnot
		pushi	$75		; 117, 'u', show
		push0
		pToa	pRightButton
		send	$4
		bnot
		ret

GroupedButton::hide:
		pushi	$69		; 105, 'i', hide
		push1
		push0
		super	CharButton, $6
		bnot
		pushi	$69		; 105, 'i', hide
		push0
		pToa	pLeftButton
		send	$4
		bnot
		pushi	$69		; 105, 'i', hide
		push0
		pToa	pRightButton
		send	$4
		bnot
		ret

TextButton::init:
		link	$1
		lofsa	IncDecButton
		aTop	pButtonType
		pToa	helpStr
		bnt	code_044a
		pushi	$4e		; 78, 'N', width
		push1
		pTos	pHelpW
		pushi	$e1		; 225, height
		push1
		pTos	pHelpH
		pushi	$1c8		; 456, helpStr
		push1
		push
		pushi	$94		; 148, init
		push0
		pushi	$db		; 219, moveTo
		push2
		pTos	pHelpX
		pTos	pHelpY
		pushi	$8d		; 141, new
		push0
		class	Button
		send	$4
		bnot
		aTop	pHelpButton
		send	$1e
		bnot
code_044a:	pushi	$94		; 148, init
		push0
		&rest	$1
		super	Button, $4
		bnot
		pToa	pMakeButtons
		bnt	code_0480
		pushi	$5ca		; 1482, pCenterButton
		push1
		pTos	pCenterButton
		pushi	$8d		; 141, new
		push0
		pToa	pButtonType
		send	$4
		bnot
		aTop	pLeftButton
		send	$6
		bnot
		pushi	$5ca		; 1482, pCenterButton
		push1
		pTos	pCenterButton
		pushi	$8d		; 141, new
		push0
		pToa	pButtonType
		send	$4
		bnot
		aTop	pRightButton
		send	$6
		bnot
code_0480:	ret

TextButton::onMe:
		link	$2
		pToa	pHelpW
		bnt	code_04c8
		lap	param[$1]
		sat	temp[$0]
		lap	param[$2]
		sat	temp[$1]
		pushi	$87		; 135, left
		push0
		pToa	pHelpButton
		send	$4
		bnot
		push
		lat	temp[$0]
		le?
		bnt	code_04c5
		pprev
		pushi	$88		; 136, right
		push0
		pToa	pHelpButton
		send	$4
		bnot
		le?
		bnt	code_04c5
		pushi	$89		; 137, top
		push0
		pToa	pHelpButton
		send	$4
		bnot
		push
		lat	temp[$1]
		le?
		bnt	code_04c5
		pprev
		pushi	$8a		; 138, bottom
		push0
		pToa	pHelpButton
		send	$4
		bnot
		le?
code_04c5:	ret

		jmp	code_04d2

code_04c8:	pushi	$eb		; 235, onMe
		push0
		&rest	$3		; z
		super	Button, $4
		bnot
code_04d2:	ret

TextButton::show:
		pushi	$75		; 117, 'u', show
		push0
		super	Button, $4
		bnot
		pushi	$75		; 117, 'u', show
		push0
		pToa	pLeftButton
		send	$4
		bnot
		pushi	$75		; 117, 'u', show
		push0
		pToa	pRightButton
		send	$4
		bnot
		ret

TextButton::hide:
		pushi	$69		; 105, 'i', hide
		push1
		push0
		super	Button, $6
		bnot
		pushi	$69		; 105, 'i', hide
		push0
		pToa	pLeftButton
		send	$4
		bnot
		pushi	$69		; 105, 'i', hide
		push0
		pToa	pRightButton
		send	$4
		bnot
		ret

IncDecButton::choose:
		link	$4
		pushi	$1cb		; 459, choose
		push0
		&rest	$1
		super	Button, $4
		bnot
		pToa	pPointSelector
		sat	temp[$1]
		push
		push0
		pToa	pPoints
		send	$4
		bnot
		sat	temp[$3]
		pToa	pSelector
		sat	temp[$1]
		pTos	pPlusMinus
		ldi	$0
		gt?
		bnt	code_05e1
		lat	temp[$3]
		bnt	code_0570
		lst	temp[$1]
		push0
		pToa	pBase
		send	$4
		bnot
		push
		ldi	$1
		add
		push
		pToa	pMax
		le?
		bnt	code_0570
		-at	temp[$3]
		lst	temp[$1]
		push1
		lst	temp[$1]
		push0
		pToa	pBase
		send	$4
		bnot
		push
		pToa	pPlusMinus
		add
		push
		pToa	pBase
		send	$6
		bnot
		pushi	$5dc		; 1500, pDelta
		push1
		pushi	$5dc		; 1500, pDelta
		push0
		pToa	pPoints
		send	$4
		bnot
		push
		pToa	pPlusMinus
		add
		push
		pToa	pPoints
		send	$6
		bnot
		jmp	code_0621

code_0570:	lst	temp[$1]
		push0
		pToa	pBase
		send	$4
		bnot
		push
		ldi	$1
		add
		push
		pToa	pMax
		ge?
		bnt	code_05c4
		lst	temp[$3]
		ldi	$0
		gt?
		bnt	code_05c4
		pushi	$8d		; 141, new
		push0
		class	Str
		send	$4
		bnot
		sat	temp[$2]
		pushi	$f5		; 245, format
		push2
		lofsa	string_0315	; "You can only assign %d points maximum"
		push
		pTos	pMax
		lat	temp[$2]
		send	$8
		bnot
		pushi	$f7		; 247, cat
		push1
		lofsa	string_033b	; "\n"
		push
		lat	temp[$2]
		send	$6
		bnot
		pushi	$4		; scaleX
		lst	temp[$2]
		pushi	$77		; 119, 'w', textTop
		lofsa	string_0364	; "Okay"
		push
		push1
		calle	export60029_0, $8
		bnot
		jmp	code_0621

code_05c4:	lst	temp[$3]
		ldi	$0
		eq?
		bnt	code_0621
		pushi	$4		; scaleX
		lofsa	string_0369	; "You've used all of your available points."
		push
		pushi	$77		; 119, 'w', textTop
		lofsa	string_0364	; "Okay"
		push
		push1
		calle	export60029_0, $8
		bnot
		jmp	code_0621

code_05e1:	lst	temp[$1]
		push0
		pToa	pBase
		send	$4
		bnot
		push
		ldi	$1
		sub
		push
		pToa	pMin
		ge?
		bnt	code_0621
		+at	temp[$3]
		lst	temp[$1]
		push1
		lst	temp[$1]
		push0
		pToa	pBase
		send	$4
		bnot
		push
		pToa	pPlusMinus
		add
		push
		pToa	pBase
		send	$6
		bnot
		pushi	$5dc		; 1500, pDelta
		push1
		pushi	$5dc		; 1500, pDelta
		push0
		pToa	pPoints
		send	$4
		bnot
		push
		pToa	pPlusMinus
		add
		push
		pToa	pPoints
		send	$6
		bnot
code_0621:	pToa	pAvailableText
		bnt	code_0661
		pushi	$95		; 149, dispose
		push0
		pushi	$23		; 35, '#', text
		push0
		send	$4
		bnot
		send	$4
		bnot
		pushi	$23		; 35, '#', text
		push1
		pushi	$f5		; 245, format
		push2
		pushi	$8c		; 140, scratch
		push0
		pToa	pAvailableText
		send	$4
		bnot
		push
		lst	temp[$3]
		class	Str
		send	$8
		bnot
		push
		pToa	pAvailableText
		send	$6
		bnot
		pushi	$1be		; 446, setSize
		push0
		pToa	pAvailableText
		send	$4
		bnot
		pushi	$57		; 87, 'W', draw
		push0
		pToa	pAvailableText
		send	$4
		bnot
code_0661:	pToa	pTextItem
		bnt	code_06b3
		pushi	$95		; 149, dispose
		push0
		pushi	$23		; 35, '#', text
		push0
		send	$4
		bnot
		send	$4
		bnot
		pushi	$23		; 35, '#', text
		push1
		pushi	$f5		; 245, format
		push2
		pushi	$8c		; 140, scratch
		push0
		pToa	pTextItem
		send	$4
		bnot
		push
		lst	temp[$1]
		push0
		pToa	pBase
		send	$4
		bnot
		push
		class	Str
		send	$8
		bnot
		push
		pToa	pTextItem
		send	$6
		bnot
		pushi	$1be		; 446, setSize
		push0
		pToa	pTextItem
		send	$4
		bnot
		pushi	$1ee		; 494, lastState
		push1
		pushi	$ff		; 255, asInteger
		pToa	pTextItem
		send	$6
		bnot
		pushi	$57		; 87, 'W', draw
		push0
		pToa	pTextItem
		send	$4
		bnot
code_06b3:	pToa	pPointSelector
		sat	temp[$1]
		push
		push1
		lst	temp[$3]
		pToa	pPoints
		send	$6
		bnot
		ret

IncDecButton::new:
		lap	param[$1]
		aTop	pBase
		lap	param[$2]
		aTop	pSelector
		lap	param[$4]
		aTop	pTextItem
		lap	param[$3]
		aTop	pPlusMinus
		lap	param[$6]
		aTop	pMax
		lap	param[$5]
		aTop	pMin
		lsp	param[$0]
		ldi	$6		; maxScale
		gt?
		bnt	code_06e4
		lap	param[$7]
		aTop	pAvailableText
code_06e4:	pushi	$8d		; 141, new
		push0
		super	Button, $4
		bnot
		ret

