Skip to content

Commit

Permalink
Merge 18f0d0f
Browse files Browse the repository at this point in the history
  • Loading branch information
lucretiomsp committed Oct 14, 2024
2 parents 724a4e3 + 18f0d0f commit 6ab7ca2
Show file tree
Hide file tree
Showing 6 changed files with 887 additions and 38 deletions.
32 changes: 18 additions & 14 deletions CoypuIDE/TbLED.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Class {
#tag : 'Acid'
}

{ #category : 'as yet unclassified' }
{ #category : 'example' }
TbLED class >> LEDexample [
<script>
| container e1 e2 |
Expand All @@ -37,12 +37,12 @@ container openInSpace.

]

{ #category : 'as yet unclassified' }
{ #category : 'accessing' }
TbLED >> indicator [
^indicator
]

{ #category : 'as yet unclassified' }
{ #category : 'setting' }
TbLED >> indicator: aBlock [
indicator:= aBlock.
]
Expand All @@ -58,8 +58,9 @@ TbLED >> initialize [
self initializeIndicator.
]

{ #category : 'as yet unclassified' }
{ #category : 'initialization' }
TbLED >> initializeIndicator [
"This method initializes the led indicator"
|e|
self indicator: (BlElement new
geometry: BlCircleGeometry new;
Expand Down Expand Up @@ -90,32 +91,36 @@ TbLED >> initializeIndicator [

{ #category : 'initialization' }
TbLED >> initializeWidget [
"This method initializes the widget"
self size: widgetSize.
self background: (Color gray alpha:0.0).
self layout: BlFrameLayout new.
]

{ #category : 'initialization' }
TbLED >> initializeWidgetSize [
"This method initializes the size of the widget."
widgetSize:= 60@55.
]

{ #category : 'evaluating' }
{ #category : 'accessing' }
TbLED >> offColor [
^ (Color r: 115 g:1 b:1 range:255).

]

{ #category : 'initialization' }
{ #category : 'setting' }
TbLED >> setValue: req [
"This method takes a request integer and toggles the led if the requested integer is opposite to the value."
self value = req
ifFalse: [
self toggle.
].
]

{ #category : 'initialization' }
{ #category : 'api - operations' }
TbLED >> toggle [
"This method changes both the value and the graphic of the widget."
self toggleValue.
self value = 1
ifTrue: [
Expand All @@ -134,7 +139,6 @@ TbLED >> toggle [
]
ifFalse: [
"Off Mode"
"indicator background: self offColor;"
indicator background: self offColor;
effect: (BlGaussianShadowEffect color: (Color green alpha:0.0) offset: 5@ 0 width: 35);
childrenDo: [ :i|
Expand All @@ -143,26 +147,26 @@ TbLED >> toggle [
scaleBy: 1.
].
i background: Color veryLightGray.

].


].
]

{ #category : 'initialization' }
{ #category : 'api - operations' }
TbLED >> toggleValue [
"This mathod changes the value of the widget."
self value = 0
"Off"
ifTrue: [ self value: 1 ]
"On"
ifFalse: [ self value: 0 ].
]

{ #category : 'initialization' }
{ #category : 'accessing' }
TbLED >> value [
^value
]

{ #category : 'initialization' }
{ #category : 'setting' }
TbLED >> value: anInteger [
value:= anInteger.
]
9 changes: 6 additions & 3 deletions CoypuIDE/TbWidget_Back.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ Class {
{ #category : 'as yet unclassified' }
TbWidget_Back class >> AllWidgetExamples [
<script>
| container e1 e2 e3 e4 e5 |
| container e1 e2 e3 e4 e5 e6 e7|
container:= BlElement new

geometry: BlRectangleGeometry new;
layout: (BlGridLayout new
columnCount: 2;
columnCount: 4;
cellSpacing: 10
);
constraintsDo: [:c |
Expand All @@ -35,10 +35,13 @@ e1:=TbWidget_Back new.
e2:=TbWidget_WriteNext new.
e3:=TbWidget_PatternClear new.
e4:=TbWidget_RunStop new.
e5:=TbWidget_PitchMode new.
e6:=TbWidget_Function new.
e7:=TbWidget_TimeMode new.



container addChildren: { e1. e3. e2. e4}.
container addChildren: { e1. e3. e5. e7. e2. e4. e6}.
container openInSpace.

]
Expand Down
Loading

0 comments on commit 6ab7ca2

Please sign in to comment.