Lazarus

Announcements => Third party => Topic started by: Edson on November 01, 2017, 12:08:32 am

Title: SynFacilCompletion highlighter
Post by: Edson on November 01, 2017, 12:08:32 am
SynfacilCompletion https://github.com/t-edson/SynFacilCompletion is a SynEdit syntax highlighter with completion code feature.

It' based in SynFacilSyn https://github.com/t-edson/SynFacilSyn and works in the same way, using an external XML file, or programmatically.
Title: Re: SynFacilCompletion highlighter
Post by: snorkel on November 01, 2017, 07:09:47 pm
Looks cool, can it do dot completion for SQL that has schemas?
I.e. in postgresql you can define schemas and each schema has it's own tables etc and has a default one called public.

Can it be set to compete on something like public.   where it would then show a list of all the objects in that schema?  with a table icon for tables, function icon for functions etc.
Title: Re: SynFacilCompletion highlighter
Post by: Edson on November 01, 2017, 07:43:37 pm
Can it be set to compete on something like public.   where it would then show a list of all the objects in that schema?  with a table icon for tables, function icon for functions etc.

Yes. Just you need a way to indicate the schema to the highlighter.
The completion can be done:
* Using a XML file. In this case the completion lists are static, but can be context aware.
* Implemented by code. So it is free of doing some more complex scan.

Icons can be defined individually for each item.
Title: Re: SynFacilCompletion highlighter
Post by: taazz on November 01, 2017, 11:25:25 pm
looking good. Does it require your highlighter or its included?
Title: Re: SynFacilCompletion highlighter
Post by: Edson on November 02, 2017, 12:22:58 am
looking good. Does it require your highlighter or its included?
It's included. The highlighter is a subclass of SynFacilHighlighter.
Title: Re: SynFacilCompletion highlighter
Post by: snorkel on November 02, 2017, 03:12:14 pm
Do you have a english versrion of the word documentation file?

Also would you happen to have any SQL completion examples?
Title: Re: SynFacilCompletion highlighter
Post by: taazz on November 02, 2017, 04:22:27 pm
looking good. Does it require your highlighter or its included?
It's included. The highlighter is a subclass of SynFacilHighlighter.
thank you.
Title: Re: SynFacilCompletion highlighter
Post by: munair on November 02, 2017, 04:54:34 pm
Thanks for sharing.  8)
Title: Re: SynFacilCompletion highlighter
Post by: Edson on November 02, 2017, 09:55:54 pm
Do you have a english versrion of the word documentation file?

Sorry. Just spanish. Maybe someone can translate it.

Also would you happen to have any SQL completion examples?

There is a Syntax File for ORACLE in https://github.com/t-edson/SynFacilUtils/blob/1.21/languages/SQLOracle.xml
It's just static completion. For dynamic completion (like table name or column name) it must be implemented programmatically.

Title: Re: SynFacilCompletion highlighter
Post by: edwinyzh on November 06, 2017, 05:15:15 am
Great! Well done!
Title: Re: SynFacilCompletion highlighter
Post by: BIT on December 30, 2017, 07:34:15 am
При большом размере файла крах всей программы(( как исправить?
PS: SynEdit Создаю динамически.

With a large file size, the collapse of the entire program(( how to fix?
PS: SynEdit Create dynamically.

//configure highlighter
  hlt := TSynFacilComplet.Create(Self);  //my highlighter
  rSynEdit.Highlighter := hlt;  //optional if we are going to use SelectEditor()
  hlt.LoadFromFile('UnrealScript.xml');  //load syntax
  hlt.SelectEditor(rSynEdit);  //assign to editor
  hlt.IconList := ImageList1;       
Title: Re: SynFacilCompletion highlighter
Post by: Edson on December 30, 2017, 04:25:15 pm
With a large file size, the collapse of the entire program(( how to fix?
PS: SynEdit Create dynamically.

What OS/Version are you using?
What Lazarus/FPC version are you using?
What SynFacilCompletion version are you using?

Would you please include a sample project to verify?
Title: Re: SynFacilCompletion highlighter
Post by: BIT on December 30, 2017, 07:35:32 pm
With a large file size, the collapse of the entire program(( how to fix?
PS: SynEdit Create dynamically.

What OS/Version are you using?
What Lazarus/FPC version are you using?
What SynFacilCompletion version are you using?

Would you please include a sample project to verify?
What OS/Version are you using? = Windows 7 64bit
What Lazarus/FPC version are you using? = 1.8.0 32bit
What SynFacilCompletion version are you using? 1.20

Attached a test project http://rgho.st/7JpzWjKln Poured here if you fail to download offer your hosting
Title: Re: SynFacilCompletion highlighter
Post by: BIT on December 30, 2017, 10:24:34 pm
With a large file size, the collapse of the entire program(( how to fix?
PS: SynEdit Create dynamically.

What OS/Version are you using?
What Lazarus/FPC version are you using?
What SynFacilCompletion version are you using?

Would you please include a sample project to verify?

Вообщем ошибка не в размере файла а в символе # где он файле встречает происходит ошибка! Теперь как это исправить?)

In General, the error in size of file and the # symbol where it encounters a file error occurs! Now how to fix it?)
Title: Re: SynFacilCompletion highlighter
Post by: Edson on December 31, 2017, 04:01:51 am
I can see. But the only problem I detect is in the definition of DIRECTIVES, no about the file size.

It seems to be a bug. I need to check it more.

By the moment, you can avoid the crash, including the definition of the attribute DIRECTIVE in the XML file:

Code: XML  [Select][+][-]
  1.    <Attribute Name="DIRECTIVE" ForeCol="#a1a130"></Attribute>
  2.  

And for a better highlighter, modify the definition for DIRECTIVES:

Code: XML  [Select][+][-]
  1.   <Token Start="#" End="" Attribute='DIRECTIVE'> </Token>
  2.  

Title: Re: SynFacilCompletion highlighter
Post by: Edson on December 31, 2017, 04:37:19 am
The explanation is There is not exist the attribute DIRECTIVE by default in SynFacilSyn (and SynFacilCompletion). You need to define when using.

Maybe a better error control must be included.   :-[

EDIT:
A better error control has been included in https://github.com/t-edson/SynFacilSyn
Title: Re: SynFacilCompletion highlighter
Post by: BIT on December 31, 2017, 06:19:48 am
Спасибо большое постараюсь разобраться! Но мне так и не понятно почему символ "#" вызывает ошибку?
Попробуйте просто открыть файл вписать только 1 символ # приложение при открытие такого го файла с символом вызывает ошибку.

¡Gracias grande trataré de comprender! ¿Pero y no me está claro por qué el símbolo "#" llama la falta?
Prueben simplemente abrir el fichero insertar solamente 1 símbolo # la aplicación a la apertura de tal го del fichero con el símbolo llama la falta.
Title: Re: SynFacilCompletion highlighter
Post by: BIT on December 31, 2017, 08:00:34 am
The explanation is There is not exist the attribute DIRECTIVE by default in SynFacilSyn (and SynFacilCompletion). You need to define when using.

Maybe a better error control must be included.   :-[

EDIT:
A better error control has been included in https://github.com/t-edson/SynFacilSyn

Спасибо большое за ваш труд!! С наступающим 2018 годом!
And thank you for your work!! With the upcoming 2018!
Title: Re: SynFacilCompletion highlighter
Post by: BIT on December 31, 2017, 08:06:01 am
I can see. But the only problem I detect is in the definition of DIRECTIVES, no about the file size.

It seems to be a bug. I need to check it more.

By the moment, you can avoid the crash, including the definition of the attribute DIRECTIVE in the XML file:

Code: XML  [Select][+][-]
  1.    <Attribute Name="DIRECTIVE" ForeCol="#a1a130"></Attribute>
  2.  

And for a better highlighter, modify the definition for DIRECTIVES:

Code: XML  [Select][+][-]
  1.   <Token Start="#" End="" Attribute='DIRECTIVE'> </Token>
  2.  

Это помогло Ура!!
It helped Cheers!! O:-)
Title: Re: SynFacilCompletion highlighter
Post by: Edson on December 31, 2017, 03:53:04 pm
Спасибо большое постараюсь разобраться! Но мне так и не понятно почему символ "#" вызывает ошибку?
Попробуйте просто открыть файл вписать только 1 символ # приложение при открытие такого го файла с символом вызывает ошибку.

It's because the token definition for "#" is using the attribute DIRECTIVE and it's not defined in the XML syntax.

Спасибо большое за ваш труд!! С наступающим 2018 годом!
And thank you for your work!! With the upcoming 2018!

You're welcome.

счастливый новый год 2018, Feliz Año Nuevo 2018.
Title: Re: SynFacilCompletion highlighter
Post by: BIT on December 31, 2017, 06:23:49 pm
Спасибо большое постараюсь разобраться! Но мне так и не понятно почему символ "#" вызывает ошибку?
Попробуйте просто открыть файл вписать только 1 символ # приложение при открытие такого го файла с символом вызывает ошибку.

It's because the token definition for "#" is using the attribute DIRECTIVE and it's not defined in the XML syntax.

Спасибо большое за ваш труд!! С наступающим 2018 годом!
And thank you for your work!! With the upcoming 2018!

You're welcome.

счастливый новый год 2018, Feliz Año Nuevo 2018.

Еще нашел ошибку если создавать динамически SynEdit и ваш компонент при удаление наборного текст происходит ошибка
Even found a bug if you create dynamically and your SynEdit component in the removal of stacked text error occurs
Title: Re: SynFacilCompletion highlighter
Post by: BIT on December 31, 2017, 08:44:58 pm
Не знаю за что отвечает но я закомментировал строку и ошибка пропала))))
I do not know what is responsible but I have commented out the line and the error was gone))))
Title: Re: SynFacilCompletion highlighter
Post by: taazz on December 31, 2017, 10:34:41 pm
Не знаю за что отвечает но я закомментировал строку и ошибка пропала))))
I do not know what is responsible but I have commented out the line and the error was gone))))
no you it did not you simple silenced it. Never ever ever edit the lcl units unles you know what you are doing and why. provide an example that raises the problem and we will tell you what you did wrong.
Title: Re: SynFacilCompletion highlighter
Post by: BIT on December 31, 2017, 11:07:48 pm
Не знаю за что отвечает но я закомментировал строку и ошибка пропала))))
I do not know what is responsible but I have commented out the line and the error was gone))))
no you it did not you simple silenced it. Never ever ever edit the lcl units unles you know what you are doing and why. provide an example that raises the problem and we will tell you what you did wrong.

