a10f6b0041b6 — Gerald Klix (speedy) 1 year, 9 months ago
SUM: State related buttons are now colored.
1 files changed, 27 insertions(+), 15 deletions(-)

M haver/office/NuMach.pck.st
M haver/office/NuMach.pck.st +27 -15
@@ 1,8 1,8 @@ 
-'From Haver 6.0 [latest update: #5832] on 1 June 2023 at 8:22:58 pm'!
+'From Haver 6.0 [latest update: #5832] on 1 June 2023 at 9:32:34 pm'!
 'Description NuMach is a very simple to list.
 
 Hopefully it will serve as a base for something more elaborate.'!
-!provides: 'NuMach' 1 22!
+!provides: 'NuMach' 1 23!
 !requires: 'Cuis-Base' 60 5780 nil!
 !requires: 'FacetsMorphs' 1 3 nil!
 !requires: 'IdGeneration' 1 0 nil!

          
@@ 903,7 903,7 @@ initialize
 	super initialize.
 	isTopLevel := false! !
 
-!(Modules>>#NuMach>>#TodoItemContainerMorph) methodsFor: 'GUI building' stamp: 'KLG 6/1/2023 20:20:31'!
+!(Modules>>#NuMach>>#TodoItemContainerMorph) methodsFor: 'GUI building' stamp: 'KLG 6/1/2023 21:03:43'!
 buildMorphicWidget
 	"Build me."
 

          
@@ 918,6 918,7 @@ buildMorphicWidget
 					selector: #visible:state:
 					arguments: { state } ::
 						secondarySelector: #visible:onlyThisState:;
+						contentsColor: state buttonColor;
 						setBalloonText:
 'If ', 'on' italic, ' show items in state ', state displayString bold,'.
 

          
@@ 1083,7 1084,7 @@ visible: aVisibleFlag state: aState
 				needsUpdate ifTrue: [
 					self showSubItemsAccordingToFilter ] ]! !
 
-!(Modules>>#NuMach>>#TodoItemMorph) methodsFor: 'GUI building' stamp: 'KLG 5/31/2023 21:29:41'!
+!(Modules>>#NuMach>>#TodoItemMorph) methodsFor: 'GUI building' stamp: 'KLG 6/1/2023 21:08:36'!
 buildMorphicWidget
 	"Build my widget."
 

          
@@ 1111,6 1112,7 @@ buildMorphicWidget
 				selector: #showNextStateMenu)
 					secondaryTarget: self model;
 					secondarySelector: #moveStateForward;
+					contentsColor: self model state buttonColor;
 					setBalloonText: self model state description)
 		fixedWidth: 130.
 	(headerPanel := LayoutMorph newRow)

          
@@ 1185,22 1187,13 @@ showNextStateMenu
 				setBalloonText: nextState description ].
 	menu invokeModal! !
 
-!(Modules>>#NuMach>>#TodoItemMorph) methodsFor: 'user interface' stamp: 'KLG 5/31/2023 17:24:45'!
-updateStateButton
-	"Update the state button."
-
-	| state |
-	stateButton
-		contents: (state := self model state) displayString;
-		setBalloonText: state description
-	! !
-
-!(Modules>>#NuMach>>#TodoItemMorph) methodsFor: 'user interface' stamp: 'KLG 5/31/2023 17:50:25'!
+!(Modules>>#NuMach>>#TodoItemMorph) methodsFor: 'user interface' stamp: 'KLG 6/1/2023 21:08:08'!
 updateStateButton: aNewState
 	"Update the state button."
 
 	stateButton
 		contents: aNewState displayString;
+		contentsColor: aNewState buttonColor;
 		setBalloonText: aNewState description
 	! !
 

          
@@ 1351,6 1344,25 @@ nextAllowedStates
 
 	^ self subclassResponsibility! !
 
+!(Modules>>#NuMach>>#AbstractItemState) methodsFor: 'user interface support' stamp: 'KLG 6/1/2023 21:04:10'!
+buttonBackroundColor
+	"Answer the backround color for buttons."
+
+	self halt: 'I am obsolte!!'.
+	^self buttonColor! !
+
+!(Modules>>#NuMach>>#AbstractItemState) methodsFor: 'user interface support' stamp: 'KLG 6/1/2023 21:03:35'!
+buttonColor
+	"Answer the backround color for buttons."
+
+	^self metaState
+		caseOf: {
+			[ 1 ] -> [ `Color white` ].
+			[ 2 ] -> [ `Color gray` ].
+			[ 3 ] -> [ `Color yellow` ].
+			[ 4 ] -> [ `Color cyan` ] }
+		otherwise: [ `Color magenta` ]! !
+
 !(Modules>>#NuMach>>#AbstractItemState) methodsFor: 'user interface support' stamp: 'KLG 5/31/2023 13:42:24'!
 displayString
 	"Answer my display string."