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  |
Novo
Messages: 1430 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   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
Novo wrote on Fri, 26 April 2019 00:58I'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   |
Novo
Messages: 1430 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 #51698 is a reply to message #51696] |
Fri, 26 April 2019 18:19   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
mirek wrote on Fri, 26 April 2019 11:14My 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
|
|
|
|
Goto Forum:
Current Time: Fri Apr 25 12:05:37 CEST 2025
Total time taken to generate the page: 0.00495 seconds
|