Code: Pascal  [Select][+][-]
  1.   private
  2.  
  3.   public
  4.     //Вывод каталога в TreeView1
  5.     procedure FilePathToTreeNode(aTreeView: TTreeView; aRoot: TTreeNode;
  6.       Path: string; Recurse: boolean);
  7.     //Запись в INI
  8.     procedure INIWrite(FileName: string; Section: string; Key: string; Param: string);
  9.     //Чтение из INI
  10.     function INIRead(FileName: string; Section: string; Key: string;
  11.       Param: string): string;
  12.     //Создание вкладка
  13.     function NewTab(TabCaption: string): boolean;
  14.     //Команды выполнения для компонента TSynEdit и PageControl1
  15.     procedure SynEditComadeTab(Comade, Param: string);
  16.     //SynFacilComplet
  17.     procedure rKeyUp(Sender: TObject; var Key: word; Shift: TShiftState);
  18.     //SynFacilComplet
  19.     procedure rUTF8KeyPress(Sender: TObject; var UTF8Key: TUTF8Char);
  20.     //Загрузить компоненты из катологка
  21.     procedure LoadComponent();
  22.     procedure rToolButtonClick(Sender: TObject);
  23.   end;
  24.  
  25.  
  26. var
  27.   Form1: TForm1;
  28.   IniF: TINIFile;// Класс для работы с INI-файлами
  29.   {Создание вкладки с TSynEdit}
  30.   hlt: TSynFacilComplet;
  31.   Tab: TTabSheet;
  32.   rSynEdit: TSynEdit;
  33.  
  34.   {TreeView Добовляем интемы при открытие файла}
  35.   TreeViewObject: TStringList;
  36.   i: integer;
  37.   ProjectDir: string;
  38.  
  39. implementation
  40.  
  41. {$R *.lfm}
  42.  
  43. { TForm1 }
  44.  
  45. //Откроем проект через диалог - Вызываем функцию  Вывод каталога в TreeView1
  46. procedure TForm1.ToolButton1Click(Sender: TObject);
  47. begin
  48.   MenuItem12.Click;
  49. end;
  50. //Сохранить
  51. procedure TForm1.ToolButton3Click(Sender: TObject);
  52. begin
  53.   MenuItem13.Click;
  54. end;
  55.  
  56. procedure TForm1.ToolButton5Click(Sender: TObject);
  57. var
  58.   CompilT: CompilThread;
  59. begin
  60.   if GroupBox1.Visible = False then
  61.   begin
  62.     GroupBox1.Visible := True;
  63.     MenuItem10.Checked := True;
  64.   end;
  65.   Form1.SynEdit1.Color := clWhite;
  66.   MenuItem12.Enabled := False;
  67.   CompilT := CompilThread.Create(True);
  68.   CompilT.FreeOnTerminate := True;
  69.   CompilT.Priority := tpnormal;
  70.  
  71.   CompilT.Start;
  72.  
  73. end;
  74. //Отмена
  75. procedure TForm1.ToolButton7Click(Sender: TObject);
  76. begin
  77.   SynEditComadeTab('Undo', '');
  78. end;
  79. //Вернуть
  80. procedure TForm1.ToolButton8Click(Sender: TObject);
  81. begin
  82.   SynEditComadeTab('Redo', '');
  83. end;
  84.  
  85. procedure TForm1.FormCreate(Sender: TObject);
  86. begin
  87.  
  88.   //Загрузим настроки из INI приложения при старте программы
  89.   Form1.Width := StrToInt(INIRead('Otions.ini', 'Form', 'Form1.Width',
  90.     IntToStr(Form1.Width)));
  91.   Form1.Height := StrToInt(INIRead('Otions.ini', 'Form', 'Form1.Height',
  92.     IntToStr(Form1.Height)));
  93.   Form1.Left := StrToInt(INIRead('Otions.ini', 'Form', 'Form1.Left',
  94.     IntToStr(Form1.Left)));
  95.   Form1.Top := StrToInt(INIRead('Otions.ini', 'Form', 'Form1.Top', IntToStr(Form1.Top)));
  96.  
  97.   {Свойста проекта}
  98.   //Запускать ли игру Fals True
  99.   ValueListEditor1.Strings[0] := ('Запускать L.exe=True');
  100.   // ValueListEditor1.ItemProps[0].EditStyle:= esPickList;
  101.   ValueListEditor1.ItemProps[0].PickList.Add('True');
  102.   ValueListEditor1.ItemProps[0].PickList.Add('False');
  103.  
  104.   //Путь до игры
  105.   ValueListEditor1.ItemProps[1].EditStyle := esEllipsis;
  106.   ValueListEditor1.ItemProps[1].ReadOnly := True;
  107.  
  108.   //Загрузить настройки проекта при старте
  109.   ValueListEditor1.Strings[1] := ('Путь к L.exe=');
  110.  
  111.   ValueListEditor1.Refresh;
  112.   ValueListEditor1.AutoSizeColumn(0);
  113.  
  114. end;
  115.  
  116. procedure TForm1.FormDestroy(Sender: TObject);
  117. begin
  118.  
  119.     hlt.UnSelectEditor;   //release editor (only necessary if we are to call to SelectEditor(), again)
  120.   hlt.Free;  //destroy the highlighter
  121. end;
  122.  
  123. procedure TForm1.FormShow(Sender: TObject);
  124. begin
  125.   LoadComponent(); // загрузка компонентов
  126. end;
  127.  
  128. //Откроем проект через диалог - Вызываем функцию  Вывод каталога в TreeView1
  129. procedure TForm1.MenuItem12Click(Sender: TObject);
  130. var
  131.   g: integer;
  132. begin
  133.  
  134.   if OpenDialog1.Execute then
  135.     // if ExtractFileName(OpenDialog1.FileName) = 'Projects.luse' then
  136.   begin
  137.     TreeViewObject := TStringList.Create;
  138.  
  139.     for i := 0 to TreeViewObject.Count - 1 do
  140.     begin
  141.       if TreeView1.Items.Item[i].Data <> nil then
  142.         Dispose(PString(TreeView1.Items.Item[i].Data));
  143.     end;
  144.     TreeView1.Items.Clear;
  145.     FilePathToTreeNode(TreeView1, nil, ExtractFileDir(OpenDialog1.FileName) +
  146.       '\', True);
  147.     with TStringList.Create do
  148.     begin
  149.       LoadFromFile(OpenDialog1.FileName);
  150.       for g := 0 to Count - 1 do
  151.         ValueListEditor1.Cells[1, g + 1] := Strings[g];
  152.  
  153.     end;
  154.     ProjectDir := ExtractFileDir(OpenDialog1.FileName);
  155.  
  156.   end;
  157.  
  158. end;
  159. //Сохранить в файл Активный  SynEdit
  160. procedure TForm1.MenuItem13Click(Sender: TObject);
  161. begin
  162.   SynEditComadeTab('SaveFile', '');
  163. end;
  164.  
  165. //Закрыть вкладку
  166. procedure TForm1.MenuItem16Click(Sender: TObject);
  167. begin
  168.   SynEditComadeTab('CloseTab', '');
  169. end;
  170. //Удалить файл
  171. procedure TForm1.MenuItem21Click(Sender: TObject);
  172. begin
  173.   DeleteFile(string(TreeView1.Selected.Data));
  174.   TreeView1.Selected.Free;
  175. end;
  176. //Копировать
  177. procedure TForm1.MenuItem22Click(Sender: TObject);
  178. begin
  179.   SynEditComadeTab('Copy', '');
  180. end;
  181. //Вставить
  182. procedure TForm1.MenuItem23Click(Sender: TObject);
  183. begin
  184.   SynEditComadeTab('Paste', '');
  185. end;
  186. //Выделить все
  187. procedure TForm1.MenuItem24Click(Sender: TObject);
  188. begin
  189.   SynEditComadeTab('SelectAll', '');
  190. end;
  191. //Удалить выделеное
  192. procedure TForm1.MenuItem25Click(Sender: TObject);
  193. begin
  194.   SynEditComadeTab('ClearSelection', '');
  195. end;
  196.  
  197. procedure TForm1.MenuItem26Click(Sender: TObject);
  198. begin
  199.   Form2.ShowModal;
  200. end;
  201.  
  202. procedure TForm1.PageControl1Changing(Sender: TObject; var AllowChange: Boolean
  203.   );
  204. begin
  205.   //(PageControl1.ActivePage.FindComponent('syed' +
  206.   //  IntToStr(PageControl1.ActivePageIndex + 1)) as TSynEdit).SetFocus;
  207. end;
  208.  
  209. procedure TForm1.PageControl1MouseDown(Sender: TObject; Button: TMouseButton;
  210.   Shift: TShiftState; X, Y: integer);
  211. var
  212.   SelectPoint: TPoint;
  213. begin
  214.   //Смысл в том, что хотим выделить таб, при нажатии на нем правой клавишей мыши (вызов меню)
  215.   SelectPoint.x := X;
  216.   SelectPoint.y := Y;
  217.   PageControl1.ActivePageIndex := PageControl1.IndexOfPageAt(SelectPoint);
  218.  
  219. end;
  220.  
  221. procedure TForm1.SynEdit1DblClick(Sender: TObject);
  222. begin
  223.     if (Trim(ExtractWord(1, SynEdit1.LineText, ['|'])) = 'Просмотр') then
  224.   begin
  225.      if PageControl1.PageCount > 0 then
  226.   for i:=0 to PageControl1.PageCount-1 do
  227.     if Trim(ExtractWord(2, SynEdit1.LineText, ['|', '('])) = Trim(PageControl1.Page[i].Hint) then
  228.     begin
  229.      PageControl1.ActivePageIndex:=i;
  230.        SynEditComadeTab('LineIndex', Trim(ExtractWord(2, SynEdit1.LineText, ['(', ')'])));
  231.    exit;
  232.     end;
  233.       if (NewTab(ExtractFileName(Trim(ExtractWord(2, SynEdit1.LineText, ['|', '('])))) =
  234.     True) then
  235.      begin
  236.     // ShowMessage(Trim(ExtractWord(2, SynEdit1.LineText, ['|','(']))); //Путь до файла
  237.     //  ShowMessage(Trim(ExtractWord(2, SynEdit1.LineText, ['(',')']))); //Номер строки
  238.     SynEditComadeTab('Hint', Trim(ExtractWord(2, SynEdit1.LineText, ['|', '('])));
  239.     SynEditComadeTab('LoadFile', Trim(ExtractWord(2, SynEdit1.LineText, ['|', '('])));
  240.       SynEditComadeTab('LineIndex', Trim(ExtractWord(2, SynEdit1.LineText, ['(', ')'])));
  241.   end;
  242.  
  243.   end;
  244. end;
  245.  
  246. // Расцветка лога
  247. procedure TForm1.SynEdit1SpecialLineColors(Sender: TObject; Line: integer;
  248.   var Special: boolean; var FG, BG: TColor);
  249.  
  250. begin
  251.   if ((line mod 1) = 0) and (SynEdit1.Lines[0] = 'Готово!') then
  252.   begin
  253.     Special := True;
  254.     BG := $0072F968;
  255.   end;
  256.   if ((line mod 1) = 0) and (SynEdit1.Lines[0] =
  257.     'Компиляция проекта: ...') then
  258.   begin
  259.     Special := True;
  260.     BG := clYellow;
  261.   end;
  262.   if ((line mod 1) = 0) and (SynEdit1.Lines[0] = 'Запуск игры...') then
  263.   begin
  264.     Special := True;
  265.     BG := clAqua;
  266.   end;
  267.  
  268.   if ((line mod 1) = 0) and (SynEdit1.Lines[0] =
  269.     'Файл скомпилирован но путь к игре не найден!')
  270.   then
  271.   begin
  272.     Special := True;
  273.     BG := $0072F968;
  274.   end;
  275. end;
  276.  
  277. procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: boolean);
  278. begin
  279.   //Сохранить настроки в INI приложения при закрытие программы
  280.   INIWrite('Otions.ini', 'Form', 'Form1.Width', IntToStr(Form1.Width));
  281.   INIWrite('Otions.ini', 'Form', 'Form1.Height', IntToStr(Form1.Height));
  282.   INIWrite('Otions.ini', 'Form', 'Form1.Left', IntToStr(Form1.Left));
  283.   INIWrite('Otions.ini', 'Form', 'Form1.Top', IntToStr(Form1.Top));
  284. end;
  285.  
  286. procedure TForm1.TreeView1DblClick(Sender: TObject);
  287. var
  288.   i:integer;
  289. begin
  290.   // ShowMessage(string(TreeView1.Selected.Data));
  291.   {При клике на элемент в  TreeView1 загрузить файл в таб}
  292.  
  293.     if PageControl1.PageCount > 0 then
  294.   for i:=0 to PageControl1.PageCount-1 do
  295.  
  296.     if string(TreeView1.Selected.Data) = PageControl1.Page[i].Hint then
  297.     begin
  298.      PageControl1.ActivePageIndex:=i;
  299.    exit;
  300.     end;
  301.  
  302.   if (ExtractFileExt(string(TreeView1.Selected.Data)) > '') and
  303.     (NewTab(ExtractFileName(string(TreeView1.Selected.Data))) = True) then
  304.   begin
  305.  
  306.     SynEditComadeTab('Hint', string(TreeView1.Selected.Data));
  307.     SynEditComadeTab('LoadFile', string(TreeView1.Selected.Data));
  308.  
  309.  
  310.   end;
  311.  
  312. end;
  313. //Указать путь к игре в редакторе проета
  314. procedure TForm1.ValueListEditor1ButtonClick(Sender: TObject; aCol, aRow: integer);
  315. begin
  316.   if aCol = 1 then
  317.     if OpenDialog1.Execute then
  318.       if ExtractFileName(OpenDialog1.FileName) = 'L.exe' then
  319.         ValueListEditor1.Strings[1] := ('Путь к L.exe=' + OpenDialog1.FileName);
  320. end;
  321. //Вывод каталога в TreeView1 Пример:
  322. //FilePathToTreeNode(TreeView1, nil, 'Папка' + '\', True);
  323. procedure TForm1.FilePathToTreeNode(aTreeView: TTreeView; aRoot: TTreeNode;
  324.   Path: string; Recurse: boolean);
  325. var
  326.   NewNode: TTreeNode;
  327.   SRec: TSearchRec;
  328. begin
  329.  
  330.   if FindFirst(Path + '*.*', SysUtils.faAnyFile, SRec) = 0 then
  331.     repeat
  332.       if (sRec.Name = '.') or (sRec.Name = '..') then
  333.         Continue;
  334.       // if SRec.Name <> 'Projects.luse' then
  335.       //Не отоброжаем фай конфигурации
  336.       begin
  337.  
  338.         TreeViewObject.Add(PChar(Path + srec.Name));
  339.  
  340.         NewNode := aTreeView.Items.AddChildObject(aRoot, SRec.Name,
  341.           PChar(TreeViewObject.Strings[i]));
  342.         Inc(i);
  343.       end;
  344.       if Recurse and ((srec.Attr and SysUtils.faDirectory) <> 0) then
  345.       begin
  346.  
  347.         FilePathToTreeNode(aTreeView, NewNode, Path + srec.Name + '\', True);
  348.  
  349.  
  350.         //папка
  351.         NewNode.ImageIndex := 1108;
  352.         NewNode.SelectedIndex := 1108;
  353.  
  354.       end
  355.       else
  356.       begin
  357.  
  358.         // ShowMessage(PChar(NewNode.Data));
  359.         //Файл
  360.         NewNode.ImageIndex := 804;
  361.         NewNode.SelectedIndex := 785;
  362.       end;
  363.  
  364.  
  365.     until FindNext(SRec) <> 0;
  366.   FindClose(SRec);
  367. end;
  368. //Запись в INI Пример:
  369. //INIWrite('Otions.ini','Section', 'Key','тест');
  370. procedure TForm1.INIWrite(FileName: string; Section: string; Key: string;
  371.   Param: string);
  372. begin
  373.   if (FileExists(FileName)) then
  374.   begin
  375.     Inif := TINIFile.Create(FileName);
  376.     INiF.WriteString(Section, Key, Param);
  377.   end;
  378. end;
  379. //Чтение из INI Пример:
  380. //INIRead('Otions.ini','Section', 'Key','тест');
  381. function TForm1.INIRead(FileName: string; Section: string; Key: string;
  382.   Param: string): string;
  383. begin
  384.   if (FileExists(FileName)) then
  385.   begin
  386.     Inif := TINIFile.Create(FileName);
  387.     Result := INiF.ReadString(Section, Key, Param);
  388.   end;
  389. end;
  390. //Создание вкладки
  391. function TForm1.NewTab(TabCaption: string): boolean;
  392. begin
  393.   Tab := TTabSheet.Create(Self);
  394.   Tab.PageControl := PageControl1;
  395.   Tab.Caption := TabCaption;
  396.   Tab.PageControl.ActivePage := Tab;
  397.   Tab.Visible := False;
  398.  
  399.   rSynEdit := TSynEdit.Create(Tab);
  400.   rSynEdit.Parent := Tab;
  401.   rSynEdit.Align := alClient;
  402.   rSynEdit.OnUTF8KeyPress := @rUTF8KeyPress;
  403.   rSynEdit.OnKeyUp := @rKeyUp;
  404.   rSynEdit.RightEdge := 0;
  405.   rSynEdit.BorderStyle := bsNone;
  406.   rSynEdit.Color := clWhite;
  407.   rSynEdit.Font := SynEdit1.Font;
  408.   rSynEdit.MouseOptions := SynEdit1.MouseOptions;
  409.   rSynEdit.Options := SynEdit1.Options;
  410.   rSynEdit.Options2 := SynEdit1.Options2;
  411.   rSynEdit.Text := 'class NameClass' + IntToStr(PageControl1.PageCount) +
  412.     ' extends UICommonAPI;' + #13#13#13 + 'defaultproperties{}';
  413.   rSynEdit.Name := 'syed' + IntToStr(PageControl1.PageCount);
  414.   rSynEdit.PopupMenu := PopupMenu3;
  415.   SynPluginSyncroEdit1.Editor := rSynEdit;
  416.  
  417.   //configure highlighter
  418.   hlt := TSynFacilComplet.Create(Self);  //my highlighter
  419.   rSynEdit.Highlighter := hlt;  //optional if we are going to use SelectEditor()
  420.   hlt.LoadFromFile('UnrealScript.xml');  //load syntax
  421.   hlt.SelectEditor(rSynEdit);  //assign to editor
  422.   hlt.IconList := ImageList1;
  423.  
  424.   Result := True;
  425.    Tab.Visible := True;
  426. end;
  427. //Команды выполнения для компонента TSynEdit и PageControl1
  428. procedure TForm1.SynEditComadeTab(Comade, Param: string);
  429. var
  430.   syed: TSynEdit;
  431.  
  432.   x1, x2: integer;
  433. begin
  434.  
  435.   syed := (PageControl1.ActivePage.FindComponent('syed' +
  436.     IntToStr(PageControl1.ActivePageIndex + 1)) as TSynEdit);
  437.  
  438.   case Comade of
  439.     'Hint': PageControl1.ActivePage.Hint := Param; //Тут хранится путь к файлу
  440.     'Text': syed.Text := Param; //Загрузим текст
  441.     //Загрузим текст из файла
  442.     'LoadFile': syed.Lines.LoadFromFile(UTF8ToSys(Param));
  443.     //Сохраним текст в файл
  444.     'SaveFile': syed.Lines.SaveToFile(UTF8ToSys(PageControl1.ActivePage.Hint));
  445.     //Вставить текст в позицию курсора
  446.     'SelText': syed.SelText := Param;
  447.     //Перейти на Index строки
  448.     'LineIndex':
  449.     begin
  450.       syed.TopLine := StrToInt(Param);
  451.       //ShowMessage(Trim(syed.Lines[StrToInt(Param) - 1]));
  452.  
  453.       x1 := PosEx(Trim(syed.Lines[StrToInt(Param)]), Trim(syed.Text));
  454.       x2 := PosEx(Trim(syed.Lines[StrToInt(Param)]), Trim(syed.Text)) +
  455.         length(Trim(syed.Lines[StrToInt(Param)]));
  456.       syed.SelStart := x1;
  457.       syed.SelEnd := x2;
  458.  
  459.     end;
  460.     //Копировать
  461.     'Copy': syed.CopyToClipboard;
  462.     //Вставить
  463.     'Paste': syed.PasteFromClipboard;
  464.     //Вырезать
  465.     'Cut': syed.CutToClipboard;
  466.     //Выделить все
  467.     'SelectAll': syed.SelectAll;
  468.     //Удалить выделеное
  469.     'ClearSelection': syed.ClearSelection;
  470.     //Отмена
  471.     'Undo': syed.Undo;
  472.     //Вернуть
  473.     'Redo': syed.Redo;
  474.     ////Проверить существует ли TAB с таким файлом
  475.     //'EatTab': for PageControl1.TabIndex-1;
  476.     //Закрыть активную вкладку
  477.     'CloseTab': PageControl1.ActivePage.Free;
  478.  
  479.  
  480.     else
  481.       ShowMessage(Comade + 'Comade Не известнена!');
  482.   end;
  483.  
  484. end;
  485. //SynFacilComplet
  486. procedure TForm1.rKeyUp(Sender: TObject; var Key: word; Shift: TShiftState);
  487. begin
  488.   sleep(10);
  489.  hlt.KeyUp(Sender, Key, Shift);
  490.  
  491. end;
  492. //SynFacilComplet
  493. procedure TForm1.rUTF8KeyPress(Sender: TObject; var UTF8Key: TUTF8Char);
  494. begin
  495.   hlt.UTF8KeyPress(Sender, UTF8Key);
  496.  
  497. end;
  498. //Загрузить компоненты
  499. procedure TForm1.LoadComponent();
  500. var
  501.   Pic: TPortableNetworkGraphic;
  502.   i: integer;
  503.   PascalFiles, FilePathComponent: TStringList;
  504. begin
  505.   PascalFiles := TStringList.Create;
  506.   FilePathComponent := TStringList.Create;
  507.   try
  508.     FindAllFiles(PascalFiles, 'components', '*.lc', True);
  509.     //ShowMessage(PascalFiles.Text);
  510.     // ... тут читаем файл в StringList:
  511.  
  512.     for i := 0 to PascalFiles.Count - 1 do
  513.     begin
  514.       ToolBar2.ButtonList.Add(TToolButton.Create(Self));
  515.       //Ico:= TIcon.Create;
  516.       FilePathComponent.LoadFromFile(PascalFiles.Strings[i]);
  517.       Pic := TPortableNetworkGraphic.Create;
  518.       if FileExists(ExtractFilePath(PascalFiles.Strings[i]) + 'icon.png') = True then
  519.       begin
  520.         Pic.LoadFromFile(ExtractFilePath(PascalFiles.Strings[i]) + 'icon.png');
  521.         ImageList2.Add(Pic, nil);
  522.         //ShowMessage(ExtractFilePath(PascalFiles.Strings[i]) + '\icon.png');
  523.         ToolBar2.Buttons[ToolBar2.ButtonCount - 1].Hint := FilePathComponent.Strings[0];
  524.         ToolBar2.Buttons[ToolBar2.ButtonCount - 1].Caption := PascalFiles.Strings[i];
  525.         ToolBar2.Buttons[ToolBar2.ButtonCount - 1].Parent := ToolBar2;
  526.         ToolBar2.Images := ImageList2;
  527.         ToolBar2.Buttons[ToolBar2.ButtonCount - 1].ImageIndex := i;
  528.         ToolBar2.Buttons[ToolBar2.ButtonCount - 1].OnClick := @rToolButtonClick;
  529.       end;
  530.     end;
  531.   finally
  532.     PascalFiles.Free;
  533.     FilePathComponent.Free;
  534.     Pic.Free;
  535.   end;
  536. end;
  537.  
  538. procedure TForm1.rToolButtonClick(Sender: TObject);
  539. var
  540.   FilePathComponent: TStringList;
  541. begin
  542.   if PageControl1.ControlCount <> 0 then
  543.   begin
  544.     FilePathComponent := TStringList.Create;
  545.     FilePathComponent.LoadFromFile((Sender as TToolButton).Caption);
  546.     FilePathComponent.Strings[0] := '';
  547.     SynEditComadeTab('SelText', FilePathComponent.Text);
  548.  
  549.     FilePathComponent.Free;
  550.  
  551.   end;
  552. end;
  553.  
  554. end.    
Title: Re: SynFacilCompletion highlighter
Post by: BIT on December 31, 2017, 11:27:10 pm
Не знаю за что отвечает но я закомментировал строку и ошибка пропала))))
I do not know what is responsible but I have commented out the line and the error was gone))))
no you it did not you simple silenced it. Never ever ever edit the lcl units unles you know what you are doing and why. provide an example that raises the problem and we will tell you what you did wrong.
Если я только мог допустить ошибку при создания компонента возможно что то указал в не правильной подследственности
If I only could make a mistake when you create a component it is possible that it is pointed in the right jurisdiction
Code: Pascal  [Select][+][-]
  1. //Создание вкладки
  2. function TForm1.NewTab(TabCaption: string): boolean;
  3. begin
  4.   Tab := TTabSheet.Create(Self);
  5.   Tab.PageControl := PageControl1;
  6.   Tab.Caption := TabCaption;
  7.   Tab.PageControl.ActivePage := Tab;
  8.   Tab.Visible := False;
  9.  
  10.   rSynEdit := TSynEdit.Create(Tab);
  11.   rSynEdit.Parent := Tab;
  12.   rSynEdit.Align := alClient;
  13.   rSynEdit.OnUTF8KeyPress := @rUTF8KeyPress;
  14.   rSynEdit.OnKeyUp := @rKeyUp;
  15.   rSynEdit.RightEdge := 0;
  16.   rSynEdit.BorderStyle := bsNone;
  17.   rSynEdit.Color := clWhite;
  18.   rSynEdit.Font := SynEdit1.Font;
  19.   rSynEdit.MouseOptions := SynEdit1.MouseOptions;
  20.   rSynEdit.Options := SynEdit1.Options;
  21.   rSynEdit.Options2 := SynEdit1.Options2;
  22.   rSynEdit.Text := 'class NameClass' + IntToStr(PageControl1.PageCount) +
  23.     ' extends UICommonAPI;' + #13#13#13 + 'defaultproperties{}';
  24.   rSynEdit.Name := 'syed' + IntToStr(PageControl1.PageCount);
  25.   rSynEdit.PopupMenu := PopupMenu3;
  26.   SynPluginSyncroEdit1.Editor := rSynEdit;
  27.  
  28.   //configure highlighter
  29.   hlt := TSynFacilComplet.Create(Self);  //my highlighter
  30.   rSynEdit.Highlighter := hlt;  //optional if we are going to use SelectEditor()
  31.   hlt.LoadFromFile('UnrealScript.xml');  //load syntax
  32.   hlt.SelectEditor(rSynEdit);  //assign to editor
  33.   hlt.IconList := ImageList1;
  34.  
  35.   Result := True;
  36.    Tab.Visible := True;
  37. end;                
