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.
Posted 27 October 2011 - 08:52 AM
Edited by dirty, 28 October 2011 - 09:05 PM.
Posted 27 October 2011 - 10:12 AM
Posted 27 October 2011 - 06:29 PM
Edited by dirty, 27 October 2011 - 06:37 PM.
Posted 27 October 2011 - 06:42 PM
Posted 27 October 2011 - 06:49 PM
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
Posted 27 October 2011 - 07:15 PM
Posted 27 October 2011 - 07:26 PM
$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.
Posted 27 October 2011 - 07:32 PM
Posted 27 October 2011 - 08:16 PM
Edited by wraithdu, 27 October 2011 - 08:17 PM.
Posted 27 October 2011 - 08:21 PM
Speak for yourself! I am sure it will be a fascinating experience and one which I am eagerly anticipating.it's likely WE don't want to see it either
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
Edited by dirty, 28 October 2011 - 09:14 AM.
Posted 28 October 2011 - 11:14 AM
#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
Edit - added quoteRemarks
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("").
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." MT"Everybody catches up with everyone, eventually" MT
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
Posted 28 October 2011 - 11:42 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) 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
#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
Posted 28 October 2011 - 12:51 PM
#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
Posted 28 October 2011 - 02:13 PM
Posted 28 October 2011 - 02:15 PM
Edited by Melba23, 28 October 2011 - 02:16 PM.
Posted 28 October 2011 - 02:28 PM
#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." MT"Everybody catches up with everyone, eventually" MT
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
Posted 28 October 2011 - 02:33 PM
#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
Posted 28 October 2011 - 02:35 PM
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.is it because it is writing each line and then does a refresh of the screen after each line is written?
Posted 28 October 2011 - 02:43 PM
#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." MT"Everybody catches up with everyone, eventually" MT
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
0 members, 0 guests, 0 anonymous users