Dear ALL,
In the course of learning how to use some of the less well documented features of the SynEdit component editor, as well as the MultiFrame component for the simulation of 'classical' MDI applications, I have developed a simple program using these components, which I have called VIPER - The Very Ineffective Programming Editor for R. Althought this program is primarily intended to be just a demonstration for teaching/learning purposes, nonetheless it aims to offer a very simple, but fully functional, interface to the R system for statistical computing and graphics (
https://www.r-project.org/).
VIPER demonstrates several features of SynEdit for which I have had a hard time to find out how to use, as a line/column counter on the status bar, search and replace using the common dialogs, turning line numbers on and off, and so on. In this effort, I have been much helped by the superb and highly recommended document 'La Biblia del SynEdit' written by Tito Hinostroza (
http://blog.pucp.edu.pe/blog/tito/2013/10/12/lazarus-la-biblia-del-synedit/).
Using the MultiFrame component (
https://github.com/lycaner/multiframe) written by Patrick Chevalley (author of two of the greatest Lazarus applications ever, the fantastic SkyChart and Virtual Moon Atlas) showed to be more difficult to master, because documentation for this component is quite scarce. In this regard, I really got a good start with the small demo provided in this forum by user PeterX (
https://forum.lazarus.freepascal.org/index.php?topic=34137.0).
The implementation is fairly satisfactory, but I found a few problems which I hope to solve with your help:
i) How to detect when there is
no more child windows on the program main window? I am using the MultiFrame event OnDeleteChild to detect when each window is closed, but it seems that it still returns '1' even after the last child is closed.
ii) I could not devise a way to detect when a file has been changed, issuing a warning to the user. The event OnChange of the SynEdit component allows to detecting changes in the text editor, but how can I pass this information to the main form?
iii) When calling R as an external process, by means of the RunCommand procedure (in the Process unit), an ugly console screen keeps flashing when R is executed, even if I added the poNoConsole parameter. This is really strange because I tested calling another command line program with the RunCommand procedure and in that case the console window has
not been displayed.
iv) Since there is no predefined highlighter for the R language included in Lazarus, I have used the one for PHP until I can create one for R using the SynAnySyn highlighter. This is not really an issue, but if someone have already done that, it would avoid the hassle of reinventing the wheel.
I attach the complete source code of VIPER, as well as the lastest version of the MultiFrame component (which should be installed in order to be able to run the program).
Could someone give me some hints towards solving these issues?
Thanks in advance for any assistance you can provide.
Best regards,