ComboView.st
changeset 4187 b658d1a5ac5d
parent 4186 0087947b1b29
child 4225 565906233a1d
equal deleted inserted replaced
4186:0087947b1b29 4187:b658d1a5ac5d
    11 "
    11 "
    12 "{ Package: 'stx:libwidg2' }"
    12 "{ Package: 'stx:libwidg2' }"
    13 
    13 
    14 View subclass:#ComboView
    14 View subclass:#ComboView
    15 	instanceVariableNames:'field pullDownButton list listHolder listMsg action resizableMenu
    15 	instanceVariableNames:'field pullDownButton list listHolder listMsg action resizableMenu
    16 		currentIndex'
    16 		currentIndex comboMenuHolder comboMenuMessage'
    17 	classVariableNames:'DefaultButtonForm ComboButtonForms'
    17 	classVariableNames:'DefaultButtonForm ComboButtonForms'
    18 	poolDictionaries:''
    18 	poolDictionaries:''
    19 	category:'Views-Interactors'
    19 	category:'Views-Interactors'
    20 !
    20 !
    21 
    21 
   392     field foregroundColor:aColor
   392     field foregroundColor:aColor
   393 ! !
   393 ! !
   394 
   394 
   395 !ComboView methodsFor:'accessing-mvc'!
   395 !ComboView methodsFor:'accessing-mvc'!
   396 
   396 
       
   397 comboMenuHolder
       
   398     ^ comboMenuHolder
       
   399 !
       
   400 
       
   401 comboMenuHolder:something
       
   402     comboMenuHolder := something.
       
   403 !
       
   404 
       
   405 comboMenuMessage
       
   406     ^ comboMenuMessage
       
   407 !
       
   408 
       
   409 comboMenuMessage:something
       
   410     comboMenuMessage := something.
       
   411 !
       
   412 
   397 listHolder:aValueHolder
   413 listHolder:aValueHolder
   398     "set the listHolder.
   414     "set the listHolder.
   399      If not set, the list is supposed to be set explicitely"
   415      If not set, the list is supposed to be set explicitely"
   400 
   416 
   401     listHolder notNil ifTrue:[
   417     listHolder notNil ifTrue:[
   704 createPullDownMenuForList:aList
   720 createPullDownMenuForList:aList
   705     "pull the menu - triggered from the button"
   721     "pull the menu - triggered from the button"
   706 
   722 
   707     |menu index|
   723     |menu index|
   708 
   724 
   709     menuHolder notNil ifTrue:[
   725     comboMenuHolder notNil ifTrue:[
   710         menu := menuHolder value
   726         menu := (comboMenuHolder perform:comboMenuMessage ? #value). 
       
   727         (menu isKindOf:Menu) ifTrue:[
       
   728             menu := MenuPanel new menu:menu.
       
   729         ]
   711     ] ifFalse:[
   730     ] ifFalse:[
   712         menu := MenuPanel new.
   731         menu := MenuPanel new.
   713         menu doAccessCharacterTranslation:false.
   732         menu doAccessCharacterTranslation:false.
   714         menu labels:aList.
   733         menu labels:aList.
   715         menu hideOnRelease:false.
   734         menu hideOnRelease:false.
   886 ! !
   905 ! !
   887 
   906 
   888 !ComboView class methodsFor:'documentation'!
   907 !ComboView class methodsFor:'documentation'!
   889 
   908 
   890 version
   909 version
   891     ^ '$Header: /cvs/stx/stx/libwidg2/ComboView.st,v 1.109 2013-03-14 13:51:09 cg Exp $'
   910     ^ '$Header: /cvs/stx/stx/libwidg2/ComboView.st,v 1.110 2013-03-18 13:27:31 cg Exp $'
   892 !
   911 !
   893 
   912 
   894 version_CVS
   913 version_CVS
   895     ^ '$Header: /cvs/stx/stx/libwidg2/ComboView.st,v 1.109 2013-03-14 13:51:09 cg Exp $'
   914     ^ '$Header: /cvs/stx/stx/libwidg2/ComboView.st,v 1.110 2013-03-18 13:27:31 cg Exp $'
   896 ! !
   915 ! !
   897 
   916