GodForsakenSoul Posted October 30, 2010 Share Posted October 30, 2010 well, i learned how to do checkboxes in listview, but i can't seem to read their state. i tried GuiCtrlGetState(), but i got the integer 80 from it. whether it is checked or not, i got 80. i trie GuiCtrlRead(), but got whatever it was in the listview, in the helpfile example case, "item3|col32|col33". I don't seem to get this to work properly. so... i need one of two things, either to figure out how to use the listview checkbox, or, aletrnatively, something else that works. Link to comment Share on other sites More sharing options...
BugFix Posted October 30, 2010 Share Posted October 30, 2010 Example from help file (_GUICtrlListView_GetItemChecked): expandcollapse popup#include <GuiConstantsEx.au3> #include <GuiListView.au3> Opt('MustDeclareVars', 1) $Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work _Main() Func _Main() Local $hListView GUICreate("ListView Get Item Checked State", 400, 300) $hListView = GUICtrlCreateListView("", 2, 2, 394, 268) _GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES)) GUISetState() ; Add columns _GUICtrlListView_AddColumn($hListView, "Column 1", 100) _GUICtrlListView_AddColumn($hListView, "Column 2", 100) _GUICtrlListView_AddColumn($hListView, "Column 3", 100) ; Add items _GUICtrlListView_AddItem($hListView, "Row 1: Col 1", 0) _GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 2", 1) _GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 3", 2) _GUICtrlListView_AddItem($hListView, "Row 2: Col 1", 1) _GUICtrlListView_AddSubItem($hListView, 1, "Row 2: Col 2", 1) _GUICtrlListView_AddItem($hListView, "Row 3: Col 1", 2) ; Check item 2 _GUICtrlListView_SetItemChecked($hListView, 1) MsgBox(4160, "Information", "Item 2 Checked: " & _GUICtrlListView_GetItemChecked($hListView, 1)) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Main Best Regards BugFix Link to comment Share on other sites More sharing options...
GodForsakenSoul Posted October 30, 2010 Author Share Posted October 30, 2010 uh... huh... your example doesn't work. Error opening memory.au3 also, it doesn't let me play with the example. it automatically does #2, AND i don't like this particular line. MsgBox(4160, "Information", "Item 2 Checked: " & _GUICtrlListView_GetItemChecked($hListView, 1)) your example has only been designed for item 2, despite whether or not you're willing to pick it. Link to comment Share on other sites More sharing options...
BugFix Posted October 31, 2010 Share Posted October 31, 2010 (edited) Now i've modified it. So you can set checked and read check-state by yourself: expandcollapse popup#include <GuiConstantsEx.au3> #include <GuiListView.au3> Opt('MustDeclareVars', 1) $Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work _Main() Func _Main() Local $hListView, $btn, $state GUICreate("ListView Get Item Checked State", 400, 300) $hListView = GUICtrlCreateListView("", 2, 2, 394, 268) _GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES)) $btn = GUICtrlCreateButton('Check State', 160, 275, 80, 20) GUISetState() ; Add columns _GUICtrlListView_AddColumn($hListView, "Column 1", 100) _GUICtrlListView_AddColumn($hListView, "Column 2", 100) _GUICtrlListView_AddColumn($hListView, "Column 3", 100) ; Add items _GUICtrlListView_AddItem($hListView, "Row 1: Col 1", 0) _GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 2", 1) _GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 3", 2) _GUICtrlListView_AddItem($hListView, "Row 2: Col 1", 1) _GUICtrlListView_AddSubItem($hListView, 1, "Row 2: Col 2", 1) _GUICtrlListView_AddItem($hListView, "Row 3: Col 1", 2) ; Loop until user exits While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete() ExitLoop Case $btn $state = '' For $i = 0 To _GUICtrlListView_GetItemCount($hListView) -1 If _GUICtrlListView_GetItemChecked($hListView, $i) Then $state &= $i & ', ' Next If $state <> '' Then MsgBox(0, '', 'Index checked Item: ' & StringTrimRight($state, 2)) EndSwitch WEnd EndFunc ;==>_Main Edited October 31, 2010 by BugFix Best Regards BugFix Link to comment Share on other sites More sharing options...
GodForsakenSoul Posted October 31, 2010 Author Share Posted October 31, 2010 one last question: i want to analize (sp?) the UDF's myself. i follow the "if you want something done right, you oughtta do it yourslef" thing. i have never went so deep into autoit actually... where do i find these UDF's? meanwhile, i shall play with your example. Link to comment Share on other sites More sharing options...
BugFix Posted October 31, 2010 Share Posted October 31, 2010 where do i find these UDF's?Open the iclude file ( #include <GuiListView.au3> ).To do this in SciTE: place cursor between the chars of this include-line. Than hit "Alt+i" - now the file will opened. Best Regards BugFix Link to comment Share on other sites More sharing options...
guinness Posted October 31, 2010 Share Posted October 31, 2010 Than hit "Alt+i"Wow, I learnt something today UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
GEOSoft Posted October 31, 2010 Share Posted October 31, 2010 In addition to what BugFix posted, you can find all the standard UDFs in your AutoIt3\Include\ folder. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" 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