ericg32 Posted November 4, 2007 Share Posted November 4, 2007 I've come to a roadblock and need a little help. I am trying to write a notecard program. Card titles on the left (Treeview) Content on the right (editbox). I need to be able to move the title up and down the tree rather than simple sort them. I can get the 'drag and drop' icons but cannot figure out how to determine the desitination.. Once I know that I can easily move the array content and redisplay the tree. My confusion is due to the fact that there are newer tree functions now (UDF) that weren't available when the examples were written. To run the progam and get results... use the latest beta.. Select "Import" and it will load a fixed tree rather than import a file. Any help greatly appreciated !!!testfolder.au3 Link to comment Share on other sites More sharing options...
Siao Posted November 4, 2007 Share Posted November 4, 2007 Well, after your initial thread (why create another?) I happened to experiment on the subject too.Might wanna take a look athttp://www.autoitscript.com/forum/index.php?showtopic=56411 "be smart, drink your wine" Link to comment Share on other sites More sharing options...
ericg32 Posted November 4, 2007 Author Share Posted November 4, 2007 (edited) Siao I'm looking at the code..but it won't run.. getting error: Running AU3Check (1.54.9.0) from:C:\Program Files\AutoIt3\beta C:\Program Files\AutoIt3\beta\Include\GuiTreeView.au3(468,68) : WARNING: $DEFAULT_GUI_FONT: possibly used before declaration. _WinAPI_SetFont ($hTree, _WinAPI_GetStockObject ($DEFAULT_GUI_FONT) C:\Program Files\AutoIt3\beta\Examples\tt.au3(226,99) : WARNING: $SRCCOPY: possibly used before declaration. _WinAPI_BitBlt($hMemDC, 0, 0, $iImgW, $iImgH, $hTreeDC, $aItemRect[0], $aItemRect[1], $SRCCOPY) Any clues ? Edited November 4, 2007 by ericg32 Link to comment Share on other sites More sharing options...
Siao Posted November 4, 2007 Share Posted November 4, 2007 Upgrade your beta, or add these to the very top of your script: Global Const $DEFAULT_GUI_FONT = 17 Global Const $SRCCOPY = 0xCC0020 "be smart, drink your wine" Link to comment Share on other sites More sharing options...
ericg32 Posted November 4, 2007 Author Share Posted November 4, 2007 OUTSTANDING! I may get this thing written yet ! Link to comment Share on other sites More sharing options...
ericg32 Posted November 5, 2007 Author Share Posted November 5, 2007 Siao: I was close !! But no cigar yet. I'm having an issue after an item is moved in the tree. The original tree load gives direct ctrl-ids to each item in the tree view. When I hi-lite one, I can trap the ctrl number and place text in the edit box on the right. When the tree is recalculated it's done in "index" mode, I think. So, all the contol-id's are no longer used (I get dup ctrl ids when the moved item is hilited). I could use a little insight into how the treemove is being done. Yes Ive read the code and assoc doc but it's above my level (so far). Any pointers .. what I want to be able to do is .. capturer the treeview list (I initially capture it in an array) and the associated text (in the second col of the array) so they need to be re-associated or kept in sync after the treemove. I can load the current source if you need to see what I am doing in detail Link to comment Share on other sites More sharing options...
Siao Posted November 5, 2007 Share Posted November 5, 2007 (edited) 1) Work with item handles instead of controlIDs. None of the GuiCtrl... funcs will work obviously, since the items are not recreated with GUICtrlCreateTreeViewItem(). Use _GUICtrlTreeView_GetText() to get the text. 2) To trap selection change, add $TVN_SELCHANGED and $TVN_SELCHANGEDW case to WM_NOTIFY function. See the example, which I updated somewhat. Also might wanna see this list of treeview notifications if you need to trap some other events. Edited November 5, 2007 by Siao "be smart, drink your wine" Link to comment Share on other sites More sharing options...
ericg32 Posted November 5, 2007 Author Share Posted November 5, 2007 Siao, Thanks I will play with it during my breaks at work ! by the way.. when I move an item in the tree - it's stops after the srop..in the WM_notify func. No error.. just stops Link to comment Share on other sites More sharing options...
Siao Posted November 5, 2007 Share Posted November 5, 2007 Eh, frankly I don't know why it crashes. That _GUICtrlTreeView_GetText inside $TVN_SELCHANGEDW clashes with something else. It runs without crash with v3.2.9.4 though. "be smart, drink your wine" Link to comment Share on other sites More sharing options...
ericg32 Posted November 5, 2007 Author Share Posted November 5, 2007 I commented it out for now and it's running . I should be able to play getting it meshed into mine ! I can't thank you enough ! Othe than perhaps posted my end results with appropriate acknowledgments 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