Title: Re: SynFacilCompletion highlighter
Post by: BIT on January 01, 2018, 10:22:18 am
Еще ошибка достала после завершения программы в Lazaruse ))

Still got error after program Lazaruse ))
Title: Re: SynFacilCompletion highlighter
Post by: Edson on January 02, 2018, 04:38:38 am
Hi. Would you please attach the project to review?
Title: Re: SynFacilCompletion highlighter
Post by: BIT on January 02, 2018, 07:49:15 am
Hi. Would you please attach the project to review?

Прошлый раз с Яндекса не качалось положил исходник на  диск google
Last time Yandex was not swayed put the source code on google drive

https://drive.google.com/file/d/1dxSTTczP4QZIYd_gsMFsktH9NjLRQYKC/view?usp=sharing

PS: Этот проект черновик много того что не реализовано но для выявления ошибок достаточно!
PS: The draft the draft a lot of that but not implemented to detect errors enough!
Title: Re: SynFacilCompletion highlighter
Post by: Edson on January 03, 2018, 02:47:45 am
The problem I see is you create dinamically a SynEdit and a Highlighter:

Code: Pascal  [Select][+][-]
  1. function TForm1.NewTab(TabCaption: string): boolean;
  2. begin
  3.   ...
  4.   rSynEdit := TSynEdit.Create(Tab);
  5.   rSynEdit.Parent := Tab;
  6.   ...
  7.   hlt := TSynFacilComplet.Create(Self);  //my highlighter
  8.   rSynEdit.Highlighter := hlt;  //optional if we are going to use SelectEditor()
  9.   ...
  10. end;

