Sign in to follow this  
Followers 0
chssoccer

Listview

10 posts in this topic

Hi,

How do I make a filter in my GUI where it searches a certain column for a certain word and every listview that doesn't contain that word will be hidden?

Thanks.

Share this post


Link to post
Share on other sites



How about you show us what you've attempted and we'll help you sort it out.


Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Share this post


Link to post
Share on other sites

Hi,

How do I make a filter in my GUI where it searches a certain column for a certain word and every listview that doesn't contain that word will be hidden?

Thanks.

Are you using the native GuiCtrlCreateListView() or the GuiListView.au3 UDF to create the control (or is it a third-party app)? It matters because there are handy new functions like _GUICtrlListView_GetItemTextArray() to make that task easier, but they have issues working with controls created with the old native functions.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Are you using the native GuiCtrlCreateListView() or the GuiListView.au3 UDF to create the control (or is it a third-party app)? It matters because there are handy new functions like _GUICtrlListView_GetItemTextArray() to make that task easier, but they have issues working with controls created with the old native functions.

:)

I'm using the native where its like GUICtrlCreateListView(), version 3.2.8.1.

Share this post


Link to post
Share on other sites

I'm using the native where its like GUICtrlCreateListView(), version 3.2.8.1.

Then you will use ControlListView() with the "FindItem" command.

But you should be learning to use the new UDFs in the meantime...

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Are you using the native GuiCtrlCreateListView() or the GuiListView.au3 UDF to create the control (or is it a third-party app)? It matters because there are handy new functions like _GUICtrlListView_GetItemTextArray() to make that task easier, but they have issues working with controls created with the old native functions.

I haven't experienced anything like that, although maybe that's just lucky me.

But I'd say, on the contrary, ..._Create() functions produce more troubles than they're worth, as if losing access to quick native read/update functions and events wasn't enough.

Lets say this open bug http://www.autoitscript.com/forum/index.php?showtopic=61031 for example, which works fine if listview is usual GuiCtrlCreate... and hangs GUI if it's API created listview.

I can't think of any good reason to chose API creation UDFs over native GuiCtrlCreate... wrappers.

I always use native creation in my apps, and I've had some rare issues with failing to get good values from some listview/treeview structures in 1 or 2 notification message, where according to MSDN there should be proper values, and they just weren't there, but the tasks that required them could be solved simply by using some different approach.

Most "problem" topics related to GUI functions not working come up because noobs pay no attention to parameters and returns (not realising difference of control IDs vs handles, or control IDs vs index values, etc), in other words, they simply don't RTFM.

Edited by Siao

"be smart, drink your wine"

Share this post


Link to post
Share on other sites

Then you will use ControlListView() with the "FindItem" command.

But you should be learning to use the new UDFs in the meantime...

:)

What is subitem for?

Share this post


Link to post
Share on other sites

Ok this is what I have so far but I still don't know how to accomplish what I said in my first post here.

$zItems = ControlListView("Buddy List - v1.0", "", 89, "FindItem", "Pot Limit")
    $zcount = _GUICtrlListViewGetItemCount($sListview)
    $zcount = $zcount - 1
    For $t = 0 To $zcount
        ControlHide("Full Tilt Buddy List - v1.0", "", $t); "supposedly" to hide the items that don't contain the text "Pot Limit"
        Next
    MsgBox(0, "", $t)

Share this post


Link to post
Share on other sites

Ok this is what I have so far but I still don't know how to accomplish what I said in my first post here.

$zItems = ControlListView("Buddy List - v1.0", "", 89, "FindItem", "Pot Limit")
    $zcount = _GUICtrlListViewGetItemCount($sListview)
    $zcount = $zcount - 1
    For $t = 0 To $zcount
        ControlHide("Full Tilt Buddy List - v1.0", "", $t); "supposedly" to hide the items that don't contain the text "Pot Limit"
        Next
    MsgBox(0, "", $t)
1. _GUICtrlListViewGetItemCount() expects a control handle, not a string (What is $sListView?).

2. The native method to get the item count is: $zcount = ControlListView("Buddy List - v1.0", "", 89, "GetItemCount")

3. I don't know how to "hide" an item with either native or UDF functions. Doesn't mean it can't be done, just that you need smarter help than me...

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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