From bf96e3bc9c7588198299570a2133ba6f1d3ac42e Mon Sep 17 00:00:00 2001 From: Grayson Riffe Date: Mon, 20 Jan 2025 21:41:36 -0600 Subject: [PATCH] Add menu --- Mainspring/resource.rc | 18 ++++++++++++++++++ Mainspring/src/resources.h | 12 ++++++++++++ 2 files changed, 30 insertions(+) diff --git a/Mainspring/resource.rc b/Mainspring/resource.rc index 0f9d952..d6ebe32 100644 --- a/Mainspring/resource.rc +++ b/Mainspring/resource.rc @@ -3,9 +3,27 @@ #include "winres.h" #include "src/resources.h" +IDR_MENUMAIN MENU +BEGIN + POPUP "&File" + BEGIN + MENUITEM "&New Time\tCtrl+N" ID_FILE_NEW + MENUITEM "&Save Time\tCtrl+S" ID_FILE_SAVE + MENUITEM "Save Time &As...\tCtrl+Shift+S" ID_FILE_SAVEAS + MENUITEM "&Open Time\tCtrl+O" ID_FILE_OPEN + MENUITEM "&Exit\tAlt+F4" ID_FILE_EXIT + END + + POPUP "&Help" + BEGIN + MENUITEM "&About" ID_HELP_ABOUT + END +END + IDD_DIALOGMAIN DIALOGEX 0, 0, 175, 75 STYLE WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | DS_SETFONT FONT 8, "MS Shell Dlg", 400, 0, 0x1 +MENU IDR_MENUMAIN BEGIN CTEXT "APPNAME", IDC_STATICTITLE, 30, 5, 115, 20, SS_CENTERIMAGE CTEXT "TIME", IDC_STATICTIME, 10, 25, 155, 25, SS_CENTERIMAGE diff --git a/Mainspring/src/resources.h b/Mainspring/src/resources.h index 7306b0f..5f0d28a 100644 --- a/Mainspring/src/resources.h +++ b/Mainspring/src/resources.h @@ -1,6 +1,18 @@ // Win32 resources +// Dialog #define IDD_DIALOGMAIN 101 +// Menu +#define IDR_MENUMAIN 201 +#define ID_FILE_NEW 202 +#define ID_FILE_SAVE 203 +#define ID_FILE_SAVEAS 204 +#define ID_FILE_OPEN 205 +#define ID_FILE_EXIT 206 + +#define ID_HELP_ABOUT 211 + +// Controls (text and buttons) #define IDC_BUTTONSTARTPAUSE 1001 #define IDC_STATICTITLE 1002 #define IDC_STATICTIME 1003