Skip to content

Commit

Permalink
add method to display PhHBarGraph as ICValueDisplay on Phausto IDE
Browse files Browse the repository at this point in the history
  • Loading branch information
lucretiomsp committed Jan 21, 2025
1 parent edcf246 commit 34428ed
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CoypuIDE/BlElement.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ BlElement >> fromDictionary: aDictionary forDsp: aDsp [
widgetDictionary := Dictionary new.
widgetDictionary
add: #hslider -> #ICDarkKnob3;
add: #button -> #ICLabelButton.
add: #button -> #ICLabelButton;
add: #hbargraph -> #ICValueDisplay.

^ (self class environment at:
(widgetDictionary at: (aDictionary at: #type)))
Expand Down
16 changes: 15 additions & 1 deletion CoypuIDE/ICValueDisplay.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ Class {
#tag : 'numericalEntry'
}

{ #category : 'instance creation' }
ICValueDisplay class >> fromDictionary: aDictionary forDsp: aDsp [

^ self new
label: (aDictionary at: #label)
]

{ #category : 'evaluating' }
ICValueDisplay >> configuredString: aString [

Expand All @@ -24,7 +31,7 @@ ICValueDisplay >> configuredString: aString [
ICValueDisplay >> initialize [

super initialize.
self background: Color black.
self background: Color black lighter.
self layout: BlFrameLayout new.

self size: self widgetSize.
Expand All @@ -44,6 +51,7 @@ ICValueDisplay >> initializeLabel: aString [
labelText text: (self configuredString: aString).
labelText text fontSize: 20.
labelText constraintsDo: [ :c | c frame horizontal alignCenter ].
valueText transformDo: [ :t | t translateBy: 0 @ 2 ].


self addChild: labelText
Expand All @@ -63,6 +71,12 @@ ICValueDisplay >> initializeValueText [
valueText transformDo: [ :t | t translateBy: 0@6 ]
]

{ #category : 'accessing' }
ICValueDisplay >> inputText [

^ labelText asString
]

{ #category : 'accessing' }
ICValueDisplay >> label: aString [

Expand Down

0 comments on commit 34428ed

Please sign in to comment.