I have a containerControl (Parent) that has to display a list of another containerControl embedded instances (Children).
The parent has a fixed height and sometimes I have to display more children than the Parent can show. So I put a scrollbar into the Parent in order to scroll my embedded elements.
I implemented the function that makes my embedded elements scrolling on mousewheel event, and that works, but…
My issue is that the overflow content of the parent is shown, over my window instead of being hidden. As soon as an element is scrolled higher than the parent top, it is still displayed.
I had this problem when I tried embedding child containers within a groupbox in the parent. I found that when changed that approach to embedding within a canvas, rather than the groupbox, it works as expected.
I’m embedding ControlContainers into a ControlContainer… I tried to put a canvas in the main controlContainer and embed the children into it but it does not wok too…
Embedding using a Canvas ought to work. For an example of this, watch the Desktop Container Controls webinar and look at the DownloadContainer example that I cover.
Is this a Windows only issue? I’m not able to reproduce it, ContainerControl in ContainerControl clips correctly on my Mac, but maybe my test is missing it.
Oh, I see the ‘mac’ in the screenshot now. I’ve never had this issue with ContainerControls, nor need to use a Canvas workaround. So this concerns me a bit.
There is something I don’t understand… In my project, if I use a window instead of a controlContainer (the parent one), it works if the window has the composite property at false. If this property is true, I have an overflow.
In the example of Paul, in both cases, it works…
I have to tell you that my main window has to be composite.
How do you expect people to help? You need to post the code you are using. As I wrote I think you might embed in the wrong control. A wrong “self” or “parent” is enough.
Also try making a new project - I had weird things happen in corrupted projects.
or are you really calling your canvas “canvas”? Seems like a bad idea if you did, and if you didn’t: if you don’t post the ACTUAL code then how is anyone supposed to find the bug?
Why not make a simple demo project with the relevant code, and if it still shows the problem then people can have a look at it and help.
The problem is that I tried to make a demo, with exactly the same code but in the demo, it works…
I’m starting to believe that the issue is due to my project that is probably corrupted by something… If I have to restart building my whole project, I’m gonna loose a lot of time… thanks XOJO
Are you building for Carbon or Cocoa? If you are building for Carbon you might want to try Cocoa. Carbon apps have issues with controls not respecting the bounds of containers.