Sign in to follow this  
Followers 0
Tiger

ListViews

19 posts in this topic

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

Share this post


Link to post
Share on other sites



Hi, wellcom to forum!

See in the help file for _GUICtrlListViewGetCheckedState().


Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: 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 Program

AutoIt_Icon_small.pngUDFs: 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
 
AutoIt_Icon_small.pngExamples: 
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 AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Here'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 by SmOke_N

[center]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.[/center]

Share this post


Link to post
Share on other sites

I have testing this answer. but not yet, i have testing this yesterday.


My UDFs:- _RegEnumKey

Share this post


Link to post
Share on other sites

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.

[center]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.[/center]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I have testing. Here is a picture

Posted Image

#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 by Tiger

My UDFs:- _RegEnumKey

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 by SmOke_N

[center]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.[/center]

Share this post


Link to post
Share on other sites

#9 ·  Posted (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 by Tiger

My UDFs:- _RegEnumKey

Share this post


Link to post
Share on other sites

On my Internet PC have I XP.

Read my edit.

[center]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.[/center]

Share this post


Link to post
Share on other sites

by the Function _GUICtrlListViewGetCheckedState ($listview, 2) you can check with the number, bu how can i check with the Name of the test

Ugh... 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"?

[center]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.[/center]

Share this post


Link to post
Share on other sites

Test | Description

Software Testing the new Software

Name = Test


My UDFs:- _RegEnumKey

Share this post


Link to post
Share on other sites

Try this:

#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


[center]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.[/center]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Your question is so broad, the only answer I can give is yes.

[center]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.[/center]

Share this post


Link to post
Share on other sites

With GUICtrlSetOnEvent?

Probably more like GUIRegisterMsg() ... but again, I have no idea what you are really talking about.

[center]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.[/center]

Share this post


Link to post
Share on other sites

Ok. When I click of ListViewItem, when must show a gui with infos.


My UDFs:- _RegEnumKey

Share this post


Link to post
Share on other sites

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.

[center]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.[/center]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0