Page 1 of 1

API questions

Posted: 02.06.2020 17:04
by tmsg
@Alexey: I'm experimenting with the on_message event, this seems to get 4 parameters: self, ed_self, id and text. id seems always to be zero so what's it doing? (BTW on_message is not yet in the API wiki.)

And also I want to write a simple plugin that toggles the display between two different fonts, one for programming and the other for plain text editing. I have not found out how to do that by looking through the API docs so I'd appreciate it if you can drop a quick hint.

And great to see that you take documenting this stuff seriously! One big problem with many APIs is that nobody (sometimes even not the creator :D ) knows how to use them.

Posted: 02.06.2020 17:52
by Alexey
https://wiki.freepascal.org/CudaText_API#Panels
it's in the wiki. "id" is described.

Font can be changed yet only for editors in dlg_proc() forms. But not for editors in ui tabs. (dlg_proc - all controls have "font_name" property.)

Posted: 03.06.2020 09:11
by tmsg
@Alexey: You are right, it's in the Wiki... I looked at the wrong section. :(

As to the editor font issue, I assume "editors in ui tabs" means the edit controls used for editing text (those changed by user.json's "font_name*").

But what is the difference between "dlg_proc() forms" and these editors?

Posted: 03.06.2020 09:39
by Alexey
"editors in ui tabs" are editors hosted /managed by Cud. if dlg_proc() makes new "editor", it's not managed by Cud.
V1.102.2 has new API to change font for ALL editors - see API wiki, what's new at end.