But you only destroy a highlighter using the global variable hlt:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormDestroy(Sender: TObject);
  2. begin
  3.   hlt.UnSelectEditor;   //release editor (only necessary if we are to call to SelectEditor(), again)
  4.   hlt.Free;  //destroy the highlighter
  5. end;
  6.  

Logically if you create several highlighters, you need to destroy each one. The SynEdit is destroyed because have a parent so no need to destroy manually.

The quick solution is just to comment the lines:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormDestroy(Sender: TObject);
  2. begin
  3.   //hlt.UnSelectEditor;   //release editor (only necessary if we are to call to SelectEditor(), again)
  4.   //hlt.Free;  //destroy the highlighter
  5. end;
  6.  

This will leave some leaks but will work.

The best solution is to implement a routine to Free the highlighter every time a SynEdit is destroyed.

Title: Re: SynFacilCompletion highlighter
Post by: BIT on January 03, 2018, 08:10:47 am
The problem I see is you create dinamically a SynEdit and a Highlighter:

Code: Pascal  [Select][+][-]
  1. function TForm1.NewTab(TabCaption: string): boolean;
  2. begin
  3.   ...
  4.   rSynEdit := TSynEdit.Create(Tab);
  5.   rSynEdit.Parent := Tab;
  6.   ...
  7.   hlt := TSynFacilComplet.Create(Self);  //my highlighter
  8.   rSynEdit.Highlighter := hlt;  //optional if we are going to use SelectEditor()
  9.   ...
  10. end;

