Custom Query
Results (112 - 114 of 3893)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #2120 | Completed | Improvements to _GuiCtrlListView_DeleteAllItems | guinness | Beege |
| Description |
I was noticing how deleting all items it a autoit listview took almost 3x longer than it takes to add them. I came up with the following improvements below. Time Results: _GUICtrlListView_DeleteAllItems = 3592.88679294215 _GUICtrlListView_DeleteAllItems2 = 587.438691126462 #include <GuiListView.au3>
Opt('MustDeclareVars', 1)
Local $hGUI = GUICreate('Listview Delete All Items', 250, 400)
Local $ListView = GUICtrlCreateListView('Items', 0, 0, 248, 398)
GUISetState()
For $i = 1 To 10000
GUICtrlCreateListViewItem($i, $ListView)
Next
Local $time = TimerInit()
_GUICtrlListView_DeleteAllItems($ListView)
ConsoleWrite('_GUICtrlListView_DeleteAllItems = ' & TimerDiff($time) & @LF)
For $i = 1 To 10000
GUICtrlCreateListViewItem($i, $ListView)
Next
Local $time = TimerInit()
_GUICtrlListView_DeleteAllItems2($ListView)
ConsoleWrite('_GUICtrlListView_DeleteAllItems2 = ' & TimerDiff($time) & @LF)
Do
Until GUIGetMsg() = -3
Func _GUICtrlListView_DeleteAllItems2($hWnd)
If $Debug_LV Then __UDF_ValidateClassName($hWnd, $__LISTVIEWCONSTANT_ClassName)
If _GUICtrlListView_GetItemCount($hWnd) = 0 Then Return True
If IsHWnd($hWnd) Then
Return _SendMessage($hWnd, $LVM_DELETEALLITEMS) <> 0
Else
Local $ctrlID
Local $tItem = DllStructCreate($tagLVITEM)
Local $pItem = DllStructGetPtr($tItem)
Local $LV_Msg = $LVM_GETITEMA
If _GUICtrlListView_GetUnicodeFormat($hWnd) Then $LV_Msg = $LVM_GETITEMW
DllStructSetData($tItem, "Mask", $LVIF_PARAM)
GUICtrlSendMsg($hWnd, 11, 0, 0);$WM_SETREDRAW
For $index = _GUICtrlListView_GetItemCount($hWnd) - 1 To 0 Step -1
DllStructSetData($tItem, "Item", $index)
GUICtrlSendMsg($hWnd, $LV_Msg, 0, $pItem)
$ctrlID = DllStructGetData($tItem, "Param")
If $ctrlID Then GUICtrlDelete($ctrlID)
Next
GUICtrlSendMsg($hWnd, 11, 1, 0);$WM_SETREDRAW
If _GUICtrlListView_GetItemCount($hWnd) = 0 Then Return True
EndIf
Return False
EndFunc ;==>__GUICtrlListView_DeleteAllItems
|
|||
| #2141 | Fixed | AU3Check keyword #IgnoreFunc causing error | Valik | Beege |
| Description |
The following script causes an error: #include <GuiListView.au3> #include <SQLite.au3> Output: C:\Program Files (x86)\AutoIt3\Include\SQLite.au3(2,13) : ERROR: missing separator character after keyword. #IgnoreFunc __SQLite_Inline_Version ~~~~~~~~~~~~^ |
|||
| #3739 | Completed | Scripting.dictionary Keys/Items array support for _ArrayDisplay | Jpm | Beege |
| Description |
I wanted to ask for this years ago but at the time _arraydisplay was stand alone function and I thought it was a bit much to ask to make it a sub function just to support this. I also couldn't see asking for _dictionarydisplay because where would it go? I see now that _arraydisplay has had an overhall and is using a shared sub function so this would be real easy to add by throwing the keys and items arrays together into a temp 2D array before calling shared function. Same idea could be done with maps as well. #include <array.au3> $oDi = ObjCreate('scripting.dictionary') For $i = 0 to 10 $oDi.Add('key' & $i,'item' & $i) Next ArrayDisplay($oDi) Func ArrayDisplay(Const ByRef $aArray, $sTitle = Default, $sArrayRange = Default, $iFlags = Default, $vUser_Separator = Default, $sHeader = Default, $iMax_ColWidth = Default) #forceref $vUser_Separator If IsObj($aArray) And StringInStr(ObjName($aArray, 3), 'scripting.dictionary') Then Local $aTmp[$aArray.Count][2], $aK = $aArray.Keys, $aI = $aArray.Items For $i = 0 To $aArray.Count - 1 $aTmp[$i][0] = $aK[$i] $aTmp[$i][1] = $aI[$i] Next If $sHeader = Default Then $sHeader = 'Keys|Items' If $sTitle = Default Then $sTitle = 'DictionaryDisplay' Local $iRet = __ArrayDisplay_Share($aTmp, $sTitle, $sArrayRange, $iFlags, Default, $sHeader, $iMax_ColWidth, 0, False) Else Local $iRet = __ArrayDisplay_Share($aArray, $sTitle, $sArrayRange, $iFlags, Default, $sHeader, $iMax_ColWidth, 0, False) EndIf Return SetError(@error, @extended, $iRet) EndFunc ;==>ArrayDisplay |
|||
