Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

How come: Slow ListView when using tabs [SOLVED on page 2]


  • Please log in to reply
37 replies to this topic

#1 dirty

dirty

    Prodigy

  • Banned (NOT IN USE)
  • 188 posts

Posted 27 October 2011 - 08:52 AM


how come performance of the calculation is effected simply by putting all GUI components into a tab ?

Edited by dirty, 28 October 2011 - 09:05 PM.








#2 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 20,856 posts

Posted 27 October 2011 - 10:12 AM

dirty,

Very interesting video - I would say that you are furgling the splungebucket in line #2348 or thereabouts. :oops:

The solution is to undergrunge the ListView - did you read the Help file carefully? :D

M23



P.S. If you seriously want help - how about posting the script! :rip:
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#3 dirty

dirty

    Prodigy

  • Banned (NOT IN USE)
  • 188 posts

Posted 27 October 2011 - 06:29 PM

furgling the splungebucke ? Spellchecker does not correct those words and i have no idea what that means
line #2348 ? There are only 1587 lines
undergrunge the ListView ? what does that mean ? yes i did read it and i didnt find anything that would give me an answer about your undergrunge

as soon as i create the guictrlcreatetab, image is no longer dwarn
and when tabitem is created, searching takes way too long :D

Edited by dirty, 27 October 2011 - 06:37 PM.


#4 wraithdu

wraithdu

    this noise inside my head

  • MVPs
  • 2,396 posts

Posted 27 October 2011 - 06:42 PM

Sorry Melba, his reply was funnier than yours LOL :D :oops:

#5 dirty

dirty

    Prodigy

  • Banned (NOT IN USE)
  • 188 posts

Posted 27 October 2011 - 06:49 PM

yeah you can AIR guitar all you want, that doesnt solve the problem.

Listview item is created in recursive folder/file search function. If file = .ini then it reads the content and displays it in GUI.
There are paths in content if found INI. If path are correct or incorrect or missing etc, the appropriate icon is assigned to created listviewitem.
Are you saying its too much for autoit to take ?

