aboutsummaryrefslogtreecommitdiffstats
path: root/src/AppDelegate.m
AgeCommit message (Collapse)Author
2023-09-30Switch to the 0BSD licenseTeddy Wing
Since this is intended to be template code upon which to build a full application, I didn't like that the prior license required the full license text to be reproduced in distributions. I want the code to be a base for developers to use when starting a Cocoa application, like the template code that's generated in a new Xcode project. As such, I want people to be allowed to remove my license when distributing the code.
2023-09-30Add license (primarily BSD-3-Clause)Teddy Wing
Set a BSD-3-Clause license on all the application code so that it can be freely used as a base template for an application. Use the GNU GPLv3+ for the log script as it's a helper utility that isn't compiled into the application.
2023-09-30AppDelegate: Set main window content view to scroll viewTeddy Wing
Make the window's `contentView` the `_scroll_view` so that resizing the window causes the scroll view to resize with the window instead of having a fixed size.
2023-09-30AppDelegate: Remove old test codeTeddy Wing
2023-09-09Clean up "Find" menu testsTeddy Wing
* Remove the `NSTextFinder` code as it's not necessary to get a find bar for an `NSTextView`. * Remove the commented notes for the "Find" menu.
2023-09-09AppDelegate: Add NSTextFinder find barTeddy Wing
Add a find bar leveraging NSTextFinder. It turns out I didn't need to do anything custom with `NSTextFinder` since `NSTextView` conveniently already has a `usesFindBar` property to turn on built-in support for it. I discovered that by looking at the TextEdit source code available here: https://developer.apple.com/library/archive/samplecode/TextEdit/Introduction/Intro.html I added an `NSScrollView` because you kind of need one to implement `NSTextFinder`. Not sure if the finding functionality would still work without the scroll view. Also use the proper `-performTextFinderAction:` selector for the "Find…" menu item to open the find bar. Now we can confirm that the "Find" menu items work correctly.
2023-08-22AppDelegate: Set `allowsUndo` on the NSTextViewTeddy Wing
Just discovered this property which enables basic undo/redo functionality on the NSTextView. I can now confirm that the Undo and Redo menu bar items do in fact work.
2023-08-22AppDelegate: Experiment to set NSTextView to window contentViewTeddy Wing
2023-08-20MainMenu: Try switching to `NSFontManager` -fontMenu:Teddy Wing
This creates the whole font menu for me, and the actions work correctly, very nice! Read about this in the `NSFontManager` documentation. The only hitch is that some menu items don't appear to have the proper keyEquivalents set. For example, "Show Colors", "Copy Style", and "Paste Style" are all missing the Apple key from the shortcuts.
2023-08-16AppDelegate: Add an NSTextView to test Edit menuTeddy Wing
Most options seem to work, except for Undo, Redo, and the Find commands.
2023-08-15AppDelegate: Make main window closeableTeddy Wing
This enables the "Close" menu item in the File menu and allows it to work.
2023-08-14Move main_menu.{h,m} to MainMenu.{h,m}Teddy Wing
Decided to use Core Foundation naming conventions here instead of C-style lowercase. It seems to fit better with the Objective-C code.
2023-08-14Move application menu bar code to a new fileTeddy Wing
Put the menu code in its own file to keep it more organised. We're also going to be adding a lot more code here for the base main menu. Wasn't sure if I should be releasing these menu objects, but it looks like the application works when I do release them, so maybe `setMainMenu` does a retain or copy. I can't decide if I should use C-style identifiers or Foundation-style in the menu file.
2023-08-14Add an NSApplicationDelegateTeddy Wing
Move the window creation to a separate class, and also allow us to take advantage of `NSApplicationDelegate` protocol methods.