InterfaceComponent subclass: #ICKulka
instanceVariableNames: '
	Sztaluga
	X
	Y
'
classVariableNames: '
'
poolDictionaries: '
' !


! ICKulka class methods!


initialize
	Kulka := self name: #Kulka.
	Kulka applicationRegister.
!"end initialize"


description
	^ #Kulka
!"end description"


iconFileName
	^ 'iccomp.ico'
!"end iconFileName"


!"End of class methods block"


! ICKulka methods!


createItemsFor: form
	|ic cItem temp controller container|
	controller := self.
	cItem := controller add: #Sztaluga
		class:			FormDrawPad
		rect:				{11 0 1103 750}
		options:			{#TrackMouse #Return #Tab #Up #Down #Backtab #Left #Right}
		form:				form.
	cItem := controller add: #EtykietaX
		class:			FormStatic
		rect:				{49 806 90 68}
		options:			{#Mnemonic}
		form:				form
		text:				'X:'.
	cItem setFormatTo: {#HCenter #VCenter {#PointSize 8}}.
	cItem := controller add: #EtykietaY
		class:			FormStatic
		rect:				{578 803 90 68}
		options:			{#Mnemonic}
		form:				form
		text:				'Y:'.
	cItem setFormatTo: {#HCenter #VCenter {#PointSize 8}}.
	cItem := controller add: #X
		class:			FormNumericSpinButton
		rect:				{176 799 330 75}
		options:			{#Return #Tab #Backtab #OnlyNumbers}
		form:				form
		text:				''.
	cItem setInitialValueTo: {1 300 250 200 150 100 50 10}.
	temp := {#Integer {#Precision 0} {#LeadingChar $ } #NoSeparators #Left
			#Top {#PointSize 8}}.
	cItem setFormatTo: temp.
	cItem := controller add: #Y
		class:			FormNumericSpinButton
		rect:				{739 795 349 75}
		options:			{#Return #Tab #Backtab #OnlyNumbers}
		form:				form
		text:				''.
	cItem setInitialValueTo: {1 150 100 50 10}.
	temp := {#Integer {#Precision 0} {#LeadingChar $ } #NoSeparators #Left
			#Top {#PointSize 8}}.
	cItem setFormatTo: temp.
	controller initializeBindings.
	controller finishInit.

!"end createItemsFor: "


initializeBindings
	|temp|
	self on: #changed: for: X
		action: (Action receiver: self send: #paintBall).
	temp := ActionSequence new.
	temp add: (Action receiver: self send: #paintBall).
	temp add: (Action receiver: Sztaluga send: #update).
	temp add: (Action receiver: Sztaluga send: #redraw).
	self on: #changed: for: Y
		action: temp.

!"end initializeBindings "


paintBall
		| p blue |
		p := Point newX: (X getValue) y: (Y getValue).
		Sztaluga erase.
		Sztaluga fillCircleAt: p radius: 5.
		Sztaluga refresh.
!"end paintBall "


!"End of methods block"

