KaFu Posted July 27, 2009 Share Posted July 27, 2009 (edited) Hello Community,I decided to release this collection of functions to create a Treeview browser as a standalone product because I hope to get some input for further improvements this way (esp. Vista and Win7 compatibility, as I don't have these OS installed). I utilize them in both my programs AMT and SMF (see sig).ShellTristateTreeViewv39, 2010-Aug-14For sure the code itself is really dirty (e.g. the WM_NOTIFY needs unification), breaks any convention, and contains enough useless variables etc. pp...But I'll be happy about any help offered to clean up this quiet complex piece of code and to learn ways to further improve these functions and to share them with the community >_< ...Kudos to Holger Kotsch and R.Gilman (a.k.a. rasim) for (large) parts of the code, if you find portions written by yourself please let me know so that I can add you to the Kudos list ... 2009-Jul-27, v272010-Aug-14, v39RegardsShellTristateTreeView_v27.zipShellTristateTreeView_v39.zip Edited August 14, 2010 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
sliceofpie Posted July 29, 2010 Share Posted July 29, 2010 Thank you for posting KaFu! I'm trying to use your TreeView for a FTP sync tool. And the look and feel is almost exactly what I was looking for! Link to comment Share on other sites More sharing options...
KaFu Posted July 30, 2010 Author Share Posted July 30, 2010 Thanks for the nice feedback . Hmmm, my most recent version I use for SMF is v38 , but that's heavily in-cooperated into SMF. When the next release of that one is finished, I'll extract the relevant code and do an update to this one as well ... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
sliceofpie Posted August 3, 2010 Share Posted August 3, 2010 Perfect! Can't wait to see it. Link to comment Share on other sites More sharing options...
sliceofpie Posted August 3, 2010 Share Posted August 3, 2010 (edited) ..having some trouble with running the example file. When I run ShellTriStateTreeView_v27_Example it tells me that $TVM_GETITEM and $TVM_SETITEM are not declared. I added "Global $TVM_GetItem, $TVM_SetItem" but when I do that it won't go to the next screen and display the directories/files that I selected. Any help would be appreciated. Edited August 4, 2010 by sliceofpie Link to comment Share on other sites More sharing options...
sliceofpie Posted August 4, 2010 Share Posted August 4, 2010 (edited) This is what I put into the example file to make it work. If Not IsDeclared("TVM_GETITEM") Then Global Const $TVM_GETITEM = 0x1100 + 12 If Not IsDeclared("TVM_SETITEM") Then Global Const $TVM_SETITEM = 0x1100 + 13 Cheers! Edited August 4, 2010 by sliceofpie Link to comment Share on other sites More sharing options...
KaFu Posted August 4, 2010 Author Share Posted August 4, 2010 Nice that you found the deviations , reason is that the script was coded with an older version of AutoIt. I'll update the snippet as soon as SMF is ready for a new release . OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
sliceofpie Posted August 5, 2010 Share Posted August 5, 2010 I'm looking to display multiple variables i.e. each folder that is checked. When I use the example below: MsgBox(0, "", $aTreeViewItemState[0][0] & @CRLF & $aTreeViewItemState[0][0]) it returns the first directory twice. How can I display every directory that is checked? Link to comment Share on other sites More sharing options...
KaFu Posted August 5, 2010 Author Share Posted August 5, 2010 This should do the trick: for $i = 0 to UBound($aTreeViewItemState) - 1 ConsoleWrite($aTreeViewItemState[$i][0] & @tab & $aTreeViewItemState[$i][1] & @crlf) next OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
sliceofpie Posted August 5, 2010 Share Posted August 5, 2010 Thanks Kafu! This works! Link to comment Share on other sites More sharing options...
sliceofpie Posted August 13, 2010 Share Posted August 13, 2010 (edited) When I run the Treeview browser, it creates a list of the folders I've selected and saves it to the ShellTristateTreeView.ini file. When I close the program and reopen, it will give me an error message "Array variable has incorrect number of subscripts or subscript dimension range exceeded." and I have to delete the .ini file in order for it to rerun. The only time this doesn't happen is if I select the C:\ drive only. Edited August 13, 2010 by sliceofpie Link to comment Share on other sites More sharing options...
KaFu Posted August 14, 2010 Author Share Posted August 14, 2010 To be honest I don't know why that happens. I've attached the latest update in the first post. Check that out, should not have such problems. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
sliceofpie Posted August 14, 2010 Share Posted August 14, 2010 You are the man Kafu! The new update works beautifully! Link to comment Share on other sites More sharing options...
netegg Posted August 15, 2010 Share Posted August 15, 2010 why is the child items not chosen when the parent item has a tick? Link to comment Share on other sites More sharing options...
KaFu Posted August 15, 2010 Author Share Posted August 15, 2010 The child item does not exit until the tree-branch is expanded, I just check if there is at least one sub-item to add the +. On creation there should be a test if the parent is checked... which isn't currently there . Expand a tree, then collapse it again and you will see that the child items will be checked if they already exist. I'll add it, but thats more a cosmetic thing. It won't change anything in the resulting array, because if the parent is checked the child items will not be returned at all. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
zarrit Posted August 23, 2010 Share Posted August 23, 2010 thanks for the update i have been looking for a nice treeview like this, great work. Link to comment Share on other sites More sharing options...
sliceofpie Posted September 9, 2010 Share Posted September 9, 2010 I'm trying to integrate the ShellTristateTreeView sample in a tab control. The problem is that treeview list shows up in every tab. Here's a sample of what I'd like to do. GUICtrlCreateTab(1, 1, 305, 353) GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) GUICtrlCreateTabItem("Tab1") $c_TreeView_LocationFilter = _GUICtrlTreeView_Create($hGUI, 10, 30, 220, 280, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_CHECKBOXES, $TVS_NOTOOLTIPS), $WS_EX_CLIENTEDGE) GUICtrlCreateTabItem("Tab2") GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) Link to comment Share on other sites More sharing options...
sliceofpie Posted September 9, 2010 Share Posted September 9, 2010 I'm trying to integrate the ShellTristateTreeView sample in a tab control. The problem is that treeview list shows up in every tab. Here's a sample of what I'd like to do.I end up using GUICtrlCreateTreeView instead of _GUICtrlTreeView_Create followed by GUICtrlGetHandle. This seems to be working.Here's the link for the post:http://www.autoitscript.com/forum/index.php?showtopic=56751&st=0&p=430278&hl=%20_GUICtrlTreeView_Create%20%20tab&fromsearch=1&#entry430278 Link to comment Share on other sites More sharing options...
sliceofpie Posted June 1, 2011 Share Posted June 1, 2011 Hi Kafu. Any updates on this yet? I'm working on a 64-bit OS and ShellTristateTreeView doesn't work properly with it. Do you have it for 64-bit? Link to comment Share on other sites More sharing options...
KaFu Posted June 2, 2011 Author Share Posted June 2, 2011 Hiho, it's part of the SMF source, there it's currently v43. As SMF is compiled only as 32bit (due to supporting 32bit dll's), I've never looked into the 64bit issue. But I assume it has to do with the dllstructure definitions used... oh, I see, and I use _ArraySortClib(), it's a machine-code function for very fast array sorting and sadly bound to 32bit, would need replacement too if the overall function should work on 64bit. Sorry, currently I'm not planning to implement compatibility. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) 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