Add wxWindow::MSWGetBorderThickness()

This function is more convenient to use in MSW-specific code than
GetWindowBorderSize() as it returns the size of a single border and so
doesn't require the caller to divide the return value by 2.

No real changes.

See #26571.
This commit is contained in:
Steve Cornett
2026-06-10 17:22:09 +02:00
committed by Vadim Zeitlin
parent f12b247d26
commit 3fc3a33f58
2 changed files with 11 additions and 8 deletions
+2
View File
@@ -794,6 +794,8 @@ private:
bool MSWSafeIsDialogMessage(WXMSG* msg);
#endif // __WXUNIVERSAL__
int MSWGetBorderThickness() const;
static inline bool MSWIsPositionDirectlySupported(int x, int y)
{
// The supported coordinate intervals for various functions are:
+9 -8
View File
@@ -2274,23 +2274,20 @@ void wxWindowMSW::DoSetClientSize(int width, int height)
}
}
wxSize wxWindowMSW::GetWindowBorderSize() const
int wxWindowMSW::MSWGetBorderThickness() const
{
wxCoord border;
switch ( GetBorder() )
{
case wxBORDER_STATIC:
case wxBORDER_SIMPLE:
border = 1;
break;
return 1;
case wxBORDER_SUNKEN:
case wxBORDER_THEME:
border = 2;
break;
return 2;
case wxBORDER_RAISED:
border = 3;
return 3;
break;
default:
@@ -2298,9 +2295,13 @@ wxSize wxWindowMSW::GetWindowBorderSize() const
wxFALLTHROUGH;
case wxBORDER_NONE:
border = 0;
return 0;
}
}
wxSize wxWindowMSW::GetWindowBorderSize() const
{
const auto border = MSWGetBorderThickness();
return 2*wxSize(border, border);
}