Previous Thread
Next Thread
Print Thread
XTREE: two synched xtrees #37637 08 Nov 24 06:49 AM
Joined: Jun 2001
Posts: 3,406
J
Jorge Tavares - UmZero Online Content OP
Member
OP Online Content
Member
J
Joined: Jun 2001
Posts: 3,406
I think it will be the last one, for today cool

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?" grin

Also it's the perfect moment to wish y'all a great weekend

Attached Files xtree_synched.jpg

Jorge Tavares

UmZero - SoftwareHouse
Brasil/Portugal
Re: XTREE: two synched xtrees [Re: Jorge Tavares - UmZero] #37642 11 Nov 24 08:20 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
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.

ash-7.0.1765.0-w32c-upd.zip
ash70notes.txt

Re: XTREE: two synched xtrees [Re: Jorge Tavares - UmZero] #37645 12 Nov 24 04:03 PM
Joined: Jun 2001
Posts: 3,406
J
Jorge Tavares - UmZero Online Content OP
Member
OP Online Content
Member
J
Joined: Jun 2001
Posts: 3,406
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?

Many, many thans


Jorge Tavares

UmZero - SoftwareHouse
Brasil/Portugal
Re: XTREE: two synched xtrees [Re: Jorge Tavares - UmZero] #37647 12 Nov 24 04:26 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
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


(Seems like you're missing several fields!)

Re: XTREE: two synched xtrees [Re: Jorge Tavares - UmZero] #37662 19 Nov 24 06:36 AM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
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.)

ash-7.0.1765.3-w32c-upd.zip
ash70notes.txt

Re: XTREE: two synched xtrees [Re: Jorge Tavares - UmZero] #37665 20 Nov 24 09:56 PM
Joined: Jun 2001
Posts: 3,406
J
Jorge Tavares - UmZero Online Content OP
Member
OP Online Content
Member
J
Joined: Jun 2001
Posts: 3,406
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?

thank you very much


Jorge Tavares

UmZero - SoftwareHouse
Brasil/Portugal
Re: XTREE: two synched xtrees [Re: Jorge Tavares - UmZero] #37666 20 Nov 24 10:12 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
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.
Code
MAP1 EXITCODE,F
XCALL SBXMSG,EXITCODE,"This is SBXMSG opcode 0","Title",0,0,0
? "Exitcode: ";EXITCODE

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.

Re: XTREE: two synched xtrees [Re: Jorge Tavares - UmZero] #37668 20 Nov 24 11:13 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
Here's the update which adds support for the mouse wheel synchronized scrolling...

ash-7.0.1765.5-w32c-upd.zip
ash70notes.txt


Moderated by  Jack McGregor, Ty Griffin 

Powered by UBB.threads™ PHP Forum Software 7.7.3