If there is a debug() statement in some nodefunction of a GUI, the code editor window is opened upon reaching the breakpoint. The editor window points to the instance of the UI, not the prototype. That's fine, but the is a usability issue if the user closes the GUI first while still in debug.
- code editor remains in debug mode, but the node function, which it was connected to, ceases to exist
- normal user interface functionality of Flexsim becomes inaccessible:
- views become non-responsive to mouse events
- the model cannot be saved
- it's impossible to execute commands in Script console (if it happens to be open)
- it's impossible to quit Flexsim normally
- on clicking Windows close button, Flexsim asks to save the model, but no matter what option the user chooses, the program doesn't close
- sometimes this leads to eventually crashing Flexsim altogether
- the most recent changes to the model will be lost
I suggest to implement a keyboard shortcut to interrupt all debug activity anytime, and stop debugging automatically in related code editor windows when the GUI is closed (or probably close these windows as well). This would avoid possible loss of data and confusion of having orphaned code windows.
Maybe I miss something, and interrupting debug from keyboard is possible? (As indicated above, the views are not responding to the mouse, though it's possible to switch between the views).
Steps to reproduce:
- Open a new model
- In Toolbox, add a new custom Graphical User Interface
- Add a button to the GUI
- In the button's >OnPress add debug(); statement
- Right-click on the GUI in the Toolbox and choose Show GUI
- Click the button
- Close GUI