Main UI layout

This commit is contained in:
Grayson Riffe 2025-01-20 21:26:11 -06:00
parent c0f04232b4
commit c076fd969e
3 changed files with 24 additions and 4 deletions

@ -1,9 +1,13 @@
// Mainspring resource script
#include "windows.h"
#include "winres.h"
#include "src/resources.h"
IDD_DIALOGMAIN DIALOGEX 0, 0, 150, 75
STYLE WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_POPUP
IDD_DIALOGMAIN DIALOGEX 0, 0, 175, 75
STYLE WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | DS_SETFONT
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
END
CTEXT "APPNAME", IDC_STATICTITLE, 30, 5, 115, 20, SS_CENTERIMAGE
CTEXT "TIME", IDC_STATICTIME, 10, 25, 155, 25, SS_CENTERIMAGE
DEFPUSHBUTTON "STARTPAUSE" IDC_BUTTONSTARTPAUSE, 63, 55, 50, 15
END

@ -36,6 +36,18 @@ namespace mainspring {
GetMonitorInfo(MonitorFromPoint(cursor, MONITOR_DEFAULTTONEAREST), &mi);
SetWindowPos(dlg, nullptr, mi.rcMonitor.left + 100, mi.rcMonitor.top + 100, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
SetDlgItemText(dlg, IDC_STATICTITLE, app->m_appName);
LOGFONT lFont = {};
lFont.lfHeight = 30;
HFONT titleFont = CreateFontIndirect(&lFont);
SendMessage(GetDlgItem(dlg, IDC_STATICTITLE), WM_SETFONT, reinterpret_cast<WPARAM>(titleFont), NULL);
lFont.lfHeight = 40;
HFONT timeFont = CreateFontIndirect(&lFont);
SendMessage(GetDlgItem(dlg, IDC_STATICTIME), WM_SETFONT, reinterpret_cast<WPARAM>(timeFont), NULL);
SetDlgItemText(dlg, IDC_BUTTONSTARTPAUSE, "Start");
return TRUE;
}

@ -1,2 +1,6 @@
// Win32 resources
#define IDD_DIALOGMAIN 101
#define IDC_BUTTONSTARTPAUSE 1001
#define IDC_STATICTITLE 1002
#define IDC_STATICTIME 1003