API questions

Post Reply
tmsg
Posts: 120
Joined: 20.05.2020 12:08

API questions

Post 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.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post 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.)
tmsg
Posts: 120
Joined: 20.05.2020 12:08

Post 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?
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post 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.
Post Reply