Here is a function
AutoIt         
Func _searchAll($dir) Local $ArrTargetItems,$n,$TargetItem If (StringRight($dir, 1) = "\") Then $dir = StringTrimRight($dir, 1) $ArrTargetItems = _FileListToArray($dir, "*", 0) If IsArray($ArrTargetItems) Then   For $n = 1 To $ArrTargetItems[0]    $TargetItem = $dir & '\' & $ArrTargetItems[$n]    If StringInStr(FileGetAttrib($TargetItem), "D") Then ;This is a folder     _searchAll($TargetItem) ;Call recursively    Else ;This is a file     If StringRight($TargetItem, 4) = ".ini" Then      Local $GetNameFromResult,$GetCountFromResult,$GetNumberFromResult,$GetMFGFromResult      Local $GetCategoryFromResult,$GetLocationFromResult,$GetImagePathFromResult,$GetMFDPathFromResult      Local $GetCountSheetFromResult,$GetNoteFromResult,$FixStringForNote,$CountTotalStrings,$FixedFileName      Local $CountNameCharacters,$CheckFileName,$CheckProjectName      $GetNameFromResult = IniRead($TargetItem, "Project", "Name", "")      $GetCountFromResult = IniRead($TargetItem, "Project", "Count", "")      $GetNumberFromResult = IniRead($TargetItem, "Project", "Number", "")      $GetMFGFromResult = IniRead($TargetItem, "Project", "MFG", "")      $GetCategoryFromResult = IniRead($TargetItem, "Project", "Category", "")      $GetLocationFromResult = IniRead($TargetItem, "Project", "Location", "")      $GetImagePathFromResult = IniRead($TargetItem, "Project", "ImagePath", "")      ;If $GetImagePathFromResult > "" And FileExists ($GetImagePathFromResult) = 0 Then      $GetMFDPathFromResult = IniRead($TargetItem, "Project", "MFDPath", "")      ;If $GetMFDPathFromResult > "" And FileExists ($GetMFDPathFromResult) = 0 Then      $GetCountSheetFromResult = IniRead($TargetItem, "Project", "CountSheet", "")      ;If $GetCountSheetFromResult > "" And FileExists ($GetCountSheetFromResult) = 0 Then      $GetNoteFromResult = IniRead($TargetItem, "Project", "Note", "")      $FixStringForNote = StringReplace($GetNoteFromResult, "|", @CRLF)      $CountTotalStrings = StringInStr($TargetItem, "\", "", -1) ;# of characters before filename      $FixedFileName = StringTrimLeft($TargetItem, $CountTotalStrings) ;Filename.ini      $CountNameCharacters = StringLen($FixedFileName) ;How many characters in above filename.ini      $CheckFileName = StringTrimRight($FixedFileName, 4) ;Filename      $CheckProjectName = IniRead($TargetItem, "Project", "Name", "") ;ProjectName      If $CheckFileName <> $CheckProjectName Then ; project file and project name no match       Local $ErroFound,$NameInFile,$DefaultName,$SaveChanges       $ErroFound = GUICreate("Fix Project Error", 220, 240, Default, Default, Default, Default, $MainGUI)       GUICtrlCreateLabel('"' & $CheckFileName & '"' & @CRLF & 'This Project Filename does not match to Name found in Project file. Please change Filename or Project name and click "Change Now"', 5, 5, 210, 100)       GUICtrlCreateGroup("This is File Name", 5, 105, 210, 40)       $NameInFile = GUICtrlCreateInput($CheckFileName, 10, 120, 200, 20) ;File Name Input       GUICtrlCreateGroup("This is project Name", 5, 150, 210, 40)       $DefaultName = GUICtrlCreateInput($CheckProjectName, 10, 165, 200, 20) ;Project Name Imput       $SaveChanges = GUICtrlCreateButton("Change Now", 10, 200, 200)       GUISetState(@SW_SHOW, $ErroFound)       While 1        Local $Getmsg        $Getmsg = GUIGetMsg()        If $Getmsg = $GUI_EVENT_CLOSE Then         GUIDelete($ErroFound) ;delete created GUI         ExitLoop        EndIf        If $Getmsg = $SaveChanges Then         Local $NewFileName,$NewName         $NewFileName = GUICtrlRead($NameInFile) ;FileName         $NewName = GUICtrlRead($DefaultName) ;ProjectName         ;MsgBox(0,'',StringReplace ($TargetItem,$FinalCategory,$NewCategory)) ;show where file wil be moved.         IniWrite($TargetItem, "Project", "Name", $NewName)         FileMove($TargetItem, StringReplace($TargetItem, $CheckFileName, $NewFileName), 1)         GUIDelete($ErroFound) ;delete created GUI         ExitLoop        EndIf       WEnd      EndIf      Local $Iconname,$PictureExist,$CountSheetExist      $Iconname = "Warning.ico"      $PictureExist = FileExists($GetImagePathFromResult)      $CountSheetExist = FileExists($GetCountSheetFromResult)      If $GetImagePathFromResult = "" And $GetCountSheetFromResult = "" Then Assign("Iconname", "BothWarning.ico") ;CC and Pic Empty      If $GetCountSheetFromResult > "" And $GetImagePathFromResult > "" And $PictureExist = 0 And $CountSheetExist = 0 Then Assign("Iconname", "BothWarning.ico") ;CC Error and Pic Error      If $GetCountSheetFromResult > "" And $GetImagePathFromResult > "" And $PictureExist = 1 And $CountSheetExist = 1 Then Assign("Iconname", "BothGood.ico") ;CC and Pic OK      If $GetCountSheetFromResult > "" And $GetImagePathFromResult > "" And $PictureExist = 0 And $CountSheetExist = 0 Then Assign("Iconname", "BothBad.ico") ;CC and Pic Error      If $GetCountSheetFromResult > "" And $GetImagePathFromResult > "" And $PictureExist = 0 And $CountSheetExist = 1 Then Assign("Iconname", "PictureError.ico") ;CC OK and Pic Error      If $GetCountSheetFromResult > "" And $GetImagePathFromResult > "" And $PictureExist = 1 And $CountSheetExist = 0 Then Assign("Iconname", "FileError.ico") ;CC Error and Pic OK      If $GetCountSheetFromResult = "" And $GetImagePathFromResult > "" And $PictureExist = 1 Then Assign("Iconname", "PictureOK.ico") ;CC empty Pic OK      If $GetCountSheetFromResult = "" And $GetImagePathFromResult > "" And $PictureExist = 0 Then Assign("Iconname", "PictureError.ico") ;CC empty Pic Error      If $GetCountSheetFromResult > "" And $GetImagePathFromResult = "" And $CountSheetExist = 1 Then Assign("Iconname", "NoPicture.ico") ;CC OK Pic empty      If $GetCountSheetFromResult > "" And $GetImagePathFromResult = "" And $CountSheetExist = 0 Then Assign("Iconname", "FileError.ico") ;CC Error Pic Empty      GUICtrlCreateListViewItem($GetNameFromResult & "|" & $GetCountFromResult & "|" & $GetNumberFromResult & "|" & $GetMFGFromResult & "|" & $GetCategoryFromResult & "|" & $GetLocationFromResult & "|" & $GetImagePathFromResult & "|" & $GetMFDPathFromResult & "|" & $GetCountSheetFromResult & "|" & $FixStringForNote, $Results)      GUICtrlSetImage(-1, @TempDir & "\" & $Iconname, '', 2) ;Because above has no variable, -1 means previously created control.      Assign("Number", $Number + 1)     EndIf    EndIf   Next   GUICtrlSetData($FoundCount, $Number) EndIf EndFunc   ;==>_searchAll


Am not sure what part of this code causes the issue

#6 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 20,856 posts

Posted 27 October 2011 - 07:15 PM

wraithdu,

Ah, but mine was intentional! :rip:

dirty,

I have no idea why your function does different things within a tab - my earlier reply was an attempt to get you to post some code so we could attempt to solve your problem. Just looking at a video gives us no clues at all - as I hope you can appreciate. :oops:

Unfortunately I am still no wiser looking at your single function. Perhaps if you posted the whole script so we can see how it fits together? :D

M23
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#7 dirty

dirty

    Prodigy

  • Banned (NOT IN USE)
  • 188 posts

Posted 27 October 2011 - 07:26 PM

this is all that gets involved

AutoIt         
$Results = GUICtrlCreateListView("Name|Qty|#|MFG|Category|Loc|Pic|MFDPath|CountSheet|Note", 505, 20, 480, 325,$LVS_SINGLESEL,$LVS_EX_GRIDLINES) ColumnSize() ;simply resize before search. Same function is used to resize when search is completed, not every time but when its completed all the way. Func ColumnSize()     _GUICtrlListView_SetColumnWidth($Results, 0, 200) ;Name column     _GUICtrlListView_SetColumnWidth($Results, 1, 35) ;Quantity     _GUICtrlListView_SetColumnWidth($Results, 2, 65) ;#     _GUICtrlListView_SetColumnWidth($Results, 3, 80) ;MFG     _GUICtrlListView_SetColumnWidth($Results, 4, 80) ;Category     _GUICtrlListView_SetColumnWidth($Results, 5, 80) ;Loc     _GUICtrlListView_SetColumnWidth($Results, 6, 40) ;Pic     _GUICtrlListView_SetColumnWidth($Results, 7, 40) ;MFD     _GUICtrlListView_SetColumnWidth($Results, 8, 40) ;Countsheet     _GUICtrlListView_SetColumnWidth($Results, 9, 300) ;Note EndFunc   ;==>ColumnSize _GUICtrlListView_RegisterSortCallBack($Results) GUISetState(@SW_SHOW, $MainGUI) While 1 ;Main Loop Local $GUIGetMsg $GUIGetMsg = GUIGetMsg() If $GUIGetMsg = $GUI_EVENT_CLOSE Then ExitLoop If $GUIGetMsg = $SearchAll Then   Local $ReadNameInput4Search,$dir,$Loading   _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($Results)) ;Clear all data in $results   $ReadNameInput4Search = GUICtrlRead($SearchByName)   $dir = ($DefaultProjectsFolder) ;where to search at   $Loading = GUICreate("Seaching", 500, 300, Default, Default, $WS_POPUP, $WS_EX_DLGMODALFRAME, $MainGUI)   GUISetState(@SW_SHOW, $Loading)   GUICtrlCreateLabel("S E A R C H I N G" & @CRLF & "P L E A S E  W A I T !", 10, 100, 490, 280, $SS_CENTER)   GUICtrlSetFont(-1, 12, 800)   GUISetState(@SW_DISABLE, $MainGUI)   Assign("Number", "0") ;reset count of found projects to 0 by assigning variable that is changing when each ini is found   GUICtrlSetData($FoundCount, $Number) ;Set found projects to 0   _searchAll($dir)   ColumnSize()   GUISetState(@SW_ENABLE, $MainGUI)   GUIDelete($Loading) EndIf Wend Func _searchAll($dir) Local $ArrTargetItems,$n,$TargetItem If (StringRight($dir, 1) = "\") Then $dir = StringTrimRight($dir, 1) $ArrTargetItems = _FileListToArray($dir, "*", 0) If IsArray($ArrTargetItems) Then   For $n = 1 To $ArrTargetItems[0]    $TargetItem = $dir & '\' & $ArrTargetItems[$n]    If StringInStr(FileGetAttrib($TargetItem), "D") Then ;This is a folder     _searchAll($TargetItem) ;Call recursively    Else ;This is a file     If StringRight($TargetItem, 4) = ".ini" Then      Local $GetNameFromResult,$GetCountFromResult,$GetNumberFromResult,$GetMFGFromResult      Local $GetCategoryFromResult,$GetLocationFromResult,$GetImagePathFromResult,$GetMFDPathFromResult      Local $GetCountSheetFromResult,$GetNoteFromResult,$FixStringForNote,$CountTotalStrings,$FixedFileName      Local $CountNameCharacters,$CheckFileName,$CheckProjectName      $GetNameFromResult = IniRead($TargetItem, "Project", "Name", "")      $GetCountFromResult = IniRead($TargetItem, "Project", "Count", "")      $GetNumberFromResult = IniRead($TargetItem, "Project", "Number", "")      $GetMFGFromResult = IniRead($TargetItem, "Project", "MFG", "")      $GetCategoryFromResult = IniRead($TargetItem, "Project", "Category", "")      $GetLocationFromResult = IniRead($TargetItem, "Project", "Location", "")      $GetImagePathFromResult = IniRead($TargetItem, "Project", "ImagePath", "")      ;If $GetImagePathFromResult > "" And FileExists ($GetImagePathFromResult) = 0 Then      $GetMFDPathFromResult = IniRead($TargetItem, "Project", "MFDPath", "")      ;If $GetMFDPathFromResult > "" And FileExists ($GetMFDPathFromResult) = 0 Then      $GetCountSheetFromResult = IniRead($TargetItem, "Project", "CountSheet", "")      ;If $GetCountSheetFromResult > "" And FileExists ($GetCountSheetFromResult) = 0 Then      $GetNoteFromResult = IniRead($TargetItem, "Project", "Note", "")      $FixStringForNote = StringReplace($GetNoteFromResult, "|", @CRLF)      $CountTotalStrings = StringInStr($TargetItem, "\", "", -1) ;# of characters before filename      $FixedFileName = StringTrimLeft($TargetItem, $CountTotalStrings) ;Filename.ini      $CountNameCharacters = StringLen($FixedFileName) ;How many characters in above filename.ini      $CheckFileName = StringTrimRight($FixedFileName, 4) ;Filename      $CheckProjectName = IniRead($TargetItem, "Project", "Name", "") ;ProjectName      If $CheckFileName <> $CheckProjectName Then ; project file and project name no match       Local $ErroFound,$NameInFile,$DefaultName,$SaveChanges       $ErroFound = GUICreate("Fix Project Error", 220, 240, Default, Default, Default, Default, $MainGUI)       GUICtrlCreateLabel('"' & $CheckFileName & '"' & @CRLF & 'This Project Filename does not match to Name found in Project file. Please change Filename or Project name and click "Change Now"', 5, 5, 210, 100)       GUICtrlCreateGroup("This is File Name", 5, 105, 210, 40)       $NameInFile = GUICtrlCreateInput($CheckFileName, 10, 120, 200, 20) ;File Name Input       GUICtrlCreateGroup("This is project Name", 5, 150, 210, 40)       $DefaultName = GUICtrlCreateInput($CheckProjectName, 10, 165, 200, 20) ;Project Name Imput       $SaveChanges = GUICtrlCreateButton("Change Now", 10, 200, 200)       GUISetState(@SW_SHOW, $ErroFound)       While 1        Local $Getmsg        $Getmsg = GUIGetMsg()        If $Getmsg = $GUI_EVENT_CLOSE Then         GUIDelete($ErroFound) ;delete created GUI         ExitLoop        EndIf        If $Getmsg = $SaveChanges Then         Local $NewFileName,$NewName         $NewFileName = GUICtrlRead($NameInFile) ;FileName         $NewName = GUICtrlRead($DefaultName) ;ProjectName         ;MsgBox(0,'',StringReplace ($TargetItem,$FinalCategory,$NewCategory)) ;show where file wil be moved.         IniWrite($TargetItem, "Project", "Name", $NewName)         FileMove($TargetItem, StringReplace($TargetItem, $CheckFileName, $NewFileName), 1)         GUIDelete($ErroFound) ;delete created GUI         ExitLoop        EndIf       WEnd      EndIf      Local $Iconname,$PictureExist,$CountSheetExist      $Iconname = "Warning.ico"      $PictureExist = FileExists($GetImagePathFromResult)      $CountSheetExist = FileExists($GetCountSheetFromResult)      If $GetImagePathFromResult = "" And $GetCountSheetFromResult = "" Then Assign("Iconname", "BothWarning.ico") ;CC and Pic Empty      If $GetCountSheetFromResult > "" And $GetImagePathFromResult > "" And $PictureExist = 0 And $CountSheetExist = 0 Then Assign("Iconname", "BothWarning.ico") ;CC Error and Pic Error      If $GetCountSheetFromResult > "" And $GetImagePathFromResult > "" And $PictureExist = 1 And $CountSheetExist = 1 Then Assign("Iconname", "BothGood.ico") ;CC and Pic OK      If $GetCountSheetFromResult > "" And $GetImagePathFromResult > "" And $PictureExist = 0 And $CountSheetExist = 0 Then Assign("Iconname", "BothBad.ico") ;CC and Pic Error      If $GetCountSheetFromResult > "" And $GetImagePathFromResult > "" And $PictureExist = 0 And $CountSheetExist = 1 Then Assign("Iconname", "PictureError.ico") ;CC OK and Pic Error      If $GetCountSheetFromResult > "" And $GetImagePathFromResult > "" And $PictureExist = 1 And $CountSheetExist = 0 Then Assign("Iconname", "FileError.ico") ;CC Error and Pic OK      If $GetCountSheetFromResult = "" And $GetImagePathFromResult > "" And $PictureExist = 1 Then Assign("Iconname", "PictureOK.ico") ;CC empty Pic OK      If $GetCountSheetFromResult = "" And $GetImagePathFromResult > "" And $PictureExist = 0 Then Assign("Iconname", "PictureError.ico") ;CC empty Pic Error      If $GetCountSheetFromResult > "" And $GetImagePathFromResult = "" And $CountSheetExist = 1 Then Assign("Iconname", "NoPicture.ico") ;CC OK Pic empty      If $GetCountSheetFromResult > "" And $GetImagePathFromResult = "" And $CountSheetExist = 0 Then Assign("Iconname", "FileError.ico") ;CC Error Pic Empty      GUICtrlCreateListViewItem($GetNameFromResult & "|" & $GetCountFromResult & "|" & $GetNumberFromResult & "|" & $GetMFGFromResult & "|" & $GetCategoryFromResult & "|" & $GetLocationFromResult & "|" & $GetImagePathFromResult & "|" & $GetMFDPathFromResult & "|" & $GetCountSheetFromResult & "|" & $FixStringForNote, $Results)      GUICtrlSetImage(-1, @TempDir & "\" & $Iconname, '', 2) ;Because above has no variable, -1 means previously created control.      Assign("Number", $Number + 1)     EndIf    EndIf   Next   GUICtrlSetData($FoundCount, $Number) EndIf EndFunc   ;==>_searchAll

Edited by dirty, 27 October 2011 - 07:27 PM.


#8 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 20,856 posts

Posted 27 October 2011 - 07:32 PM

dirty,

Last chance saloon time! :D

Where is the GUICtrlCreateTabItem line that is causing you so much trouble? If you do not include a working script which might possibly give me a clue as to what is going on in your next post I am out of here. :oops:

M23
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#9 wraithdu

wraithdu

    this noise inside my head

  • MVPs
  • 2,396 posts

Posted 27 October 2011 - 08:16 PM

If you don't want to post your script for whatever reason (and judging from the possible size, it's likely WE don't want to see it either), then YOU need to take the time to write the smallest script that exemplifies your problem so people can look at it. We don't read minds, we don't do your legwork. Now I haven't even bothered to look at what you have posted... but I know Melba23 enough that if he says what you have is insufficient, then you need to try harder.

Edited by wraithdu, 27 October 2011 - 08:17 PM.


#10 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 20,856 posts

Posted 27 October 2011 - 08:21 PM

wraithdu,

it's likely WE don't want to see it either

Speak for yourself! I am sure it will be a fascinating experience and one which I am eagerly anticipating. :D

M23
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#11 dirty

dirty

    Prodigy

  • Banned (NOT IN USE)
  • 188 posts

Posted 28 October 2011 - 05:18 AM

#include <GUIConstantsEx.au3> $WinTitle = "whatever" $MainGUI = GUICreate($WinTitle, 995, 765, Default, Default) $TabControl = GUICtrlCreateTab (0,0,995,750) $Tab = GUICtrlCreateTabItem ("Progect Managment") $SearchAll = GUICtrlCreateButton("  Display all available projects", 10, 330, 480, 35) $Results = GUICtrlCreateListView("1_________|2|3", 505, 20, 480, 325) GUISetState(@SW_SHOW, $MainGUI) While 1 ;Main Loop     Local $GUIGetMsg     $GUIGetMsg = GUIGetMsg()     If $GUIGetMsg = $GUI_EVENT_CLOSE Then ExitLoop     If $GUIGetMsg = $SearchAll Then         for $i = 1 to 1000 Step 1                 GUICtrlCreateListViewItem ("test" & $i,$Results)         Next     EndIf WEnd


This will reproduce the issue

Edited by dirty, 28 October 2011 - 09:14 AM.


#12 nitekram

nitekram

    Ng1-Nf3

  • Active Members
  • PipPipPipPipPipPip
  • 1,871 posts

Posted 28 October 2011 - 11:14 AM

Try this?
#include <GUIConstantsEx.au3> $WinTitle = "whatever" $MainGUI = GUICreate($WinTitle, 995, 765, Default, Default) $TabControl = GUICtrlCreateTab (0,0,995,750) $Tab = GUICtrlCreateTabItem ("Progect Managment") GUICtrlCreateTabItem("") $SearchAll = GUICtrlCreateButton("  Display all available projects", 10, 330, 480, 35) $Results = GUICtrlCreateListView("1_________|2|3", 505, 20, 480, 325) GUISetState(@SW_SHOW, $MainGUI) While 1 ;Main Loop     Local $GUIGetMsg     $GUIGetMsg = GUIGetMsg()     If $GUIGetMsg = $GUI_EVENT_CLOSE Then ExitLoop     If $GUIGetMsg = $SearchAll Then         for $i = 1 to 1000 Step 1                 GUICtrlCreateListViewItem ("test" & $i,$Results)         Next     EndIf WEnd


Remarks
For setting more information see GUICtrlUpdate....

To select a specific tabitem to be shown when the dialog box open just issue a GUICtrlSetState(-1,$GUI_SHOW) see example.

To terminate the tab control just create a last "tabitem" control with a null text "". The "tabitem" control cannot be painted (too much code ...).

When advanced mode is used, GUICtrlRead($tab,1) will return the controlID instead of index of the clicked tab item.

To create a new control on an existing tabitem use GUISwitch($hWin,$tabitem) to select it and just create your new control. Don't forget to close your tabitem creation with GUICtrlCreateTabItem("").

Edit - added quote

Edited by nitekram, 28 October 2011 - 11:16 AM.

"Sometimes you have to go back to where you started, to get to where you want to go."  "Everybody catches up with everyone, eventually"  "As you teach others, you are really teaching yourself." all by me. From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow."

Windows_error.gif

How to ask a Question Forum SearchWIKI FAQ Tutorials Original FAQ - AutoIt Snippets - Multple Guis - Interrupting a running functionAnother Send StringRegExp StringRegExp Help RegEX TesterONLINE HELP UDF's Wiki AutoIt PDF AutoItSetOption Macros Wiki Arrays AutoIt Snippets WrapperAutoit Docs SCITE SciteJump - BB MyTopicsProgramming UDFs AutoIt_101 UDFs Form - UDFTutorial - Tutorials - Documentation - IE.AU3Games? - FreeSoftwarePath_Online

 

Spoiler

#13 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 20,856 posts

Posted 28 October 2011 - 11:42 AM

dirty,

I imagine the problem is caused by the overhead that a Tab control causes - AutoIt has to decide whether the ListView control is visible or not as it adds each ListViewItem.

You can speed it up significantly by using $GUI_HIDE/SHOW like this:
AutoIt         
#include <GUIConstantsEx.au3> $WinTitle = "whatever" $MainGUI = GUICreate($WinTitle, 995, 765, Default, Default) $TabControl = GUICtrlCreateTab(0, 0, 995, 750) $Tab = GUICtrlCreateTabItem("Progect Managment") $SearchAll = GUICtrlCreateButton("  Display all available projects", 10, 330, 480, 35) $Results = GUICtrlCreateListView("1_________|2|3", 505, 20, 480, 325) GUICtrlCreateTabItem("") ; Do nto forget this line  <<<<<<<<<<<<<<<<<<<<<<<<<<<< GUISetState(@SW_SHOW, $MainGUI) While 1 ;Main Loop     Local $GUIGetMsg     $GUIGetMsg = GUIGetMsg()     If $GUIGetMsg = $GUI_EVENT_CLOSE Then ExitLoop     If $GUIGetMsg = $SearchAll Then         GUICtrlSetState($Results, $GUI_HIDE)         For $i = 1 To 1000 Step 1             GUICtrlCreateListViewItem("test" & $i, $Results)         Next         GUICtrlSetState($Results, $GUI_SHOW)     EndIf WEnd

I will keep looking to see if I can reduce the flashing even more. :D

nitekram,

By putting the GUICtrlCreateTabItem("") where you have it, the other controls are no longer on the tab and are permanently visible - as you can see from this script with 2 tabs:
#include <GUIConstantsEx.au3> $WinTitle = "whatever" $MainGUI = GUICreate($WinTitle, 995, 765, Default, Default) $TabControl = GUICtrlCreateTab (0,0,995,750) $Tab = GUICtrlCreateTabItem ("Progect Managment") $Tab = GUICtrlCreateTabItem ("Test") ; New tab <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< GUICtrlCreateTabItem("") $SearchAll = GUICtrlCreateButton("  Display all available projects", 10, 330, 480, 35) $Results = GUICtrlCreateListView("1_________|2|3", 505, 20, 480, 325) GUISetState(@SW_SHOW, $MainGUI) While 1 ;Main Loop     Local $GUIGetMsg     $GUIGetMsg = GUIGetMsg()     If $GUIGetMsg = $GUI_EVENT_CLOSE Then ExitLoop     If $GUIGetMsg = $SearchAll Then         for $i = 1 to 1000 Step 1                 GUICtrlCreateListViewItem ("test" & $i,$Results)         Next     EndIf WEnd

M23
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#14 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 20,856 posts

Posted 28 October 2011 - 12:51 PM

dirty,

This is a pretty good solution - creating a child GUI to cover the ListView while it updates: :oops:
AutoIt         
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> $WinTitle = "whatever" $MainGUI = GUICreate($WinTitle, 995, 765, Default, Default) $TabControl = GUICtrlCreateTab(0, 0, 995, 750) $Tab = GUICtrlCreateTabItem("Progect Managment") $SearchAll = GUICtrlCreateButton("  Display all available projects", 10, 330, 480, 35) $Results = GUICtrlCreateListView("1_________|2|3", 505, 30, 480, 325) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW, $MainGUI) While 1 ;Main Loop     Local $GUIGetMsg     $GUIGetMsg = GUIGetMsg()     If $GUIGetMsg = $GUI_EVENT_CLOSE Then ExitLoop     If $GUIGetMsg = $SearchAll Then         ; Create a child GUI         $hChild = GUICreate("", 480, 325, 0, 0, $WS_POPUP, $WS_EX_MDICHILD, $MainGUI)         ; Create a label to show we are updating         $hLabel = GUICtrlCreateLabel("Updating", 0, 0, 480, 325, BitOR($SS_CENTER, $SS_CENTERIMAGE))         GUICtrlSetFont(-1, 36)         ; Move the child to cover the ListView         $aPos = WinGetPos(GUICtrlGetHandle($Results))         WinMove($hChild, "", $aPos[0], $aPos[1])         ; Show the child without stealing focus from the main GUI         GUISetState(@SW_SHOWNOACTIVATE)         ; Update the ListView         For $i = 1 To 1000 Step 1             GUICtrlCreateListViewItem("test" & $i, $Results)         Next         ; Delete the child and make sure we reset the main GUI for subsequent actions         GUIDelete($hChild)         GUISwitch($MainGUI)     EndIf WEnd

