The blend level of a stack...
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
The blend level of a stack...
I was playing with blendLevel today, and noticed that when you set the stack to a blendLevel, it automatically applies to all the objects in that stack (which I should have probably known).
My question is, is it possible to have a stack blendLevel of say, 100, but set an object to still show?
My question is, is it possible to have a stack blendLevel of say, 100, but set an object to still show?
-
- VIP Livecode Opensource Backer
- Posts: 9842
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: The blend level of a stack...
If you're looking for transparency, see the windowShape property, using a masked PNG.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: The blend level of a stack...
Oh, I already know about creating a window shape from a picture, and I already further know that you can say, drop some controls, set the bottom to srcClear, and then drop the decorations and have it show just like the windowShape, for example -
What I would like to know is if there is a way to have the stacks blending set to 100 (clear), and have controls that still show up.
Removing decorations is workable, and I can code the moving of the stack just fine (thanks to Ben Beaumont's useful article).
However, if you say, turn decorations off, the stack immediately goes to the center of the screen. Same if you turn them back on again (not sure why that happens either, pretty sure I read about it somewhere but have forgotten).
I don't necessarily want to ditch the decorations, just make it fade in and out. If you see what I mean. Without affecting objects on the card.
What I would like to know is if there is a way to have the stacks blending set to 100 (clear), and have controls that still show up.
Removing decorations is workable, and I can code the moving of the stack just fine (thanks to Ben Beaumont's useful article).
However, if you say, turn decorations off, the stack immediately goes to the center of the screen. Same if you turn them back on again (not sure why that happens either, pretty sure I read about it somewhere but have forgotten).
I don't necessarily want to ditch the decorations, just make it fade in and out. If you see what I mean. Without affecting objects on the card.
-
- VIP Livecode Opensource Backer
- Posts: 9842
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: The blend level of a stack...
The window is recreated from OS routines when decorations are toggled, hence the reinitialization.
I don't know a way around that which would also support a dissolve effect.
I don't know a way around that which would also support a dissolve effect.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: The blend level of a stack...
No, that's contradictory as controls are part of the stack.bogs wrote:What I would like to know is if there is a way to have the stacks blending set to 100 (clear), and have controls that still show up.
What you want is probably to have a transparent background for some controls (the titlebar is not a control). This is, as FourthWorld and yourself wrote, easily achievable with windowshape.
In order to have a fading titlebar (window controls) you could use the technique from the sample stack "Yosemite Style Window Creator" ( http://livecodeshare.runrev.com/stack/791/ by Rolf & Bernd) and then fade the fake "titlebar" in/out.
shiftLock happens
Re: The blend level of a stack...
Alright, that sounds like what I remember reading (I really need to keep better track of these things when I come across them ) and it makes sense.FourthWorld wrote: ↑Thu Aug 01, 2019 11:52 pmThe window is recreated from OS routines when decorations are toggled, hence the reinitialization.
I tried a number of methods of storing the location of the stack prior to the code removing decorations, so that after the window re-initialized it would (I thought) go to the last location it was at while the decorations were showing, but apparently I am still lacking somewhere and couldn't get it to go.
I guess I'll have to keep trying along that tack, though, until I figure it out.
I really am not looking for windowShape, nor to fake the decorations blending (I guess I may have to use some fakery in this though I'll try not to), but thanks for pointing out that stack -hh, I'll make sure to take a look at it.This is, as FourthWorld and yourself wrote, easily achievable with windowshape.
Just removing decorations doesn't require windowShape (that picture 2 posts up doesn't use it), and I created an animated stack that didn't use it either (but does use Ben's routine to move it around). Creating the transparent background for controls is easier than I would have thought, and doesn't actually require using anything outside of Lc objects.
I found it funny while looking for clues to this that they had split Ben's article into 2 segments from the original, the first displaying creating a windowShape, and the second displaying (more or less) the code for moving the window after the shape was applied. The original article was a nice 1 shot explanation
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: The blend level of a stack...
The most important thing is that, at the end of the thread, you know what you want
shiftLock happens
Re: The blend level of a stack...
Yes, figuring out how to get to it is a little irritating though
I suppose the reason I thought I was just missing something is that I was thinking of the blending of the stack like the text settings for it.
You know, when you put a control on the card, unless you change the text setting for that control, it inherits the text of the stack. Of course, you can then set the text format of the control to anything you want. I had been thinking it worked that way for all the settings for some reason.
Now I wonder why it doesn't (I'm such a stinker)
Re: The blend level of a stack...
Ok, I think I found a workable solution using a bit of 'fakery' (thanks for that hint -hh!) by using 2 stacks.
It goes something like this -
- I turn the decorations off on the main stack
- the substack has decorations
- when the mouseEnter message for the graphic is sent, the substack is made visible
- I set the topLeft of the substack to the topLeft of the main stack, effectively making it an overlay
- I use the moveStack handler to keep them synced up
Now, all of the above works perfectly, no issues. The problem comes in when I am finished moving the stack, and want to hide it again. I can't seem to figure out what message is sent when moveStack finishes?
None of the usual suspects seem to work, mouseUp, mouseLeave, etc if you exit the title bar from an upward direction. mouseLeave *does* work if you move the mouse down through the card area, but you can hardly expect an end user to do that with any regularity
So, how do you detect when a user has stopped dragging a stack somewhere? Is it 'resumeStack'?
It goes something like this -
- I turn the decorations off on the main stack
- the substack has decorations
- when the mouseEnter message for the graphic is sent, the substack is made visible
- I set the topLeft of the substack to the topLeft of the main stack, effectively making it an overlay
- I use the moveStack handler to keep them synced up
Now, all of the above works perfectly, no issues. The problem comes in when I am finished moving the stack, and want to hide it again. I can't seem to figure out what message is sent when moveStack finishes?
None of the usual suspects seem to work, mouseUp, mouseLeave, etc if you exit the title bar from an upward direction. mouseLeave *does* work if you move the mouse down through the card area, but you can hardly expect an end user to do that with any regularity
So, how do you detect when a user has stopped dragging a stack somewhere? Is it 'resumeStack'?
Re: The blend level of a stack...
Ok, This is more or less the effect I was shooting for with the original question, you can see (maybe) why windowShape would not have worked for this.
However, reaching this point brings up more questions that I couldn't figure out the answer to.
For instance, 'rect' as it applies to stacks vs. objects.
If i 'put the rect of button 1', it returns the outside dimensions of the button, as I would expect it too. However, if I 'put the rect of this stack', it appears to return the dimensions of the card area inside the stack? Is this a bug, or is rect supposed to act in this fashion? It presents some problems in cases where you are trying to determine if the mouse is or is not within the rect of the stack if it does not include the titlebar / side frames / etc.
If there is no better suggestion, is there a way to determine when the window has lost focus? I couldn't find that either
Depending on the answers (or lack thereof) I may have more questions to follow
However, reaching this point brings up more questions that I couldn't figure out the answer to.
For instance, 'rect' as it applies to stacks vs. objects.
If i 'put the rect of button 1', it returns the outside dimensions of the button, as I would expect it too. However, if I 'put the rect of this stack', it appears to return the dimensions of the card area inside the stack? Is this a bug, or is rect supposed to act in this fashion? It presents some problems in cases where you are trying to determine if the mouse is or is not within the rect of the stack if it does not include the titlebar / side frames / etc.
resumeStack *does* kind of work, however it doesn't appear as reliable as I would like, is there a suggestion for a better method of detecting when the mouse is released from the titlebar? I couldn't seem to find anything that suggested itself.
If there is no better suggestion, is there a way to determine when the window has lost focus? I couldn't find that either
Depending on the answers (or lack thereof) I may have more questions to follow
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: The blend level of a stack...
(1)
Possibly you are simply documenting an old bug (some may call it feature) which is on linux only: That is to have a partially transparent stack window.
Here another possibility to have transparent parts ("holes") in the stack window using the ink, once again on linux only: https://quality.livecode.com/show_bug.cgi?id=19700
I doubt your demo runs on non-linux platforms.
(2)
the rect of a stack --> global coords (relative to screen)
the rect of a control --> local coords (relative to stack window)
(3)
When you use an own drag routine (window without titlebar) you know it anyway.
Possibly you are simply documenting an old bug (some may call it feature) which is on linux only: That is to have a partially transparent stack window.
Here another possibility to have transparent parts ("holes") in the stack window using the ink, once again on linux only: https://quality.livecode.com/show_bug.cgi?id=19700
I doubt your demo runs on non-linux platforms.
(2)
the rect of a stack --> global coords (relative to screen)
the rect of a control --> local coords (relative to stack window)
(3)
You could use moveStack or mouseEnter (the card gets mouseEnter or a control that hides the card window below the titlebar).how do you detect when a user has stopped dragging a stack somewhere? Is it 'resumeStack'?
When you use an own drag routine (window without titlebar) you know it anyway.
shiftLock happens
Re: The blend level of a stack...
Huh, I didn't know that existed, but no, that isn't what is going on, and what I did should be able to be duplicated on any platform. Here it is running on Win 7, for instance, in Lc 9.5 stable...[-hh] wrote: ↑Sun Aug 04, 2019 6:55 pm(1)
Possibly you are simply documenting an old bug (some may call it feature) which is on linux only: That is to have a partially transparent stack window.
Here another possibility to have transparent parts ("holes") in the stack window using the ink, once again on linux only: https://quality.livecode.com/show_bug.cgi?id=19700
I doubt your demo runs on non-linux platforms.
Maybe the description of what I was doing 2 posts up wasn't clear enough, if that is the case, forgive me.
To lift the curtains, so to speak, here is the stack I am experimenting with. I will warn you right now, it is both rough and ugly, and the fading out is more for show than any real necessity (although I think it looks better than just blinking on and off).
I really am still working out the bugs. Should be able to run at least back to 6.5.x., and while I couldn't test it on Mac, it worked elsewhere.
Yes, but I don't think I made what I meant clear there either. Maybe these 2 pictures will make it a little better to understand -(2)
the rect of a stack --> global coords (relative to screen)
the rect of a control --> local coords (relative to stack window)
This is where the topLeft of the stack places the cursor... But this is where I would expect to see the topLeft of the stack...
Hm. I am using 'moveStack' in fact to line the 2 stacks up, how would I use it to trigger the fade out? I tried a few ways, but couldn't figure out how to tell when moving the stack actually ended? I am in fact currently tying the fading in and out to mouseEnter and mouseLeave, but the problem is of course you have to enter and leave through the card area, and an end user may wind up going straight up from the title bar, if you see what I mean.
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: The blend level of a stack...
(1)
For the rect including the decorations use the effective rect of this stack (LC 6/7/8/9)
(2)
Your stack sadly doesn't work as intended on Mac here. I'll look into it tomorrow.
(3)
For the rect including the decorations use the effective rect of this stack (LC 6/7/8/9)
(2)
Your stack sadly doesn't work as intended on Mac here. I'll look into it tomorrow.
(3)
For example:... how to tell when moving the stack actually ended
Code: Select all
on movestack h,v
-- ... your code here
send "movedone" to me in 0.5 seconds -- time may need adjustment
end movestack
on movedone
if the mouse is up then put "movedone"
end movedone
shiftLock happens
Re: The blend level of a stack...
Er, apart from the Window decorations fading in and out, can I ask what is expected here?
As far as I can see, the background graphic "Round Rectangle" is always visible. I can't see any partial transparency of the stack. Is this what you're expecting? I got the impression you were suggesting we could have a floating button without any other stack controls? I see the black background graphic all the time (Win 10).
(The behaviour I see is what I would expect, this is why I was intrigued to see if you had got something magic going on)
As far as I can see, the background graphic "Round Rectangle" is always visible. I can't see any partial transparency of the stack. Is this what you're expecting? I got the impression you were suggesting we could have a floating button without any other stack controls? I see the black background graphic all the time (Win 10).
(The behaviour I see is what I would expect, this is why I was intrigued to see if you had got something magic going on)
Re: The blend level of a stack...
AAAAAAAHHHHHHHHHhhhhhhhhhhhhhh !! (x 2)
Thanks -hh! I'll take a look at it on OSX myself, I'd really be surprised if it didn't work there for some reason, after all, it is just one stack moving another
@ SparkOut -- hmmmm.... Maybe what -hh said before is right after all, It didn't occur to me to check it by floating it over something else, when it looked like it was showing the desktop like it does on 'nix. I'll have to take a look at it tomorrow, when I have more time.
I'll apologize to -hh in advance, since I may have jumped the gun there, I guess it *may* be what you said after all
Thanks -hh! I'll take a look at it on OSX myself, I'd really be surprised if it didn't work there for some reason, after all, it is just one stack moving another
@ SparkOut -- hmmmm.... Maybe what -hh said before is right after all, It didn't occur to me to check it by floating it over something else, when it looked like it was showing the desktop like it does on 'nix. I'll have to take a look at it tomorrow, when I have more time.
I'll apologize to -hh in advance, since I may have jumped the gun there, I guess it *may* be what you said after all