Page 1 of 1
Posted: 24 Oct 2010, 07:24
by woodslanding
It would be nice to be able to programmatically change the background color of a patch...... or to change the bitmap
Right now, it seems like the container object doesn't actuallyhave anything to do with the background object--but it seems like maybe you could put controls for the background into the container object???
Of course there may be a reason not to, which I don't understand.....
thanks,
-eric
Posted: 24 Oct 2010, 08:04
by 23fx23
what do you call a backround object?
if you speak of container or any usine interface item that have a backround color option avaible in edit layout,
then now it's accessible since a few versions via iml and the SET_LAYOUT procedure.
so if you place your items in a container, you can dynamically change the bacground, border or whatever avaible
layout option via iml, that can be trig via sendusine message module or inside a script.
if you speak of backrounf of patch i don't think it's possible, but just add a contenair will do the job.
here an exemple with script:
SendInternalMsg ('SET_TARGET_PATCH','SENDER_PATCH')
SendInternalMsg ('SET_LAYOUT','ThecontenairName','background color', FloatToStr(getValue(color_in)))
note that if you make inputs that will trig differents colors codes, you have to disable their fastCallback in init procedure using
SetFastCallback(input, FALSE);
SET_LAYOUT is awesome for that, i use it a lot, but do not abuse as it 's cpu hungry.
Posted: 07 Nov 2010, 05:37
by woodslanding
ahhh, cool.
It is still a bit awkward to use IML, but it does work.
Also I am trying not to use IML, as my cpu is right at the edge!
Posted: 10 Nov 2010, 08:53
by woodslanding
can this be used also to change the background bitmap?
Posted: 10 Nov 2010, 22:33
by 23fx23
sorry I don't know,
im pretty sure it work for every other layout options,
but i don't think it would work for bmp , as need to deal with files path.
tried with a jpg on c: but the var was not found, when trying via send message in console we can see:
"Bit map affectation is not allowed : BACK BITMAP" so i suppose it's a protection.
can use fader with frames as a workaround? (but will not work as Bg).
also i found a trick if really need BG, is to set visible items in a certain order via iml, from behind to upper so the fader is always behind the other items, then can increment the fader to change the BG image of the sequence. ..but i reckon it's tricky, especially if lot of items to re-set on top, ...still a possible workaround..)
i did a test and that worked, named all items exept the farder from 0 to n in order to make it easier then with the script iml
set them all invisible, then back visible, so above the fader. a cool option to solve this pb would be a "force item to be under",
or dynamically change all the layout preset.
but maybe i did wrong and it's already possible. i guess only senso can answer that..
Posted: 10 Nov 2010, 23:00
by woodslanding
Okay.... I'm thinking of a different way to do this anyway.... I think I will indicate active with a switch, even though it is actually a button. Then I can use the mouse down feature to do the button work. So no need for bkg switching.
With setting visible items order: Is there a way to get the slider thumb to appear on top of the title for a fader??
Obviously it looks all wrong for the title to show over the thumb!
Posted: 11 Nov 2010, 10:55
by senso
Yes it's a protection.
I'm not sure I can disable it.
Posted: 13 Nov 2010, 19:29
by woodslanding
it's fine, no worries.