]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/control.cpp
- better behaviour of wxMGL's wxTimer w.r.t. memory allocations
[wxWidgets.git] / src / mac / control.cpp
index 764da5b8c24b1ce3a74cf32763b5a05fb5047e0d..8c19e3cec28ee9585c8508cd60fa0213d8038fde 100644 (file)
@@ -111,7 +111,7 @@ wxControl::~wxControl()
     }
     if ( m_macControl )
     {
-       UMADisposeControl( m_macControl ) ;
+       ::DisposeControl( m_macControl ) ;
        m_macControl = NULL ;
     }
 }
@@ -146,7 +146,7 @@ wxSize wxControl::DoGetBestSize() const
        Rect    bestsize = { 0 , 0 , 0 , 0 } ;
        short   baselineoffset ;
        int bestWidth, bestHeight ;
-       UMAGetBestControlRect( m_macControl , &bestsize , &baselineoffset ) ;
+       ::GetBestControlRect( m_macControl , &bestsize , &baselineoffset ) ;
 
        if ( EmptyRect( &bestsize ) )
        {
@@ -297,7 +297,7 @@ void wxControl::MacPostControlCreate()
                controlstyle.flags = kControlUseFontMask ;
                controlstyle.font = kControlFontSmallBoldSystemFont ;
                
-               ::UMASetControlFontStyle( m_macControl , &controlstyle ) ;
+               ::SetControlFontStyle( m_macControl , &controlstyle ) ;
        }
        else
        {
@@ -305,11 +305,11 @@ void wxControl::MacPostControlCreate()
                controlstyle.flags = kControlUseFontMask ;
                controlstyle.font = kControlFontSmallSystemFont ;
                
-               ::UMASetControlFontStyle( m_macControl , &controlstyle ) ;
+               ::SetControlFontStyle( m_macControl , &controlstyle ) ;
        }
        ControlHandle container = GetParent()->MacGetContainerForEmbedding() ;
        wxASSERT_MSG( container != NULL , wxT("No valid mac container control") ) ;
-       ::UMAEmbedControl( m_macControl , container ) ;
+       ::EmbedControl( m_macControl , container ) ;
        m_macControlIsShown  = true ;
 
        wxAssociateControlWithMacControl( m_macControl , this ) ;
@@ -342,7 +342,7 @@ void wxControl::MacAdjustControlRect()
                Rect    bestsize = { 0 , 0 , 0 , 0 } ;
                short   baselineoffset ;
                
-               UMAGetBestControlRect( m_macControl , &bestsize , &baselineoffset ) ;
+               ::GetBestControlRect( m_macControl , &bestsize , &baselineoffset ) ;
 
                if ( EmptyRect( &bestsize ) )
                {
@@ -415,7 +415,7 @@ void wxControl::MacSuperChangedPosition()
                
                WindowRef rootwindow = GetMacRootWindow() ;
                wxWindow* wxrootwindow = wxFindWinFromMacWindow( rootwindow ) ;
-               UMASetThemeWindowBackground( rootwindow , kThemeBrushDialogBackgroundActive , false ) ;
+               ::SetThemeWindowBackground( rootwindow , kThemeBrushDialogBackgroundActive , false ) ;
                wxMacDrawingHelper focus( wxrootwindow ) ;
        
                if ( mac_x != former_mac_x || mac_y != former_mac_y )
@@ -435,7 +435,7 @@ void wxControl::MacSuperChangedPosition()
                }
                else
                {
-                       UMASetThemeWindowBackground( rootwindow , kThemeBrushDocumentWindowBackground , false ) ;
+                       ::SetThemeWindowBackground( rootwindow , kThemeBrushDocumentWindowBackground , false ) ;
                }
        }
 
@@ -484,7 +484,7 @@ void  wxControl::MacSuperShown( bool show )
                {
                        if ( m_macControlIsShown )
                        {
-                               ::UMAHideControl( m_macControl ) ;
+                               ::HideControl( m_macControl ) ;
                                m_macControlIsShown = false ;
                        }
                }
@@ -609,6 +609,7 @@ void  wxControl::DoSetSize(int x, int y,
                              m_width - 2 * m_macHorizontalBorder,
                              m_height -  2 * m_macVerticalBorder ) ;
  
              wxSizeEvent event(wxSize(m_width, m_height), m_windowId);
              event.SetEventObject(this);
              GetEventHandler()->ProcessEvent(event);
