|
|
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » CtrlPaint Bug: Frame draws outside of Ctrl
CtrlPaint Bug: Frame draws outside of Ctrl [message #15120] |
Tue, 01 April 2008 17:37  |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
If you have a Ctrl with FrameCtrl type frames large enough to exceed the width/height of the ctrl there is nothing to prevent them drawing outside the ctrls rect. I've attached a test package.
Simple solution (Ctrl::CtrlPaint, CtrlCore/CtrlDraw.cpp):
w.Clip(orect); // New clip
for(q = firstchild; q; q = q->next)
if(q->IsShown())
if(q->InFrame()) {
// Draw CtrlFrame
}
else
hasviewctrls = true;
if(viewexcluded)
w.End();
w.End(); // End new clip
Although I'm sure you can find a better solution.
James
|
|
|
|
|
|
|
Re: CtrlPaint Bug: Frame draws outside of Ctrl [message #15256 is a reply to message #15253] |
Sat, 12 April 2008 04:45  |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
mrjt wrote on Fri, 11 April 2008 13:48 |
Quote: |
I have "resolved" the issue by "defining" that it is frame responsibility to place its widgets correctly. After all, cliping is not for free.
Anyway, this is definitely arguable... I welcome any more hints but maybe you should consider how hard would be to fix your FrameLayout routine...
|
Fair enough, though this problem is present with every Ctrl-based frame. The usage above is just an exreme case but it possible with a ScrollBar for instance and can be really ugly. This causes problems mainly when you have dynamic layouts (like window docking) where you can't enforce minimum ctrl sizes.
Besides, I don't see how I can implement a visually acceptable solution from FrameLayout since I can only control the size, and scaling it is the wrong approach.
|
What about using ParentCtrl as the "inframe" ctrl and putting real widget inside? You can keep "correct" sizes of your real widgets and you can limit the size of ParentCtrl to provide necessarry clipping.
Quote: |
I'll have another look to see if a solution is possible without adding a whole extra clip though.
|
Well, I would have nothing against adding an extra clip, if it would really solved the problem... Anyway, as your black frame suggests, the problem is solved only partially...
Obviously, the trouble is that frame ctrls are "disconnected" from respective frames.
Mirek
|
|
|
Goto Forum:
Current Time: Mon Apr 28 00:57:50 CEST 2025
Total time taken to generate the page: 0.00565 seconds
|
|
|