Jump to content

A shortlist of short List questions


Guy_
 Share

Recommended Posts

Been using GUICtrlCreateList for the first time in the last few days and am wondering for how many currently perceived shortcomings I am still to blame... ;)

Been scanning some of the special settings here and there, but currently still wondering about these...

Even "yes" or "no" can be helpful. More is welcome if it saves me some hours  :)

1) When wanting to hilite a List item with the help of GUICtrlSetData ( $myList, data, $hiliteThisItem ), my impression is that this is not case sensitive? If not, can this be set to be so? [solved, if *not* using $LBS_EXTENDEDSEL only?]

2) Is it possible to have right-clicking an item also immediately making it the active item (highlight it)...?

3) Is manually dragging items for custom sorting possible?

4) While using my scroll wheel inside a List, I've been hearing some beeps, as if it wanted to tell me when I got to the edge of either end. However, it does not seem to work consistently and I don't want these sounds anyway. Are they from AutoIt and can I disable them?

5) Is it possible to multi-select items?  (à la Ctrl-click) [solved with $LBS_EXTENDEDSEL]

6) [non-List question] Is it possible that using the Return key inside a GUICtrlCreateInput field activates a Function?

Thanks for any tips!

Edited by Guy_
Link to comment
Share on other sites

5) Is it possible to multi-select items?  (à la Ctrl-click)

 

www.autoitscript.com/forum/topic/141202-simple-gui-with-listbox-and-some-functions/page__view__findpost__p__992976

EDIT: normal link was broken, so link only in TXT way ... (new cripled forum is really hell :-( )

Edited by Zedna
Link to comment
Share on other sites

Thanks & sorry..., there *was* a huge oversight on my part... :>

(5) is kinda solved now by including $LBS_EXTENDEDSEL

However...

I had solved (1) by using ...

$_idx = _GUICtrlListBox_FindString ($idList, $newItem, 1) ; find item (case sens.)
_GUICtrlListBox_SetCurSel(($idList, $_idx)

But after adding $LBS_EXTENDEDSEL the above scrollTo & hilite code does not work anymore... (and neither does the 'Default' parameter in GUICtrlSetData)

I figured by prepending a "Select none" to the prev. 2 lines it might work again, but it doesn't...

_GUICtrlListBox_SelectString ( $idList, "")

Is that a known limitation, or do I need to unset something else first...?

Edited by Guy_
Link to comment
Share on other sites

2) Yes. in the same manner as point 3) if not in other ways.

3) See Drag-and-drop reordering listbox. Note that subclassing is much easier implemented with the four functions SetWindowSubclass, GetWindowSubclass, RemoveWindowSubclass and DefSubclassProc (all implemented in WinAPIShellEx.au3) than with _WinAPI_SetWindowLong.

4) I have never heard beeps when I have used the scrool wheel in a listbox. I think it has something to do with your specific code.

Have you looked at GUICtrlCreateListView and the GuiListView UDF? A listview is an advanced version of a listbox. Because a listview natively supports more functionality than a listbox most of your questions are easier to implement for a listview than for a listbox. Also the forums contains many more questions/answers and code examples for listviews than for listboxes. GUIListViewEx is a very popular example.

6) This can be implemented with GUISetAccelerators.

Edited by LarsJ
Link to comment
Share on other sites

Thank you Larsj! Very helpful  :)

Have you looked at GUICtrlCreateListView and the GuiListView UDF?

Just discovered it. When I looked at a Listview example yesterday it reminded me of Excel or _ArrayDisplay() and I was like "No, that's not what I need at the moment." But I will look at the UDF to see if it can be a simple box too.

 

6) This can be implemented with GUISetAccelerators.

I was figuring as much when running across that after my opening post. Good to have confirmation.

Link to comment
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
 Share

×
×
  • Create New...