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 » ArrayCtrl, HeaderCtrl & GridCtrl » ArrayCtrl::Paint is called three times
ArrayCtrl::Paint is called three times [message #51686] Fri, 26 April 2019 00:58 Go to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
I'm just curious why ArrayCtrl::Paint is called three times when drawing the control?
Example: I just slightly modified reference/ArrayCtrl.
struct MyConvert : public Convert {
	Value Format(const Value& v) const {
		ValueArray va = v;
		RDUMP(va[1]);
		return String().Cat() << va[0] << " - " << va[1] << " - " << va[2];
	}
};

The log will contain THREE sets of data.
IMHO, this is a little bit too much from the performance point of view ...


Regards,
Novo
Re: ArrayCtrl::Paint is called three times [message #51692 is a reply to message #51686] Fri, 26 April 2019 10:54 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Novo wrote on Fri, 26 April 2019 00:58
I'm just curious why ArrayCtrl::Paint is called three times when drawing the control?
Example: I just slightly modified reference/ArrayCtrl.
struct MyConvert : public Convert {
	Value Format(const Value& v) const {
		ValueArray va = v;
		RDUMP(va[1]);
		return String().Cat() << va[0] << " - " << va[1] << " - " << va[2];
	}
};

The log will contain THREE sets of data.
IMHO, this is a little bit too much from the performance point of view ...


More details? If I change MyConvert in Win10, I get

* C:\upp\out\reference\MSVS17.Gui\ArrayCtrl.exe 26.04.2019 10:53:16, user: cxl

v = { ID2: 04/26/2019, ID1: 0, ID3: 0 }
v = { ID2: 04/26/2019, ID1: 10, ID3: 3 }
v = { ID2: 04/26/2019, ID1: 20, ID3: 6 }
v = { ID2: 04/26/2019, ID1: 30, ID3: 9 }
v = { ID2: 04/26/2019, ID1: 40, ID3: 12 }
v = { ID2: 04/26/2019, ID1: 50, ID3: 15 }
v = { ID2: 04/26/2019, ID1: 60, ID3: 18 }
v = { ID2: 04/26/2019, ID1: 70, ID3: 21 }
v = { ID2: 04/26/2019, ID1: 80, ID3: 24 }
v = { ID2: 04/26/2019, ID1: 90, ID3: 27 }
v = { ID2: 04/26/2019, ID1: 100, ID3: 30 }
v = { ID2: 04/26/2019, ID1: 110, ID3: 33 }
v = { ID2: 04/26/2019, ID1: 120, ID3: 36 }
v = { ID2: 04/26/2019, ID1: 130, ID3: 39 }
Re: ArrayCtrl::Paint is called three times [message #51695 is a reply to message #51692] Fri, 26 April 2019 16:10 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
mirek wrote on Fri, 26 April 2019 04:54

More details?

XUbuntu 18.10 (XFCE desktop). GCC.
va[1] = 0
va[1] = 10
va[1] = 20
va[1] = 30
va[1] = 40
va[1] = 50
va[1] = 60
va[1] = 70
va[1] = 80
va[1] = 90
va[1] = 100
va[1] = 110
va[1] = 120
va[1] = 130
va[1] = 140
va[1] = 150
va[1] = 0
va[1] = 10
va[1] = 20
va[1] = 30
va[1] = 40
va[1] = 50
va[1] = 60
va[1] = 70
va[1] = 80
va[1] = 90
va[1] = 100
va[1] = 110
va[1] = 120
va[1] = 130
va[1] = 140
va[1] = 150
va[1] = 0
va[1] = 10
va[1] = 20
va[1] = 30
va[1] = 40
va[1] = 50
va[1] = 60
va[1] = 70
va[1] = 80
va[1] = 90
va[1] = 100
va[1] = 110
va[1] = 120
va[1] = 130
va[1] = 140
va[1] = 150

Theoretically, this can be desktop animation (or whatever it is called), but XFCE is a very simple desktop manager, and I couldn't find a place where animation is managed. Probably, XFCE doesn't have it.


Regards,
Novo
Re: ArrayCtrl::Paint is called three times [message #51696 is a reply to message #51695] Fri, 26 April 2019 17:14 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Novo wrote on Fri, 26 April 2019 16:10
mirek wrote on Fri, 26 April 2019 04:54

More details?

XUbuntu 18.10 (XFCE desktop). GCC.
va[1] = 0
va[1] = 10
va[1] = 20
va[1] = 30
va[1] = 40
va[1] = 50
va[1] = 60
va[1] = 70
va[1] = 80
va[1] = 90
va[1] = 100
va[1] = 110
va[1] = 120
va[1] = 130
va[1] = 140
va[1] = 150
va[1] = 0
va[1] = 10
va[1] = 20
va[1] = 30
va[1] = 40
va[1] = 50
va[1] = 60
va[1] = 70
va[1] = 80
va[1] = 90
va[1] = 100
va[1] = 110
va[1] = 120
va[1] = 130
va[1] = 140
va[1] = 150
va[1] = 0
va[1] = 10
va[1] = 20
va[1] = 30
va[1] = 40
va[1] = 50
va[1] = 60
va[1] = 70
va[1] = 80
va[1] = 90
va[1] = 100
va[1] = 110
va[1] = 120
va[1] = 130
va[1] = 140
va[1] = 150

Theoretically, this can be desktop animation (or whatever it is called), but XFCE is a very simple desktop manager, and I couldn't find a place where animation is managed. Probably, XFCE doesn't have it.


I would start investigation with something more simple, like basic CtrlLib app and just to count the number of paints.

Maybe even paint that count...

My initial suspection is that this is a part of opening the window, when paint gets called more than absolutly necessary number of times....

Mirek
Re: ArrayCtrl::Paint is called three times [message #51698 is a reply to message #51696] Fri, 26 April 2019 18:19 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
mirek wrote on Fri, 26 April 2019 11:14
My initial suspection is that this is a part of opening the window, when paint gets called more than absolutly necessary number of times....

Yes, you are right. Paint is called three times when opening the window. This is a generic issue. It is not specific to ArrayCtrl.

Thanks.


Regards,
Novo
Re: ArrayCtrl::Paint is called three times [message #51699 is a reply to message #51698] Fri, 26 April 2019 18:43 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Novo wrote on Fri, 26 April 2019 18:19
mirek wrote on Fri, 26 April 2019 11:14
My initial suspection is that this is a part of opening the window, when paint gets called more than absolutly necessary number of times....

Yes, you are right. Paint is called three times when opening the window. This is a generic issue. It is not specific to ArrayCtrl.

Thanks.


I will ignore it for now, as I plan to go gtk3 soon. But it would be nice to test once that is done.
Previous Topic: No callback on last row deletion
Next Topic: [Bug]ArrayCtrl,MultiSelect.In WhenSel callback, selection status of last selected row is incorrect
Goto Forum:
  


Current Time: Thu Mar 28 22:39:23 CET 2024

Total time taken to generate the page: 0.01056 seconds