Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG#6: Scrollbug with Invisible columns in grid
Message
From
19/02/2003 10:45:23
 
 
To
19/02/2003 06:29:24
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00754850
Message ID:
00754943
Views:
49
>All,
>
>Is this an already known bug ?

We know about it now.

>
>In a grid where some columns are invisible, the columns are accounted for in the horizontal scrollbar. Though all visible columns do perfectly fit within the width of the grid, you can still scroll to the right.

Here is code. Click the form to toggle the column2.visible. I added a workaround, to save then set the column width to 0 in the column.visible_assign. Uncomment the commented code for the workaround.
CREATE CURSOR cJunk (field_one c(20), f2 c(20), f3 c(20))
FOR lni = 1 TO 10
	INSERT INTO cJunk VALUES (REPLICATE('11',lni), REPLICATE('22',lni),REPLICATE('33',lni) )
endfor
GO TOP 
LOCAL aobj[1], xx
DELETE FILE testxx.sc?
CREATE FORM testxx NOWAIT
=ASELOBJ(aobj,1)
xx = aobj[1]
xx.autocenter = .t.
xx.addobject('grid1','grd')
xx.grid1.recordsource = 'cJunk'
xx.grid1.columncount = 3
xx.writemethod('click','this.grid1.column2.visible = !this.grid1.column2.visible')
ACTIVATE WINDOW 'form designer - testxx.scx'
KEYBOARD '{ctrl+w}'
DO FORM testxx
testxx.grid1.autofit()
RETURN

DEFINE CLASS grd AS grid
    columncount = 3
*!*		procedure column2.visible_assign(tuNewVal)
*!*			if tuNewVal = .f.
*!*				this.Tag = Transform(this.Width)
*!*				this.Width = 0
*!*			else
*!*				this.Width = Val(this.Tag)
*!*			endif
*!*			this.Visible = tuNewVal
*!*			* repaint the scrollbars
*!*	 		this.Parent.scrollbars = this.Parent.scrollbars
*!*		endproc
ENDDEFINE
>Futher, when scrolling to the right (having hightlightrow =.t. and highlight = .f.) a visual bug occurs in a sense that it seems to display the outlines of the hidden columns on the currently active row.

I'm not sure what this means. If you can give me steps, I'll have a look. I think you may be seeing default grid behavior where a selection frame appears in empty column to right of existing grid columns, but I can't be sure without seeing it. If you could modify my code above and repost it so I can see the problem, I can let you know.

Thanks!
Jim Saunders
Microsoft
This posting is provided “AS IS”, with no warranties, and confers no rights.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform