Recent

Author Topic: Markups: Reseting MarkupInfo colors to SynEdit.Color  (Read 6198 times)

Pascal

  • Hero Member
  • *****
  • Posts: 932
Markups: Reseting MarkupInfo colors to SynEdit.Color
« on: September 21, 2016, 02:47:02 pm »
Is there a way (special TColor code) to set MarkupInfo colors to the current SynEdit.Color?
It is needed to clear/override all colors of other Markups with lower priority.
I clould use SynEdit.Color but it could have been changed after initialization of MarkupInfo
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12511
  • Debugger - SynEdit - and more
    • wiki
Re: Markups: Reseting MarkupInfo colors to SynEdit.Color
« Reply #1 on: September 21, 2016, 04:07:18 pm »
Not sure what you try to archive?

clNone (or maybe clDefault) should mean that no highlight/markup is applied.

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Markups: Reseting MarkupInfo colors to SynEdit.Color
« Reply #2 on: September 21, 2016, 04:34:19 pm »
Because there are other markups apllied already and i want ot clear them out and override them with my MarkupInfo.
clNone and clDefault do not work. I do not want to apply no highlight i want to clear underlaying highlights.
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12511
  • Debugger - SynEdit - and more
    • wiki
Re: Markups: Reseting MarkupInfo colors to SynEdit.Color
« Reply #3 on: September 21, 2016, 05:10:47 pm »
I don't think that currently exists.

even if you lookup the syn.color correct, it will not work.

Imagine a white bg color, you want to cancel underlines, so you draw a white underline....
But if there is a markup (or hl) that changed the bg color, then it fails...

Markups are supposed to work individually, as such they can not affect other markups.

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Markups: Reseting MarkupInfo colors to SynEdit.Color
« Reply #4 on: September 21, 2016, 07:00:31 pm »
Yes, but i can override other markups by using higher priority (laying on top of other markups).
i can use Synedit.color but i have to take care that the markupinfo has the current value of synedit.color.
Maybe there could be a special TColor code. Maybe clDefault could be used to redraw the background for Frames and Background.
« Last Edit: September 21, 2016, 07:50:09 pm by Pascal »
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12511
  • Debugger - SynEdit - and more
    • wiki
Re: Markups: Reseting MarkupInfo colors to SynEdit.Color
« Reply #5 on: September 21, 2016, 08:40:09 pm »
The computing (merging) of markup colors (from all the markups) is already very complex. And dangerously lacking testcases.

Also I still dont see the usecase for what you want to do?

If markups depend on each other, then should they know?
Also suppressing markup colors like that, will always also suppress the highlighter colors.

Also for one markup, to disable another in that way, it would have to rely on the other (the to be suppressed) is configured correct.
If you suppress frames, but the other uses textcolor.... or font-style...

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Markups: Reseting MarkupInfo colors to SynEdit.Color
« Reply #6 on: September 21, 2016, 09:07:56 pm »
Pictures will say more than 1000 words  :D
I am currently testing a ghosting mode for TSynEditmarkupMouseLink inside my COBOL IDE.
If the qualifier keys for a configured MousLink are pressed the complete Text is grayed out while
all linkable tokens a highlighted. And i also want to suppress all other markups like the markups for the
cross referenced fields/variables.

Screenshot 1: Editor as is
Screenshot 2: pressed qualifiers for cross reference

I would like to suppress all other markups to have a very clear view while doing the selection for the link.
It should look more like Screenshot 3.
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12511
  • Debugger - SynEdit - and more
    • wiki
Re: Markups: Reseting MarkupInfo colors to SynEdit.Color
« Reply #7 on: September 21, 2016, 10:11:35 pm »
Do you also want to get rid of the language highlight? (eg green keywords)?

Or should the simply fade (faded green), like the inactive ifdef in Lazarus?

For fading you can merge with an alpha channel. Define a markup of high prior, that has the syn-background (white), and an alpha. Apply it everywhere, but for the links (as they do not fade).
(you need a custom markup module for that)

If you want all text grey on white, the you can do the same, simple define a markup with highest prior, that sets all the colors....

If you want to grey some (eg the highlighter), and you want only (selected) markups do be off, then add 2 events to the link module
onLinkShown / Hidden.
In them call TempDisable/Enable on the desired markups.




Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Markups: Reseting MarkupInfo colors to SynEdit.Color
« Reply #8 on: September 21, 2016, 10:55:01 pm »
Ah, okay. I didn't know TempDisable/-Enable.
Maybe i can use a combination of TempDisplay and an alpha with white color do make everything grayed out.
Thanks for the tips.

Did you test the new TSynEditMarkupMouseLink already?
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12511
  • Debugger - SynEdit - and more
    • wiki
Re: Markups: Reseting MarkupInfo colors to SynEdit.Color
« Reply #9 on: September 21, 2016, 10:56:54 pm »
havent looked at any code yet. will let you know once I get to it.

 

TinyPortal © 2005-2018