]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/containr.cpp
compilation fixes for wxUSE_TREEBOOK=0
[wxWidgets.git] / src / common / containr.cpp
index 67823965b2bb82d5a93ea283aa7233d59a5359fd..72f8634104024cfce90d4cf9a1674ee2e5b91a76 100644 (file)
 // headers
 // ----------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "containr.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -44,6 +40,9 @@
     #include "wx/radiobut.h"
 #endif
 
+// trace mask for focus messages
+#define TRACE_FOCUS _T("focus")
+
 // ============================================================================
 // implementation
 // ============================================================================
@@ -133,13 +132,13 @@ void wxControlContainer::SetLastFocus(wxWindow *win)
 
         if ( win )
         {
-            wxLogTrace(_T("focus"), _T("Set last focus to %s(%s)"),
+            wxLogTrace(TRACE_FOCUS, _T("Set last focus to %s(%s)"),
                        win->GetClassInfo()->GetClassName(),
                        win->GetLabel().c_str());
         }
         else
         {
-            wxLogTrace(_T("focus"), _T("No more last focus"));
+            wxLogTrace(TRACE_FOCUS, _T("No more last focus"));
         }
     }
 
@@ -154,7 +153,7 @@ void wxControlContainer::SetLastFocus(wxWindow *win)
 }
 
 // --------------------------------------------------------------------
-// The following four functions are used to find other radio buttons 
+// The following four functions are used to find other radio buttons
 // within the same group. Used by wxSetFocusToChild on wxMSW
 // --------------------------------------------------------------------
 
@@ -180,7 +179,7 @@ wxRadioButton* wxGetPreviousButtonInGroup(wxRadioButton *btn)
 
         nodeBefore = nodeBefore->GetPrevious();
     }
-    
+
     if (!prevBtn || prevBtn->HasFlag(wxRB_SINGLE))
     {
         // no more buttons in group
@@ -227,7 +226,7 @@ wxRadioButton* wxGetFirstButtonInGroup(wxRadioButton *btn)
         wxRadioButton* prevBtn = wxGetPreviousButtonInGroup(btn);
         if (!prevBtn)
             return btn;
-        
+
         btn = prevBtn;
     }
 }
@@ -256,7 +255,7 @@ wxRadioButton* wxGetSelectedButtonInGroup(wxRadioButton *btn)
     return NULL;
 }
 
-#endif __WXMSW__
+#endif // __WXMSW__
 
 // ----------------------------------------------------------------------------
 // Keyboard handling - this is the place where the TAB traversal logic is
@@ -330,7 +329,7 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event )
         if ( winFocus )
         {
 #ifdef __WXMSW__
-            // If we are in a radio button group, start from the first item in the 
+            // If we are in a radio button group, start from the first item in the
             // group
             if ( event.IsFromTab() && wxIsKindOf(winFocus, wxRadioButton ) )
                 winFocus = wxGetFirstButtonInGroup((wxRadioButton*)winFocus);
@@ -411,8 +410,8 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event )
             {
                 if (!wxIsKindOf(child, wxRadioButton))
                 {
-                    child = forward ? 
-                                wxGetNextButtonInGroup((wxRadioButton*)m_winLastFocused) : 
+                    child = forward ?
+                                wxGetNextButtonInGroup((wxRadioButton*)m_winLastFocused) :
                                 wxGetPreviousButtonInGroup((wxRadioButton*)m_winLastFocused);
                     if (!child)
                     {
@@ -500,8 +499,8 @@ void wxControlContainer::HandleOnWindowDestroy(wxWindowBase *child)
 
 bool wxControlContainer::DoSetFocus()
 {
-    wxLogTrace(_T("focus"), _T("SetFocus on wxPanel 0x%08lx."),
-               (unsigned long)m_winParent->GetHandle());
+    wxLogTrace(TRACE_FOCUS, _T("SetFocus on wxPanel 0x%p."),
+               m_winParent->GetHandle());
 
     if (m_inSetFocus)
         return true;
@@ -541,8 +540,8 @@ bool wxControlContainer::DoSetFocus()
 
 void wxControlContainer::HandleOnFocus(wxFocusEvent& event)
 {
-    wxLogTrace(_T("focus"), _T("OnFocus on wxPanel 0x%08lx, name: %s"),
-               (unsigned long)m_winParent->GetHandle(),
+    wxLogTrace(TRACE_FOCUS, _T("OnFocus on wxPanel 0x%p, name: %s"),
+               m_winParent->GetHandle(),
                m_winParent->GetName().c_str() );
 
     DoSetFocus();
@@ -571,9 +570,9 @@ bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused)
         // It might happen that the window got reparented
         if ( (*childLastFocused)->GetParent() == win )
         {
-            wxLogTrace(_T("focus"),
-                       _T("SetFocusToChild() => last child (0x%08lx)."),
-                       (unsigned long)(*childLastFocused)->GetHandle());
+            wxLogTrace(TRACE_FOCUS,
+                       _T("SetFocusToChild() => last child (0x%p)."),
+                       (*childLastFocused)->GetHandle());
 
             // not SetFocusFromKbd(): we're restoring focus back to the old
             // window and not setting it as the result of a kbd action
@@ -596,7 +595,7 @@ bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused)
         if ( child->AcceptsFocusFromKeyboard() && !child->IsTopLevel() )
         {
 #ifdef __WXMSW__
-            // If a radiobutton is the first focusable child, search for the 
+            // If a radiobutton is the first focusable child, search for the
             // selected radiobutton in the same group
             wxRadioButton* btn = wxDynamicCast(child, wxRadioButton);
             if (btn)
@@ -607,9 +606,9 @@ bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused)
             }
 #endif
 
-            wxLogTrace(_T("focus"),
-                       _T("SetFocusToChild() => first child (0x%08lx)."),
-                       (unsigned long)child->GetHandle());
+            wxLogTrace(TRACE_FOCUS,
+                       _T("SetFocusToChild() => first child (0x%p)."),
+                       child->GetHandle());
 
             *childLastFocused = child;
             child->SetFocusFromKbd();