But you only destroy a highlighter using the global variable hlt:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormDestroy(Sender: TObject);
  2. begin
  3.   hlt.UnSelectEditor;   //release editor (only necessary if we are to call to SelectEditor(), again)
  4.   hlt.Free;  //destroy the highlighter
  5. end;
  6.  

Logically if you create several highlighters, you need to destroy each one. The SynEdit is destroyed because have a parent so no need to destroy manually.

The quick solution is just to comment the lines:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormDestroy(Sender: TObject);
  2. begin
  3.   //hlt.UnSelectEditor;   //release editor (only necessary if we are to call to SelectEditor(), again)
  4.   //hlt.Free;  //destroy the highlighter
  5. end;
  6.  

This will leave some leaks but will work.

The best solution is to implement a routine to Free the highlighter every time a SynEdit is destroyed.

С этим понятно!

Меня больше интересует этот вопрос с ошибкой.
Возможно я не понятно объяснил что происходит. При наборе текста в SynEdit через некоторое время происходит ошибка которая на картинки.
Если отключить   hlt.KeyUp(Sender, Key, Shift);   и   hlt.UTF8KeyPress(Sender, UTF8Key);    Все работает отлично никаких ошибок подсветка работает.

With this clear!

I'm more interested in this question with the error.
I may not have clearly explained what was going on. When typing text in the SynEdit after some time an error occurs which pictures.
If you disable hlt.KeyUp(Sender, Key, Shift); and hlt.UTF8KeyPress(Sender, UTF8Key); Everything works fine no errors the backlight works.
Title: Re: SynFacilCompletion highlighter
Post by: Edson on January 03, 2018, 02:58:30 pm
When typing text in the SynEdit after some time an error occurs which pictures.
If you disable hlt.KeyUp(Sender, Key, Shift); and hlt.UTF8KeyPress(Sender, UTF8Key); Everything works fine no errors the backlight works.

