+ return LayoutWindow(frame, mainWindow);
+}
+
+// Layout algorithm for any window. mainWindow gets what's left over.
+bool wxLayoutAlgorithm::LayoutWindow(wxWindow* parent, wxWindow* mainWindow)
+{
+ // 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
+