Jump to content

Problem with slow scrolling


Recommended Posts

I have problem with scrolling listview in my new soft, I made program but scrolling in it is very slow, it looks like pc is too low for it or something, when cells are empty its ok everything works fine but when i fill it up its crashes and works very slow. Help me pls or give me link to example script

Link to comment
Share on other sites

I need example script with fast scrolling.=] In my script I have many cells... it's only listview and if I fill cells up this scrolling to right or bot is really slow.

if u need it's my listview part of script

global $ListView = GUICtrlCreateListView("", 110, 80, $guiw - 220, $guih - 100)
    
    GUICtrlSendMsg($ListView, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
    $__LISTVIEWCTRL = $ListView
    
    
For $i = 0 To 160
    if $i = 2 Then
        ContinueLoop
    EndIf
    
    _GUICtrlListView_AddColumn($ListView, $wartosc[$i][0], "",2)
    _GUICtrlListView_SetColumnWidth($ListView, $i, 100)
Next
    

    _GUICtrlListView_SetBkColor($ListView, $CLR_MONEYGREEN)
    _GUICtrlListView_SetTextColor($ListView, $CLR_BLACK)
    _GUICtrlListView_SetTextBkColor($ListView, $CLR_MONEYGREEN)

    
    
    
    
    Global $B_DESCENDING[_GUICtrlListView_GetColumnCount($ListView)]
    Global $maxColumn = _GUICtrlListView_GetColumnCount($ListView)
    Global $aIParam[1][$maxColumn+1][5]
    Global $oParamSearch = ObjCreate('Scripting.Dictionary') ; store for faster search (iParam, arrayIndex)
    
    
; itemy
    
    GUICtrlSetOnEvent($__LISTVIEWCTRL, "lvListViewHandler")
    global $cccc
    $cccc = StringTrimRight("L|P|0|1|2|", 1)
    
For $i = 1 To 99
    
     _GUICtrlListView_AddItem($ListView, $wartosc[0][$i])
Next

For $i = 1 To 99
    
    
    For $j = 1 To 70
        if $j = 4 then 
             
            ContinueLoop
        EndIf
        if $j > 4 then 
              _GUICtrlListView_AddSubItem($ListView, $i - 1, $wartosc[$j][$i], $j-1)
            ContinueLoop
        EndIf
    _GUICtrlListView_AddSubItem($ListView, $i - 1, $wartosc[$j][$i], $j)

    Next    
Next    

; przyciski

$usun = GUICtrlCreateButton("Usun", 100, 0, 60, 40)

$load = GUICtrlCreateButton("load", 170, 0, 60, 40)

$dodaj = GUICtrlCreateButton("Dodaj poz", 240, 0, 60, 40)

$do = GUICtrlCreateButton("save", 310, 0, 60, 40)

$dod = GUICtrlCreateButton("Dodaj Zad", 380, 0, 60, 40)



    
Local $liczebka[300]
Local $rzym[100]

    For $k = 1 to 101
                $liczebka[$k] = IniRead($lokacja2, "section-2", $k, "")
            Next
            For $s = 1 to 51 step 2
                $rzym[$s] = IniRead($lokacja2, "section-1", $s, "")
            Next
            
                    
                    For $f = 1 To 99
                    _GUICtrlListView_SetItemText($listview, $f-1, $f-3)
                    Next
                    
                    for $d = 1 to 99 step 2
                    
                        _GUICtrlListView_SetItemText($listview, $liczebka[$d]-1, $rzym[$d])
                            
                    Next
                    
                    _GUICtrlListView_SetItemText($listview, 0, "-")
                    _GUICtrlListView_SetItemText($listview, 1, "-") 
            $liczebka[0] = IniRead($lokacja2, "section-2", 0, "")   
GUICtrlCreateTabItem("") 




for $d = 0 to 98
    IniWrite(@ScriptDir&"\plik.ini", "section-1", $d, $rzym[$d])
    IniWrite(@ScriptDir&"\plik.ini", "section-2", $d, $liczebka[$d])
Next
        IniWrite(@ScriptDir&"\plik.ini", "section-2", 0, $liczebka[0])

FileSetAttrib(@ScriptDir&"\plik.ini", "+H")                     
    

for $i = 0 to 3
    _guictrllistview_setcolumn($listview, $i, $wartosc[$i][0], 100,2)
    next

$iLV_Width = 17
For $i = 0 To 79
    if $i = 1 Then
        ContinueLoop
    EndIf
    _GUICtrlListView_SetColumnWidth($ListView, $i, $LVSCW_AUTOSIZE_USEHEADER)
    $iHeader_Width = _GUICtrlListView_GetColumnWidth($ListView, $i)
   
    _GUICtrlListView_SetColumnWidth($ListView, $i, $LVSCW_AUTOSIZE)
    $iData_Width = _GUICtrlListView_GetColumnWidth($ListView, $i)
  
    If $iHeader_Width > $iData_Width Then
        _GUICtrlListView_SetColumnWidth($ListView, $i, $iHeader_Width)
        $iLV_Width += $iHeader_Width
    Else
        $iLV_Width += $iData_Width
    EndIf
Next

sorry for bad english :mellow:

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...