Jump to content

ListView Gridlines get garbled


MikeA
 Share

Recommended Posts

In releases as far back as 3.2.6.0 at least, on Windows XP, if I use the up or down scroll buttons or click in the scroll bar to move up or down in a ListView with gridlines, the ListView display becomes "garbled" (see the attached screen capture).

This does not happen when I use the slider button to scroll. In fact, using the slider button will "clean up" the garbled ListView display.

This issue does not occur on Vista. I haven't tested it on any other OS.

post-16304-1189521443_thumb.jpg

Link to comment
Share on other sites

Post as small as possible code snippet to reproduce problem.

$MainWin = GUICreate($WinTitle, 800, 670)
GUISetFont(9, Default, Default, "Tahoma")

$ShareList = GUICtrlCreateListView("User Name|User ID|Share Name|Path", 70, 20, 710, 600, _
        BitOR($GUI_SS_Default_ListView, $LVS_NoSortHeader), BitOR($LVS_Ex_FullRowSelect, $LVS_Ex_Gridlines))
GUICtrlSetFont($ShareList, 8.5)
;
;   intervening code loads data into $SharesArray ...
;
For $i = 1 To $SharesArray[0]
    $GUIid = GUICtrlCreateListViewItem($SharesArray[$i], $ShareList)
Next

GUICtrlSendMsg($ShareList, $LVM_SetColumnWidth, 0, $LVSCW_AutoSize)
GUICtrlSendMsg($ShareList, $LVM_SetColumnWidth, 1, $LVSCW_AutoSize)
GUICtrlSendMsg($ShareList, $LVM_SetColumnWidth, 2, $LVSCW_AutoSize)
GUICtrlSendMsg($ShareList, $LVM_SetColumnWidth, 3, $LVSCW_AutoSize_UseHeader)
Edited by MikeA
Link to comment
Share on other sites

Ya, these gridlines are glitchy, about any script works as an example...

Lets say

#include <GUIConstants.au3>

GUICreate("listview items",220,200)

$listview = GUICtrlCreateListView ("col1  |col2",10,10,200,150,-1,$LVS_EX_GRIDLINES)
Dim $aLVItm[16]
For $i = 1 to 15
    $aLVItm[$i]=GUICtrlCreateListViewItem("item"&$i,$listview)
Next

GUISetState()

While GUIGetMsg() <> $GUI_EVENT_CLOSE
WEnd

If I scroll down using methods MikeA mentioned, I get this:

Posted Image

No gridlines for any of the items that come into view.

Dragging the scroll button or mouse scrolling works OK.

And I remember getting that garbled view in one of my programs too, probably I used custom Font settings just like OP.

v3.2.4.9

Edited by Siao

"be smart, drink your wine"

Link to comment
Share on other sites

I think problem is with

GUISetFont(9, Default, Default, "Tahoma")
GUICtrlSetFont($ShareList, 8.5)

but here must help you somebody more experienced

I thought so too, but removing the line that sets the 8.5 font doesn't make a difference with the gridlines problem.
Link to comment
Share on other sites

It's the some behavior with a simple, but long Listview for me (WinXP). If I scroll the LV it has a repain problem.

I think that is a generell problem/challenge/bug with the built-in LV. In a disussion with Mr. Gafrost about drag'n drop inside a LV, where also a repain problem occurs, if the LV is scrolled, he stated:

... "Also found out that if you use the Built-in ListView then there is the repain problem in using the DragImage, didn't see that problem with Creating your own ListView." ...

Creating my own Listview is far about my level, but Au3Lib can create a own Listview.

So perhaps someone may test, if that works.

HTH, Reinhard

Edited by ReFran
Link to comment
Share on other sites

So perhaps someone may test, if that works.

It's the same behavoir with a Au3Lib created Listview.

After scrolling it gets a repain problem.

So it seems, there is a bug. Or?

br, Reinhard

#include <A3LListView.au3>

Global $hGUI, $hList

; Create GUI
$hGUI  = GUICreate("ListView", 400, 300)
$hList = _ListView_Create($hGUI, 2, 2, 394, 268)
_ListView_SetExtendedListViewStyle($hList, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES))
GUISetState()


; Add columns
_ListView_InsertColumn($hList, 0, "Column 1", 100)
_ListView_InsertColumn($hList, 1, "Column 2", 100)
_ListView_InsertColumn($hList, 2, "Column 3", 100)


for $i=0 to 30
    _ListView_AddItem   ($hList,    "Row "&$i &": Col 1", $i)
    _ListView_AddSubItem($hList, $i, "Row "&$i &": Col 2", 1)
    _ListView_AddSubItem($hList, $i, "Row "&$i &": Col 3", 2)
next

; Loop until user exits
do
until GUIGetMsg() = $GUI_EVENT_CLOSE
Edited by ReFran
Link to comment
Share on other sites

Hi, I noticed the the listview problem back when I dl'd the ApiConstants gui from the downloads section of the forum.

If I scroll using the down arrow on the scroll bar then the lines become all screwwed up, but if I use the scrollbar slider button or the scrollbar up button then the graphics glistch is not there..

I just never looked to deeply into it..

Good to see it's not just my configuration of software that has this glitch :)

Cheers

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...