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 » Community » U++ community news and announcements » 2019.2 rc5
Re: 2019.2 (pre)released [message #52560 is a reply to message #52559] Tue, 22 October 2019 12:20 Go to previous messageGo to previous message
Tom1
Messages: 1251
Registered: March 2007
Senior Contributor
Hi,

Thanks! I will look into your suggestions next.

Meanwhile, here's a "crashable" testcase:

#include <CtrlLib/CtrlLib.h>
#include <Painter/Painter.h>

using namespace Upp;

class BufferPainterCreateCrash: public TopWindow{
	public:
		ImageBuffer ib;
		BufferPainter bpainter;
		Image largeimage;

		BufferPainterCreateCrash(){
			Sizeable().MaximizeBox().MinimizeBox();
			bpainter.PreClipDashed();
			
			ImageBuffer lib(10000,10000);
			BufferPainter bp(lib);
			bp.Clear(LtGray());
			largeimage=lib;
		}
		
		void Paint(Draw &draw){
			SetSurface(draw,Rect(ib.GetSize()),ib,ib.GetSize(),Point(0,0));
		}
		
		void Render(Point p){
			// Use local bpainter below instead of bpainter.Create to avoid crash:
			//BufferPainter bpainter(ib);
			//bpainter.PreClipDashed();
			
			bpainter.Create(ib);
			bpainter.EvenOdd();
			bpainter.Co();
	
			bpainter.Clear(White());
			
			bpainter.Rectangle(0,0,GetSize().cx,GetSize().cy);
			bpainter.Fill(largeimage);
			int fh=StdFont().GetHeight();
			
			bpainter.Text(10,fh,Format("Cursor now at %`, %`",p.x,p.y),StdFont()).Fill(Black());
			bpainter.Text(10,2*fh,"Grab the window by the edge and resize wildly. Expect crash...",StdFont()).Fill(Black());
			bpainter.Finish();
			// Fast updates
			if(GetTopCtrl()&&GetTopCtrl()->GetHWND()){
				ViewDraw draw(this);
				SetSurface(draw,Rect(ib.GetSize()),ib,ib.GetSize(),Point(0,0));
			}
			
			// For slow / delayed updates use Refresh() instead:
			// Refresh();
		}
		
		void Layout(){
			ib.Create(GetSize());
			Render(Point(0,0));
		}
		
		void MouseMove(Point p, dword keyflags){
			Render(p);
		}
};


GUI_APP_MAIN
{
	BufferPainterCreateCrash().Execute();
	
}


Best regards,

Tom
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: 2019.2rc4
Next Topic: 2019.2
Goto Forum:
  


Current Time: Fri Nov 01 00:45:26 CET 2024

Total time taken to generate the page: 0.02614 seconds