Am I dreaming or, once, we discussed here how to have two synched xtrees while scroling? I have two properties sheet side-by-side, with the same settings for the Left and Right shoe and would be of great help to have them synched.
It sounds almost impossible and I'm posting it, only, because I came here for the previous two posts and "why not ask?"
Also it's the perfect moment to wish y'all a great weekend
This was an interesting adventure into the dark recesses of Windows messages, but it seems to work, at least within some limitations. As you'll see in the notes, it's currently only synced one way, and only supports the vertical scroll bar, although it may be that the technique could be extended to the selection bar. I would definitely consider it beta so testing is advised.
Finally, the one I didn't put a lot of expectation to be implemented and, here we are, a simple solution. But I've added a XTR'SYNCCTLNO,b1 to the map structure and didn't work, I'm probably not updated, can you confirm the current one (I know, I'm on the MAP, slowly moving to the DEFSTRUCT).
map2 XTR'COLID,b,1 ! [135] column ID (6.5.1689.0+) map2 XTR'SYNCCTLNO,b,1 map2 XTR'UNUSED2,X,11 ! [138] was 12
I've created the slave xtree.which was assingned xtr.ctlno=1 After, created the master xtree which was assigned xtr'ctlno=2 and I've assigned in this xtree xtr.syncctlno=2 that came from the previous xtr.ctlno + 1 Is this correct?
Sorry, I meant to include an updated XTRCTL in the notes but forgot. The tail end should look like this...
Code
map2 XTR'FOOTERSTYLE,B,1 ! [134] same XTHSF_xxx flags as HEADERSTYLE (6.3.1537+)
map2 XTR'COLID,B,1 ! [135] column ID (6.5.1689.0+)
map2 XTR'COLTYPEID,B,1 ! [136] column Type ID
map2 XTR'XDIRTY,B,1 ! [136] exit cell (XROW,XCOL) was changed (i.e. dirty)
map2 XTR'XDSPROW,B,4 ! [136] display row corresponding to physical XROW
map2 XTR'FILTERED,B,1 ! [136] =1 if rows have been filtered by user
map2 XTR'SYNCCTLNO,B,1 ! [137] XTR.CTLNO (+1) of XTREE ctl to sync scroll with
map2 XTR'UNUSED2,X,3 ! [137] was 4136] was 10 [141] was 11 [140] was 12
After some further testing, I decided to recall the original implementation of this feature, as it wasn't working reliably. The replacement version, in 7.0.1765.3, seems to work much more reliably. And as an added bonus, works automatically in both directions. (The first scroll operation on the first tree will set up the second tree to forward its scroll operations back to the first tree.)
Hi Jack, Apologize for my silence on this, too much pressure to implement other features more important than scroll two xtrees together. Anyway, I've installed this new release and, undoubtly, the synch is much better. I noticed that using the mouse wheel to scroll doesn't trigger the synch, I don't know if it's not possible or you just forgot that, but if you find it too much complicated, it's great the way it is now.
But while playing with this new release, maybe I've found the problem and it's not related with exiting the XTREE, in fact, not related to XTREE, something broke the call of my SBXMSG. Today I was getting crazy trying to understand why "if a>1" was not working because a message should pop up using "xcall sbxmsg ....", but the problem was in the sbxmsg not working and, I guess, the problem previously described as "xtree hangs on exit" was precisely due to the SBXMSG problem that should be called on the xtree exit. Can you check if sbxmsg.sbx is working on your side?
Yes, regarding the wheel, I forgot that it doesn't act as a front-end to the regular scroll messages that I trapped. I'll add a hook and post an update.
But as for SBXMSG, I'm not that familiar with it, although it appears to be a wrapper for AG_MESSAGEBOXSTD.
The source I have is dated in 2018 and has no version, so I'm not sure if it's current. I didn't see any obvious test programs but created this simple one which seems to work ok.
If you'd like, I'd be happy to modernize it to act as a wrapper to XCALL MSGBOX. That routine is a bit simpler in that it doesn't require a round-trip communication with between the application and UI sides of the client, as well as way more sophisticated with additional options, but perhaps most important, it gets a LOT of use, so any problems would become quickly apparent.