Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to next message
mrjt is currently offline  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 #15158 is a reply to message #15120] Sun, 06 April 2008 04:37 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I have to say that I am a little bit confused.

It is not those "AAAAAAAAAAAAAAAAAAAAAA" at the bottom, right?

Mirek
Re: CtrlPaint Bug: Frame draws outside of Ctrl [message #15172 is a reply to message #15158] Mon, 07 April 2008 11:35 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Sorry. Perhaps it wasn't a very clear example, I just happenned to be testing something else so I used that package.

It's also a bit clearer if you add an additional BlackFrame. The 'AAAA...' label is outside the rect that contains the frame, but as you can see is being overlapped by the frames:
index.php?t=getfile&id=1128&private=0
and this is what it should look like:
index.php?t=getfile&id=1129&private=0
A perfect fix would preserve the bottom of the BlackFrame also, but
that may be difficult.

James
  • Attachment: bug.png
    (Size: 11.14KB, Downloaded 429 times)
  • Attachment: fix.png
    (Size: 9.93KB, Downloaded 418 times)

[Updated on: Mon, 07 April 2008 11:43]

Report message to a moderator

Re: CtrlPaint Bug: Frame draws outside of Ctrl [message #15243 is a reply to message #15172] Fri, 11 April 2008 14:42 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
OK, I see. I am aware about this issue, I have left it untouched as the solution you suggest is just partial...

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...

Mirek
Re: CtrlPaint Bug: Frame draws outside of Ctrl [message #15253 is a reply to message #15243] Fri, 11 April 2008 19:48 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
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.

But I can always just apply the fix to my uppsrc, it's cool Smile. I'll have another look to see if a solution is possible without adding a whole extra clip though.

Cheers,
James
Re: CtrlPaint Bug: Frame draws outside of Ctrl [message #15256 is a reply to message #15253] Sat, 12 April 2008 04:45 Go to previous message
mirek is currently offline  mirek
Messages: 13975
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
Previous Topic: New member needs help
Next Topic: StreamRasterEncoder puzzle
Goto Forum:
  


Current Time: Wed Apr 24 04:47:22 CEST 2024

Total time taken to generate the page: 0.02086 seconds