]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
DC reorganization
[wxWidgets.git] / src / common / wincmn.cpp
index 52ab77657c87ff6fba5162ad51a514235a746f70..5c25f4f47a723cf36f027f77fe8f99b06dbaf982 100644 (file)
@@ -1051,6 +1051,11 @@ bool wxWindowBase::RemoveEventHandler(wxEvtHandler *handler)
     return false;
 }
 
+bool wxWindowBase::HandleWindowEvent(wxEvent& event) const
+{
+    return GetEventHandler()->SafelyProcessEvent(event);
+}
+
 // ----------------------------------------------------------------------------
 // colours, fonts &c
 // ----------------------------------------------------------------------------
@@ -2357,43 +2362,7 @@ void wxWindowBase::OnMiddleClick( wxMouseEvent& event )
             return;
         }
 #endif // __WXDEBUG__
-
-#if wxUSE_MSGDLG
-        // don't translate these strings, they're for diagnostics purposes only
-        wxString msg;
-        msg.Printf(_T("wxWidgets Library (%s port)\n")
-                   _T("Version %d.%d.%d%s%s, compiled at %s %s\n")
-                   _T("Runtime version of toolkit used is %d.%d.%s\n")
-                   _T("Copyright (c) 1995-2007 wxWidgets team"),
-                   wxPlatformInfo::Get().GetPortIdName().c_str(),
-                   wxMAJOR_VERSION,
-                   wxMINOR_VERSION,
-                   wxRELEASE_NUMBER,
-#if wxUSE_UNICODE
-                   L" (Unicode)",
-#else
-                   wxEmptyString,
-#endif
-#ifdef __WXDEBUG__
-                   _T(" Debug build"),
-#else
-                   wxEmptyString,
-#endif
-                   __TDATE__,
-                   __TTIME__,
-                   wxPlatformInfo::Get().GetToolkitMajorVersion(),
-                   wxPlatformInfo::Get().GetToolkitMinorVersion(),
-#ifdef __WXGTK__
-                   wxString::Format(_T("\nThe compile-time GTK+ version is %d.%d.%d."), GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION).c_str()
-#else
-                   wxEmptyString
-#endif
-                   );
-
-        wxMessageBox(msg, _T("wxWidgets information"),
-                     wxICON_INFORMATION | wxOK,
-                     (wxWindow *)this);
-#endif // wxUSE_MSGDLG
+        ::wxInfoMessageBox((wxWindow*)this);
     }
     else
     {
@@ -2671,6 +2640,27 @@ bool wxWindowBase::TryParent(wxEvent& event)
     return wxEvtHandler::TryParent(event);
 }
 
+// ----------------------------------------------------------------------------
+// window relationships
+// ----------------------------------------------------------------------------
+
+wxWindow *wxWindowBase::DoGetSibling(WindowOrder order) const
+{
+    wxCHECK_MSG( GetParent(), NULL,
+                    _T("GetPrev/NextSibling() don't work for TLWs!") );
+
+    wxWindowList& siblings = GetParent()->GetChildren();
+    wxWindowList::compatibility_iterator i = siblings.Find((wxWindow *)this);
+    wxCHECK_MSG( i, NULL, _T("window not a child of its parent?") );
+
+    if ( order == OrderBefore )
+        i = i->GetPrevious();
+    else // OrderAfter
+        i = i->GetNext();
+
+    return i ? i->GetData() : NULL;
+}
+
 // ----------------------------------------------------------------------------
 // keyboard navigation
 // ----------------------------------------------------------------------------
@@ -2690,7 +2680,7 @@ bool wxWindowBase::DoNavigateIn(int flags)
 #endif // wxHAS_NATIVE_TAB_TRAVERSAL/!wxHAS_NATIVE_TAB_TRAVERSAL
 }
 
-void wxWindowBase::DoMoveInTabOrder(wxWindow *win, MoveKind move)
+void wxWindowBase::DoMoveInTabOrder(wxWindow *win, WindowOrder move)
 {
     // check that we're not a top level window
     wxCHECK_RET( GetParent(),
@@ -2710,7 +2700,7 @@ void wxWindowBase::DoMoveInTabOrder(wxWindow *win, MoveKind move)
     // can't just move the node around
     wxWindow *self = (wxWindow *)this;
     siblings.DeleteObject(self);
-    if ( move == MoveAfter )
+    if ( move == OrderAfter )
     {
         i = i->GetNext();
     }
@@ -2719,7 +2709,7 @@ void wxWindowBase::DoMoveInTabOrder(wxWindow *win, MoveKind move)
     {
         siblings.Insert(i, self);
     }
-    else // MoveAfter and win was the last sibling
+    else // OrderAfter and win was the last sibling
     {
         siblings.Append(self);
     }