Do you mean the error occurs after some minutes of typing in SynEdit?
I always use SynFacilCompletion in mode "Autocompletion" and have no problems.

Do you have the error picture?

I need to recreate the problem in a project to check.
Title: Re: SynFacilCompletion highlighter
Post by: BIT on January 03, 2018, 05:02:55 pm
When typing text in the SynEdit after some time an error occurs which pictures.
If you disable hlt.KeyUp(Sender, Key, Shift); and hlt.UTF8KeyPress(Sender, UTF8Key); Everything works fine no errors the backlight works.

Do you mean the error occurs after some minutes of typing in SynEdit?
I always use SynFacilCompletion in mode "Autocompletion" and have no problems.

Do you have the error picture?

I need to recreate the problem in a project to check.


Да вы правильно поняли
Эту ошибку можно вызвать из проекта что я скинул выше

Yes, you understand correctly
This error can be cause from a project that I threw above
Title: Re: SynFacilCompletion highlighter
Post by: Edson on January 03, 2018, 07:12:25 pm
I see.

The error has nothing to do with using the SynEdit for a while. It's produced in some circumstances, like  When changing  the Editor tab, when the completion window is opened.

In general, I would say you need to include several error treatment routines, no only for SYnFacilCompletion.

Maybe you can use SynFacilUtils: https://github.com/t-edson/SynFacilUtils. It includes a frontend class for SynFacilCompletion and SynEdit.

