Open moirage opened 7 years ago
The reason I commented out that line, as the comment preceding the line says, was a bug it caused with undo/redo/cut/copy/paste/delete keyboard shortcuts. The RichTextFX TextArea we use for editing assembly language programs has built-in undo/redo/cut/copy/paste/delete keyboard shortcuts. These work just fine in CPU Sim on every platform except one: a Mac in which CPU Sim's menubar is at the top of the screen. If the menubar is at the top of the screen, then, when you use those keyboard shortcuts, the action is executed twice. Executing the action twice is not a problem with cut or copy, but pasting twice or undoing twice is not good. (The action is only executed once if you select the menu item with the mouse instead of using the keyboard shortcut.) I thought at first that it was a bug in TextArea, but I think it might be a bug in JavaFX on the Mac. I have been hoping that Java 9, when it appears, will have a fix. I haven't pursued the issue in a while.
For later, here is the repository of the component: https://github.com/TomasMikula/RichTextFX
Perhaps we can update the dependency, see if it fixes itself. If it doesn't, time to open a bug.
When I build a Mac application, it correctly puts the menubar at the top of the screen like is done on a Mac, instead of at the top of the window. And it adds an Apple menu on the left end of the menu bar. However, there are two Quit menu items now: one in the Apple menu and one in the File menu. They both perform the same action. Also, there is no way to move the Preferences and About menu items to the Apple menu, as is standard for Mac applications. I think this is a JavaFX missing feature.