|
|
|
|
@@ -58,7 +58,6 @@ void CConfigWindow::updateFont()
|
|
|
|
|
for (HWND child : std::initializer_list<HWND>({
|
|
|
|
|
*m_version, *m_modeGroup, *m_modeBox, *m_widthLabel, *m_heightLabel, *m_refreshLabel,
|
|
|
|
|
*m_modeWidth, *m_modeHeight, *m_modeRefresh, *m_modeUpdate, *m_modeDelete,
|
|
|
|
|
*m_autosizeGroup, *m_defRefreshLabel, *m_defRefresh, *m_defRefreshHz,
|
|
|
|
|
}))
|
|
|
|
|
SendMessage(child, WM_SETFONT, (WPARAM)m_font.Get(), 1);
|
|
|
|
|
}
|
|
|
|
|
@@ -111,24 +110,15 @@ LRESULT CConfigWindow::onCreate()
|
|
|
|
|
m_heightLabel.reset(new CStaticWidget(L"Height:", WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, m_hwnd));
|
|
|
|
|
m_refreshLabel.reset(new CStaticWidget(L"Refresh:", WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, m_hwnd));
|
|
|
|
|
|
|
|
|
|
m_modeWidth.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT | ES_NUMBER, m_hwnd));
|
|
|
|
|
m_modeHeight.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT | ES_NUMBER, m_hwnd));
|
|
|
|
|
m_modeRefresh.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT | ES_NUMBER, m_hwnd));
|
|
|
|
|
m_modeWidth.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT, m_hwnd));
|
|
|
|
|
m_modeHeight.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT, m_hwnd));
|
|
|
|
|
m_modeRefresh.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT, m_hwnd));
|
|
|
|
|
|
|
|
|
|
m_modeUpdate.reset(new CButton(L"Save", WS_CHILD | WS_VISIBLE, m_hwnd));
|
|
|
|
|
m_modeDelete.reset(new CButton(L"Delete", WS_CHILD | WS_VISIBLE, m_hwnd));
|
|
|
|
|
EnableWindow(*m_modeUpdate, FALSE);
|
|
|
|
|
EnableWindow(*m_modeDelete, FALSE);
|
|
|
|
|
|
|
|
|
|
m_autosizeGroup.reset(new CGroupBox(L"Autosizing", WS_CHILD | WS_VISIBLE, m_hwnd));
|
|
|
|
|
m_defRefreshLabel.reset(new CStaticWidget(L"Default refresh:", WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, m_hwnd));
|
|
|
|
|
m_defRefresh.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT | ES_NUMBER, m_hwnd));
|
|
|
|
|
m_defRefreshHz.reset(new CStaticWidget(L"Hz", WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, m_hwnd));
|
|
|
|
|
|
|
|
|
|
RECT client = { 0, 0, (LONG)(436 * m_scale), (LONG)(300 * m_scale) };
|
|
|
|
|
AdjustWindowRect(&client, WS_OVERLAPPEDWINDOW, FALSE);
|
|
|
|
|
SetWindowPos(m_hwnd, NULL, 0, 0, client.right - client.left, client.bottom - client.top, SWP_NOMOVE | SWP_NOZORDER);
|
|
|
|
|
|
|
|
|
|
updateFont();
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
@@ -145,7 +135,6 @@ LRESULT CConfigWindow::onResize(DWORD width, DWORD height)
|
|
|
|
|
{
|
|
|
|
|
WidgetPositioner pos(m_scale, width, height);
|
|
|
|
|
pos.pinTopLeftRight(*m_version, 12, 12, 12, 20);
|
|
|
|
|
|
|
|
|
|
pos.pinLeftTopBottom(*m_modeGroup, 12, 40, 200, 12);
|
|
|
|
|
pos.pinLeftTopBottom(*m_modeBox, 24, 64, 176, 120);
|
|
|
|
|
pos.pinBottomLeft(*m_widthLabel, 24, 96, 50, 20);
|
|
|
|
|
@@ -156,11 +145,6 @@ LRESULT CConfigWindow::onResize(DWORD width, DWORD height)
|
|
|
|
|
pos.pinBottomLeft(*m_modeRefresh, 75, 48, 50, 20);
|
|
|
|
|
pos.pinBottomLeft(*m_modeUpdate, 24, 20, 50, 24);
|
|
|
|
|
pos.pinBottomLeft(*m_modeDelete, 75, 20, 50, 24);
|
|
|
|
|
|
|
|
|
|
pos.pinTopLeft(*m_autosizeGroup, 224, 40, 200, 52);
|
|
|
|
|
pos.pinTopLeft(*m_defRefreshLabel, 236, 64, 95, 20);
|
|
|
|
|
pos.pinTopLeft(*m_defRefresh, 331, 64, 63, 20);
|
|
|
|
|
pos.pinTopLeft(*m_defRefreshHz, 398, 64, 16, 20);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -220,7 +204,7 @@ LRESULT CConfigWindow::onCommand(WORD id, WORD code, HWND hwnd)
|
|
|
|
|
|
|
|
|
|
LRESULT result = m_settings.setModes(*m_modes);
|
|
|
|
|
if (result != ERROR_SUCCESS)
|
|
|
|
|
DEBUG_ERROR_HR((HRESULT) result, "Failed to save modes");
|
|
|
|
|
DEBUG_ERROR_HR(result, "Failed to save modes");
|
|
|
|
|
}
|
|
|
|
|
else if (hwnd == *m_modeDelete && code == BN_CLICKED && m_modes)
|
|
|
|
|
{
|
|
|
|
|
@@ -234,7 +218,7 @@ LRESULT CConfigWindow::onCommand(WORD id, WORD code, HWND hwnd)
|
|
|
|
|
|
|
|
|
|
LRESULT result = m_settings.setModes(*m_modes);
|
|
|
|
|
if (result != ERROR_SUCCESS)
|
|
|
|
|
DEBUG_ERROR_HR((HRESULT) result, "Failed to save modes");
|
|
|
|
|
DEBUG_ERROR_HR(result, "Failed to save modes");
|
|
|
|
|
|
|
|
|
|
updateModeList();
|
|
|
|
|
onModeListSelectChange();
|
|
|
|
|
|