From 569619384c754430c4786d1faccac88cbb94220f Mon Sep 17 00:00:00 2001 From: Quantum Date: Sat, 4 Oct 2025 03:12:22 -0400 Subject: [PATCH] [idd] helper: add mode edit labels --- idd/LGIddHelper/CConfigWindow.cpp | 14 ++++++++++++-- idd/LGIddHelper/CConfigWindow.h | 4 ++++ idd/LGIddHelper/UIHelpers.h | 5 +++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/idd/LGIddHelper/CConfigWindow.cpp b/idd/LGIddHelper/CConfigWindow.cpp index 4e125cde..0adf7821 100644 --- a/idd/LGIddHelper/CConfigWindow.cpp +++ b/idd/LGIddHelper/CConfigWindow.cpp @@ -53,7 +53,9 @@ void CConfigWindow::updateFont() return; } - for (HWND child : std::initializer_list({ *m_version, *m_modeGroup, *m_modeBox })) + for (HWND child : std::initializer_list({ + *m_version, *m_modeGroup, *m_modeBox, *m_widthLabel, *m_heightLabel, *m_refreshLabel, + })) SendMessage(child, WM_SETFONT, (WPARAM)m_font.Get(), 1); } @@ -95,6 +97,11 @@ LRESULT CConfigWindow::onCreate() for (size_t i = 0; i < modes.size(); ++i) m_modeBox->addItem(modes[i].toString(), i); } + + m_widthLabel.reset(new CStaticWidget(L"Width:", WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, m_hwnd)); + 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)); + updateFont(); return 0; @@ -112,7 +119,10 @@ 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, 24); + pos.pinLeftTopBottom(*m_modeBox, 24, 64, 176, 96); + pos.pinBottomLeft(*m_widthLabel, 24, 72, 50, 20); + pos.pinBottomLeft(*m_heightLabel, 24, 48, 50, 20); + pos.pinBottomLeft(*m_refreshLabel, 24, 24, 50, 20); return 0; } diff --git a/idd/LGIddHelper/CConfigWindow.h b/idd/LGIddHelper/CConfigWindow.h index 538ed463..c83208d6 100644 --- a/idd/LGIddHelper/CConfigWindow.h +++ b/idd/LGIddHelper/CConfigWindow.h @@ -19,6 +19,10 @@ class CConfigWindow : public CWindow std::unique_ptr m_modeGroup; std::unique_ptr m_modeBox; + std::unique_ptr m_widthLabel; + std::unique_ptr m_heightLabel; + std::unique_ptr m_refreshLabel; + std::function m_onDestroy; double m_scale; Microsoft::WRL::Wrappers::HandleT m_font; diff --git a/idd/LGIddHelper/UIHelpers.h b/idd/LGIddHelper/UIHelpers.h index 86865e63..c20a665c 100644 --- a/idd/LGIddHelper/UIHelpers.h +++ b/idd/LGIddHelper/UIHelpers.h @@ -44,4 +44,9 @@ public: { move(child, scale(x), scale(y), scale(cx), height - scale(y + by)); } + + void pinBottomLeft(HWND child, int x, int by, int cx, int cy) + { + move(child, scale(x), height - scale(by + cy), scale(cx), scale(cy)); + } };