Skip to content

Commit

Permalink
Merge pull request #55 from ElvinPero/ICelv
Browse files Browse the repository at this point in the history
Assembled Tp33 with all the widgets
  • Loading branch information
lucretiomsp authored Nov 16, 2024
2 parents e9c3338 + a792bcf commit 76d2e65
Show file tree
Hide file tree
Showing 21 changed files with 2,011 additions and 38 deletions.
47 changes: 42 additions & 5 deletions CoypuIDE/TbButton.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,36 @@ container openInSpace.



]

{ #category : 'as yet unclassified' }
TbButton class >> layoutViewExample_1560_800 [
<script>
| container e1 e2 e3 e4 e5|
container:= BlElement new
geometry: BlRectangleGeometry new;
layout: (BlGridLayout new
columnCount: 10;
cellSpacing: 10
);
"size: 1280@720;"
size: 1560@800;
"background: Color veryVeryDarkGray ."
"background: Color veryDarkGray ."
background: Color black .


e1:= TbButton new.
e2:= TbLEDButton new.
e3:= TbLEDButton toggleable.
e4:= TbLEDDarkButton new.
e5:= TbLEDDarkButton toggleable.

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



]

{ #category : 'api - attribute' }
Expand Down Expand Up @@ -123,6 +153,12 @@ TbButton >> callbackDown: aBlock [
callbackDown := aBlock
]

{ #category : 'initialization' }
TbButton >> color4 [
"^ (Color r: 233 g:208 b:168 range:255)."
^ (Color r: 99 g:78 b:44 range:255).
]

{ #category : 'evaluating' }
TbButton >> indicator [
^ indicator.
Expand Down Expand Up @@ -150,7 +186,8 @@ TbButton >> initializeButton [
|s|
self button: (BlElement new
geometry:(BlRoundedRectangleGeometry cornerRadius: 4);
background: self switchOnColor;
"background: self switchOnColor;"
background: (self color4 alpha:0.7);
transformDo: [ :t|
t translateBy: 0@ -4 ];
effect: (BlGaussianShadowEffect color: (self shadowColor) offset: 0@ 4 width: 10);
Expand Down Expand Up @@ -251,7 +288,7 @@ TbButton >> initializeSwitch [
TbButton >> initializeWidget [
self size: widgetSize.
self geometry: (BlRoundedRectangleGeometry cornerRadius: 6).
self padding: (BlInsets all: 5).
self padding: (BlInsets top: 15 right:5 bottom:15 left:5 ).
self background: self backColor.
self layout: BlFrameLayout new.

Expand All @@ -262,7 +299,7 @@ TbButton >> initializeWidget [

{ #category : 'evaluating' }
TbButton >> initializeWidgetSize [
widgetSize:= 60@120.
widgetSize:= 50@135.
]

{ #category : 'accessing' }
Expand Down Expand Up @@ -362,7 +399,7 @@ TbButton >> toggle [

].

button background: (self switchOnColor alpha: 1.0);
button
childrenDo: [ :i|
i constraintsDo: [ :c |
c frame horizontal alignCenter.
Expand All @@ -384,7 +421,7 @@ TbButton >> toggle [
i background:Color veryVeryLightGray.

].
button background: (self switchOnColor alpha: 1.0);
button
childrenDo: [ :i|
i constraintsDo: [ :c |
c frame horizontal alignCenter.
Expand Down
3 changes: 2 additions & 1 deletion CoypuIDE/TbHorizontalSwitch.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ TbHorizontalSwitch >> initializeSwitch [
|s|
self switch: (BlElement new
geometry:(BlRoundedRectangleGeometry cornerRadius: 4);
background: self switchOnColor;
"background: self switchOnColor;"
background: (self color4 alpha:0.7);
transformDo: [ :t|
t translateBy: 0@ -4 ];
effect: (BlGaussianShadowEffect color: (self shadowColor) offset: 0@ 4 width: 10);
Expand Down
3 changes: 2 additions & 1 deletion CoypuIDE/TbHorizontalSwitch2.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ TbHorizontalSwitch2 >> initializeSwitch [
|s|
self switch: (BlElement new
geometry:(BlRoundedRectangleGeometry cornerRadius: 6);
background: self switchOnColor;
"background: self switchOnColor;"
background: (self color4 alpha:0.7);
transformDo: [ :t|
t translateBy: 0@ -4 ];
effect: (BlGaussianShadowEffect color: (self shadowColor) offset: 0@ 4 width: 10);
Expand Down
6 changes: 3 additions & 3 deletions CoypuIDE/TbKnob.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ TbKnob class >> AllExamples [
k4 := TbKnob label:'ENV MOD'.
k5 := TbKnob label:'DECAY'.
k6 := TbKnob label:'ACCENT'.
k7 := TbKnob1 label:'BIGGER KNOB'.
k8 := TbKnob1 label:'BIGGER KNOB'.
k7 := TbKnob1 label:'BIGGER KNOB1'.
k8 := TbKnob2 label:'BIGGER KNOB2'.



Expand Down Expand Up @@ -462,7 +462,7 @@ TbKnob >> initializeGeometry [
geometry: BlCircleGeometry new;
size: self knobSize+5 asPoint;
clipChildren: false;
background: (self color4 alpha:1);
background: (self color4 alpha:1.0);
constraintsDo: [ :c |
c frame horizontal alignCenter.
c frame vertical alignCenter];
Expand Down
4 changes: 2 additions & 2 deletions CoypuIDE/TbKnob1.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ TbKnob1 class >> basicExample [
"knob callBack: [ :v | v inspect ]"
]

{ #category : 'accessing' }
{ #category : 'initialization' }
TbKnob1 >> initializeDefaultValues [

minValue := 0.
Expand Down Expand Up @@ -198,7 +198,7 @@ TbKnob1 >> initializeGeometry [
self addChild: self knob.
]

{ #category : 'initialization' }
{ #category : 'accessing' }
TbKnob1 >> labelSize [
^20
]
216 changes: 216 additions & 0 deletions CoypuIDE/TbKnob2.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
Class {
#name : 'TbKnob2',
#superclass : 'TbKnob',
#category : 'CoypuIDE-Acid',
#package : 'CoypuIDE',
#tag : 'Acid'
}

{ #category : 'examples' }
TbKnob2 class >> basicExample [

<script>

|container knob |
container:= BlElement new

geometry: BlRectangleGeometry new;
layout: (BlGridLayout new
columnCount: 2;
cellSpacing: 50
);
constraintsDo: [:c |
c horizontal matchParent.
c vertical matchParent.
];
background: (Color r: 233 g:224 b:208 range:255).
"background: (Color r: 249 g:239 b:224 range:255)."
"background: Color white."

knob := self label:'RESONANCE'.
container addChildren: { knob }.
container openInSpace.

"knob callBack: [ :v | v inspect ]"
]

{ #category : 'accessing' }
TbKnob2 >> color6 [
^ (Color r: 241 g:224 b:205 range:255).
]

{ #category : 'initialization' }
TbKnob2 >> initializeDefaultValues [

minValue := 0.
maxValue := 100.
stepValue := nil.
diameter :=120.
minAngle := -135.
maxAngle := 135
]

{ #category : 'initialization' }
TbKnob2 >> initializeGeometry [

|e1 e2 st st2 marker k kb kb2 kf k1 |

self size: 180 @ 230.
self background: (self backColor alpha:0.0).
"self border: (BlBorder paint: (Color gray) width: 2)."
self clipChildren: false.
self layout: BlFrameLayout new.
self padding:(BlInsets all: 7).

e1:= BlElement new
size: 130 asPoint;
geometry: (BlCircleGeometry new);
background: Color veryDarkGray;
transformDo:[:t |
t translateBy: -1.2@ -1.2];
constraintsDo: [ :c |
c frame horizontal alignCenter.
c frame vertical alignCenter];
transformDo:[:t | t translateBy:2.2@ -1.2];
effect: (BlGaussianShadowEffect color: (self shadowColor) offset: 10@35 width: 60).


e2:= BlElement new
size: 122 asPoint;
geometry: (BlCircleGeometry new);
background: (BlRadialGradientPaint new
stops: { 0 -> self color2. 1 -> self color1 };
center: 35@35;
radius: 150;
yourself);
constraintsDo: [ :c |
c frame horizontal alignCenter.
c frame vertical alignCenter];
transformDo:[:t | t translateBy:3@ 0].

self addChildren:{ e1. e2}.


"st:= -280.
1 to: 11 do: [:i |
|dash curr|
curr:= (i * 30).
curr:= curr + st.
curr:= curr + 10.
dash:=
BlElement new
background: Color veryVeryDarkGray ;
size: diameter+ 50 asPoint;
geometry: (BlAnnulusSectorGeometry new
startAngle: curr;
endAngle: curr + 2;
innerRadius: 0.82;
outerRadius: 0.97);
constraintsDo: [ :c |
c frame horizontal alignCenter.
c frame vertical alignCenter ];
transformDo:[:t | t translateBy:3@ 0].
self addChild:dash.].
st2:= -265.
1 to: 10 do: [:i |
|dash curr|
curr:= (i * 30).
curr:= curr + st2.
curr:= curr + 10.
dash:=
BlElement new
background: Color veryVeryDarkGray ;
size: diameter+ 50 asPoint;
geometry: (BlAnnulusSectorGeometry new
startAngle: curr;
endAngle: curr + 1.5;
innerRadius: 0.82;
outerRadius: 0.88);
constraintsDo: [ :c |
c frame horizontal alignCenter.
c frame vertical alignCenter ];
transformDo:[:t | t translateBy:3@ 0].
self addChild:dash.]."


k:= BlElement new
geometry: (BlRoundedRectangleGeometry cornerRadius: 10);
size: self knobSize-40 @ self knobSize +20;
clipChildren: true;
background: (self color4 alpha:1);
constraintsDo: [ :c |
c frame horizontal alignCenter.
c frame vertical alignCenter];
layout: BlFrameLayout new;
effect: (BlGaussianShadowEffect color: (Color brown alpha:1) offset: 0@0 width: 24).




marker := BlElement new
size: 24 @ 7;
geometry: (BlRoundedRectangleGeometry cornerRadius: 2);
background: self color4;
transformDo:[:t | t rotateBy:80.
t translateBy: 5@ 5];
constraintsDo: [ :c |
c frame horizontal alignCenter.
c frame vertical alignTop].

marker zIndex: 100.
k1 := BlElement new
size: 24 @ 100;
transformDo: [ :t | t translateBy: -2 @ 0 ];

geometry: (BlRoundedRectangleGeometry cornerRadius: 2);
background: self color5 ;
transformDo:[:t | t rotateBy:90.
t translateBy: 0@ -40];
constraintsDo: [ :c |
c frame horizontal alignCenter.
c frame vertical alignTop].

kf := BlElement new
size: 46@72;
geometry: (BlRoundedRectangleGeometry cornerRadius:4);
background: self color6;
transformDo:[:t | t rotateBy:0.
t translateBy: 6@ 5];
constraintsDo: [ :c |
c frame horizontal alignCenter.
c frame vertical alignCenter].

kb := BlElement new
size: 24@40;
geometry: (BlRoundedRectangleGeometry cornerRadius:3);
background: (self color4 alpha:1);
transformDo:[:t | t rotateBy:-30.
t translateBy: -16@ -6];
constraintsDo: [ :c |
c frame horizontal alignLeft.
c frame vertical alignTop].
kb2 := BlElement new
size: 14@40;
geometry: (BlRoundedRectangleGeometry cornerRadius:3);
background: (self color4 alpha:1);
transformDo:[:t | t rotateBy:10.
t translateBy: 10@ -3];
constraintsDo: [ :c |
c frame horizontal alignRight.
c frame vertical alignTop].

k addChildren: {k1. marker. kb. kb2. kf}.


self knob: k.
self addChild: self knob.
]

{ #category : 'accessing' }
TbKnob2 >> labelSize [
^20
]
1 change: 0 additions & 1 deletion CoypuIDE/TbLED.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ TbLED >> initializeIndicator [
transformDo: [ :t|
t translateBy: -4@ -4.
];
effect: (BlGaussianShadowEffect color: (Color white alpha:1.0) offset: 0@ 0 width: 7);
constraintsDo: [ :c |
c frame horizontal alignCenter.
c frame vertical alignCenter.
Expand Down
Loading

0 comments on commit 76d2e65

Please sign in to comment.