Hi, Boki:
Slowly working my way forward from D2007 to XE2 as far as getting my program working properly.
When I run my mouse over the grid the attached image happens. This is new behavior in XE2. Can you suggest what I can do to stop the strange painting behavior?
If I simply delete the reference to DoGridMouseMove in the onmousemove event, then the strange drawing stops. So there is something with this code that is lacking. I did add the RefreshCell at the end, but it made no difference.
Thanks,
Chuck Belanger
I have an NextGrid laying on top of a JvWizard Panel on my MainForm. The NextGrid has an onmousemove event:
//the idea here is to provide a hot tracking effect in the grid.
//Just hot track the main column, i.e. 0th col.
procedure DoGridMouseMove(Grid: TNextGrid; Shift: TShiftState;
X, Y: Integer);
var
RowNum, ColNum : integer;
Col : TNxCustomColumn;
begin
with Grid do
begin
RowNum := GetRowAtPos(x, y);
//store RowNum for reverting change
if RowNum > -1 then
begin
Cell[0,RowNum].FontStyle := [fsBold];
if Wizard.WizGridRowNum <> RowNum then
begin
if RowExist(Wizard.WizGridRowNum) then
Cell[0,Wizard.WizGridRowNum].FontStyle := [];
Wizard.WizGridRowNum := RowNum;
end;
end;
RefreshCell(0,Wizard.WizGridRowNum);
end;
end;
In XE2 Strange painting of NextGrid via OnMouseMove Event
Started by BelangerC, Aug 07 2012 03:23 AM
5 replies to this topic
#1
Posted 07 August 2012 - 03:23 AM
#2
Posted 07 August 2012 - 03:26 AM
p.s. I tried to attach a JPG of what this looks like. Does not look like it came through.
What it shows is the 1st column of the Grid being painted with the Wizard node map elements, which is to the left of the grid.
Chuck
What it shows is the 1st column of the Grid being painted with the Wizard node map elements, which is to the left of the grid.
Chuck
#3
Posted 07 August 2012 - 03:50 AM
Some more similar reaction:
In another NextGrid on the MainForm whenever I click to expand a treed column, on expansion the grid draws using the image from the left half of the MainForm. In this case it is an image of a VirtualStringTree. This fills the first 4-5 columns. It is persistent which makes the grid totally unusable.
Thanks,
Chuck
In another NextGrid on the MainForm whenever I click to expand a treed column, on expansion the grid draws using the image from the left half of the MainForm. In this case it is an image of a VirtualStringTree. This fills the first 4-5 columns. It is persistent which makes the grid totally unusable.
Thanks,
Chuck
#4
Posted 10 August 2012 - 10:40 PM
Ok, I found that adding NextGrid.Repaint in the onmousemove event rather than the RefreshCell helped with the most egregious screen painting issues. But I notice that the two grids on my main form still will paint the grid headers oddly: the indicator will be painted in different column headers (I mean actually painted in the header itself).
Also, on expansion of a treed column row will cause a painting which includes other parts of the screen. I added a Repaint in the OnExpand event. Now, it still does the painting wrong, but it lasts a fraction of a second then is painted properly. I notice it does that only on the first time I try to expand the treed column. Afterwards, the opening and closing of a treed row looks correct.
There is still something wrong with the painting process at least on this mainform which admittedly has many controls on it, which may be interfering with the individual controls' painting. (I have a fcProgressBar in a fcStatusBar which is not painted at all. Instead a section of the top menu is painted here--Weird!)
Chuck
Also, on expansion of a treed column row will cause a painting which includes other parts of the screen. I added a Repaint in the OnExpand event. Now, it still does the painting wrong, but it lasts a fraction of a second then is painted properly. I notice it does that only on the first time I try to expand the treed column. Afterwards, the opening and closing of a treed row looks correct.
There is still something wrong with the painting process at least on this mainform which admittedly has many controls on it, which may be interfering with the individual controls' painting. (I have a fcProgressBar in a fcStatusBar which is not painted at all. Instead a section of the top menu is painted here--Weird!)
Chuck
#5
Posted 23 August 2012 - 11:39 PM
Still some issues, but I found that making sure DoubleBuffered := False, seems to help most of the painting issues at this point.
The remaining issues I see are repaints in which briefly the column headers are painted where they belong and again in the first couple of rows of the grid. It is very brief and also does not happen all the time.
Chuck
The remaining issues I see are repaints in which briefly the column headers are painted where they belong and again in the first couple of rows of the grid. It is very brief and also does not happen all the time.
Chuck
#6
Posted 01 September 2012 - 07:31 PM
Hi,
Please sorry for delay, I was no idea what happenings until you say that DoubleBuffered made it. NextGrid don't need DoubleBuffered since I have spend many time to eliminate flickering (on old computers and monitors). But in v6 you will be able to use it too since I have learn new things in WinAPI.
Please sorry for delay, I was no idea what happenings until you say that DoubleBuffered made it. NextGrid don't need DoubleBuffered since I have spend many time to eliminate flickering (on old computers and monitors). But in v6 you will be able to use it too since I have learn new things in WinAPI.
boki@bergsoft.net
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











