
tolyasher
Members-
Posts
12 -
Joined
-
Last visited
tolyasher's Achievements

Seeker (1/7)
0
Reputation
-
Creating editable ListView control with 'OnEvent' mode
tolyasher replied to tolyasher's topic in AutoIt GUI Help and Support
At the end I've successfully used library from @eltorro. It was found that it is very easy ))) I listed below what I add to my code for including library from @eltorro; #include <_EIPListView_my.au3> ; Include @eltorro library Global $LVcolControl[5] = [1, 1, 2, 2, 2] ;left click actions ; I've used just 'edit' and 'combobox' $Gui = $DualListDlg ; Copy handle to my GUI $__LISTVIEWCTRL = $ListView2 ; Copy handle to my listview _InitEditLib ("", "", "", "Whatever", $Gui); Local $c ; start filling combobox with data For $i = 1 To 18 $c = $c & Chr($i + 66) & "|" Next $c = StringTrimRight($c, 1) GUICtrlSetData($lvCombo, $c) ; end filling combobox with data While Not($Started) ; Infinity Cycle _MonitorEditState ($editCtrl, $editFlag, $__LISTVIEWCTRL, $LVINFO);<<<====== add this in your message loop<<<====== If $bCALLBACK_EVENT = True Then $bCALLBACK_EVENT = False Call($LVCALLBACK, $LVINFO) EndIf Sleep(25) WEnd I attached files with my code and with @eltorro library. In the library I've commented string ; $pos[0] = $aINFO[2] - (($aINFO[2]+$aINFO[4])- $ctrlSize[2])_EIPListView_my.au3 SimpleCode.au3 -
Creating editable ListView control with 'OnEvent' mode
tolyasher replied to tolyasher's topic in AutoIt GUI Help and Support
Thanks to you an rhanks to @eltorro. Combobox in the fourth column is decision for me! I'll try to implement it. I thought about one more workaround: Below ListView control create Text Inputs controls for every column an copy data to inputs from selected row. After editing Text Inputs and pressing button "Store to Listview" update ListView columns with data from Text Inputs. Thanks to you again! -
Creating editable ListView control with 'OnEvent' mode
tolyasher replied to tolyasher's topic in AutoIt GUI Help and Support
Melba23, thank for your remark. I have made this code workable and executable. I have deleted other not valuable parts. This aplication should load some info from file (ListView1) after pressing 'Open' button. After that user can select required rows from left side and transfer selected to the right side (ListView2) by pressing ">" after that it is possible to save new data to the new file. So, execute, then press 'Open' then select row and press '>' after that it is supposed that user can change data in the ListView2 and save data to file. But I can not implement editing of ListView ( #include-once #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListView.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form=C:\Program Files\AutoIt3\koda\Templates\Test.kxf Global $Paused = False Global $Started = False Local $DualListDlg = GUICreate("Test", 921, 550, 202, 141, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS)) GUISetIcon("D:\007.ico") GUISetOnEvent($GUI_EVENT_CLOSE, "DualListDlgClose") GUISetOnEvent($GUI_EVENT_MINIMIZE, "DualListDlgMinimize") GUISetOnEvent($GUI_EVENT_MAXIMIZE, "DualListDlgMaximize") GUISetOnEvent($GUI_EVENT_RESTORE, "DualListDlgRestore") ;Local $ListView1 = GUICtrlCreateList("", 24, 32, 257, 227, BitOR($LBS_SORT,$LBS_STANDARD,$WS_VSCROLL,$WS_BORDER)) Local $ListView1 = GUICtrlCreateListView("Test Number|Test Name |Device|Protocol|Port", 16, 32, 418, 230 ) GUICtrlSetOnEvent($ListView1, "ListView1Click") Local $ListViewItems1[10] Local $GUICTRL_RIGHTARROW_BTN = GUICtrlCreateButton(">", 448, 48, 30, 25, $WS_GROUP) GUICtrlSetOnEvent($GUICTRL_RIGHTARROW_BTN, "RightArrowClick") Local $GUICTRL_RUNTESTSUIT__BTN = GUICtrlCreateButton("Run", 424, 424, 75, 25, $WS_GROUP) GUICtrlSetOnEvent($GUICTRL_RUNTESTSUIT__BTN, "RunSuitClick") Local $ListView2 = GUICtrlCreateListView("Test Number|Test Name |Device|Protocol|Port", 488, 32, 418, 230, BitOR($LVS_EDITLABELS, $LVS_SINGLESEL, $LVS_REPORT)) GUICtrlSetOnEvent($ListView2, "ListView2Click") Local $ListViewItems2[1] Local $GUICTRL_SAVESUIT_BTN = GUICtrlCreateButton("&Save", 688, 416, 75, 25, $WS_GROUP) GUICtrlSetOnEvent($GUICTRL_SAVESUIT_BTN, "SaveSuitClick") Local $GUICTRL_EXIT_BTN = GUICtrlCreateButton("&Exit", 424, 488, 75, 25, $WS_GROUP) GUICtrlSetOnEvent($GUICTRL_EXIT_BTN, "ExitClick") Local $GUICTRL_OPENSUIT__BTN = GUICtrlCreateButton("Open", 184, 416, 75, 25, $WS_GROUP) GUICtrlSetOnEvent($GUICTRL_OPENSUIT__BTN, "OpenSuitClick") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Func RightArrowClick() Local $currentItem = GUICtrlRead(GUICtrlRead($ListView1)) If UBound($ListViewItems2) ==1 Then $ListViewItems2[0] = GUICtrlCreateListViewItem($currentItem, $ListView2) Else _ArrayAdd($ListViewItems2, GUICtrlCreateListViewItem($currentItem, $ListView2)) EndIf EndFunc Func SaveSuitClick() EndFunc Func ExitClick() Exit EndFunc Func RunSuitClick() ;CALLTIP: This function executed after pressing 'Run' button. Start to executing Test Suit $Started = NOT $Started ; Set flag TRUE and start executing Test Suit GUICtrlSetState($GUICTRL_RUNTESTSUIT__BTN, $GUI_DISABLE) ; Disable 'Run' button EndFunc Func ContinueClick() ;CALLTIP: This function executed after pressing 'Continue' button $Paused = NOT $Paused ; Set flag False and continue executing Test Suit EndFunc Func OpenSuitClick() For $index=0 To 9 ; Cycle goes over $ListViewItems1[$index] = GUICtrlCreateListViewItem("Test"&$index&"|"&"Test"&$index&"|||"&"Test"&$index, $ListView1) Next EndFunc Func DualListDlgClose() Exit EndFunc Func DualListDlgMaximize() EndFunc Func DualListDlgMinimize() EndFunc Func DualListDlgRestore() EndFunc Func ListView1Click() EndFunc Func ListView2Click() Local $result= _GUICtrlListView_EditLabel($ListView2, 0) EndFunc While Not($Started) ;CALLTIP: This cycle like tap (stopper). Do not allow to start Test Suit. Suit will start just after pressing 'Run' button. Sleep(100) WEnd -
Hi guys, I am trying to create ListView control with possibility edit it (items in it). But afterdabble click just first column of selected item become editable. Therewith double click does not work properly. Label become editable from time to time. Is it possible to edit every label ? I use 'OnEvent' mode. I list peace of my code. Thank you in advance! Local $DualListDlg = GUICreate("Test-O-Matic", 921, 550, 202, 141, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS)) GUISetIcon("D:\007.ico") GUISetOnEvent($GUI_EVENT_CLOSE, "DualListDlgClose") GUISetOnEvent($GUI_EVENT_MINIMIZE, "DualListDlgMinimize") GUISetOnEvent($GUI_EVENT_MAXIMIZE, "DualListDlgMaximize") GUISetOnEvent($GUI_EVENT_RESTORE, "DualListDlgRestore") ;Local $ListView1 = GUICtrlCreateList("", 24, 32, 257, 227, BitOR($LBS_SORT,$LBS_STANDARD,$WS_VSCROLL,$WS_BORDER)) Local $ListView1 = GUICtrlCreateListView("Test Number|Test Name |Device|Protocol|Port", 16, 32, 418, 230) GUICtrlSetOnEvent($ListView1, "ListView1Click") Local $ListViewItems1[1] Local $GUICTRL_RIGHTARROW_BTN = GUICtrlCreateButton(">", 448, 48, 30, 25, $WS_GROUP) GUICtrlSetOnEvent($GUICTRL_RIGHTARROW_BTN, "RightArrowClick") Local $Button2 = GUICtrlCreateButton(">>", 448, 104, 31, 25, $WS_GROUP) GUICtrlSetOnEvent($Button2, "Button2Click") Local $GUICTRL_LEFTARROW_BTN = GUICtrlCreateButton("<", 448, 152, 31, 25, $WS_GROUP) GUICtrlSetOnEvent($GUICTRL_LEFTARROW_BTN, "LeftArrowClick") Local $GUICTRL_DOUBLELEFTARROW_BTN = GUICtrlCreateButton("<<", 448, 208, 32, 25, $WS_GROUP) GUICtrlSetOnEvent($GUICTRL_DOUBLELEFTARROW_BTN, "DoubleLeftArrowClick") Local $ListView2 = GUICtrlCreateListView("Test Number|Test Name |Device|Protocol|Port", 488, 32, 418, 230, BitOR($LVS_EDITLABELS, $LVS_SINGLESEL, $LVS_REPORT) ) GUICtrlSetOnEvent($ListView2, "ListView2Click") Local $ListViewItems2[1] Local $GUICTRL_SAVESUIT_BTN = GUICtrlCreateButton("&Save", 688, 416, 75, 25, $WS_GROUP) GUICtrlSetOnEvent($GUICTRL_SAVESUIT_BTN, "SaveSuitClick") Local $GUICTRL_EXIT_BTN = GUICtrlCreateButton("&Exit", 424, 488, 75, 25, $WS_GROUP) GUICtrlSetOnEvent($GUICTRL_EXIT_BTN, "ExitClick") Local $Button7 = GUICtrlCreateButton("&Help", 424, 520, 75, 25, $WS_GROUP) GUICtrlSetOnEvent($Button7, "Button7Click") Local $GUICTRL_RUNTESTSUIT__BTN = GUICtrlCreateButton("Run", 424, 424, 75, 25, $WS_GROUP) GUICtrlSetOnEvent($GUICTRL_RUNTESTSUIT__BTN, "RunSuitClick") Local $GUICTRL_CONTINUE__BTN = GUICtrlCreateButton("&Continue", 424, 456, 75, 25, $WS_GROUP) GUICtrlSetState($GUICTRL_CONTINUE__BTN, $GUI_DISABLE) GUICtrlSetOnEvent($GUICTRL_CONTINUE__BTN, "ContinueClick") Local $GUICTRL_OPENSUIT__BTN = GUICtrlCreateButton("Open", 184, 416, 75, 25, $WS_GROUP) GUICtrlSetOnEvent($GUICTRL_OPENSUIT__BTN, "OpenSuitClick") Local $GUICTRL_RIGHTNEEDLE_BTN = GUICtrlCreateButton("->", 448, 296, 35, 25, $WS_GROUP) GUICtrlSetOnEvent($GUICTRL_RIGHTNEEDLE_BTN, "RightNeedleClick") Local $Input1_FileName = GUICtrlCreateInput("IntegTest.ini", 16, 384, 385, 21) GUICtrlSetOnEvent($Input1_FileName, "Input1_FileNameChange") Local $Input2_FileName = GUICtrlCreateInput("NewTestSuit.ini", 528, 384, 377, 21) GUICtrlSetOnEvent($Input2_FileName, "Input2_FileNameChange") Local $Label1_CommSetting1 = GUICtrlCreateLabel("Common Settings:", 48, 296, 112, 20) GUICtrlSetFont($Label1_CommSetting1, 10, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($Label1_CommSetting1, "Label1_CommSetting1Click") Local $Label2_CommSetting2 = GUICtrlCreateLabel("Common Settings:", 528, 296, 112, 20) GUICtrlSetFont($Label2_CommSetting2, 10, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($Label2_CommSetting2, "Label2_CommSetting2Click") Local $Label3_Port1 = GUICtrlCreateLabel("Port", 352, 272, 28, 20) GUICtrlSetFont($Label3_Port1, 10, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($Label3_Port1, "Label3_Port1Click") Local $Label4_Port2 = GUICtrlCreateLabel("Port", 832, 272, 28, 20) GUICtrlSetFont($Label4_Port2, 10, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($Label4_Port2, "Label4_Port2Click") Local $Label5_Protocol1 = GUICtrlCreateLabel("Protocol", 280, 272, 54, 20) GUICtrlSetFont($Label5_Protocol1, 10, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($Label5_Protocol1, "Label5_Protocol1Click") Local $Label6_Protocol2 = GUICtrlCreateLabel("Protocol", 760, 272, 54, 20) GUICtrlSetFont($Label6_Protocol2, 10, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($Label6_Protocol2, "Label6_Protocol2Click") Local $Label7_Device1 = GUICtrlCreateLabel("Device", 224, 272, 47, 20) GUICtrlSetFont($Label7_Device1, 10, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($Label7_Device1, "Label7_Device1Click") Local $Label8_Device2 = GUICtrlCreateLabel("Device", 704, 272, 47, 20) GUICtrlSetFont($Label8_Device2, 10, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($Label8_Device2, "Label8_Device2Click") Local $Label9_OS1 = GUICtrlCreateLabel("OS", 176, 272, 23, 20) GUICtrlSetFont($Label9_OS1, 10, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($Label9_OS1, "Label9_OS1Click") Local $Label10_OS2 = GUICtrlCreateLabel("OS", 656, 272, 23, 20) GUICtrlSetFont($Label10_OS2, 10, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($Label10_OS2, "Label10_OS2Click") Local $Input3_Port1 = GUICtrlCreateInput("", 344, 296, 49, 21) GUICtrlSetBkColor($Input3_Port1, 0xFFFFFF) GUICtrlSetState($Input3_Port1, $GUI_DISABLE) GUICtrlSetOnEvent($Input3_Port1, "Input3_Port1Change") Local $Input4_Protocol1 = GUICtrlCreateInput("", 280, 296, 57, 21) GUICtrlSetBkColor($Input4_Protocol1, 0xFFFFFF) GUICtrlSetState($Input4_Protocol1, $GUI_DISABLE) GUICtrlSetOnEvent($Input4_Protocol1, "Input4_Protocol1Change") Local $Input5_Device1 = GUICtrlCreateInput("", 224, 296, 49, 21) GUICtrlSetBkColor($Input5_Device1, 0xFFFFFF) GUICtrlSetState($Input5_Device1, $GUI_DISABLE) GUICtrlSetOnEvent($Input5_Device1, "Input5_Device1Change") Local $Input6_OS1 = GUICtrlCreateInput("", 168, 296, 49, 21) GUICtrlSetBkColor($Input6_OS1, 0xFFFFFF) GUICtrlSetState($Input6_OS1, $GUI_DISABLE) GUICtrlSetOnEvent($Input6_OS1, "Input6_OS1Change") Local $Input7_OS2 = GUICtrlCreateInput("", 648, 296, 49, 21) GUICtrlSetOnEvent($Input7_OS2, "Input7_OS2Change") Local $Input8_Device2 = GUICtrlCreateInput("", 704, 296, 49, 21) GUICtrlSetOnEvent($Input8_Device2, "Input8_Device2Change") Local $Input9_Protocol2 = GUICtrlCreateInput("", 760, 296, 57, 21) GUICtrlSetOnEvent($Input9_Protocol2, "Input9_Protocol2Change") Local $Input10_Port2 = GUICtrlCreateInput("", 824, 296, 49, 21) GUICtrlSetOnEvent($Input10_Port2, "Input10_Port2Change") GUISetState(@SW_SHOW)
-
Start / Stop / Pause scripting
tolyasher replied to tolyasher's topic in AutoIt GUI Help and Support
Yes, this way used hotkeys. What about GUI buttons ? Start/Stop and Pause/Continue ? How to start loop While 1 ;Some stuff WEnd from the GUI, 'Pause' it and the 'Continue' from GUI. For example, I need to test some application and need to do some operations with application. Therefore I should firstly configure my script and then start to perform (Start button).Then while in the process of the testing (performing script operations) I need to perform some additional configuration of the script (enable or disable some checkboxes in the GUI that administrate my testing script (script will recognize it as adding or removing some instructions)). Therefore I need to pause script ('Pause' button), reconfigure script and then 'Continue' scripting. So, in a few words I need to write certain Administrator program for testing some applications. -
Start / Stop / Pause scripting
tolyasher replied to tolyasher's topic in AutoIt GUI Help and Support
I found that I can add next code and did it with hotkeys. So it will be like combination of the hotkeyes and GUI events : Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) WEnd EndFunc Func Terminate() Exit 0 EndFunc Func StartButtonclick() $Paused = NOT $Paused EndFunc Func StopButtonclick() ; ??? TogglePause() will not work here :(( EndFunc May be another way here ? ... without hotkeys "TogglePause" working fine after hotkey but as in the part of the "StopButtonclick" it is not OK. But I still could not find the way how to start perform 'While' loop after pressing button 'Run' (but not automatically as default) -
Hi guys, Is it possible to Start / Stop and pause scripting from the GUI? For example I have a GUI with GUIOnEventMode=True. And I have a buttons "Run" (should start scripting, writing any data to the file for example), "Stop" (should stop writing data to the file, but after pressing "Run" it should start writing again from previous position). While 1 FileWriteLine("Line 1") FileWriteLine("Line 2") FileWriteLine("Line 3") FileWriteLine("Line 4") WEnd Local $Stop = GUICtrlCreateButton("Stop", 172, 47, 30, 25, $WS_GROUP) GUICtrlSetOnEvent($Button1, "StopButtonclick") Local $Start = GUICtrlCreateButton("Start", 172, 80, 31, 25, $WS_GROUP) GUICtrlSetOnEvent($Button2, "StartButtonclick") Func StopButtonclick() ;Script should stop perform 'While' loop after pressing 'Stop' button. If it stopped between 'Line 2' and 'Line 3' then after next pressing 'Start' it should start from 'Line 3' EndFunc Func StartButtonclick() ;Script should start perform 'While' loop after pressing 'Start' button EndFunc p.s. thank you in advance
-
Qustion about FileReadLine
tolyasher replied to tolyasher's topic in AutoIt General Help and Support
Thank you very much. I thought that "ConsoleWrite" do not affect error flag because it do not described in the AutoIT Help -
I have small question related to code below: Code 1 (This code is working properly): While 1 Local $LineRead = FileReadLine($hFile) If (@error = -1) Then ExitLoop ConsoleWrite( " " & @error & @CRLF) ConsoleWrite( " " & $LineRead & @CRLF) WEnd Code 2 ( I see that '@error = -1' in the Console but this code is never stop): While 1 Local $LineRead = FileReadLine($hFile) ConsoleWrite( " " & @error & @CRLF) If (@error = -1) Then ExitLoop ConsoleWrite( " " & $LineRead & @CRLF) WEnd Why? Thanks in advance!
-
Thank you for your participation. I did not find the way how to use AutoIt Window Info for tooltips. Tooltips appear below the mouse
-
- Thank you very much for your answer. Your code is very helpful for growing my experience in AutoIT Your code is working properly in many applications. But in my case it does not work (may be in my application used other class for tooltips) - "I think the $ID is the id you used when you created the toolbar component as in"..... I am not a developer of this application. I just test this application and I know that GUI of this app developed on Visual Basic. - I can not understand why _GUIToolTip_GetTitleText and _GUIToolTip_GetText do not work but _GUIToolTip_GetToolCount and _GUIToolTip_ToolExists work properly
-
Hi Guys, I have a task to verify correctness tooltips text in application. (testing purpose) But I could not get the text of tooltips. I found function _GUIToolTip_GetText($hWnd, $hTool, $iID), but I can not get $iID. Piece of my code below: Local $hWnd = WinGetHandle($wnd[$IDX_WND_NAME],$wnd[$IDX_WND_TEXT]) ; working properly Local $hToolbar = ControlGetHandle($wnd[$IDX_WND_NAME],$wnd[$IDX_WND_TEXT],"[CLASS:msvb_lib_toolbar;INSTANCE:5]") ; working properly Local $hTooltips = _GUICtrlToolbar_GetToolTips($hToolbar) ; working properly Local $TextToolTip = _GUIToolTip_GetText($toolTips, $hWnd, $iID) ; I do not know how to get 3-d parameter $iID (I tried Index of tooltips element $iID = [0..6] (I have 7 tooltips and 7 toolbars elements) - but it does not work ) in the end of this script TextToolTip="" (empty string) Could anybody help me to get the tooltips text. Thanks in advance.