@@ -619,7 +620,7 @@ void  wxControl::DoSetSize(int x, int y,
          wxWindow* wxrootwindow = wxFindWinFromMacWindow( rootwindow ) ;
          wxMacDrawingHelper focus( wxrootwindow );
  
-         UMASetThemeWindowBackground( rootwindow , kThemeBrushDialogBackgroundActive , false ) ;
+         ::SetThemeWindowBackground( rootwindow , kThemeBrushDialogBackgroundActive , false ) ;
          // Update window at old and new positions
          SetRect(&newbounds, m_x, m_y, m_x + m_width, m_y + m_height);
          InvalWindowRect( rootwindow , &oldbounds );
@@ -629,7 +630,7 @@ void  wxControl::DoSetSize(int x, int y,
  
          if ( !wxrootwindow->IsKindOf( CLASSINFO( wxDialog ) ) )
          {
-             UMASetThemeWindowBackground( rootwindow, kThemeBrushDocumentWindowBackground, false );
+             ::SetThemeWindowBackground( rootwindow, kThemeBrushDocumentWindowBackground, false );
          }
      }
 }
@@ -645,7 +646,7 @@ bool  wxControl::Show(bool show)
                {
                        if ( m_macControlIsShown )
                        {
-                               ::UMAHideControl( m_macControl ) ;
+                               ::HideControl( m_macControl ) ;
                                m_macControlIsShown = false ;
                        }
                }
@@ -707,7 +708,7 @@ void wxControl::MacRedrawControl()
                                {
                                        if( parent->MacGetWindowData() )
                                        {
-                                               UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
+                                               ::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
                                                break ;
                                        }
                                        
@@ -722,7 +723,7 @@ void wxControl::MacRedrawControl()
                                } 
                                
                                UMADrawControl( m_macControl ) ;
-                               UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
+                               ::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
                        }
                }
        }
@@ -747,7 +748,7 @@ void wxControl::OnPaint(wxPaintEvent& event)
                                {
                                        if( parent->MacGetWindowData() )
                                        {
-                                               UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
+                                               ::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
                                                break ;
                                        }
                                        
@@ -762,7 +763,7 @@ void wxControl::OnPaint(wxPaintEvent& event)
                                } 
 
                                UMADrawControl( m_macControl ) ;
-                               UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
+                               ::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
                        }
                }
        }
@@ -791,7 +792,7 @@ void  wxControl::OnKeyDown( wxKeyEvent &event )
        keychar = short(ev->message & charCodeMask);
        keycode = short(ev->message & keyCodeMask) >> 8 ;
 
-       UMAHandleControlKey( m_macControl , keycode , keychar , ev->modifiers ) ;
+       ::HandleControlKey( m_macControl , keycode , keychar , ev->modifiers ) ;
 }
 
 void  wxControl::OnMouseEvent( wxMouseEvent &event ) 
@@ -834,9 +835,13 @@ void  wxControl::OnMouseEvent( wxMouseEvent &event )
        
                if ( event.m_metaDown )
                        modifiers |= cmdKey ;
-       
-//             controlpart = FindControl( localwhere , window , &control ) ;
+/*
+#if TARGET_CARBON
         control = FindControlUnderMouse( localwhere , window , &controlpart ) ;
+#else
+               controlpart = FindControl( localwhere , window , &control ) ;
+#endif
+*/
                {
                /*
                        if ( AcceptsFocus() && FindFocus() != this )
@@ -844,18 +849,17 @@ void  wxControl::OnMouseEvent( wxMouseEvent &event )
                                SetFocus() ;
                        }
                */
-                       if ( control && UMAIsControlActive( control ) )
+                   control = m_macControl ;
+                       if ( control && ::IsControlActive( control ) )
                        {
                                {
-                                       if ( controlpart == kControlIndicatorPart && !UMAHasAppearance() )
-                                               controlpart = UMAHandleControlClick( control , localwhere , modifiers , (ControlActionUPP) NULL ) ;
-                                       else
-                                               controlpart = UMAHandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ;
+                                       controlpart = ::HandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ;
                                        wxTheApp->s_lastMouseDown = 0 ;
-                                       if ( control && ! ( ( UMAHasAppearance() || (controlpart != kControlIndicatorPart) ) 
-                                               && (IsKindOf( CLASSINFO( wxScrollBar ) ) ) ) ) // otherwise we will get the event twice
+                                       if ( control && controlpart != kControlNoPart && 
+                                           ! IsKindOf( CLASSINFO( wxScrollBar ) ) 
+                                       ) // otherwise we will get the event twice for scrollbar
                                        {
-                                               MacHandleControlClick( control , controlpart ) ;
+                                           MacHandleControlClick( control , controlpart ) ;
                                        }
                                }
                        }