How can I make my own window like: ???
There are obviously different approaches… Built one with a Canvas. I think a custom Window shape can do the same (see examples, only Windows).
5 minutes of work… Windows only. Custom windows shape with some code to detect ‘transparant pixel’ and some methods to move etc.
I used the example in Xojo and changed the graphic.
On mac that’s a NSPopover. The one in Xojo is a graphic.
You could possibly create a custom window shape with declares/macoslib for mac. Definitely with mbs, which also has popovers, but maybe window shapes are easier for cross-platform. What’s your OS targets?
I’ve come up with some cocoa declares that create a real NSPopover using a ContainerControl for the View Contents. It’s very proof-of-concept atm but working, though I can’t tell if it’s safe to use the CC this way and I haven’t accounted for memory leaking. If you’re interested I can clean it bit and post for a possible starting point.
The layout editor canvas draws the popover shape, and a container control is embedded to display the controls.
Thom, would using a container control to embed other controls get around the problem that I’m seeing with checkboxes, radio buttons, sliders, etc. not drawing correctly over a shaded canvas (see my other post here?
No. That is the reason the popover is drawn the same color that FillColor returns. Otherwise I’d have made it somewhat translucent.
Hm. So what’s the trick to using sliders, etc. over a pattern? Or is it just impossible in Windows?
(sorry Jeremy, not trying to threadjack…)
The advice I follow is to NEVER layer controls. The container over the canvas used in this case is the only exception I can think of, and that was done with extreme care. Layering controls produces flicker if translucent, or effects like you see if they are not. There’s no good way around it.
One workaround is drawing your pattern inside the topmost control, but that only works with custom controls.
Basically, Windows and translucency do not get along at all.
So how would you suggest doing something like your scrolling “Inspector”? You must have all those controls placed on a [tall] canvas which is then moved up/down in the main window, correct? I can’t imagine that you’re adjusting the .Top property of every one of those individually, on the fly.
Then you’d be imagining wrong. That’s precisely what is happening.
Gaaahhh. What a nightmare! I thought that I was making serious progress only to find out that I’ve been doing it wrong in my apps all along. You’re a monster