The addition of a `Copy' menu item on OS X was really beginning to
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 1 May 2005 14:05:03 +0000 (14:05 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 1 May 2005 14:05:03 +0000 (14:05 +0000)
strain my unconventional menu organisation, so I've reverted to
having `File' and `Edit' menus like everyone else.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@5727 cda61777-01e9-0310-a592-d414129be87e

osx.m
puzzles.but

diff --git a/osx.m b/osx.m
index 28af613..f444a9f 100644 (file)
--- a/osx.m
+++ b/osx.m
  *    nested sheet. On the other hand I think there are good
  *    practical reasons for wanting it that way. Uncertain.
  * 
- *  - User feedback suggests we should have `File' and `Edit' menus
- *    like everyone else, so some menu reorg is probably required,
- *    along with some documentation rewording.
- * 
- *  - User feedback also dislikes nothing happening when you start
- *    the app; they suggest a finder-like window containing an icon
- *    for each puzzle type, enabling you to start one easily. Needs
+ *  - User feedback dislikes nothing happening when you start the
+ *    app; they suggest a finder-like window containing an icon for
+ *    each puzzle type, enabling you to start one easily. Needs
  *    thought.
  * 
  * Grotty implementation details that could probably be improved:
@@ -1151,12 +1147,12 @@ void status_bar(frontend *fe, char *text)
 @interface AppController : NSObject
 {
 }
-- (void)newGame:(id)sender;
+- (void)newGameWindow:(id)sender;
 @end
 
 @implementation AppController
 
-- (void)newGame:(id)sender
+- (void)newGameWindow:(id)sender
 {
     const game *g = [sender getPayload];
     id win;
@@ -1175,7 +1171,7 @@ void status_bar(frontend *fe, char *text)
            id item =
                initnewitem([DataMenuItem allocWithZone:[NSMenu menuZone]],
                            menu, gamelist[i]->name, "", self,
-                           @selector(newGame:));
+                           @selector(newGameWindow:));
            [item setPayload:(void *)gamelist[i]];
        }
     }
@@ -1216,30 +1212,31 @@ int main(int argc, char **argv)
     item = newitem(menu, "Quit", "q", NSApp, @selector(terminate:));
     [NSApp setAppleMenu: menu];
 
-    menu = newsubmenu([NSApp mainMenu], "Open");
+    menu = newsubmenu([NSApp mainMenu], "File");
+    item = newitem(menu, "New Game", "n", NULL, @selector(newGame:));
+    item = newitem(menu, "Restart Game", "r", NULL, @selector(restartGame:));
+    item = newitem(menu, "Specific Game", "", NULL, @selector(specificGame:));
+    [menu addItem:[NSMenuItem separatorItem]];
     {
+       NSMenu *submenu = newsubmenu(menu, "New Window");
        int i;
 
        for (i = 0; i < gamecount; i++) {
            id item =
                initnewitem([DataMenuItem allocWithZone:[NSMenu menuZone]],
-                           menu, gamelist[i]->name, "", controller,
-                           @selector(newGame:));
+                           submenu, gamelist[i]->name, "", controller,
+                           @selector(newGameWindow:));
            [item setPayload:(void *)gamelist[i]];
        }
     }
-
-    menu = newsubmenu([NSApp mainMenu], "Game");
-    item = newitem(menu, "New", "n", NULL, @selector(newGame:));
-    item = newitem(menu, "Restart", "r", NULL, @selector(restartGame:));
-    item = newitem(menu, "Specific", "", NULL, @selector(specificGame:));
     [menu addItem:[NSMenuItem separatorItem]];
+    item = newitem(menu, "Close", "w", NULL, @selector(performClose:));
+
+    menu = newsubmenu([NSApp mainMenu], "Edit");
     item = newitem(menu, "Undo", "z", NULL, @selector(undoMove:));
     item = newitem(menu, "Redo", "S-z", NULL, @selector(redoMove:));
     [menu addItem:[NSMenuItem separatorItem]];
     item = newitem(menu, "Copy", "c", NULL, @selector(copy:));
-    [menu addItem:[NSMenuItem separatorItem]];
-    item = newitem(menu, "Close", "w", NULL, @selector(performClose:));
 
     menu = newsubmenu([NSApp mainMenu], "Type");
     typemenu = menu;
index c25ec00..9b88d18 100644 (file)
@@ -82,6 +82,10 @@ These actions are all available from the \I{Game menu}\q{Game} menu
 and via \I{keys}keyboard shortcuts, in addition to any game-specific
 actions.
 
+(On Mac OS X, to conform with local user interface standards, these
+actions are situated on the \I{File menu}\q{File} and \q{Edit
+menu}\q{Edit} menus instead.)
+
 \dt \ii\e{New game} (\q{N}, Ctrl+\q{N})
 
 \dd Starts a new game, with a random initial state.
@@ -99,6 +103,13 @@ game.)
 
 \dd Redoes a previous undone move.
 
+\dt \ii\e{Copy}
+
+\dd Copies the current state of your game to the clipboard in text
+format, so that you can paste it into (say) an e-mail client or a
+web message board if you're discussing the game with someone else.
+(Not all games support this feature.)
+
 \dt \I{exit}\ii\e{Quit} (\q{Q}, Ctrl+\q{Q})
 
 \dd Closes the application entirely.
@@ -106,8 +117,8 @@ game.)
 \H{common-id} Recreating games with the \ii{game ID}
 
 The \q{\i{Specific...}} option from the \I{Game menu}\q{Game} menu
-lets you see a short string (the \q{game ID}) that captures the
-initial state of the current game.
+(or the \q{File} menu, on Mac OS X) lets you see a short string (the
+\q{game ID}) that captures the initial state of the current game.
 
 The precise \I{ID format}format of the ID is specific to each game.
 It consists of two parts delimited by a colon (e.g., \c{c4x4:4F01,0});
@@ -151,11 +162,11 @@ command line.
 
 The easiest way to do this is to set up the parameters you want
 using the \q{Type} menu (see \k{common-type}), and then to select
-\q{Specific} from the \q{Game} menu (see \k{common-id}). The text in
-the \q{Game ID} box will be composed of two parts, separated by a
-colon. The first of these parts represents the game parameters (the
-size of the playing area, for example, and anything else you set
-using the \q{Type} menu).
+\q{Specific} from the \q{Game} or \q{File} menu (see \k{common-id}).
+The text in the \q{Game ID} box will be composed of two parts,
+separated by a colon. The first of these parts represents the game
+parameters (the size of the playing area, for example, and anything
+else you set using the \q{Type} menu).
 
 If you run the game with just that parameter text on the command
 line, it will start up with the settings you specified.