Recent

Author Topic: (Syntax) Color Selection  (Read 7156 times)

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
(Syntax) Color Selection
« on: September 28, 2015, 03:35:02 pm »
Is it true that syntax highlight color selection has never been implemented?

I'm looking at ColorSel dialog (that seems as an attempt to implement the dialog) and after some code modifications it's as far as it goes (see the attached image).

The menu for "Colors" has been commented out since 2006 (r3479)

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: (Syntax) Color Selection
« Reply #1 on: September 28, 2015, 09:04:39 pm »
What I remember about it:

Afaik it colorsel was found to be based on a TP version and removed/disabled.

I added some prototypes from a C++ version, and had contact for a while with sb who wanted to improve it. That contact dried  up, and that's about it.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: (Syntax) Color Selection
« Reply #2 on: September 28, 2015, 09:32:35 pm »
hey marcov, thank you for the answer.
From the top of your head (since I've not had a chance to look into the code myself yet), do you know if colors are fully read from .ini file?
optionally, a user could just fill the .ini manually and it works (no need to change colors in run-time).

if yes, what how to populate the colors "array" in .ini file?

It's definitely not the key/value reading .
(fpini.pas)
Code: [Select]
  { Colors }
  S:=AppPalette;
  PS:=StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_1_40',PaletteToStr(copy(S,1,40))));
  PS:=PS+StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_41_80',PaletteToStr(copy(S,41,40))));
  PS:=PS+StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_81_120',PaletteToStr(copy(S,81,40))));
  PS:=PS+StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_121_160',PaletteToStr(copy(S,121,40))));
  PS:=PS+StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_161_200',PaletteToStr(copy(S,161,40))));
  PS:=PS+StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_201_240',PaletteToStr(copy(S,201,40))));
  if length(PS)<length(CIDEAppColor) then
    PS:=PS+copy(CIDEAppColor,length(PS)+1,255);
  AppPalette:=PS;


skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: (Syntax) Color Selection
« Reply #3 on: September 30, 2015, 07:36:17 pm »
alright. FP IDE text editor font colors start at palette index 199. The most wanted are located starting at 201.
Adding such line to fp.ini file
Code: [Select]
[Colors]
Palette_201_240=#$17#$1F#$1E#$1B#$1A#$1A#$1E#$71#$3F#$30#$1C#$1A#$1F#$4E#$31#$3F#$3A#$31#$31#$31#$71#$1F#$31#$2F#$3E#$3F#$70#$20#$FF#$3A#$37#$FF#$FF#$FF
changes the color of numbers from cyan to light green (lime).
« Last Edit: September 30, 2015, 07:39:23 pm by skalogryz »

skiy1337lazarus

  • New Member
  • *
  • Posts: 34
Re: Colour of Numbers
« Reply #4 on: October 07, 2015, 05:15:50 pm »
I did file a bug report about that. Hope the default gets changed. (Blue is too dark for numbers)

Guillermo

  • New Member
  • *
  • Posts: 19
Re: (Syntax) Color Selection
« Reply #5 on: January 17, 2016, 08:45:47 pm »
Really, the colors of the FPC IDE makes VERY difficult to read the menus and helps :-(. Any fix will be appreciated, the idea of changing colors from the .ini file text is good. We who code pure Pascal eat assembler code at breakfast! ;-)

Best regards,
Guillermo.
Guillermo.

 

TinyPortal © 2005-2018