And for manage several Editor tabs, you can check PicPas: https://github.com/t-edson/PicPas
Title: Re: SynFacilCompletion highlighter
Post by: BIT on January 03, 2018, 08:35:54 pm
I see.

The error has nothing to do with using the SynEdit for a while. It's produced in some circumstances, like  When changing  the Editor tab, when the completion window is opened.

In general, I would say you need to include several error treatment routines, no only for SYnFacilCompletion.

Maybe you can use SynFacilUtils: https://github.com/t-edson/SynFacilUtils. It includes a frontend class for SynFacilCompletion and SynEdit.

And for manage several Editor tabs, you can check PicPas: https://github.com/t-edson/PicPas
Хорошо спасибо буду искать способ исправления ошибки
Good thank you I will look for the way to fix the error
Title: Re: SynFacilCompletion highlighter
Post by: BIT on January 04, 2018, 06:46:35 am
I see.

The error has nothing to do with using the SynEdit for a while. It's produced in some circumstances, like  When changing  the Editor tab, when the completion window is opened.

In general, I would say you need to include several error treatment routines, no only for SYnFacilCompletion.

Maybe you can use SynFacilUtils: https://github.com/t-edson/SynFacilUtils. It includes a frontend class for SynFacilCompletion and SynEdit.

And for manage several Editor tabs, you can check PicPas: https://github.com/t-edson/PicPas
Случайно увидел у вас в коде такую функцию, решил использовать и вот чудо все заработало!!!
Возможно в будущих версия учтете и добавите сразу исправление ошибки чтоб другие не сталкивались!

Accidentally saw you in the code such a feature, decided to use and that's a miracle it worked!!!
Perhaps in future version I will consider and add a bug fix that others have not experienced!
Code: Pascal  [Select][+][-]
  1. procedure TForm1.PageControl1Change(Sender: TObject);
  2. begin
  3.  
  4.  hlt.SelectEditor(SynEdit));
  5. end;
  6.          
Title: Re: SynFacilCompletion highlighter
Post by: BIT on January 04, 2018, 06:55:56 am
И чтоб вообще быть точным вот мой код
And that actually to be exact here is my code

Code: Pascal  [Select][+][-]
  1. procedure TForm1.PageControl1Change(Sender: TObject);
  2. begin
  3.  
  4.  hlt.SelectEditor(( PageControl1.ActivePage.FindComponent('syed' +IntToStr(PageControl1.ActivePageIndex + 1)) as TSynEdit));
  5.  
  6.  
  7. end;            
Title: Re: SynFacilCompletion highlighter
Post by: BIT on January 04, 2018, 07:07:56 am
И еще после перехода на версию 1.20 как я заметил перестала вызываться вот это строка
And even after the upgrade to version 1.20 as I noticed stopped volunteering here is a string

Code: Pascal  [Select][+][-]
  1. <Keyword>void defaultproperties struct function extends class union enum char short int long double float signed unsigned const static extern auto register volatile</Keyword>

