]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/control.cpp
Some minor clean-ups to the wxScrolledWindow code.
[wxWidgets.git] / src / mac / control.cpp
index 0953356de7d7f53f1ed4bc45d2387e22e4935e98..63610676a06912f12de959f129bd651bd5ebeceb 100644 (file)
@@ -16,6 +16,7 @@
 #include "wx/control.h"
 #include "wx/panel.h"
 #include "wx/app.h"
 #include "wx/control.h"
 #include "wx/panel.h"
 #include "wx/app.h"
+#include "wx/dc.h"
 #include "wx/notebook.h"
 #include "wx/tabctrl.h"
 #include "wx/radiobox.h"
 #include "wx/notebook.h"
 #include "wx/tabctrl.h"
 #include "wx/radiobox.h"
@@ -266,6 +267,7 @@ void wxControl::MacPostControlCreate()
        ControlHandle container = GetParent()->MacGetContainerForEmbedding() ;
        wxASSERT_MSG( container != NULL , "No valid mac container control" ) ;
        ::UMAEmbedControl( m_macControl , container ) ;
        ControlHandle container = GetParent()->MacGetContainerForEmbedding() ;
        wxASSERT_MSG( container != NULL , "No valid mac container control" ) ;
        ::UMAEmbedControl( m_macControl , container ) ;
+       m_macControlIsShown  = true ;
        MacAdjustControlRect() ;
        wxAssociateControlWithMacControl( m_macControl , this ) ;
 }
        MacAdjustControlRect() ;
        wxAssociateControlWithMacControl( m_macControl , this ) ;
 }
@@ -416,12 +418,19 @@ void  wxControl::MacSuperShown( bool show )
        {
                if ( !show )
                {
        {
                if ( !show )
                {
-                       ::UMAHideControl( m_macControl ) ;
+                       if ( m_macControlIsShown )
+                       {
+                               ::UMAHideControl( m_macControl ) ;
+                               m_macControlIsShown = false ;
+                       }
                }
                else
                {
                }
                else
                {
-                       if ( m_isShown )
+                       if ( MacIsReallyShown() && !m_macControlIsShown )
+                       {
                                ::UMAShowControl( m_macControl ) ;
                                ::UMAShowControl( m_macControl ) ;
+                               m_macControlIsShown = true ;
+                       }
                }
        }
                
                }
        }
                
@@ -541,10 +550,22 @@ bool  wxControl::Show(bool show)
                
        if ( m_macControl )
        {
                
        if ( m_macControl )
        {
-               if ( show )
-                       ::UMAShowControl( m_macControl ) ;
+               if ( !show )
+               {
+                       if ( m_macControlIsShown )
+                       {
+                               ::UMAHideControl( m_macControl ) ;
+                               m_macControlIsShown = false ;
+                       }
+               }
                else
                else
-                       ::UMAHideControl( m_macControl ) ;
+               {
+                       if ( MacIsReallyShown() && !m_macControlIsShown )
+                       {
+                               ::UMAShowControl( m_macControl ) ;
+                               m_macControlIsShown = true ;
+                       }
+               }
        }
        return TRUE ;
 }
        }
        return TRUE ;
 }
@@ -741,10 +762,12 @@ void  wxControl::OnMouseEvent( wxMouseEvent &event )
        
                controlpart = FindControl( localwhere , window , &control ) ;
                {
        
                controlpart = FindControl( localwhere , window , &control ) ;
                {
+               /*
                        if ( AcceptsFocus() && FindFocus() != this )
                        {
                                SetFocus() ;
                        }
                        if ( AcceptsFocus() && FindFocus() != this )
                        {
                                SetFocus() ;
                        }
+               */
                        if ( control && UMAIsControlActive( control ) )
                        {
                                {
                        if ( control && UMAIsControlActive( control ) )
                        {
                                {