Recent

Author Topic: Make ItemList in TSynBaseCompletionForm as virtual  (Read 844 times)

Zaher

  • Hero Member
  • *****
  • Posts: 679
    • parmaja.org
Make ItemList in TSynBaseCompletionForm as virtual
« on: July 30, 2022, 05:36:36 pm »
I am working on patch SynCompletion.pas to add some features, every thing is ok, and not any break for any old codes that use it.

But now I want to make  TSynBaseCompletionForm.FItemList is not a real list, i want to add GetItem, SetItem and GetCount as virtual methods , then this used used in TSynCompletion to to get values from FItemList created inside TSynCompletion

I want to make it virtual because i have my own List inside my application

Add this feature will break some compatibility for who Base classes not the derived class TSynCompletion

And I see Lazarus IDE is using this class TSynBaseCompletionForm that mean there is a break, and I need a help before working on it.

My Work is safe to merge (I hope)
https://gitlab.com/freepascal.org/lazarus/lazarus/-/merge_requests/103

A new class added in this branch but will add merge request after previous one applied
https://gitlab.com/parmaja/lazarus/-/commits/ShowParamsHint

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Make ItemList in TSynBaseCompletionForm as virtual
« Reply #1 on: July 30, 2022, 06:28:02 pm »
Rather busy right now... So unfortunately this may take a while.

Based on a really quick look (and almost certainly having missed out various important details)

What is the whole "chunk" business? Some kind of coloring?

If so, just a thought: SynEdit has various coloring methods of its own, and they could be extended. The most natural would be to apply the current highlighter. (E.g. in pascal, that would take care of keywords and lots of stuff). I am aware that leaves some requirements out...

Anyway, supporting costum HL/markup/coloring helpers should be fine. But then they should be entirely optional. (Except an API needs to be agreed on and implemented).

Technically the entire drop down could be drawn as if it was a synedit, and the list could be the (virtual) text buffer.
But it doesn't have to do it that way. However the ability to include a SynHighlighter should be minded as a *later* possibility (I haven't checked if that would go with the merge request)

---
Depending on that, if the new stringlist, is for the markup only, then it should be created in a "factory" method, that could be hooked by the coloring plugin.

---
I will see when I find some time for a more detailed look.

Zaher

  • Hero Member
  • *****
  • Posts: 679
    • parmaja.org
Re: Make ItemList in TSynBaseCompletionForm as virtual
« Reply #2 on: July 30, 2022, 07:19:25 pm »
In that patch

In the patches
I just ported functions as from Delphi SynEdit kind of re port it, but i clean it up to make it work, I keep compatiplity with old , but if we need new formatted text we can use property for it, and for FInsert

This will make it a lil compatiple with Delphi version

and yes i feel i went so deep, espically in the next MR(patches) i think i will split it into separated file

Zaher

  • Hero Member
  • *****
  • Posts: 679
    • parmaja.org
Re: Make ItemList in TSynBaseCompletionForm as virtual
« Reply #3 on: July 30, 2022, 07:21:39 pm »
If we forget about my patches, thequestion what if i want to use my own list instead of FItemList that exists inside form.
I wanted it callback/virtual call of items value and with ownerdraw that exists we can inherit it and add FInsertItem in next level of classes

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Make ItemList in TSynBaseCompletionForm as virtual
« Reply #4 on: July 30, 2022, 07:28:30 pm »
I still don't know what they do....
So, I can't answer where they should go.

 

TinyPortal © 2005-2018