'From Squeak3.7 of ''4 September 2004'' [latest update: #5989] on 2 February 2009 at 10:54:22 am'!
!classDefinition: #CustomNavigationEntryFieldLW category: #'LightWidgets-Kernel'!
EntryField2LW subclass: #CustomNavigationEntryFieldLW
	instanceVariableNames: 'upLW downLW'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'LightWidgets-Kernel'!

!CustomNavigationEntryFieldLW commentStamp: '<historical>' prior: 0!
A kind of entry field where up and down arrow don't navigate to the default previous / next widget, but to some specific widget previously set.

Useful for example, for laying out fields in a matrix like way.!


!CustomNavigationEntryFieldLW methodsFor: 'accessing' stamp: 'jmv 2/2/2009 10:37'!
downLW: anLW
	downLW _ anLW! !

!CustomNavigationEntryFieldLW methodsFor: 'accessing' stamp: 'jmv 2/2/2009 10:37'!
upLW: anLW
	upLW _ anLW! !

!CustomNavigationEntryFieldLW methodsFor: 'event handling' stamp: 'jmv 2/2/2009 10:42'!
keyStroke: aKeyboardEvent
	"Handle a keystroke event."

	| k |
	aKeyboardEvent commandKeyPressed
		ifTrue: [ ^super keyStroke: aKeyboardEvent ].
	
	k _ aKeyboardEvent keyValue.
	(k = 30 and: [ upLW notNil ]) ifTrue: [
		^ aKeyboardEvent hand newKeyboardFocus: upLW ].
	(k = 31 and: [ downLW notNil ]) ifTrue: [
		^ aKeyboardEvent hand newKeyboardFocus: downLW ].

	 ^super keyStroke: aKeyboardEvent! !


!CustomNavigationEntryFieldLW reorganize!
('accessing' downLW: upLW:)
('event handling' keyStroke:)
!

