Add icon and resume

This commit is contained in:
Grayson Riffe 2025-01-21 00:42:05 -06:00
parent d60cedf10d
commit ab198d6778
4 changed files with 20 additions and 12 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -3,6 +3,8 @@
#include "winres.h" #include "winres.h"
#include "src/resources.h" #include "src/resources.h"
IDI_ICONMAIN ICON "res/mainspring.ico"
IDR_MENUMAIN MENU IDR_MENUMAIN MENU
BEGIN BEGIN
POPUP "&File" POPUP "&File"

View File

@ -35,6 +35,7 @@ namespace mainspring {
app = reinterpret_cast<Application*>(lParam); app = reinterpret_cast<Application*>(lParam);
SetWindowText(dlg, app->m_appName); SetWindowText(dlg, app->m_appName);
SendMessage(dlg, WM_SETICON, ICON_BIG, reinterpret_cast<LPARAM>(LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICONMAIN))));
POINT cursor = {}; POINT cursor = {};
GetCursorPos(&cursor); GetCursorPos(&cursor);
@ -71,9 +72,9 @@ namespace mainspring {
SetTimer(dlg, 1, 50, nullptr); SetTimer(dlg, 1, 50, nullptr);
} }
else { else {
SetDlgItemText(dlg, IDC_BUTTONSTARTPAUSE, "Start");
KillTimer(dlg, 1); KillTimer(dlg, 1);
app->m_elapsedSaved += app->getElapsed(); app->m_elapsedSaved += app->getElapsed();
SetDlgItemText(dlg, IDC_BUTTONSTARTPAUSE, !app->m_elapsedSaved ? "Start" : "Resume");
} }
app->m_timing = !app->m_timing; app->m_timing = !app->m_timing;

View File

@ -1,18 +1,23 @@
// Win32 resources // Win32 resources
// Icon
#define IDI_ICONMAIN 101
// Dialog // Dialog
#define IDD_DIALOGMAIN 101 #define IDD_DIALOGMAIN 201
// Menu // Menu
#define IDR_MENUMAIN 201 #define IDR_MENUMAIN 301
#define ID_FILE_NEW 202 #define ID_FILE_NEW 302
#define ID_FILE_SAVE 203 #define ID_FILE_SAVE 303
#define ID_FILE_SAVEAS 204 #define ID_FILE_SAVEAS 304
#define ID_FILE_OPEN 205 #define ID_FILE_OPEN 305
#define ID_FILE_EXIT 206 #define ID_FILE_EXIT 306
#define ID_HELP_ABOUT 211 #define ID_HELP_ABOUT 311
// Controls (text and buttons) // Controls (text and buttons)
#define IDC_BUTTONSTARTPAUSE 1001 #define IDC_BUTTONSTARTPAUSE 1001
#define IDC_STATICTITLE 1002 #define IDC_STATICTITLE 1002
#define IDC_STATICTIME 1003 #define IDC_STATICTIME 1003
#define IDC_STATICICON 1004