'From Squeak3.9 of 7 November 2006 [latest update: #7067] on 2 April 2008 at 6:28:49 pm'! Model subclass: #Bouton instanceVariableNames: 'etat chaine' classVariableNames: '' poolDictionaries: '' category: 'Cours-Smalltalk-GUI'! !Bouton methodsFor: 'as yet unclassified' stamp: 'hw 3/28/2006 10:22'! activer self etat: true. self changed: #bouton! ! !Bouton methodsFor: 'as yet unclassified' stamp: 'hw 3/30/2006 08:52'! buttonMenu: evt | menu | menu := MenuMorph new defaultTarget: self. menu addTitle: 'TV-Menu'; add: 'inspect' action: #inspect. ^menu! ! !Bouton methodsFor: 'as yet unclassified' stamp: 'hw 3/26/2006 21:06'! chaine ^ chaine! ! !Bouton methodsFor: 'as yet unclassified' stamp: 'hw 3/26/2006 21:07'! chaine: aNumber chaine := aNumber. ! ! !Bouton methodsFor: 'as yet unclassified' stamp: 'hw 3/27/2006 19:22'! changeEtiquette ^ etat ifTrue: [self chaine , ' allum¦©'] ifFalse: [self chaine] ! ! !Bouton methodsFor: 'as yet unclassified' stamp: 'hw 3/26/2006 18:43'! etat ^etat! ! !Bouton methodsFor: 'as yet unclassified' stamp: 'hw 3/28/2006 10:06'! etat: aBool etat := aBool. self changed: #changeEtiquette! ! !Bouton methodsFor: 'as yet unclassified' stamp: 'hw 3/27/2006 08:51'! handlesMouseDown: evt ^ evt yellowButtonPressed ! ! !Bouton methodsFor: 'as yet unclassified' stamp: 'hw 3/27/2006 23:57'! initialize: n "Bouton example" | window collection aux | window := AlignmentMorph newRow. window layoutBounds: (0 @ 0 corner: 300 @ 50). collection := Array new: n. 1 to: n do: [:b | collection at: b put: (aux := Bouton new). aux etat: false; chaine: b asString. aux := PluggableButtonMorph on: aux getState: #etat action: #activer label: #changeEtiquette menu: #buttonMenu:. aux onColor: Color lightBlue offColor: Color lightYellow; feedbackColor: Color red; useRoundedCorners; hResizing: #spaceFill; vResizing: #spaceFill. window addMorphBack: aux]. Bouton initialise: collection. window openInWorld! ! !Bouton methodsFor: 'as yet unclassified' stamp: 'hw 3/25/2006 18:19'! printOn: aStream aStream nextPutAll: etat printString! ! !Bouton methodsFor: 'as yet unclassified' stamp: 'hw 3/29/2006 16:00'! update: aSymbol aSymbol == #bouton ifTrue: [self etat: false]! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! Bouton class instanceVariableNames: ''! !Bouton class methodsFor: 'as yet unclassified' stamp: 'hw 3/31/2008 23:06'! example "Bouton example" Bouton new initialize: 5! ! !Bouton class methodsFor: 'as yet unclassified' stamp: 'hw 3/26/2006 19:05'! initialise: aCollection aCollection do: [:b1 | aCollection do: [:b2 | b2 == b1 ifFalse: [b1 addDependent: b2 ]]]! !