[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sc-devel] Transparent backgrounds in Views




Hi Jan

well this is already possible,

Oh, thanks. I tried but must have done something wrong.
(I think I had a flowlayout in the code and the view was below the view I was testing)
But what about SC2DSlider? The code pasted below does not do that.

it would be useful to have a method to change the layering of views.

Yes, that would be nice. 


(
var size;
size = 12;
a = SCWindow("test", Rect(200 , 450, 10 + (size * 17), 10 + (size * 17))).front;


b = SC2DSlider(a, Rect(0, 0, size * 17, size * 17))
.knobColor_(Color.blue)
.x_(0.8)
.background_(Color.green.alpha_(0.0))
.fillColor_(Color.blue);

c = SC2DSlider(a, Rect(0, 0, size * 17, size * 17))
.knobColor_(Color.red)
.x_(0.4)
.background_(Color.green.alpha_(0.0))
)


t




(
//use as table
var size, win, data1, data2, view1, view2, swapData, data1Color, data2Color;
data1Color = Color.blue;
data2Color = Color.green;
size = 350 / 6;
data1 = {1.0.rand} ! size;
data2 = {1.0.rand} ! size;

win = SCWindow("test", Rect(200 , 450, 450, 150));
//win.view.decorator =  FlowLayout(win.view.bounds);
SCButton(win, Rect(0,0, 80,20)).states_([["data1"],["data2"]])
.action_{|v| swapData.(v.value)};
view1 = SCMultiSliderView(win, Rect(0, 24, 350, 100))
.background_(Color.green.alpha_(0.0))
.fillColor_(data1Color.alpha_(0.5))
.value_(data1)
.isFilled_(true)
.indexThumbSize_(2)
.gap_(4);
view2 = SCMultiSliderView(win, Rect(0, 24, 350, 100))
.background_(Color.green.alpha_(0.0))
.fillColor_(data2Color)
.value_(data2)
.isFilled_(true)
.indexThumbSize_(2)
.gap_(4);

swapData = {|dofocusOn|
view1.remove;
view2.remove;


if(dofocusOn == 0){
view1 = SCMultiSliderView(win, Rect(0, 24, 350, 100))
.background_(Color.green.alpha_(0.0))
.fillColor_(data1Color.alpha_(0.5))
.value_(data1)
.isFilled_(true)
.indexThumbSize_(2)
.gap_(4);
view2 = SCMultiSliderView(win, Rect(0, 24, 350, 100))
.background_(Color.green.alpha_(0.0))
.fillColor_(data2Color)
.value_(data2)
.isFilled_(true)
.indexThumbSize_(2)
.gap_(4);

}{

view2 = SCMultiSliderView(win, Rect(0, 24, 350, 100))
.background_(Color.green.alpha_(0.0))
.fillColor_(data2Color.alpha_(0.5))
.value_(data2)
.isFilled_(true)
.indexThumbSize_(2)
.gap_(4);
view1 = SCMultiSliderView(win, Rect(0, 24, 350, 100))
.background_(Color.green.alpha_(0.0))
.fillColor_(data1Color)
.value_(data1)
.isFilled_(true)
.indexThumbSize_(2)
.gap_(4);
}


};

win.front;
)


On Dec 1, 2007, at 12:24 PM, thor wrote:


Hi Jan.

Since you're working on the GUI views, do you think it's possible to
implement transparent background of the views?

For example to allow for 2 or more multisliderviews to be on top
of each other but the top one would have transparent background.

One could then programmatically decide which one is active, and
takes mouseevents.

This would make lots of interesting things possible in terms of GUIs.

Cheers
thor
_______________________________________________
Sc-devel mailing list

_______________________________________________
Sc-devel mailing list