FilteredListBox.dcl 1.4 KB
Newer Older
Diederik van Arkel's avatar
Diederik van Arkel committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
definition module FilteredListBox

import StdControl, StdControlClass, StdId, StdPSt

::	FilteredListBoxId
	=	{	fcontrolId	:: !Id							// The Id of the outmost CompoundControl
		,	freceiverId	:: !R2Id (FilteredMessageIn) FilteredMessageOut	// The Id of the Receiver2Control that handles message passing
		}
:: FilteredMessageIn
:: FilteredMessageOut
:: FilteredListBoxItem :== String

:: FilteredListBoxControl ls ps
	= FilteredListBoxControl [FilteredListBoxItem] [Int] FilteredListBoxId [ControlAttribute *(*(FilteredListBoxState,ls),ps)]

instance Controls FilteredListBoxControl

openFilteredListBoxId			:: !*env -> (!FilteredListBoxId,!*env)	| Ids env

appendFilteredListBoxItems		:: !FilteredListBoxId ![FilteredListBoxItem]			!(PSt .l) -> PSt .l
setFilteredListBoxPen			:: !FilteredListBoxId ![PenAttribute] !(PSt .l) -> PSt .l
22
exec_next_filtered				:: !Bool !FilteredListBoxId (String (PSt .l) -> (PSt .l)) !(PSt .l) -> (PSt .l)
Diederik van Arkel's avatar
Diederik van Arkel committed
23 24 25 26 27 28

flbMouse	:: ({#Char} -> .(*(PSt .a) -> *PSt .a)) -> .ControlAttribute *((FilteredListBoxState,.b),*PSt .a);
flbKeyboard	:: ({#Char} -> .(*(PSt .a) -> *PSt .a)) -> .ControlAttribute *((FilteredListBoxState,.b),*PSt .a);

:: FilteredListBoxState

29 30
setFilter :: !FilteredListBoxId ([String]->[String]) !(PSt .l) -> PSt .l
getFilter :: !FilteredListBoxId !(PSt .l) -> (![String]->[String],PSt .l)
Diederik van Arkel's avatar
Diederik van Arkel committed
31 32

getFilteredListBoxSelection :: !FilteredListBoxId !(PSt .l) -> (!(!Bool,![(String,!Index)]),!PSt .l)