Code: Pascal  [Select][+][-]
  1. </List>
  2.  
  3. </Completion>
  4.  <Attribute Name="Especiales" ForeCol="#00bfff" Bold="True"> </Attribute>
  5.   <Attribute Name="Keyword"  ForeCol="Blue"> </Attribute>
  6.   <Attribute Name="DIRECTIVE" ForeCol="#a1a130"></Attribute>
  7.    <Attribute Name="Comment"  ForeCol="#228b22"> </Attribute>
  8.    <Attribute Name="SYMBOL" ForeCol="Red"></Attribute>
  9.    <Attribute Name="STRING" ForeCol="#a1a130"></Attribute>
  10.   <Comment Start="//" ></Comment>
  11.   <Comment Start="/*" End="*/" Multiline="true" Folding="true"></Comment>
  12.  
  13.    <Token CharsStart="$" Content = '0..9ABCDEFabcdef' Attribute='NUMBER' > </Token>
  14.    <Token CharsStart="@" Content = '0..9ABCDEFabcdef' Attribute='NUMBER'> </Token>
  15.  
  16.    <Identifiers CharsStart= "A..Za..z_" Content = "A..Za..z0..9_">
  17.  <Especiales>
  18. var local
  19.  </Especiales>
  20.  </Identifiers>
  21.  
  22.   <String Start='"' End='"'></String>
  23.  
  24.   <Keyword>void defaultproperties struct function extends class union enum char short int long double float signed unsigned const static extern auto register volatile</Keyword>
  25.    <Keyword>if else switch case default break goto return for while do continue typedef sizeof NULL</Keyword>
  26.    <Block Start="{" End= "}"> </Block>
  27.   <Token Start="#" Attribute='DIRECTIVE'> </Token>
  28.  
  29. </Language>

И не могли бы вы мне правильно собрать эту подсветку?
And could you give me the right to collect the ambient lighting?
Title: Re: SynFacilCompletion highlighter
Post by: BIT on January 04, 2018, 10:46:41 am
Еще 1 ошибка при удаление PageControl1.ActivePage.Free и переходе на другой Page возможно ошибка  не связана с вашим модулем но как правильно уничтожить?
hlt.UnSelectEditor;   //release editor (only necessary if we are to call to SelectEditor(), again)
  hlt.Free;  //destroy the highlighter


1 more error when deleting PageControl1.ActivePage.Free and move to another Page perhaps the error is not with your module but how to destroy?
hlt.UnSelectEditor; //release editor (only necessary if we are to call to SelectEditor(), again)
hlt.Free; //destroy the highlighter
Title: Re: SynFacilCompletion highlighter
Post by: BIT on January 04, 2018, 12:37:10 pm
Решил эту ошибку так может кому то пригодится
Solved this error so maybe someone will be useful

Code: Pascal  [Select][+][-]
  1. Tab.OnShow:= @TabShow;
  2.  
  3.  
  4. procedure TForm1.TabShow(Sender: TObject);
  5. begin
  6.        
  7. hlt.SelectEditor(( PageControl1.ActivePage.FindComponent('syed' +IntToStr(PageControl1.ActivePageIndex + 1)) as TSynEdit));
  8.  
  9. end;  
  10.  
  11.  
Title: Re: SynFacilCompletion highlighter
Post by: BIT on January 04, 2018, 12:44:07 pm
Да что же это такое теперь вот эта ошибка))) но она как я поняли из вашего модуля точно!

То есть если удалить последнею вкладку все работает отлично но если удалить любую другую получаю при переходе на вкладку такую ошибку

What is it now here is the mistake))) but it as I understood from your module for sure!

That is, if you remove the last tab, everything works fine but if you remove any other getting when you go to the tab that mistake
Title: Re: SynFacilCompletion highlighter
Post by: BIT on January 04, 2018, 05:42:57 pm
Я как понял  PageControl на свое усмотрение возвращает Sender вкладки(( Сделал пока так  PageControl1.ActivePage.TabVisible:=false; 
Если кто сталкивался с такой проблемой помогите это не вариант что я сделал PageControl1.ActivePage.TabVisible:=false;

I understand PageControl in its sole discretion returns the Sender tab(( PageControl1 Done yet.ActivePage.TabVisible:=false;
If who faced such problem help is not an option what did I do PageControl1.ActivePage.TabVisible:=false;
Title: Re: SynFacilCompletion highlighter
Post by: Edson on January 04, 2018, 10:19:40 pm
Accidentally saw you in the code such a feature, decided to use and that's a miracle it worked!!!
Code: Pascal  [Select][+][-]
  1. procedure TForm1.PageControl1Change(Sender: TObject);
  2. begin
  3.  hlt.SelectEditor(SynEdit));
  4. end;
  5.  

Where did you find this code?
Title: Re: SynFacilCompletion highlighter
Post by: Edson on January 04, 2018, 10:53:27 pm
И еще после перехода на версию 1.20 как я заметил перестала вызываться вот это строка
And even after the upgrade to version 1.20 as I noticed stopped volunteering here is a string

Code: Pascal  [Select][+][-]
  1. <Keyword>void defaultproperties struct function extends class union enum char short int long double float signed unsigned const static extern auto register volatile</Keyword>

Do you refer the Keyword list is not include in the completion list?

It's because it is not included in the Completion definition. You need to do something like:

Code: XML  [Select][+][-]
  1. <Completion>
  2.   <List name='UnrealScript' IconIndex='938'>
  3. "IsPKMode();//bool"
  4. "RequestExit();"
  5. "RequestAuthCardKeyLogin( int uid, string value);"
  6. ...
  7.     </List>
  8.  
  9.     <OpenOn >
  10.       <Include list="UnrealScript"></Include>
  11.       <Include Attribute="Keyword"></Include>
  12.     </OpenOn>
  13.  
  14. </Completion>
  15.  
Title: Re: SynFacilCompletion highlighter
Post by: BIT on January 04, 2018, 11:06:04 pm
Accidentally saw you in the code such a feature, decided to use and that's a miracle it worked!!!
Code: Pascal  [Select][+][-]
  1. procedure TForm1.PageControl1Change(Sender: TObject);
  2. begin
  3.  hlt.SelectEditor(SynEdit));
  4. end;
  5.  

Where did you find this code?

оказалось что он уже  был в описание)  hlt.SelectEditor(); вообщем неважно. Я отключил ваш компонент и испробовал все тоже самое с вкладками после удаления вкладки предыдущие компоненты на вкладке становятся недоступны теперь я поманю что это никак не связано с вашим компонентом спасибо за помощь удачи!

it turned out that he was already in the description) hlt.SelectEditor(); actually doesn't matter. I disabled your component and tried all the same with the tabs after removing the previous tab components in the tab are unavailable now, I beckon that it has nothing to do with your component thanks for the help good luck!
Title: Re: SynFacilCompletion highlighter
Post by: Edson on August 31, 2020, 05:37:14 pm
SynFacilCompletion library for completion code in SynEdit is updated to version 1.22: https://github.com/t-edson/SynFacilCompletion
TinyPortal © 2005-2018