summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6ad5ed7)
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
* nested sheet. On the other hand I think there are good
* practical reasons for wanting it that way. Uncertain.
*
* 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:
* thought.
*
* Grotty implementation details that could probably be improved:
@interface AppController : NSObject
{
}
@interface AppController : NSObject
{
}
-- (void)newGame:(id)sender;
+- (void)newGameWindow:(id)sender;
@end
@implementation AppController
@end
@implementation AppController
-- (void)newGame:(id)sender
+- (void)newGameWindow:(id)sender
{
const game *g = [sender getPayload];
id win;
{
const game *g = [sender getPayload];
id win;
id item =
initnewitem([DataMenuItem allocWithZone:[NSMenu menuZone]],
menu, gamelist[i]->name, "", self,
id item =
initnewitem([DataMenuItem allocWithZone:[NSMenu menuZone]],
menu, gamelist[i]->name, "", self,
+ @selector(newGameWindow:));
[item setPayload:(void *)gamelist[i]];
}
}
[item setPayload:(void *)gamelist[i]];
}
}
item = newitem(menu, "Quit", "q", NSApp, @selector(terminate:));
[NSApp setAppleMenu: menu];
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]],
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]];
}
}
[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]];
[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:));
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;
menu = newsubmenu([NSApp mainMenu], "Type");
typemenu = menu;
and via \I{keys}keyboard shortcuts, in addition to any game-specific
actions.
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.
\dt \ii\e{New game} (\q{N}, Ctrl+\q{N})
\dd Starts a new game, with a random initial state.
\dd Redoes a previous undone move.
\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.
\dt \I{exit}\ii\e{Quit} (\q{Q}, Ctrl+\q{Q})
\dd Closes the application entirely.
\H{common-id} Recreating games with the \ii{game ID}
The \q{\i{Specific...}} option from the \I{Game menu}\q{Game} menu
\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});
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});
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
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.
If you run the game with just that parameter text on the command
line, it will start up with the settings you specified.