View previous topic :: View next topic |
Author |
Message |
avatar5d
Joined: 26 Jul 2005 Posts: 1
|
Posted: Fri Aug 19, 2005 2:01 am Post subject: Cell Editor Drawing Bug |
|
|
Hello,
I am having a little problem with VirtualTree. I wish to have a cell editor, which is derived from a UserControl, always visible in my tree. When I do this with an alternating row background color, and scroll, I get a problem with the way the editor is drawn. Here is a shot from a little example program I doctored up earlier:
Steps to reproduce:
1) Create a VirtualTree with alternating row colors
2) Create a new CellEditor in the Virtual Tree Editor from a Panel
3) Set DisplayMode to Always
4) Set the Panel's BackColor control property to Transparent
5) Attach the new CellEditor to a column
6) Add some dummy data to your VirtualTree
7) Scroll!
You should notice behavior similar to the screenshot above, as if some paint events are being fired out of order. As soon as the scrolling stops the problem goes away and the control draws fine. I have verified this problem on a few machines with various types of controls.
I will go ahead and email a copy of the demo code I created to the support staff.
Thanks guys,
Casey |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri Aug 19, 2005 2:56 am Post subject: |
|
|
Thanks for the sample project. As you noted this is a transient issue, in that the display only flickers while you are scrolling. It is probably due to a paint ordering problem between the main control and the edit controls. This may not be simple to fix because we don't have direct control over cell editor controls painting. We will do some investigation however and see if it is possible to eliminate the flicker.
In general we recommend using OnEdit DisplayMode because it uses less resources, is faster and it certainly won't have this sort of issue. The DisplayMode Always is useful for checkboxes and the like when you need single click activation.
You could, as an alternative to using a custom control, write your own custom cell widget to handle painting and mouse interaction. See the section on "Using Widgets" in the Task based help for more information on this. _________________ Infralution Support |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri Aug 19, 2005 3:51 am Post subject: |
|
|
Another possible resolution for this is to not use alternating colors for the column with the DisplayMode.Always editor in it. You can do this by setting the CellStyle.Backcolor for the column (this overrides the RowStyle).
A brief play with the relevant code indicates that it will be quite difficult (if not impossible) to completely eliminate the flicker when scrolling DisplayMode.Always controls with alternating backgrounds. _________________ Infralution Support |
|
Back to top |
|
|
stevehartwell
Joined: 11 Sep 2005 Posts: 1
|
Posted: Sun Sep 11, 2005 12:18 am Post subject: |
|
|
The view requires alternating row colors, and the control we're using is a slider-like control with a transparent background. We use this control elsewhere in dialog boxes, etc.
Is the only solution to rewrite the control as a custom cell widget? |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Sun Sep 11, 2005 9:00 am Post subject: |
|
|
You could set the styles for the column containing the control so that only background colors for that column did not alternate. If this was acceptable to you then that would fix the issue - otherwise at the moment the other resolution would be the custom cell widget.
If you have actually written the control yourself then this is not actually a very difficult job since widgets are essentially the same as controls except that they draw to the parent controls surface. _________________ Infralution Support |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Sep 15, 2005 6:20 am Post subject: |
|
|
You may want to check out the latest release (2.0.4). While the flickering can still be seen if you use an empty panel control we found that when using real controls (for instance UniversalEditBox) it is not really perceptible. For example change the DisplayMode of the universal editor in the Database Browser sample (where it is used to display colors etc). If you scroll this the flicker is not really evident.
Let us know what you think. _________________ Infralution Support |
|
Back to top |
|
|
|