+bool wxWindow::Close(bool force)
+{
+ wxCloseEvent event(wxEVT_CLOSE_WINDOW, m_windowId);
+ event.SetEventObject(this);
+#if WXWIN_COMPATIBILITY
+ event.SetForce(force);
+#endif
+ event.SetCanVeto(!force);
+
+ return GetEventHandler()->ProcessEvent(event);
+}
+
+wxObject* wxWindow::GetChild(int number) const
+{
+ // Return a pointer to the Nth object in the window
+ if (!GetChildren())
+ return(NULL) ;
+ wxNode *node = GetChildren()->First();
+ int n = number;
+ while (node && n--)
+ node = node->Next() ;
+ if (node)
+ {
+ wxObject *obj = (wxObject *)node->Data();
+ return(obj) ;
+ }
+ else
+ return NULL ;
+}
+
+void wxWindow::OnDefaultAction(wxControl *initiatingItem)
+{
+ // Obsolete function
+}
+
+void wxWindow::Clear()
+{
+ wxClientDC dc(this);
+ wxBrush brush(GetBackgroundColour(), wxSOLID);
+ dc.SetBackground(brush);
+ dc.Clear();
+}
+
+// Fits the panel around the items
+void wxWindow::Fit()
+{
+ int maxX = 0;
+ int maxY = 0;
+ wxNode *node = GetChildren()->First();
+ while ( node )
+ {
+ wxWindow *win = (wxWindow *)node->Data();
+ int wx, wy, ww, wh;
+ win->GetPosition(&wx, &wy);
+ win->GetSize(&ww, &wh);
+ if ( wx + ww > maxX )
+ maxX = wx + ww;
+ if ( wy + wh > maxY )
+ maxY = wy + wh;
+
+ node = node->Next();
+ }
+ SetClientSize(maxX + 5, maxY + 5);
+}
+
+void wxWindow::SetValidator(const wxValidator& validator)
+{
+ if ( m_windowValidator )
+ delete m_windowValidator;
+ m_windowValidator = validator.Clone();
+
+ if ( m_windowValidator )
+ m_windowValidator->SetWindow(this) ;
+}
+
+// Find a window by id or name
+wxWindow *wxWindow::FindWindow(long id)
+{
+ if ( GetId() == id)
+ return this;
+
+ wxNode *node = GetChildren()->First();
+ while ( node )
+ {
+ wxWindow *child = (wxWindow *)node->Data();
+ wxWindow *found = child->FindWindow(id);
+ if ( found )
+ return found;
+ node = node->Next();
+ }
+ return NULL;
+}
+
+wxWindow *wxWindow::FindWindow(const wxString& name)
+{
+ if ( GetName() == name)
+ return this;
+
+ wxNode *node = GetChildren()->First();
+ while ( node )
+ {
+ wxWindow *child = (wxWindow *)node->Data();
+ wxWindow *found = child->FindWindow(name);
+ if ( found )
+ return found;
+ node = node->Next();
+ }
+ return NULL;
+}
+
+void wxWindow::OnIdle(wxIdleEvent& event)
+{
+/* TODO: you may need to do something like this
+ * if your GUI doesn't generate enter/leave events
+
+ // Check if we need to send a LEAVE event
+ if (m_mouseInWindow)
+ {
+ POINT pt;
+ ::GetCursorPos(&pt);
+ if (::WindowFromPoint(pt) != (HWND) GetHWND())
+ {
+ // Generate a LEAVE event
+ m_mouseInWindow = FALSE;
+ MSWOnMouseLeave(pt.x, pt.y, 0);
+ }
+ }
+*/
+
+ // This calls the UI-update mechanism (querying windows for
+ // menu/toolbar/control state information)
+ UpdateWindowUI();
+}
+
+// Raise the window to the top of the Z order
+void wxWindow::Raise()
+{
+ // TODO
+}
+
+// Lower the window to the bottom of the Z order
+void wxWindow::Lower()
+{
+ // TODO
+}
+