Tiger Posted March 17, 2007 Share Posted March 17, 2007 Hello AutoIt-Fans, how can I check witch Test is marked. In the Listviews are Checkboxes. ListView: Test | Description Software Testing the new Software My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
MrCreatoR Posted March 17, 2007 Share Posted March 17, 2007 Hi, wellcom to forum! See in the help file for _GUICtrlListViewGetCheckedState(). Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
Tiger Posted March 17, 2007 Author Share Posted March 17, 2007 Thanks, but I will check witch Test is marked. Not the ListView Numbers ListView: Test | Description Software Testing the new Software Test Software is marked, when I click auf Next wenn show a MsgBox in this box is the name of the marked Test. Here Software My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 17, 2007 Moderators Share Posted March 17, 2007 (edited) Thanks, but I will check witch Test is marked. Not the ListView NumbersListView:Test | DescriptionSoftware Testing the new SoftwareTest Software is marked, when I click auf Next wenn show a MsgBox in this box is the name of the marked Test. Here SoftwareHere's a question, he gave you an answer, and from the time he posted, to the time you posted, there's practically no way you could have even tried to see if it worked, if you were experienced in AutoIt maybe, but the fact you are asking this question, and the way you are asking it, makes me think you are not.... but the question... did you bother to even try his suggestion? Edited March 17, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Tiger Posted March 17, 2007 Author Share Posted March 17, 2007 I have testing this answer. but not yet, i have testing this yesterday. My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 17, 2007 Moderators Share Posted March 17, 2007 I have testing this answer. but not yet, i have testing this yesterday.Then to help us help you, and not waste anymore of your time and more importantly ours. Provide a working/runnable example script (something small), and comment what you would like to see. Without you providing the tools necessary to help you, you're only chasing your tail. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Tiger Posted March 17, 2007 Author Share Posted March 17, 2007 (edited) I have testing. Here is a pictureexpandcollapse popup#include <GuiConstants.au3> #include <GuiListView.au3> opt('MustDeclareVars', 1) Dim $listview, $Btn_Get, $Btn_Exit, $msg, $Status, $ret GUICreate("ListView Get Checked State", 392, 322) $listview = GUICtrlCreateListView("col1|col2|col3", 40, 30, 310, 149) GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES) GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT) GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_CHECKBOXES, $LVS_EX_CHECKBOXES) GUICtrlCreateListViewItem("index 0|data1|more1", $listview) GUICtrlCreateListViewItem("index 1|data2|more2", $listview) GUICtrlCreateListViewItem("index 2|data3|more3", $listview) GUICtrlCreateListViewItem("index 3|data4|more4", $listview) GUICtrlCreateListViewItem("index 4|data5|more5", $listview) _GUICtrlListViewSetColumnWidth ($listview, 0, 100) $Btn_Get = GUICtrlCreateButton("Get From Index 2", 150, 200, 90, 40) $Btn_Exit = GUICtrlCreateButton("Exit", 300, 260, 70, 30) $Status = GUICtrlCreateLabel("", 0, 302, 392, 20, BitOR($SS_SUNKEN, $SS_CENTER)) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit ExitLoop Case $msg = $Btn_Get GUICtrlSetData($Status, "") Local $is_Checked = _GUICtrlListViewGetCheckedState ($listview, 2) If ($is_Checked <> $LV_ERR) Then If ($is_Checked) Then GUICtrlSetData($Status, "Item is Checked") Else GUICtrlSetData($Status, "Item not Checked") EndIf EndIf EndSelect WEnd Exit Edited March 17, 2007 by Tiger My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 17, 2007 Moderators Share Posted March 17, 2007 (edited) And what part of the "Help File" example doesn't work for you? On my XP Pro SP2 it is working fine. Are you using Vista? Edit: Wait... Your picture shows it is working!! Edited March 17, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Tiger Posted March 17, 2007 Author Share Posted March 17, 2007 (edited) On my Internet PC have I XP. Edit: by the Function _GUICtrlListViewGetCheckedState ($listview, 2) you can check with the number, bu how can i check with the Name of the test Edited March 17, 2007 by Tiger My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 17, 2007 Moderators Share Posted March 17, 2007 On my Internet PC have I XP.Read my edit. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 17, 2007 Moderators Share Posted March 17, 2007 by the Function _GUICtrlListViewGetCheckedState ($listview, 2) you can check with the number, bu how can i check with the Name of the testUgh... I am assuming English is not your native language... so can you (by example ... like commenting in the code) show us what you mean by "Name"? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Tiger Posted March 17, 2007 Author Share Posted March 17, 2007 Test | Description Software Testing the new Software Name = Test My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 17, 2007 Moderators Share Posted March 17, 2007 Try this:expandcollapse popup#include <GuiConstants.au3> #include <GuiListView.au3> #include <array.au3> opt('MustDeclareVars', 1) Dim $listview, $Btn_Get, $Btn_Exit, $msg, $Status, $ret GUICreate("ListView Get Checked State", 392, 322) $listview = GUICtrlCreateListView("col1|col2|col3", 40, 30, 310, 149) GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES) GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT) GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_CHECKBOXES, $LVS_EX_CHECKBOXES) GUICtrlCreateListViewItem("index 0|data1|more1", $listview) GUICtrlCreateListViewItem("index 1|data2|more2", $listview) GUICtrlCreateListViewItem("index 2|data3|more3", $listview) GUICtrlCreateListViewItem("index 3|data4|more4", $listview) GUICtrlCreateListViewItem("index 4|data5|more5", $listview) _GUICtrlListViewSetColumnWidth ($listview, 0, 100) $Btn_Get = GUICtrlCreateButton("Get From Index 2", 150, 200, 90, 40) $Btn_Exit = GUICtrlCreateButton("Exit", 300, 260, 70, 30) $Status = GUICtrlCreateLabel("", 0, 302, 392, 20, BitOR($SS_SUNKEN, $SS_CENTER)) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit ExitLoop Case $msg = $Btn_Get GUICtrlSetData($Status, "") Local $is_Checked = _GUICtrlListViewTextCheckState($listview, 'index 2', 1) If ($is_Checked <> $LV_ERR) Then If ($is_Checked) Then GUICtrlSetData($Status, "Item is Checked") Else GUICtrlSetData($Status, "Item not Checked") EndIf EndIf EndSelect WEnd Func _GUICtrlListViewTextCheckState($hLV, $sName, $nIndex) Local $aLVArray = '' For $iCC = 0 To _GUICtrlListViewGetItemCount($hLV) $aLVArray = _GUICtrlListViewGetItemTextArray($hLV, $iCC) If IsArray($aLVArray) And $aLVArray[$nIndex] = $sName Then Return _GUICtrlListViewGetCheckedState($hLV, $iCC) EndIf Next Return SetError(2, 0, 0) EndFunc Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Tiger Posted March 17, 2007 Author Share Posted March 17, 2007 Thanks. I have this testing and it's ver good. Another problem, when i'm click on a listview. can i show a gui with details My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 17, 2007 Moderators Share Posted March 17, 2007 Thanks. I have this testing and it's ver good. Another problem, when i'm click on a listview. can i show a gui with detailsYour question is so broad, the only answer I can give is yes. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Tiger Posted March 17, 2007 Author Share Posted March 17, 2007 With GUICtrlSetOnEvent? My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 17, 2007 Moderators Share Posted March 17, 2007 With GUICtrlSetOnEvent?Probably more like GUIRegisterMsg() ... but again, I have no idea what you are really talking about. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Tiger Posted March 17, 2007 Author Share Posted March 17, 2007 Ok. When I click of ListViewItem, when must show a gui with infos. My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 17, 2007 Moderators Share Posted March 17, 2007 Ok. When I click of ListViewItem, when must show a gui with infos.I understand that part... what I'm saying is your question is still to broad. I'm going to stick with my original answer and say, learn to use GUIRegisterMsg(), we have no idea what your GUI does or what conditions you want to set to show whatever, or how you even plan on showing it. Again, we are back to a poor description (You didn't think out your question), and no code to base what you want off of, you got lucky with the help file last time, don't think you'll be so lucky posting a Help snippet this time. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now