mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-17 08:53:06 +08:00
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:
committed by
Vadim Zeitlin
parent
f12b247d26
commit
3fc3a33f58
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user