Topic: AppGraphics AutoTextProject

Hi Jeff,

I was unable to compile your AutoText MultiLine project example using MS Windows 10 and SF 3.29. I received the following error but don't know the reason for the error.

BTW, At first read, it appears that your application of real-time multi-line printing has the potential to be a useful addition to Simply Fortran's toolbox.

Frank

==============================================================================
Generating Makefile... Okay
==============================================================================
Processing default resource
Generating multilinetextbox.exe
build\autotext_thread.o:autotext_thread.c:(.text+0x141): undefined reference to `_imp__PathIsRelativeA@4'
build\autotext_thread.o:autotext_thread.c:(.text+0x1ec): undefined reference to `_imp__PathCombineA@12'
build\autotext_thread.o:autotext_thread.c:(.text+0x26a): undefined reference to `_imp__PathRemoveFileSpecA@4'
collect2.exe: error: ld returned 1 exit status
Error: Last command making (multilinetextbox.exe) returned a bad status
Error: Make execution terminated

* Failed *

Re: AppGraphics AutoTextProject

Frank,

The project requires another library for linking, shlwapi, that provides those functions.  They're standard Windows API calls.  Make sure your linking flags include at least the following:

-lappgraphics -lgdi32 -lcomdlg32 -lcomctl32 -luuid -loleaut32 -lole32 -lshlwapi

and it should compile fine.

Jeff Armstrong
Approximatrix, LLC

Re: AppGraphics AutoTextProject

Jeff,

Thanks for your prompt reply to my question. Adding the link to the library -lshlwapi worked perfectly.

However, I have one further question regarding the MultiLineTextBox object.  I noticed that it's possible to scroll and type within the textbox even after the results are displayed.

So to my question, once the results are displayed and comments referring to the results are added manually by typing them in the text box, would it be possible to have the typed-in comments saved with the results file itself? Currently, they are not saved.

Frank

Re: AppGraphics AutoTextProject

Frank,

You would have to take that step manually.  The example code opens the file to display in read-only mode and attempts to display the results as the file updates.  If you wanted to save the text box contents, which could have notes, you'd need to manually offer that to users.  I would think some indicator that the contents are modified to encourage saving might be sufficient.

Jeff Armstrong
Approximatrix, LLC

Re: AppGraphics AutoTextProject

Jeff,

Is there a programmatically way of "Clearing" (deleting) text in an already population multi-line textbox?

For example, when text is written to the textbox, I would like to delete all the contents, and then repopulated it.

A clear_textbox() function or something like that would help.

Frank

Re: AppGraphics AutoTextProject

Frank,

A call to settextboxcontents with an empty or all-spaces string should clear the contents.  Perhaps a more explicit interface would be nice, though.

Jeff Armstrong
Approximatrix, LLC

Re: AppGraphics AutoTextProject

Hi Jeff,

UPDATE: Your suggestion does, in fact, clear the textbox using either buffer="" or buffer=" ".

However, I'm likely trying to use the textbox for something it was not intended to be used for.
When repeatedly (usually 3 times) Reading data, then Saving the textbox to a file, and Clearing it again, I receive an abort error from the autotext.f90 subroutine isfortranunitopen. I'm not exactly sure of the cause of the problem. I've also seen a recursive error from the same autotext.f90 subroutine.  The problem is likely with my code and not your createmultilinetextbox routine.

Frank

Re: AppGraphics AutoTextProject

Frank,

I'll look into it a bit more. There's a good chance there is an issue in the C<->Fortran interfacing there or I'm not seeing a problem.

Out of curiosity, are you reusing a unit number?  That could cause some problems.

Jeff Armstrong
Approximatrix, LLC

Re: AppGraphics AutoTextProject

Jeff,

You are correct about keeping track of file and object unit numbers. With some better accounting of the open and closed unit numbers, the createmultilinetextbox appears to now work correctly.  By adding Save and Print routines, I can now Read data from a text file, edit the text, then Save it, and Print it.  Even though this can more easily be done with any notepad, having the ability to add this functionality to SF applications is a nice addition. Nice work.

Frank