|
|
| version 1.11, 2003/11/09 21:57:04 | version 1.12, 2003/11/09 23:42:06 |
|---|---|
| Line 98 static void InitToolBox(void) { | Line 98 static void InitToolBox(void) { |
| static void MenuBarInit(void) { | static void MenuBarInit(void) { |
| Handle hMenu; | Handle hdl; |
| MenuHandle happlemenu; | MenuHandle hmenu; |
| hMenu = GetNewMBar(IDM_MAINMENU); | hdl = GetNewMBar(IDM_MAINMENU); |
| if (!hMenu) { | if (hdl == NULL) { |
| ExitToShell(); | ExitToShell(); |
| } | } |
| SetMenuBar(hMenu); | SetMenuBar(hdl); |
| happlemenu = GetMenuHandle(IDM_APPLE); | hmenu = GetMenuHandle(IDM_APPLE); |
| if (happlemenu) { | if (hmenu) { |
| AppendResMenu(happlemenu, 'DRVR'); | AppendResMenu(hmenu, 'DRVR'); |
| } | } |
| InsertMenu(GetMenu(IDM_SASI1), -1); | InsertMenu(GetMenu(IDM_SASI1), -1); |
| InsertMenu(GetMenu(IDM_SASI2), -1); | InsertMenu(GetMenu(IDM_SASI2), -1); |
| InsertMenu(GetMenu(IDM_KEYBOARD), -1); | InsertMenu(GetMenu(IDM_KEYBOARD), -1); |
| InsertMenu(GetMenu(IDM_SOUND), -1); | InsertMenu(GetMenu(IDM_SOUND), -1); |
| InsertMenu(GetMenu(IDM_MEMORY), -1); | InsertMenu(GetMenu(IDM_MEMORY), -1); |
| SetMenuItemModifiers(GetMenuHandle(IDM_FDD2), LoWord(IDM_FDD2OPEN), | |
| kMenuOptionModifier); | |
| SetMenuItemModifiers(GetMenuHandle(IDM_FDD2), LoWord(IDM_FDD2EJECT), | |
| kMenuOptionModifier); | |
| SetMenuItemModifiers(GetMenuHandle(IDM_SASI2), LoWord(IDM_SASI2OPEN), | |
| kMenuOptionModifier); | |
| #if TARGET_API_MAC_CARBON | #if TARGET_API_MAC_CARBON |
| DisableMenuItem(GetMenuHandle(IDM_DEVICE), LoWord(IDM_MOUSE)); | hmenu = GetMenuHandle(IDM_FDD2); |
| DisableMenuItem(GetMenuHandle(IDM_KEYBOARD), LoWord(IDM_F12MOUSE)); | SetItemCmd(hmenu, LoWord(IDM_FDD2OPEN), 'D'); |
| SetMenuItemModifiers(hmenu, LoWord(IDM_FDD2OPEN), kMenuOptionModifier); | |
| SetItemCmd(hmenu, LoWord(IDM_FDD2EJECT), 'E'); | |
| SetMenuItemModifiers(hmenu, LoWord(IDM_FDD2EJECT), kMenuOptionModifier); | |
| hmenu = GetMenuHandle(IDM_SASI2); | |
| SetItemCmd(hmenu, LoWord(IDM_FDD2OPEN), 'O'); | |
| SetMenuItemModifiers(hmenu, LoWord(IDM_SASI2OPEN), kMenuOptionModifier); | |
| #else | |
| EnableItem(GetMenuHandle(IDM_DEVICE), LoWord(IDM_MOUSE)); | |
| EnableItem(GetMenuHandle(IDM_KEYBOARD), LoWord(IDM_F12MOUSE)); | |
| #endif | #endif |
| DrawMenuBar(); | DrawMenuBar(); |
| } | } |
| Line 483 static void HandleMouseDown(EventRecord | Line 487 static void HandleMouseDown(EventRecord |
| case inMenuBar: | case inMenuBar: |
| if (np2running) { | if (np2running) { |
| soundmng_stop(); | soundmng_stop(); |
| mousemng_disable(MOUSEPROC_MACUI); | |
| HandleMenuChoice(MenuSelect(pevent->where)); | HandleMenuChoice(MenuSelect(pevent->where)); |
| mousemng_enable(MOUSEPROC_MACUI); | |
| soundmng_play(); | soundmng_play(); |
| } | } |
| break; | break; |
| Line 518 static void HandleMouseDown(EventRecord | Line 524 static void HandleMouseDown(EventRecord |
| static void eventproc(EventRecord *event) { | static void eventproc(EventRecord *event) { |
| int keycode; | |
| keycode = (event->message & keyCodeMask) >> 8; | |
| switch(event->what) { | switch(event->what) { |
| case mouseDown: | case mouseDown: |
| HandleMouseDown(event); | HandleMouseDown(event); |
| Line 529 static void eventproc(EventRecord *event | Line 538 static void eventproc(EventRecord *event |
| case keyDown: | case keyDown: |
| case autoKey: | case autoKey: |
| if (np2running) { | if (!np2running) { |
| mackbd_f12down(((event->message) & keyCodeMask) >> 8); | break; |
| if (event->modifiers & cmdKey) { | } |
| soundmng_stop(); | #if !TARGET_API_MAC_CARBON |
| HandleMenuChoice(MenuKey(event->message & charCodeMask)); | if ((keycode == 0x6f) && (np2oscfg.F12COPY == 0)) { |
| soundmng_play(); | HandleMenuChoice(IDM_MOUSE); |
| } | break; |
| } | |
| #endif | |
| if (event->modifiers & cmdKey) { | |
| soundmng_stop(); | |
| mousemng_disable(MOUSEPROC_MACUI); | |
| HandleMenuChoice(MenuKey(event->message & charCodeMask)); | |
| mousemng_enable(MOUSEPROC_MACUI); | |
| soundmng_play(); | |
| } | |
| else { | |
| mackbd_keydown(keycode); | |
| } | } |
| break; | break; |
| case keyUp: | case keyUp: |
| mackbd_f12up(((event->message) & keyCodeMask) >> 8); | mackbd_keyup(keycode); |
| break; | break; |
| case mouseUp: | case mouseUp: |