[Gambas-user] Issue 387 in gambas: Gridview crreated by adding rows does not scroll

gambas at ...2524... gambas at ...2524...
Sun Jan 13 18:24:08 CET 2013


Status: New
Owner: ----
Labels: Version Type-Bug Priority-Medium OpSys-Any Dist-Any Arch-Any  
Desktop-Any GUI-Any

New issue 387 by JohnFort... at ...626...: Gridview crreated by adding rows  
does not scroll
http://code.google.com/p/gambas/issues/detail?id=387

1) Describe the problem.
I have a problem with not being able to scroll a gridview.

After trying a large number of things, I have narrowed this down to how the  
grid is filled.

Basically, if the number of rows is set before any data is added, the grid  
will scroll properly.

However, if the number of rows is initially set to zero, and rows are added  
as the data becomes available, then then the grid will NOT scroll.

2) GIVE THE FOLLOWING INFORMATIONS (if they are appropriate):

Version: TRUNK or BRANCHES/2.0 or 2.22.0
Revision: r1234 (if you use a development version)
Operating system: Linux / FreeBSD
Distribution: Ubuntu / Fedora / ArchLinux / Gentoo ...
Architecture: x86 / x86_64 / ARM
GUI component: QT3 / QT4 / GTK+
Desktop used: Gnome / KDE ...

[System]
OperatingSystem=Linux
Kernel=3.2.0-35-generic-pae
Architecture=i686
Memory=3028144 kB
DistributionVendor=Ubuntu
DistributionRelease="Ubuntu 12.04.1 LTS"
Desktop=KDE4

[Gambas 3]
Version=3.3.4
Path=/usr/bin/gbx3

[Libraries]
Qt4=libQtCore.so.4.8.1
GTK+=libgtk-x11-2.0.so.0.2400.10

I am using Gambas 3.3.4 and QT4.

3) Provide a little project that reproduces the bug or the crash.
To reproduce this problem, create a project with a single form, and add two  
gridview controls, called grdOne and grdTwo.

Add the following code in the Form_Open event:

Public Sub Form_Open()
Dim intR As Integer
Dim intC As Integer
Dim intRows As Integer
Dim intCols As Integer

   Me.Center

   intRows = 99
   intCols = 3

   ' Set up Grid One
   With grdOne

     ' Size the grid
     .Columns.Count = intCols
     .Rows.Count = intRows     ' <------ Number of rows is preset
   '
     ' Set the column widths
     For intC = 0 To intCols - 1
       .Columns[intC].Width = .Width / intCols
     Next

'   Fill the grid
     For intR = 0 To intRows - 1
       For intC = 0 To intCols - 1
         grdOne[intR, intC].text = "Row: " & CStr(intR) & " Col: " &  
CStr(intC)
       Next
     Next

   End With

   ' Set up Grid Two
   With grdTwo

     ' Size the grid
     .Columns.Count = intCols
     .Rows.Count = 0           ' <----- Number of rows is initially zero
   '
     ' Set the column widths
     For intC = 0 To intCols - 1
       .Columns[intC].Width = .Width / intCols
     Next

'   Fill the grid
     For intR = 0 To intRows - 1
       .Rows.Count = .Rows.Count + 1     ' <----- Each row is added as needed
       For intC = 0 To intCols - 1
         grdTwo[intR, intC].text = "Row: " & CStr(intR) & " Col: " &  
CStr(intC)
       Next
     Next
   End With

End

4) If your project needs a database, try to provide it, or part of it.
N/A

5) Explain clearly how to reproduce the bug or the crash.
Run the above project. Grid One can be scrolled; grid Two cannot.

6) By doing that carefully, you have done 50% of the bug fix job!

IMPORTANT NOTE: if you encounter several different problems or bugs, (for
example, a bug in your project, and an interpreter crash while debugging
it), please create distinct issues!






More information about the User mailing list