Overlapping Controls and Scrolling

Hi,

I am about to finish my work on a browser class for MacOSX which is quite nice & powerful. I’ve developed it
by using overlapping controls such as arrows canvas and container controls for scrolling items:

Base Layer: Container Control - does the background
Browser Layer: Used for embedded items to scroll
Arrow Canvases: Used for the Arrows (fadein/out by mouseEnter/Exit)

However, I tried running it on Window and was shocked what my class looks alike. Awfully. (Flickering,
controls do not overlap and all this kind of stuff). Of course I changed, doublebuffer=true and
eraseBackground = false resulting in a better scrolling but at the cost of transparency.

Well, after reading some posts, I could get to understand that overlapping is a no go anyway so I am
wondering how I can get the same results for windows at all?

Drawing it all in a canvas won’t work either as the embedded controls overwrite everything after a “Scroll” call.
Any suggestions from some more experienced developers ?

[quote=193241:@Rob Egal]Hi,

I am about to finish my work on a browser class for MacOSX which is quite nice & powerful. I’ve developed it
by using overlapping controls such as arrows canvas and container controls for scrolling items:

Base Layer: Container Control - does the background
Browser Layer: Used for embedded items to scroll
Arrow Canvases: Used for the Arrows (fadein/out by mouseEnter/Exit)

However, I tried running it on Window and was shocked what my class looks alike. Awfully. (Flickering,
controls do not overlap and all this kind of stuff). Of course I changed, doublebuffer=true and
eraseBackground = false resulting in a better scrolling but at the cost of transparency.

Well, after reading some posts, I could get to understand that overlapping is a no go anyway so I am
wondering how I can get the same results for windows at all?

Drawing it all in a canvas won’t work either as the embedded controls overwrite everything after a “Scroll” call.
Any suggestions from some more experienced developers ?

[/quote]

Now I see why you are asking in another thread about license protection :wink:

Maybe you should release first for Mac only, while you figure out what may be done in Windows.

There are inherent limits to the Windows platform that cannot be overcome, such as flicker, as well as Xojo limitations. In my experience, flicker is mostly unavoidable. Coming from Mac, it may seem unbearable, but amazingly, Windows users tend to get accustomed to some level of flicker.

In my RubberViews class, it appeared very quickly that I could not in good conscience advise users to put a background image in their projects. I tried every trick I know of to use one in the demo project, until I simply gave up. Under Windows the demo does not have a background image, where in Mac it looks quite good.

Then there are the limitations in Xojo itself regarding Windows. Due to the platform, again, but fact remains. One simply cannot stack controls in Windows. Sometimes it creates flicker, sometimes strange things happen with Z-Order. For instance in one of my apps I placed a TextField under a Rectangle, and whenever the mouse passed over it, it sprung above the rectangle from behind. Basically you cannot hide a control with another. You should instead make controls invisible.

I have no idea what you are doing in your scrolling class, but you should take your time and check every aspect of the windows project until it runs satisfactorily. Also, there are several Windows developers in this forum that can give you precious indications about dos and don’ts.

Simple projects are easy to generate for Windows and Mac simultaneously. But anything a tad more complex needs to be optimized for Windows.

Hi Michel,

Thanks for your feedback.

[quote=193343:@Michel Bujardet]Now I see why you are asking in another thread about license protection :wink:
Maybe you should release first for Mac only, while you figure out what may be done in Windows.[/quote]

Yeah good point.

I’m racking my brain over a few problems with Windows and I currently cannot see all limitations. I’ve spent a couple of hours to rework the code for windows only and could get some issues worked out but always at the costs of features/visual drawbacks. :-/
You know, what I am missing is a sort of concept how to make win/mac compatible in one class. At this point of time, I don’t see this happen.

Yeah dont overlap controls
Windows will flicker like mad
So how to achieve what your after ?
Even on OS X I’d have a single canvas that everything draws into
Conceptually you might have several “layers” - which are pictures - then composite those together in the right order so things look like they are in front of everything else

Thats how the IDE’s layout editor works

[quote=193360:@Rob Egal]
You know, what I am missing is a sort of concept how to make win/mac compatible in one class. At this point of time, I don’t see this happen.[/quote]

I see Norman already posted one of the best ways I know of.

[quote=193363:@Norman Palardy]Yeah dont overlap controls
Windows will flicker like mad
So how to achieve what your after ?
Even on OS X I’d have a single canvas that everything draws into
Conceptually you might have several “layers” - which are pictures - then composite those together in the right order so things look like they are in front of everything else

Thats how the IDE’s layout editor works[/quote]

That’s what I am doing too but how would you handle the embedded controls ? I used to work with that on the OSX side but on win I threw it out. What a heck of work to replace it all…

I would not use embedded controls IF they have to possibly be drawn over with the up down scrollers as you’re trying to do

Layered controls just wont work on Windows with anything close to acceptable results
You could on Windows have the master ask the embedded controls to draw themselves into one of the layer pictures which you composite, and on OS X just skip that and use embedded controls only

The reality is that Win32 doesn’t use a fully compositing drawing model like OS X so what you need to do there is substantially different than what you need to do on OS X where you can draw whatever get no flicker & decent compositing

Hi Norman,

Your answer is basically what I come down to sadly and it needs a different approach for win/mac as I thought.
This is pretty challinging but I’ll give up finding the solution in one class for both and keep working on the OSX
class and maybe convert it to win. Too bad.

The layered images approach also works on OS X