]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/control.cpp
Upated list operators, TRUE, FALSE.
[wxWidgets.git] / src / mac / control.cpp
index 9e6e9197912634743096391ba829f5f1ca5fb7c9..05db0f21668571bd0cdf69829e785553e69f8a6d 100644 (file)
@@ -87,7 +87,7 @@ pascal void wxMacLiveScrollbarActionProc( ControlHandle control , ControlPartCod
 ControlColorUPP wxMacSetupControlBackgroundUPP = NULL ;
 ControlDefUPP wxMacControlActionUPP = NULL ;
 
-pascal SInt32  wxMacControlDefintion(SInt16 varCode, ControlRef theControl, ControlDefProcMessage message, SInt32 param)
+pascal SInt32  wxMacControlDefinition(SInt16 varCode, ControlRef theControl, ControlDefProcMessage message, SInt32 param)
 {
     
        wxControl*  wx = (wxControl*) wxFindControlFromMacControl( theControl ) ;
@@ -295,7 +295,7 @@ wxControl *wxFindControlFromMacControl(ControlHandle inControl )
     wxNode *node = wxWinMacControlList->Find((long)inControl);
     if (!node)
         return NULL;
-    return (wxControl *)node->Data();
+    return (wxControl *)node->GetData();
 }
 
 void wxAssociateControlWithMacControl(ControlHandle inControl, wxControl *control)
@@ -398,8 +398,12 @@ void wxControl::MacPostControlCreate()
        }
        if ( wxMacControlActionUPP == NULL )
        {
-           wxMacControlActionUPP = NewControlDefUPP( wxMacControlDefintion ) ;
+           wxMacControlActionUPP = NewControlDefUPP( wxMacControlDefinition ) ;
        }
+    // The following block of code is responsible for crashes when switching
+    // back to windows, which can be seen in the dialogs sample.
+    // It is disabled until a proper solution can be found.
+#if 0
 #if TARGET_CARBON
 /*
     only working under classic carbon
@@ -417,6 +421,7 @@ void wxControl::MacPostControlCreate()
       (**cdef).function = (void(*)()) wxMacControlActionUPP;
       (**(ControlHandle)m_macControl).contrlDefProc = (Handle) cdef ;
     }
+#endif
 #endif
        SetControlColorProc( (ControlHandle) m_macControl , wxMacSetupControlBackgroundUPP ) ;
  
@@ -437,6 +442,9 @@ void wxControl::MacPostControlCreate()
      SetSize(pos.x, pos.y, new_size.x, new_size.y);
  
      UMAShowControl( (ControlHandle) m_macControl ) ;
+     
+     SetCursor( *wxSTANDARD_CURSOR ) ;
+     
      Refresh() ;
 }
 
@@ -755,7 +763,7 @@ void wxControl::Refresh(bool eraseBack, const wxRect *rect)
 
 void wxControl::MacRedrawControl()
 {
-    if ( (ControlHandle) m_macControl && MacGetRootWindow() )
+    if ( (ControlHandle) m_macControl && MacGetRootWindow() && m_macControlIsShown )
     {
         wxClientDC dc(this) ;
         wxMacPortSetter helper(&dc) ;
@@ -819,7 +827,6 @@ void  wxControl::OnMouseEvent( wxMouseEvent &event )
         ControlHandle   control ;
         Point       localwhere ;
         SInt16      controlpart ;
-        WindowRef   window = (WindowRef) MacGetRootWindow() ;
         
         localwhere.h = x ;
         localwhere.v = y ;
@@ -840,20 +847,7 @@ void  wxControl::OnMouseEvent( wxMouseEvent &event )
     
         if ( event.m_metaDown )
             modifiers |= cmdKey ;
-/*
-#if TARGET_CARBON
-        control = FindControlUnderMouse( localwhere , window , &controlpart ) ;
-#else
-        controlpart = FindControl( localwhere , window , &control ) ;
-#endif
-*/
         {
-        /*
-            if ( AcceptsFocus() && FindFocus() != this )
-            {
-                SetFocus() ;
-            }
-        */
             control = (ControlHandle) m_macControl ;
             if ( control && ::IsControlActive( control ) )
             {