Jump to content


bug: nextgrid, NxCheckBox disapears


  • Please log in to reply
7 replies to this topic

#1 d6user

d6user
  • Members
  • 58 posts

Posted 04 July 2012 - 07:02 PM

i am not sure this was reported, yet? i read through many forum posts but did not find this, although, i can't believe this was not discovered yet. and this bug (the fix) is criticle.

where--the bug occurs once you include any of the 'events' that draw or redraws or refreshes.
for example, OnPostDraw() or OnCellColoring() for instance. i have not searched every event, just those two came up in some examples i was debugging to find out how to resovle it.

when--the bug occur when you add code in those events. once those events are fired up, and after a certain given number of intevals, i.e., 30 seconds or more, depending on the size/complexity of the grid, in the NxCheckBoxColumn, the checkboxes begin to disapear as you scroll up/down. and if you hit the Home or End keys, all them are removed. also, when you add doublebuffer=true (to remove the flicker in the grid, when you incorporate the OnCellColloring--i use it for highlighting rows of text) it seems to speed up the NxCheckBox disapearance.

resolved--no.

in the app i am developing, i have the following controls (they are inside a NxPageControl)

tNxIncrementColumn
TNxCheckBoxColumn
TNxTextColumn
TNxTextColumn
TNxTextColumn
TNxTextColumn
TNxTextColumn
TNxTextColumn
TNxTextColumn

windows xp home
nextcomps_51111 version.

#2 d6user

d6user
  • Members
  • 58 posts

Posted 04 July 2012 - 09:26 PM

update...

i am not able to duplicate the bug when i create a new app with nextgrid and checkbox.

i wonder if it has to do with when i make the row always show selected...i will test that next..

#3 d6user

d6user
  • Members
  • 58 posts

Posted 04 July 2012 - 09:56 PM

update...

ok, i made an app that show the symtom, but let me describe what i found so far.

the bug seems to show when you add code to the OnCellColoring() event--see below for the code snipplet.

clue 1--when you first run the app, and fill nextgrid list, (i filled with only 8 rows) nothing happens.
but as soon as you select on a row, it begins to flicker, like its refreshing itself constantly.

clue 2--then opened the taskman.exe to bring up the resource/cpu usage.  when you first
open the app and fill the nextgrid, (eight rows in this example) the cpu is approx 2%
but as soon as you click on any of the rows, it jumps to 50% as you watch the row refresh constantly.

procedure TForm1.ng1CellColoring(Sender: TObject; ACol, ARow: Integer;
var CellColor, GridColor: TColor; CellState: TCellState);
begin
  xCol:=acol; xRow:=arow;
  //exit;
  if ng1.RowCount-1>0 then begin
	if (csSelected in CellState) then begin
	  if ng1.Cell[1,arow].AsBoolean = True then begin CellColor:=clYellow;ng1.cell[xcol,xrow].Color:=clyellow;end;
	  if ng1.Cell[1,arow].AsBoolean = false then begin CellColor:=clWhite;ng1.cell[xcol,xrow].Color:=clWhite;end;
	end;
  end;


where xcol, and xrow: integer, elsewhere.  they serve as my global col,row values.

if i remove the //exit; to exit; the problem is gone. so its something to do with the code above.

#4 d6user

d6user
  • Members
  • 58 posts

Posted 05 July 2012 - 01:18 AM

update...

i believe i may have found where/what causes the bug.

if you look at the code posted in the above post, look at the line:

if ng1.Cell[1,arow].AsBoolean = True then begin CellColor:=clYellow;ng1.cell[xcol,xrow].Color:=clyellow;end;

the checkboxes disapear when this is called constantly (when you see the flicker when you click the checkbox)
to be more exact, this code: ng1.cell[xcol,xrow].Color:=clyellow; is called so many time.  

when you look at the taskman cpu % you can see it jump to +/- 50%

and when you rem it out with //

//ng1.cell[xcol,xrow].Color:=clyellow;

the cpu drops back down

and when you remove the rem //, it jumps back up to 50%

i'll see if i can post a demo app shortly.

#5 d6user

d6user
  • Members
  • 58 posts

Posted 05 July 2012 - 07:10 AM

resolved

although the bug is still present, (it must be related only to when you have a NxCheckBox in a grid) i found an alternate solution to highlighting rows.

i guess the bug is unquie to checkboxes and when you use it in conjunction with changing cell colors at runtime under the OnCellColoring event.

but i am happy to say that the alternate method to highlighting rows is successful, so far :) .

#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 6,686 posts
  • Gender:Male

Posted 05 July 2012 - 07:16 PM

Hi,

Can you post here this app. Thanks.
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.

#7 d6user

d6user
  • Members
  • 58 posts

Posted 07 July 2012 - 06:01 AM

bug_demo_missing_checkboxes.exe
You aren't permitted to upload this kind of file


i am not able to upload even though the upload takes place, it gave me the error above.  

i dont' know how else to upload you a demo app...any suggestions ?

#8 d6user

d6user
  • Members
  • 58 posts

Posted 07 July 2012 - 04:31 PM

here is a zip file, i hope it makes it to you...

sorry for the delay, boki...here's the test app that shows the problem. to reproduce the problem, follow these steps:

1. open taskmgr.exe (ctrl+alt+del) so you can observe the cpu %
2. run the test app
3. click on the Add. it fills 8 rows. more clicks keeps adding more rows.
4. click on any rows to see the flicker/cpu problem.

some notes/what to expect from the above steps:

* selecting Clear All only cleans the rows. it does not reset the checkboxes. once they are gone, they are gone. you will have to close down the app to stop the problem.

* when you add rows for the first time, nothing happens, yet. but when you click on a row, thats when the problem starts. you will see the row flicker. then after 25 or 30 or so seconds (once the resources of that routine has exhausted itself) the checkboxs disappear. and when you cursor up/down or click any of the rows from that time forward, the boxes disappear. once the boxes are gone, you can not get them back untill you close the app and restart it. i guess it has to release the resource it ate up. note, while the app is still running, the cpu % will still be taxing at 50% or more. but once you close the app the cpu % will drop back down to normal--whatever that is on your system.

* note, i added a Clock and a Seconds value that increments, at the top caption bar area. i was trying to give you a guage at how long till the checkboxes disappear, but there seems to be a problem with that since the OnCellColoring() routine seems to block the clock from working. it is probably another bug. and that explains why i was not able to include a clock in my grid when OnCellColoring() event is enabled. however, while the app is still running, and the bug is in motion, when you click the Clear All, the timer is available.

* when the bug is in motion (that is, the row is flickering) when you click on the Clear All, the cpu % drops back down to normal. but if you add more rows again, the bug starts up again.

* when the bug is in motion, and shortly afterwards you manage to cause all boxes to disappear, clearing all the rows with Clear All will cause the cput % to drop back down to normal but Adding new rows will add them but without checkboxes now, and clicking on the rows still flickers and causes cpu % to tax over 50% so i am guessing that if you keep this in motion, that it make cause a system crash. i am just guessing. but i don't want you to overlook this possible point, since i use this component in production right now.

* also, i just discovered that this is not isolated to checkboxes. if you remove the checkbox, and re-run the app, the flickering and 50% cpu resource is still their. so it seems that the (main) issue is with the OnCellColoring() event, and that the checkboxes is one of the easier aspects of noticing there is a problem.

i think that this is a bug that got unnoticed for a while. it may only be isolated to the OnCellColoring() event, but i would look into some of the others if they do something similar.

so, i hope this helps you figure out what is causing the problem. let me know if you need anything else.

as alway, thank you.

Attached Files






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users