Recent

Author Topic: scrolling Tmemos simultaneously ?  (Read 3167 times)

ArtLogi

  • Full Member
  • ***
  • Posts: 194
Re: scrolling Tmemos simultaneously ?
« Reply #15 on: October 06, 2024, 01:09:45 pm »
the mismatched lenght should be adapted as percentage of scrollbar motion by each and not directy run by line count. All else goes over my head on this thread.
While Record is a drawer and method is a clerk, when both are combined to same space it forms an concept of office, which is alias for a great suffering.

jamie

  • Hero Member
  • *****
  • Posts: 6690
Re: scrolling Tmemos simultaneously ?
« Reply #16 on: October 06, 2024, 03:19:59 pm »
WoW, for something that appears to be simple, and most ways is looking like it's the problem of solving world hunger!

Let's see, hmm. If it were me, I would take advantage of the object pointers in the stringlist that represent the lines in the memo and assign them to an index for the other memo.

  At least that way, they would be in sync to some degree!

The only true wisdom is knowing you know nothing

MarkMLl

  • Hero Member
  • *****
  • Posts: 7904
Re: scrolling Tmemos simultaneously ?
« Reply #17 on: October 06, 2024, 04:33:24 pm »
WoW, for something that appears to be simple, and most ways is looking like it's the problem of solving world hunger!

Let's see, hmm. If it were me, I would take advantage of the object pointers in the stringlist that represent the lines in the memo and assign them to an index for the other memo.

  At least that way, they would be in sync to some degree!

But memos don't scroll by line, they scroll by caret (i.e. point x,y) position... I think you can get at how many lines are actually being displayed but the whole thing is uncomfortable (and I've looked at this several times in the context of stabilising a TMemo being used for status information etc. hence my earlier link).

Stepping back from the scrolling for a moment: I'm uncomfortable with this, but could see a situation where some sort of extraction of the texts' AI-style "tokens", i.e. smallest significant fragments, often (but by no means always) words, might be relevant. That would make the problem /potentially/ one of highlighting equivalent tokens in the two texts irrespective of the mutual ordering which again reminds me of Meld and Heckel's algorithm ** hence https://upload.wikimedia.org/wikipedia/commons/3/30/Meld_file1.png

Now that illustration doesn't show exchanged blocks but I believe Meld handles them intelligently... the underlying algorithm certainly does (although I last used it pre-GUI with different fonts on an Epson dot-matrix indicating "here" vs "there"). ***

So if we actually assume the tentative use of TRichMemo to get text highlighting etc., the next question is: is there a better control on which to base this sort of thing, or could one be written relatively easily?

** The significance of Heckel's algorithm in this context is that it works by finding unique lines that match, then growing larger blocks outwards from those points as long as there are adjacent matching (albeit non-unique) lines. I suspect that something similar would work for texts in different languages, i.e. find unique matching tokens and grow outwards.

*** Updated: I'm wrong, it doesn't. Which is unfortunate since I believe the underlying algorithm is capable of it... unless of course the programmers fluffed a difficult implementation.

MarkMLl
« Last Edit: October 07, 2024, 11:24:13 am by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

jamie

  • Hero Member
  • *****
  • Posts: 6690
Re: scrolling Tmemos simultaneously ?
« Reply #18 on: October 06, 2024, 05:06:55 pm »
Yes, I am aware of the line index not matching the caret index on the screen due to how windows manage the memo when line wrapping takes place, once that happens, all lines before that are off by that much. keep adding that up and it really gets out of place.

I too wrote a basic block of code to address this, But I also found that cross platform wise they are not compatible.

Widgets are not cross compatible for this so who is going to win?



The only true wisdom is knowing you know nothing

MarkMLl

  • Hero Member
  • *****
  • Posts: 7904
Re: scrolling Tmemos simultaneously ?
« Reply #19 on: October 06, 2024, 05:44:26 pm »
The data presentation aspect might make it into an application which mandates a specific underlying OS. But OTOH if Meld can do it...

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

VisualLab

  • Hero Member
  • *****
  • Posts: 526
Re: scrolling Tmemos simultaneously ?
« Reply #20 on: October 06, 2024, 09:33:31 pm »
WoW, for something that appears to be simple, and most ways is looking like it's the problem of solving world hunger!

Let's see, hmm. If it were me, I would take advantage of the object pointers in the stringlist that represent the lines in the memo and assign them to an index for the other memo.

  At least that way, they would be in sync to some degree!

It seems to me that it is only seemingly so simple. In reality, it is rather complex.

Joanna from IRC

  • Hero Member
  • *****
  • Posts: 1180
Re: scrolling Tmemos simultaneously ?
« Reply #21 on: October 06, 2024, 11:36:46 pm »
The standalone tscrollbar control can accept change events and set positions of the memo.vertscrollbars. However I’m not sure how to set the range of the scroll bar.
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

MarkMLl

  • Hero Member
  • *****
  • Posts: 7904
Re: scrolling Tmemos simultaneously ?
« Reply #22 on: October 07, 2024, 08:32:59 am »
The standalone tscrollbar control can accept change events and set positions of the memo.vertscrollbars. However I’m not sure how to set the range of the scroll bar.

Does that include the case where the scrollbars aren't visible? I still suspect that the caret position would need to be changed as well, and there's still the problem of picking up scrolling caused by cursor (i.e. caret as distinct from pointer) movement.

But if OP knows how to generate tuples of the corresponding lines (etc.) it should be doable...

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Joanna from IRC

  • Hero Member
  • *****
  • Posts: 1180