I hope you find it useful. :D

M23
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#15 wraithdu

wraithdu

    this noise inside my head

  • MVPs
  • 2,396 posts

Posted 28 October 2011 - 02:13 PM

Won't the good old _GUICtrlListView_BeginUpdate() and _GUICtrlListView_EndUpdate() take care of the ListView redraw? It's what I always use.

#16 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 20,856 posts

Posted 28 October 2011 - 02:15 PM

wraithdu,

That was my first thought too, but it still flickered. :D

Again I imagine it is the Tab structure causing the problem as the new GUICtrlListViewItems are added.

M23

Edit: I might at least get your name right! :oops:

Edited by Melba23, 28 October 2011 - 02:16 PM.

StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#17 nitekram

nitekram

    Ng1-Nf3

  • Active Members
  • PipPipPipPipPipPip
  • 1,871 posts

Posted 28 October 2011 - 02:28 PM

I knew my fix was to easy to have worked - lol.

Not sure why then this would not work - other then your work around? Would this be a bug, or is it because it is writing each line and then does a refresh of the screen after each line is written?
#include <GUIConstantsEx.au3> $WinTitle = "whatever" $MainGUI = GUICreate($WinTitle, 995, 765, Default, Default) $TabControl = GUICtrlCreateTab (0,0,995,750) $Tab = GUICtrlCreateTabItem ("Progect Managment") $SearchAll = GUICtrlCreateButton("  Display all available projects", 10, 330, 480, 35) $Results = GUICtrlCreateListView("1_________|2|3", 505, 20, 480, 325) $Tab2 = GUICtrlCreateTabItem ("Test") ; New tab <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< GUICtrlCreateTabItem("")   GUISetState(@SW_SHOW, $MainGUI) While 1 ;Main Loop     Local $GUIGetMsg     $GUIGetMsg = GUIGetMsg()     If $GUIGetMsg = $GUI_EVENT_CLOSE Then ExitLoop     If $GUIGetMsg = $SearchAll Then         for $i = 1 to 1000 Step 1                 GUICtrlCreateListViewItem ("test" & $i,$Results)         Next     EndIf WEnd

