HighGuy Posted January 7, 2005 Posted January 7, 2005 Hi, has anyone already found a solution for sorting a ListView when clicking on a column header (and maybe reverse sorting when clicking on it again)?
jpm Posted January 7, 2005 Posted January 7, 2005 Hi,has anyone already found a solution for sorting a ListView when clicking on a column header (and maybe reverse sorting when clicking on it again)?<{POST_SNAPBACK}>as stated in the doc it is not implemented. It looks like to much code to do event from the script side.
LazyCoder Posted January 7, 2005 Posted January 7, 2005 (edited) Indeed, I've done something like that (that's the main reason of my interest in sort algorithms to sort 2D array encording to a given subentry... look here)As soon as I'll have removed my private code, I'll post here sample version, to show you. Edited January 7, 2005 by LazyCoder A good program computing A into B is mostly one that won't crash in all the other cases...
LazyCoder Posted January 7, 2005 Posted January 7, 2005 (edited) OK, let's test this... In fact I've implemented a lot of functions to easily fulfill my ListView and get its data from a file but, anyway, with this, everyone is free to do this his own way! Enjoy! Two little things: 1) There is no bug when sorting the fifth column, but as we are sorting strings, "12" comes before "7" cause it starts with "1"... just to be sure, look, the letters are re-ordered the way they should 2) All this came thanks to a Canadian friend of mine, the same who made me discover AutoIt, so many thanks to him (and if Jon, that my friend simply calls "God", could just drop a line for him, I'm sure it will make his whole day shine even more) [Edit:] I forgot to add that I made this as AutoIt code, not as C++ modified code to define a general behavior... it's just a workaround as long as it's not implemented by our AutoIt development fellows!ListViewSort.zip Edited January 7, 2005 by LazyCoder A good program computing A into B is mostly one that won't crash in all the other cases...
jpm Posted January 7, 2005 Posted January 7, 2005 @Lazycoder, Looking at the code, it is exactly why I didn't put something inside AutoIT. On Click on one column the script need to resync the ControlId of the items and the data. So it is needed that the script memorize the new Controlid related to a specific raw. It will be possible if the script memorize the data to be in sync as you did. Congratulation you grade A in AutoIt GUI.
LazyCoder Posted January 7, 2005 Posted January 7, 2005 Thank you very much. And, to tell more, I'm currently working on multi-sort capabilities... A good program computing A into B is mostly one that won't crash in all the other cases...
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