Tuesday, January 7, 2014

Program Loading Process

The main window class currently loads the entire text of the program read from the selected file.  This text is given to the edit box instance using the setPlainText function, which is overloaded from the QPlainTextEdit base class, and just resets the cursor valid flag before calling the base class function.

The document of the edit box then emits a document changed signal, which is processed and the attached program unit is updated.  The cursor valid flag prevents the program change and error signals from the updated program unit from being processed, otherwise an infinite loop would occur.  Once the cursor is moved (the cursor position is changed after the document is changed), the cursor valid flag is set and the errors are processed.

This process will be changed to where the new program class will load the program from the file into the program unit.  Later all the subroutines and functions that are included in the program file will be detected and each loaded into a separate program unit.  This change in the program loading process will be handled over several sets of changes and will be explained in the next set of posts.