+void wxControl::OnEraseBackground(wxEraseEvent& event)
+{
+ // In general, you don't want to erase the background of a control,
+ // or you'll get a flicker.
+ // TODO: move this 'null' function into each control that
+ // might flicker.
+
+ RECT rect;
+/*
+* below is msw code.
+* TODO: convert to PM Code
+* ::GetClientRect((HWND) GetHWND(), &rect);
+*
+* HBRUSH hBrush = ::CreateSolidBrush(PALETTERGB(GetBackgroundColour().Red(),
+* GetBackgroundColour().Green(),
+* GetBackgroundColour().Blue()));
+* int mode = ::SetMapMode((HDC) event.GetDC()->GetHDC(), MM_TEXT);
+*
+* ::FillRect ((HDC) event.GetDC()->GetHDC(), &rect, hBrush);
+* ::DeleteObject(hBrush);
+* ::SetMapMode((HDC) event.GetDC()->GetHDC(), mode);
+*/
+}
+
+WXDWORD wxControl::GetExStyle(WXDWORD& style) const
+{
+ bool want3D;
+ WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ;
+
+ // Even with extended styles, need to combine with FS_BORDER
+ // for them to look right. Check it out later, base window style does
+ // not designate BORDERS. Down in Frame and And controls.
+
+ if ( want3D || wxStyleHasBorder(m_windowStyle) )
+ style |= FS_BORDER;
+
+ return exStyle;
+}
+
+// ---------------------------------------------------------------------------
+// global functions
+// ---------------------------------------------------------------------------
+
+// Call this repeatedly for several wnds to find the overall size
+// of the widget.
+// Call it initially with -1 for all values in rect.
+// Keep calling for other widgets, and rect will be modified
+// to calculate largest bounding rectangle.
+void wxFindMaxSize(WXHWND wnd, RECT *rect)