Edited by nitekram, 28 October 2011 - 02:42 PM.

"Sometimes you have to go back to where you started, to get to where you want to go."  "Everybody catches up with everyone, eventually"  "As you teach others, you are really teaching yourself." all by me. From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow."

Windows_error.gif

How to ask a Question Forum SearchWIKI FAQ Tutorials Original FAQ - AutoIt Snippets - Multple Guis - Interrupting a running functionAnother Send StringRegExp StringRegExp Help RegEX TesterONLINE HELP UDF's Wiki AutoIt PDF AutoItSetOption Macros Wiki Arrays AutoIt Snippets WrapperAutoit Docs SCITE SciteJump - BB MyTopicsProgramming UDFs AutoIt_101 UDFs Form - UDFTutorial - Tutorials - Documentation - IE.AU3Games? - FreeSoftwarePath_Online

 

Spoiler

#18 wraithdu

wraithdu

    this noise inside my head

  • MVPs
  • 2,396 posts

Posted 28 October 2011 - 02:33 PM

This is the best I could do (played with a bunch of window styles). It still flickers, but it is much faster.
AutoIt         
#include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <ListViewConstants.au3> $WinTitle = "whatever" $MainGUI = GUICreate($WinTitle, 995, 765) $TabControl = GUICtrlCreateTab (0,0,995,750) $Tab = GUICtrlCreateTabItem ("Progect Managment") $SearchAll = GUICtrlCreateButton("  Display all available projects", 10, 330, 480, 35) $Results = GUICtrlCreateListView("1_________|2|3", 505, 20, 480, 325) _GUICtrlListView_SetExtendedListViewStyle(GUICtrlGetHandle($Results), $LVS_EX_DOUBLEBUFFER, $LVS_EX_DOUBLEBUFFER) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW, $MainGUI) While 1 ;Main Loop     Local $GUIGetMsg     $GUIGetMsg = GUIGetMsg()     If $GUIGetMsg = $GUI_EVENT_CLOSE Then ExitLoop     If $GUIGetMsg = $SearchAll Then         _GUICtrlListView_BeginUpdate(GUICtrlGetHandle($Results))         for $i = 1 to 1000 Step 1                 GUICtrlCreateListViewItem ("test" & $i,$Results)         Next         _GUICtrlListView_EndUpdate(GUICtrlGetHandle($Results))     EndIf WEnd


