diff --git a/CoypuIDE/BlElement.extension.st b/CoypuIDE/BlElement.extension.st index f4bc31e..cc67e1c 100644 --- a/CoypuIDE/BlElement.extension.st +++ b/CoypuIDE/BlElement.extension.st @@ -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))) diff --git a/CoypuIDE/ICValueDisplay.class.st b/CoypuIDE/ICValueDisplay.class.st index 1e69f73..46b4b2b 100644 --- a/CoypuIDE/ICValueDisplay.class.st +++ b/CoypuIDE/ICValueDisplay.class.st @@ -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 [ @@ -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. @@ -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 @@ -63,6 +71,12 @@ ICValueDisplay >> initializeValueText [ valueText transformDo: [ :t | t translateBy: 0@6 ] ] +{ #category : 'accessing' } +ICValueDisplay >> inputText [ + + ^ labelText asString +] + { #category : 'accessing' } ICValueDisplay >> label: aString [