aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
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-21MainMenu: Remove custom Font menuTeddy Wing
Now that we have a working Font menu built by `NSFontManager`, we can remove our custom Font menu code.
2023-08-21MainMenu: Add missing Command modifier if missing from Font menu itemsTeddy Wing
I don't understand why, but on Mac OS X 10.15, three menu items in the automatically-generated Font menu don't have a Command key modifier. Detect when this happens and add the modifier to the mask. These menu items correctly had a Command key modifier when I tested the code on macOS 13.
2023-08-21MainMenu: Reorder Font menu fix functionsTeddy Wing
Do this so we don't have to bother with forward declarations.
2023-08-21MainMenu: Ideas for adding missing Command key equivalent modifierTeddy Wing
Check if the Command key is included in the modifier mask. If not, then add it.
2023-08-21MainMenu: Trying to debug lack of Apple modifiers in Font menuTeddy 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-20MainMenu: Fix "Enter Full Screen" shortcutTeddy Wing
Turns out the problem was that I just didn't update the keyEquivalent after copy-pasting this paragraph. Now it works correctly. As for the tab bar menu items, it looks like those are inserted automatically in an Xcode-generated app, so it isn't strange that they're there.
2023-08-20MainMenu: Add Help menuTeddy Wing
2023-08-20MainMenu: Add Window menuTeddy Wing
2023-08-20MainMenu: Add View menuTeddy Wing
Create the View menu based on MainMenu.xib. Need to investigate this more, as some default menu items appeared even without me adding anything to this menu. My menu has "Show Tab Bar" and "Show All Tabs" even though I haven't added these. And it already had an "Enter Full Screen" menu item without any shortcut tied to it, which appears to override mine with a shortcut.
2023-08-20MainMenu: Add actions for most Format menu itemsTeddy Wing
Add the actions based on MainMenu.xib that target First Responder. The others require an NSFontManager, so I have to read up on what's required for that.
2023-08-20MainMenu: Add rest of the menu items to the Format menuTeddy Wing
Still need to set the actions on these menu items.
2023-08-17MainMenu: Add note for "Open Recent" menuTeddy Wing
2023-08-17MainMenu: Add Format>Font menuTeddy Wing
Don't have the actions yet, but this is the structure.
2023-08-17MainMenu: Return `NSMenuItem`s from functionsTeddy Wing
2023-08-17MainMenu: Trying to get Edit>Find menu items workingTeddy Wing
I learned about tags and that there are new names for the NSTextFinder identifiers starting in 10.7. But these still don't seem to be doing anything. But I tried adding an NSTextView to a window in a base Xcode project and the Find actions don't seem to work there either. So now that I have this, I'm thinking the rest of the problem lies elsewhere. Perhaps the NSTextView isn't connected enough to enable the Find actions.
2023-08-16MainMenu: Add notes for Edit menu fixesTeddy Wing
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-16MainMenu: Add Edit menu itemsTeddy Wing
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-15MainMenu: Add File menu itemsTeddy Wing
2023-08-15Default main menu: Describe base main menuTeddy Wing
Write a list of all the default main menu items generated in a new Cocoa app MainMenu.nib generated by Xcode. We'll use this as a guide to reimplement all of the menus and items in code.
2023-08-15MainMenu: Add Services menu to Application menuTeddy Wing
2023-08-15MainMenu: Set "Quit" target to `NSApp`Teddy Wing
It seemed to work without this, but I figure it's better to be more explicit.
2023-08-15MainMenu: Make "Hide" and "Hide Others" menu items workTeddy Wing
2023-08-15MainMenu: Add application name to application menu itemsTeddy Wing
The About, Hide, and Quit menu items all include the application name in their titles.
2023-08-15MainMenu: Add Application menu itemsTeddy Wing
These don't work yet, but this is the default list in a Cocoa application created with Xcode.
2023-08-15MainMenu: Switch `about_menu_item` to non-local allocationTeddy Wing
Found out there's an `addItemWithTitle:action:keyEquivalent:` in `NSMenu` that allows us to skip allocating the menu item ourselves.
2023-08-15MainMenu.m: Add "About" menu itemTeddy Wing
2023-08-15Move build product to `/build/`Teddy Wing
Makes it cleaner and easier to ignore from revision control.
2023-08-14MainMenu.m: Add structure for menusTeddy Wing
Add functions that will create the menus in the application.
2023-08-14main: Release AppDelegateTeddy Wing
Forgot this when I added it.
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.
2023-08-14Simple windowed applicationTeddy Wing
Create a simple windowed Cocoa application with an application menu and a "Quit" menu item.