From a9fbb1092a180dbe1e51906a217e41110c89172d Mon Sep 17 00:00:00 2001 From: cy384 Date: Thu, 13 Aug 2020 11:21:05 -0400 Subject: [PATCH] add edit menu --- ssheven-constants.r | 5 +++-- ssheven.c | 5 +++++ ssheven.r | 19 ++++++++++++++++++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/ssheven-constants.r b/ssheven-constants.r index 3ebd5af..ccc0129 100644 --- a/ssheven-constants.r +++ b/ssheven-constants.r @@ -53,7 +53,8 @@ /* menus */ #define SSHEVEN_MBAR 128 -#define MENU_APPLE 128 -#define MENU_FILE 129 +#define MENU_APPLE 128 +#define MENU_FILE 129 +#define MENU_EDIT 130 #endif diff --git a/ssheven.c b/ssheven.c index 5196209..ad60377 100644 --- a/ssheven.c +++ b/ssheven.c @@ -640,6 +640,11 @@ int main(int argc, char** argv) void* menu = GetNewMBar(SSHEVEN_MBAR); SetMenuBar(menu); AppendResMenu(GetMenuHandle(MENU_APPLE), 'DRVR'); + + // disable everything in the edit menu until we implement it + menu = GetMenuHandle(MENU_EDIT); + DisableItem(menu, 0); + DrawMenuBar(); console_setup(); diff --git a/ssheven.r b/ssheven.r index 841c6b6..c5e7b05 100644 --- a/ssheven.r +++ b/ssheven.r @@ -235,7 +235,7 @@ resource 'BNDL' (128, purgeable) { resource 'MBAR' (SSHEVEN_MBAR, preload) { - { MENU_APPLE, MENU_FILE }; + { MENU_APPLE, MENU_FILE, MENU_EDIT }; }; resource 'MENU' (MENU_APPLE) { @@ -257,6 +257,23 @@ resource 'MENU' (MENU_FILE) { } }; +resource 'MENU' (MENU_EDIT) { + MENU_EDIT, textMenuProc; + allEnabled, enabled; + "Edit"; + { + "Undo", noIcon, "Z", noMark, plain; + "-", noIcon, noKey, noMark, plain; + "Cut", noIcon, "X", noMark, plain; + "Copy", noIcon, "C", noMark, plain; + "Paste", noIcon, "V", noMark, plain; + "Clear", noIcon, noKey, noMark, plain; + "Select All", noIcon, "A", noMark, plain; + "-", noIcon, noKey, noMark, plain; + "Show Clipboard", noIcon, noKey, noMark, plain; + } +}; + #include "Icons.r" /* use this regex to get rid of data comments: " \/\*[^\*]*\*\/" */