resize and move bounding boxes based off measurements
@@ -475,9 +475,9 @@ BOOL UI::CreateCheckbox(HWND parentHWnd, RECT parentRect)
L"BUTTON",
GetStringResource(IDS_STRING_LAUNCH_CHECKBOX).c_str(), // text
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX, // style
- parentRect.left + 50, // x coord
+ parentRect.left + 30, // x coord
parentRect.bottom - 60, // y coord
- 165, // width
+ 185, // width
35, // height
parentHWnd, // parent
(HMENU)IDC_LAUNCHCHECKBOX, // menu
@@ -616,7 +616,7 @@ BOOL UI::ChangeText(HWND parentHWnd, std::wstring displayName, std::wstring mess
Gdiplus::Graphics graphics(deviceContext);
- Gdiplus::RectF layoutRect(50, 50, g_width - 144, 100);
+ Gdiplus::RectF layoutRect(30, 30, g_width - 250, 100);
Gdiplus::Font displayNameFont(L"Arial", 16);
Gdiplus::Font messageFont(L"Arial", 10);
Gdiplus::StringFormat format;
@@ -625,24 +625,26 @@ BOOL UI::ChangeText(HWND parentHWnd, std::wstring displayName, std::wstring mess
windowsTextColor.SetFromCOLORREF(GetSysColor(COLOR_WINDOWTEXT));
Gdiplus::SolidBrush textBrush(windowsTextColor);
+ Gdiplus::RectF displayNameBoundRect;
+ graphics.MeasureString(displayName.c_str(), -1, &displayNameFont, layoutRect, &format, &displayNameBoundRect);
graphics.DrawString(displayName.c_str(), -1, &displayNameFont, layoutRect, &format, &textBrush);
- layoutRect.Y += 40;
+ layoutRect.Y += displayNameBoundRect.Height;
+ layoutRect.X = 50;
if (!messageText.empty())
{
+ Gdiplus::RectF messageBoundRect;
+ graphics.MeasureString(messageText.c_str(), -1, &messageFont, layoutRect, &format, &messageBoundRect);
graphics.DrawString(messageText.c_str(), -1, &messageFont, layoutRect, &format, &textBrush);
+ layoutRect.Y += messageBoundRect.Height + 5;
- std::wstring capabilitiesHeading = GetStringResource(IDS_STRING_CAPABILITIES);
- layoutRect.Y += 40;
- graphics.DrawString(capabilitiesHeading.c_str(), -1, &messageFont, layoutRect, &format, &textBrush);
+ std::wstring capabilities = GetStringResource(IDS_STRING_CAPABILITIES);
- layoutRect.Y += 17;
if (m_capabilities.size() > 0)
{
- std::wstring capabilityString = L"\x2022 " + GetStringResource(IDS_RUNFULLTRUST_CAPABILITY);
- graphics.DrawString(capabilityString.c_str(), -1, &messageFont, layoutRect, &format, &textBrush);
- layoutRect.Y += 20;
+ capabilities += L"\n\x2022 " + GetStringResource(IDS_RUNFULLTRUST_CAPABILITY);
}
+ graphics.DrawString(capabilities.c_str(), -1, &messageFont, layoutRect, &format, &textBrush);
}
if (logoStream != nullptr)