Re: scrolling Tmemos simultaneously ?
« Reply #23 on: October 07, 2024, 09:10:37 am »
This discussion is interesting but I don’t think the tmemo is the correct control to be using for two columns of related text. How about using a string grid with two columns aligned to client that has variable height cells so that it will be obvious which text goes together. The tmemo is for typing in text free form or loading a stringlist to read.

I will be very surprised of the op participates any further on this thread.  8-)
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

MarkMLl

  • Hero Member
  • *****
  • Posts: 7904
Re: scrolling Tmemos simultaneously ?
« Reply #24 on: October 07, 2024, 09:29:02 am »
This discussion is interesting but I don’t think the tmemo is the correct control to be using for two columns of related text. How about using a string grid with two columns aligned to client that has variable height cells so that it will be obvious which text goes together. The tmemo is for typing in text free form or loading a stringlist to read.

I've also got misgivings about TMemo/TRichMemo in this context, but the fact that so many of us have resorted to it for "odd jobs" suggests that there is not anything currently better. I've tried using grids for various things and am not convinced that they're better in this context: they're OK if what you really need is columnation, but their scrolling etc. behaviour... well it might have improved, but IME it was easier to use a memo.

However- and I'm writing this from the position of somebody with no component development experience- /if/ it were possible to write a "Meld-like" control which could specifically handle text comparison I can see a lot of ways it could be useful, including Git integration etc.

Quote
I will be very surprised of the op participates any further on this thread.  8-)

Please stop that Joanna. You know full well that the rest of us are very unhappy with the way that you're rude about (and to) new arrivals, and if you step back for a moment you might possibly realise that you don't like being treated that way yourself.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Joanna from IRC

  • Hero Member
  • *****
  • Posts: 1180
Re: scrolling Tmemos simultaneously ?
« Reply #25 on: October 07, 2024, 02:09:45 pm »
I was in chat today and a member of our community who lives in an “unapproved country” told me about how he was banned from gitlab so he used a vpn and then got busted for that too. The result is that he can never submit patches to Lazarus again unless the project is hosted on a site that doesn’t block him.. yea yea I know he is being so unreasonable insisting on living in his country instead of expatriating so he can access gitlab!  ::)

I suggested that someone who isn’t blocked by gitlab act as an intermediary but that idea didn’t work so well when I asked for help reporting bugs. As far as I know not a single one of the bugs I shared was ever reported in the bug tracker judging by the amount of energy that was put into screaming at me for being unable to use it.  :D

I can go to the bug tracker just fine but im not allowed to see what is in there unless I go buy a new computer. Yes I know I’m so naughty   :P
 
Let’s not worry about the fact that people can’t fix bugs and Lazarus project is suffering when we can bicker about where the op went to...
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

MarkMLl

  • Hero Member
  • *****
  • Posts: 7904
Re: scrolling Tmemos simultaneously ?
« Reply #26 on: October 07, 2024, 02:39:32 pm »
Joanna, that's off-topic and I presume you intended to post it elsewhere. If that's the case please delete it and I'll delete this one to keep the record reasonably tidy.

I was in chat today and a member of our community who lives in an “unapproved country” told me about how he was banned from gitlab so he used a vpn and then got busted for that too. The result is that he can never submit patches to Lazarus again unless the project is hosted on a site that doesn’t block him.. yea yea I know he is being so unreasonable insisting on living in his country instead of expatriating so he can access gitlab!  ::)

How long has this been going on? Has he made any attempt to contact the FPC/Lazarus team, most of whom are in Europe, about it?

Quote
I can go to the bug tracker just fine but im not allowed to see what is in there unless I go buy a new computer. Yes I know I’m so naughty   :P

Rubbish Joanna. You won't even tell us what web browser you're running so how the Hell can we help with your problems?

If you want to continue those please start new threads, rather than messing up discussion of OP's problem.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Joanna from IRC

  • Hero Member
  • *****
  • Posts: 1180
Re: scrolling Tmemos simultaneously ?
« Reply #27 on: October 07, 2024, 02:59:15 pm »
He didn’t contact the Lazarus team because he thought it would be unreasonable to demand that they move the hosting site. I knew he had been using a vpn for a long time to access gitlab but apparently they found a way to detect vpn usage. So he was banned for that for awhile. Now he says he can go to gitlab but can’t do anything. So the long and short of it is gitlab is deciding who can fix and/or Report bugs for the Lazarus project. I don’t know why there is no hosting site that isn’t involved in politics.
The Lazarus project has lost at least one good programmer because Gitlab bans innocent people.
« Last Edit: October 07, 2024, 03:01:23 pm by Joanna »
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

JanRoza

  • Hero Member
  • *****
  • Posts: 699
    • http://www.silentwings.nl
Re: scrolling Tmemos simultaneously ?
« Reply #28 on: October 07, 2024, 03:11:10 pm »
And one more discussion that gets sidetracked by the famous Johanna, how long do still we accept this?  >:( >:D
OS: Windows 11 / Linux Mint 22
       Lazarus 4.0 RC FPC 3.2.2
       CodeTyphon 8.50 FPC 3.3.1

Joanna from IRC

  • Hero Member
  • *****
  • Posts: 1180
Re: scrolling Tmemos simultaneously ?
« Reply #29 on: October 07, 2024, 03:32:22 pm »
Please stop stalking me !  :o
I tried to help this person when everyone was ignoring this thread and he ignored me so I deleted my post you busybody.. >:(
« Last Edit: October 07, 2024, 03:37:14 pm by Joanna »
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

 

TinyPortal © 2005-2018