#19 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 20,856 posts

Posted 28 October 2011 - 02:35 PM

nitekram,

is it because it is writing each line and then does a refresh of the screen after each line is written?

That is my belief - exacerbated by the fact that the control being on a Tab seems to slow the whole thing down because AutoIt needs to do its internal checking on the visibility of the Tab. :D

Which is why I ended up just covering the whole ListView. :oops:

M23
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#20 nitekram

nitekram

    Ng1-Nf3

  • Active Members
  • PipPipPipPipPipPip
  • 1,871 posts

Posted 28 October 2011 - 02:43 PM

I think I got it this time though - after help from above
AutoIt         
#include <GUIConstantsEx.au3> #Include <GuiListView.au3> $WinTitle = "whatever" $MainGUI = GUICreate($WinTitle, 995, 765, Default, Default) $TabControl = GUICtrlCreateTab(0, 0, 995, 750) $Tab = GUICtrlCreateTabItem("Progect Managment") $SearchAll = GUICtrlCreateButton("  Display all available projects", 10, 330, 480, 35) $Results = GUICtrlCreateListView("1_________|2|3", 505, 20, 480, 325) $Tab2 = GUICtrlCreateTabItem("tab2") GUICtrlCreateTabItem("") ; Do nto forget this line  <<<<<<<<<<<<<<<<<<<<<<<<<<<< GUISetState(@SW_SHOW, $MainGUI) While 1 ;Main Loop     Local $GUIGetMsg     $GUIGetMsg = GUIGetMsg()     If $GUIGetMsg = $GUI_EVENT_CLOSE Then ExitLoop     If $GUIGetMsg = $SearchAll Then         ;GUICtrlSetState($Results, $GUI_HIDE)   _GUICtrlListView_BeginUpdate($Results)         For $i = 1 To 1000 Step 1             _GUICtrlListView_AddItem($Results, "test" & $i, 0)         Next   _GUICtrlListView_EndUpdate($Results)         ;GUICtrlSetState($Results, $GUI_SHOW)     EndIf WEnd

"Sometimes you have to go back to where you started, to get to where you want to go."  "Everybody catches up with everyone, eventually"  "As you teach others, you are really teaching yourself." all by me. From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow."

Windows_error.gif

How to ask a Question Forum SearchWIKI FAQ Tutorials Original FAQ - AutoIt Snippets - Multple Guis - Interrupting a running functionAnother Send StringRegExp StringRegExp Help RegEX TesterONLINE HELP UDF's Wiki AutoIt PDF AutoItSetOption Macros Wiki Arrays AutoIt Snippets WrapperAutoit Docs SCITE SciteJump - BB MyTopicsProgramming UDFs AutoIt_101 UDFs Form - UDFTutorial - Tutorials - Documentation - IE.AU3Games? - FreeSoftwarePath_Online

 

Spoiler




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users