+ // Test if the parent is a sash window, and if so,
+ // reduce the available space to allow space for any active edges.
+
+ int leftMargin = 0, rightMargin = 0, topMargin = 0, bottomMargin = 0;
+#if wxUSE_SASH
+ if (parent->IsKindOf(CLASSINFO(wxSashWindow)))
+ {
+ wxSashWindow* sashWindow = (wxSashWindow*) parent;
+
+ leftMargin = sashWindow->GetExtraBorderSize();
+ rightMargin = sashWindow->GetExtraBorderSize();
+ topMargin = sashWindow->GetExtraBorderSize();
+ bottomMargin = sashWindow->GetExtraBorderSize();
+
+ if (sashWindow->GetSashVisible(wxSASH_LEFT))
+ leftMargin += sashWindow->GetDefaultBorderSize();
+ if (sashWindow->GetSashVisible(wxSASH_RIGHT))
+ rightMargin += sashWindow->GetDefaultBorderSize();
+ if (sashWindow->GetSashVisible(wxSASH_TOP))
+ topMargin += sashWindow->GetDefaultBorderSize();
+ if (sashWindow->GetSashVisible(wxSASH_BOTTOM))
+ bottomMargin += sashWindow->GetDefaultBorderSize();
+ }
+#endif // wxUSE_SASH
+