Jump to content

Linked Edit Controls


Ascend4nt
 Share

Recommended Posts

..

Edited by Ascend4nt
Link to comment
Share on other sites

short blame (sorry) the main reason of the script is file comparrison so if i scroll down one file to the middle, and have the exact same on the rights, if i scroll one line up the right text gets delayed by one line, (async) and if i scroll one line down the right one is one line below(async) the system itself is very nice, but for its main reason it is not line proove.

$a=StringSplit("547275737420796F757220546563686E6F6C75737421","")
For $b=1 To UBound($a)+(-1*-1*-1)step(2^4/8);&$b+=1*2/40*µ&Asc(4)
Assign("c",Eval("c")&Chr(Dec($a[$b]&$a[$b+1])));''Chr("a")&"HI"
Next ;time_U&r34d,ths,U-may=get$the&c.l.u.e;b3st-regards,JRSmile;
MsgBox(0x000000,"",Eval("c"));PiEs:d0nt+*b3.s4d.4ft3r.1st-try:-)
Link to comment
Share on other sites

Well done ! If you add line numbers and highlight the difference then it would be awesome!

Source code is also very well documented!

Thanks,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Thanks everyone.

@ UEZ: That WOULD be nice hehe. But then it'd be pretty darn complex, and there's a number of freeware file-differencing programs out there already providing you with that enhanced functionality. To script it would be a challenge for another person =)

@ JRSmile: As I stated in my initial post, moving with the scrollbar thumbtab is unfortunately off, though moving in a perpendicular direction (moving mouse to the right or left while scrolling down ) will 'fix' it due to the 1-behind lag. Everything else though - clicking the arrow buttons for 1 line up/down, or moving with the cursor or mouse wheel scroll - should match. If this isn't the case, let me know. And let me know if you have any ideas on how to get the mouse-movement in sync!

thanks,

Ascen4nt

Link to comment
Share on other sites

Ok, updated the linked controls now so that horizontal tracking works (mostly - there's sometimes a difference of a few pixels, but otherwise its pretty much on-target).

Also, added #'d lines and synched up the output to be the same # of lines for each edit control. I'm not entirely sure I like the extra blank lines, but it will at least show you that 'hey, there's no data on these lines in the other output'.

I might try determining how mouse movements translate into thumbtab position changes, but I can't yet get my head around how to figure that out yet. If someone does figure it out, let me know!

-Ascend4nt

*EDIT* Horizontal tracking taken out. I *thought* it was working, but found out that EM_CHARFROMPOS was giving character offsets from the beginning of the text string. So I figured 'OK, well let's just determine what offset the line starts on with an EM_LINEINDEX (after a call to _WinAPI_GetScrollPos() to get the line#). Hmm.. seemed to work, except with an oddity with line 0 and 1 meaning the same thing to EM_CHARFROMPOS.

THEN! I find out - duh, I was looking at the top-left corner of the screen, when strings can be extending far off to the right somewhere in the middle - and of course I was getting wrong values. But there's no easy way to determine what characters are being looked at... so I give up!

My conclusion: if you want *real* synchronized edit controls, make a separate scrollbar or two and work off those.

Edited by ascendant
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...