git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36689 
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
 
     virtual void WriteText(const wxString& str) ;
 
 
     virtual void WriteText(const wxString& str) ;
 
-    virtual bool HasOwnContextMenu() const 
-    { 
+    virtual bool HasOwnContextMenu() const
+    {
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
         if ( UMAGetSystemVersion() >= 0x1040 )
         {
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
         if ( UMAGetSystemVersion() >= 0x1040 )
         {
     {
         if ( CanPaste() )
             Paste() ;
     {
         if ( CanPaste() )
             Paste() ;
                 }
 
                 // this will make wxWidgets eat the ENTER key so that
                 }
 
                 // this will make wxWidgets eat the ENTER key so that
-                // we actually prevent line wrapping in a single line
-                // text control
+                // we actually prevent line wrapping in a single line text control
-            if ( wxMacConvertEventToRecord(  (EventRef) wxTheApp->MacGetCurrentEvent() , &rec ) )
+            if ( wxMacConvertEventToRecord( (EventRef) wxTheApp->MacGetCurrentEvent() , &rec ) )
             {
                 EventRecord *ev = &rec ;
             {
                 EventRecord *ev = &rec ;
-                short keycode ;
-                short keychar ;
+                short keycode, keychar ;
                 keychar = short(ev->message & charCodeMask);
                 keycode = short(ev->message & keyCodeMask) >> 8 ;
 
                 keychar = short(ev->message & charCodeMask);
                 keycode = short(ev->message & keyCodeMask) >> 8 ;
 
 {
     long from, to;
     GetSelection(& from, & to);
 {
     long from, to;
     GetSelection(& from, & to);
-    event.Enable(from != -1 && to != -1 && from != to && IsEditable()) ;
+    event.Enable( from != -1 && to != -1 && from != to && IsEditable() ) ;
 }
 
 void wxTextCtrl::OnUpdateSelectAll(wxUpdateUIEvent& event)
 }
 
 void wxTextCtrl::OnUpdateSelectAll(wxUpdateUIEvent& event)
         event.Skip() ;
         return ;
     }
         event.Skip() ;
         return ;
     }
     if (m_privateContextMenu == NULL)
     {
         m_privateContextMenu = new wxMenu;
     if (m_privateContextMenu == NULL)
     {
         m_privateContextMenu = new wxMenu;
 
 bool wxTextCtrl::MacSetupCursor( const wxPoint& pt )
 {
 
 bool wxTextCtrl::MacSetupCursor( const wxPoint& pt )
 {
-    if ( !GetPeer()->SetupCursor(pt) )
+    if ( !GetPeer()->SetupCursor( pt ) )
         return wxWindow::MacSetupCursor( pt ) ;
     else
         return true ;
         return wxWindow::MacSetupCursor( pt ) ;
     else
         return true ;
     wxString st = str ;
     wxMacConvertNewlines10To13( &st ) ;
     wxMacCFStringHolder cf(st , m_font.GetEncoding() ) ;
     wxString st = str ;
     wxMacConvertNewlines10To13( &st ) ;
     wxMacCFStringHolder cf(st , m_font.GetEncoding() ) ;
-    verify_noerr( SetData<CFStringRef>(  0, m_valueTag , cf ) ) ;
+    verify_noerr( SetData<CFStringRef>( 0, m_valueTag , cf ) ) ;
 }
 
 void wxMacUnicodeTextControl::Copy()
 }
 
 void wxMacUnicodeTextControl::Copy()
     SetData<Boolean>( 0 , kControlEditTextLockedTag , (Boolean) !editable ) ;
 }
 
     SetData<Boolean>( 0 , kControlEditTextLockedTag , (Boolean) !editable ) ;
 }
 
-void wxMacUnicodeTextControl::GetSelection( long* from, long* to) const
+void wxMacUnicodeTextControl::GetSelection( long* from, long* to ) const
 {
     ControlEditTextSelectionRec sel ;
 {
     ControlEditTextSelectionRec sel ;
-    verify_noerr(GetData<ControlEditTextSelectionRec>(  0, kControlEditTextSelectionTag, &sel ) ) ;
-    if ( from ) *from = sel.selStart ;
-    if ( to ) *to = sel.selEnd ;
+    verify_noerr( GetData<ControlEditTextSelectionRec>( 0, kControlEditTextSelectionTag, &sel ) ) ;
+    if ( from )
+        *from = sel.selStart ;
+    if ( to )
+        *to = sel.selEnd ;
 }
 
 void wxMacUnicodeTextControl::SetSelection( long from , long to )
 }
 
 void wxMacUnicodeTextControl::SetSelection( long from , long to )
 
     sel.selStart = from ;
     sel.selEnd = to ;
 
     sel.selStart = from ;
     sel.selEnd = to ;
-    SetData<ControlEditTextSelectionRec>( 0 , kControlEditTextSelectionTag, &sel ) ;
+    SetData<ControlEditTextSelectionRec>( 0, kControlEditTextSelectionTag, &sel ) ;
 }
 
 void wxMacUnicodeTextControl::WriteText(const wxString& str)
 {
     wxString st = str ;
     wxMacConvertNewlines10To13( &st ) ;
 }
 
 void wxMacUnicodeTextControl::WriteText(const wxString& str)
 {
     wxString st = str ;
     wxMacConvertNewlines10To13( &st ) ;
-    #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
         wxMacCFStringHolder cf(st , m_font.GetEncoding() ) ;
         CFStringRef value = cf ;
         SetData<CFStringRef>( 0, kControlEditTextInsertCFStringRefTag, &value );
         wxMacCFStringHolder cf(st , m_font.GetEncoding() ) ;
         CFStringRef value = cf ;
         SetData<CFStringRef>( 0, kControlEditTextInsertCFStringRefTag, &value );
         wxString val = GetStringValue() ;
         long start , end ;
         GetSelection( &start , &end ) ;
         wxString val = GetStringValue() ;
         long start , end ;
         GetSelection( &start , &end ) ;
         val.insert( start , str ) ;
         SetStringValue( val ) ;
         SetSelection( start + str.Length() , start + str.Length() ) ;
         val.insert( start , str ) ;
         SetStringValue( val ) ;
         SetSelection( start + str.Length() , start + str.Length() ) ;
 #else
         Handle theText ;
         err = TXNGetDataEncoded( m_txn , kTXNStartOffset, kTXNEndOffset, &theText , kTXNTextData );
 #else
         Handle theText ;
         err = TXNGetDataEncoded( m_txn , kTXNStartOffset, kTXNEndOffset, &theText , kTXNTextData );
-void wxMacMLTEControl::SetStringValue( const wxString &str)
+void wxMacMLTEControl::SetStringValue( const wxString &str )
 {
     wxString st = str ;
 
     wxMacConvertNewlines10To13( &st ) ;
     {
         wxMacWindowClipper c( m_peer ) ;
 {
     wxString st = str ;
 
     wxMacConvertNewlines10To13( &st ) ;
     {
         wxMacWindowClipper c( m_peer ) ;
         {
             wxMacEditHelper help(m_txn) ;
             SetTXNData( st , kTXNStartOffset, kTXNEndOffset ) ;
         }
         {
             wxMacEditHelper help(m_txn) ;
             SetTXNData( st , kTXNStartOffset, kTXNEndOffset ) ;
         }
         TXNSetSelection( m_txn, 0, 0 );
         TXNShowSelection( m_txn, kTXNShowStart );
     }
         TXNSetSelection( m_txn, 0, 0 );
         TXNShowSelection( m_txn, kTXNShowStart );
     }
         else
             iControlData[1].uValue = kTXNAutoWrap ;
     }
         else
             iControlData[1].uValue = kTXNAutoWrap ;
     }
-    verify_noerr( TXNSetTXNObjectControls( m_txn, false, toptag,
-                                        iControlTags, iControlData )) ;
+
+    verify_noerr( TXNSetTXNObjectControls( m_txn, false, toptag, iControlTags, iControlData )) ;
 
     // setting the default font:
     // under 10.2 this causes a visible caret, therefore we avoid it
 
     // setting the default font:
     // under 10.2 this causes a visible caret, therefore we avoid it
     TXNBackground tback;
     tback.bgType = kTXNBackgroundTypeRGB;
     tback.bg.color = MAC_WXCOLORREF( background.GetPixel() );
     TXNBackground tback;
     tback.bgType = kTXNBackgroundTypeRGB;
     tback.bg.color = MAC_WXCOLORREF( background.GetPixel() );
-    TXNSetBackground( m_txn , &tback);
+    TXNSetBackground( m_txn , &tback );
 
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
     if ( UMAGetSystemVersion() >= 0x1040 )
 
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
     if ( UMAGetSystemVersion() >= 0x1040 )
                 | kTXNSupportSpellCheckCommandUpdating
                 | kTXNSupportFontCommandProcessing
                 | kTXNSupportFontCommandUpdating;
                 | kTXNSupportSpellCheckCommandUpdating
                 | kTXNSupportFontCommandProcessing
                 | kTXNSupportFontCommandUpdating;
             TXNSetCommandEventSupport( m_txn , options ) ;
         }
     }
             TXNSetCommandEventSupport( m_txn , options ) ;
         }
     }
 {
     // currently only solid background are supported
     TXNBackground tback;
 {
     // currently only solid background are supported
     TXNBackground tback;
     tback.bgType = kTXNBackgroundTypeRGB;
     tback.bg.color = MAC_WXCOLORREF( brush.GetColour().GetPixel() );
     tback.bgType = kTXNBackgroundTypeRGB;
     tback.bg.color = MAC_WXCOLORREF( brush.GetColour().GetPixel() );
-    TXNSetBackground( m_txn , &tback);
+    TXNSetBackground( m_txn , &tback );
-void wxMacMLTEControl::TXNSetAttribute( const wxTextAttr& style , long from , long to)
+void wxMacMLTEControl::TXNSetAttribute( const wxTextAttr& style , long from , long to )
 {
     TXNTypeAttributes typeAttr[4] ;
     Str255 fontName = "\pMonaco" ;
     SInt16 fontSize = 12 ;
     Style fontStyle = normal ;
     RGBColor color ;
 {
     TXNTypeAttributes typeAttr[4] ;
     Str255 fontName = "\pMonaco" ;
     SInt16 fontSize = 12 ;
     Style fontStyle = normal ;
     RGBColor color ;
         if ( font.GetStyle() == wxITALIC )
             fontStyle |= italic ;
 
         if ( font.GetStyle() == wxITALIC )
             fontStyle |= italic ;
 
-        typeAttr[attrCounter].tag = kTXNQDFontNameAttribute ;
-        typeAttr[attrCounter].size = kTXNQDFontNameAttributeSize ;
-        typeAttr[attrCounter].data.dataPtr = (void*) fontName ;
-        typeAttr[attrCounter+1].tag = kTXNQDFontSizeAttribute ;
-        typeAttr[attrCounter+1].size = kTXNFontSizeAttributeSize ;
-        typeAttr[attrCounter+1].data.dataValue =  (fontSize << 16) ;
-        typeAttr[attrCounter+2].tag = kTXNQDFontStyleAttribute ;
-        typeAttr[attrCounter+2].size = kTXNQDFontStyleAttributeSize ;
-        typeAttr[attrCounter+2].data.dataValue = fontStyle ;
-        attrCounter += 3 ;
+        typeAttr[attrCount].tag = kTXNQDFontNameAttribute ;
+        typeAttr[attrCount].size = kTXNQDFontNameAttributeSize ;
+        typeAttr[attrCount].data.dataPtr = (void*)fontName ;
+        attrCount++ ;
+
+        typeAttr[attrCount].tag = kTXNQDFontSizeAttribute ;
+        typeAttr[attrCount].size = kTXNFontSizeAttributeSize ;
+        typeAttr[attrCount].data.dataValue = (fontSize << 16) ;
+        attrCount++ ;
+
+        typeAttr[attrCount].tag = kTXNQDFontStyleAttribute ;
+        typeAttr[attrCount].size = kTXNQDFontStyleAttributeSize ;
+        typeAttr[attrCount].data.dataValue = fontStyle ;
+        attrCount++ ;
     }
 
     if ( style.HasTextColour() )
     {
     }
 
     if ( style.HasTextColour() )
     {
-        typeAttr[attrCounter].tag = kTXNQDFontColorAttribute ;
-        typeAttr[attrCounter].size = kTXNQDFontColorAttributeSize ;
-        typeAttr[attrCounter].data.dataPtr = (void*) &color ;
         color = MAC_WXCOLORREF(style.GetTextColour().GetPixel()) ;
         color = MAC_WXCOLORREF(style.GetTextColour().GetPixel()) ;
+
+        typeAttr[attrCount].tag = kTXNQDFontColorAttribute ;
+        typeAttr[attrCount].size = kTXNQDFontColorAttributeSize ;
+        typeAttr[attrCount].data.dataPtr = (void*) &color ;
+        attrCount++ ;
-        verify_noerr( TXNSetTypeAttributes ( m_txn , attrCounter , typeAttr, from , to) );
+        verify_noerr( TXNSetTypeAttributes( m_txn , attrCount , typeAttr, from , to ) );
     }
 }
 
 void wxMacMLTEControl::SetFont( const wxFont & font , const wxColour& foreground , long windowStyle )
 {
     }
 }
 
 void wxMacMLTEControl::SetFont( const wxFont & font , const wxColour& foreground , long windowStyle )
 {
-    wxMacEditHelper help(m_txn) ;
-    TXNSetAttribute( wxTextAttr(foreground,wxNullColour,font) , kTXNStartOffset,kTXNEndOffset ) ;
+    wxMacEditHelper help( m_txn ) ;
+    TXNSetAttribute( wxTextAttr( foreground, wxNullColour, font ), kTXNStartOffset, kTXNEndOffset ) ;
-void wxMacMLTEControl::SetStyle(long start, long end, const wxTextAttr& style)
+void wxMacMLTEControl::SetStyle( long start, long end, const wxTextAttr& style )
-    wxMacEditHelper help(m_txn) ;
-    TXNSetAttribute( style , start,end ) ;
+    wxMacEditHelper help( m_txn ) ;
+    TXNSetAttribute( style, start, end ) ;
 }
 
 void wxMacMLTEControl::Copy()
 {
     ClearCurrentScrap();
 }
 
 void wxMacMLTEControl::Copy()
 {
     ClearCurrentScrap();
     TXNConvertToPublicScrap();
 }
 
 void wxMacMLTEControl::Cut()
 {
     ClearCurrentScrap();
     TXNConvertToPublicScrap();
 }
 
 void wxMacMLTEControl::Cut()
 {
     ClearCurrentScrap();
     TXNConvertToPublicScrap();
 }
 
 void wxMacMLTEControl::Paste()
 {
     TXNConvertFromPublicScrap();
     TXNConvertToPublicScrap();
 }
 
 void wxMacMLTEControl::Paste()
 {
     TXNConvertFromPublicScrap();
 }
 
 bool wxMacMLTEControl::CanPaste() const
 }
 
 bool wxMacMLTEControl::CanPaste() const
     wxTextPos actualsize = 0 ;
 
     Handle theText ;
     wxTextPos actualsize = 0 ;
 
     Handle theText ;
-    OSErr err = TXNGetDataEncoded( m_txn, kTXNStartOffset, kTXNEndOffset, &theText , kTXNTextData );
+    OSErr err = TXNGetDataEncoded( m_txn, kTXNStartOffset, kTXNEndOffset, &theText, kTXNTextData );
 
     // all done
     if ( err == noErr )
 
     // all done
     if ( err == noErr )
     wxMacEditHelper help( m_txn ) ;
     wxMacWindowClipper c( m_peer ) ;
 
     wxMacEditHelper help( m_txn ) ;
     wxMacWindowClipper c( m_peer ) ;
 
-    TXNSetSelection(m_txn , from , to ) ;
+    TXNSetSelection( m_txn, from, to ) ;
-    SetTXNData( value , kTXNUseCurrentSelection, kTXNUseCurrentSelection ) ;
+    SetTXNData( value, kTXNUseCurrentSelection, kTXNUseCurrentSelection ) ;
 }
 
 void wxMacMLTEControl::Remove( long from , long to )
 {
     wxMacWindowClipper c( m_peer ) ;
     wxMacEditHelper help( m_txn ) ;
 }
 
 void wxMacMLTEControl::Remove( long from , long to )
 {
     wxMacWindowClipper c( m_peer ) ;
     wxMacEditHelper help( m_txn ) ;
-    TXNSetSelection(m_txn , from , to ) ;
+    TXNSetSelection( m_txn , from , to ) ;
 
     // change the selection
     if ((from == -1) && (to == -1))
 
     // change the selection
     if ((from == -1) && (to == -1))
     else
         TXNSetSelection( m_txn, from, to );
     else
         TXNSetSelection( m_txn, from, to );
     TXNShowSelection( m_txn, kTXNShowStart );
 }
 
     TXNShowSelection( m_txn, kTXNShowStart );
 }
 
     wxMacConvertNewlines10To13( &st ) ;
 
     long start , end , dummy ;
     wxMacConvertNewlines10To13( &st ) ;
 
     long start , end , dummy ;
     GetSelection( &start , &dummy ) ;
     wxMacWindowClipper c( m_peer ) ;
     GetSelection( &start , &dummy ) ;
     wxMacWindowClipper c( m_peer ) ;
     {
         wxMacEditHelper helper( m_txn ) ;
         SetTXNData( st , kTXNUseCurrentSelection, kTXNUseCurrentSelection ) ;
     {
         wxMacEditHelper helper( m_txn ) ;
         SetTXNData( st , kTXNUseCurrentSelection, kTXNUseCurrentSelection ) ;
 void wxMacMLTEControl::Clear()
 {
     wxMacWindowClipper c( m_peer ) ;
 void wxMacMLTEControl::Clear()
 {
     wxMacWindowClipper c( m_peer ) ;
-    wxMacEditHelper st(m_txn) ;
+    wxMacEditHelper st( m_txn ) ;
     TXNSetSelection( m_txn , kTXNStartOffset , kTXNEndOffset ) ;
     TXNClear(m_txn);
 }
     TXNSetSelection( m_txn , kTXNStartOffset , kTXNEndOffset ) ;
     TXNClear(m_txn);
 }
             xpos = 0 ;
             if ( n > 0 )
                 ++ypos ;
             xpos = 0 ;
             if ( n > 0 )
                 ++ypos ;
             lastHeight = curpt.v ;
         }
         else
             lastHeight = curpt.v ;
         }
         else
     lastpos = GetLastPosition() ;
     if ( pos <= lastpos )
     {
     lastpos = GetLastPosition() ;
     if ( pos <= lastpos )
     {
-        // TODO find a better implementation : while we can get the
+        // TODO: find a better implementation : while we can get the
         // line metrics of a certain line, we don't get its starting
         // position, so it would probably be rather a binary search
         // for the start position
         // line metrics of a certain line, we don't get its starting
         // position, so it would probably be rather a binary search
         // for the start position
-        long xpos = 0 ;
-        long ypos = 0 ;
+        long xpos = 0, ypos = 0 ;
         for ( n = 0 ; n <= (ItemCount) pos ; ++n )
         {
             TXNOffsetToPoint(m_txn ,  n , &curpt);
         for ( n = 0 ; n <= (ItemCount) pos ; ++n )
         {
             TXNOffsetToPoint(m_txn ,  n , &curpt);
                 xpos = 0 ;
                 if ( n > 0 )
                     ++ypos ;
                 xpos = 0 ;
                 if ( n > 0 )
                     ++ypos ;
                 lastHeight = curpt.v ;
             }
             else
                 lastHeight = curpt.v ;
             }
             else
 // ----------------------------------------------------------------------------
 // MLTE control implementation (classic part)
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // MLTE control implementation (classic part)
 // ----------------------------------------------------------------------------
 
 pascal void wxMacMLTEClassicControl::TXNScrollInfoProc(
     SInt32 iValue, SInt32 iMaximumValue,
 
 pascal void wxMacMLTEClassicControl::TXNScrollInfoProc(
     SInt32 iValue, SInt32 iMaximumValue,
-    TXNScrollBarOrientation iScrollBarOrientation, SInt32 iRefCon)
+    TXNScrollBarOrientation iScrollBarOrientation, SInt32 iRefCon )
 {
     wxMacMLTEClassicControl* mlte = (wxMacMLTEClassicControl*) iRefCon ;
     SInt32 value =  wxMax( iValue , 0 ) ;
 {
     wxMacMLTEClassicControl* mlte = (wxMacMLTEClassicControl*) iRefCon ;
     SInt32 value =  wxMax( iValue , 0 ) ;
         SInt32 verticalDelta = isHorizontal ? 0 : delta ;
         SInt32 horizontalDelta = isHorizontal ? delta : 0 ;
 
         SInt32 verticalDelta = isHorizontal ? 0 : delta ;
         SInt32 horizontalDelta = isHorizontal ? delta : 0 ;
 
-        err = TXNScroll( mlte->m_txn , kTXNScrollUnitsInPixels, kTXNScrollUnitsInPixels,
-                                    &verticalDelta , &horizontalDelta  );
+        err = TXNScroll(
+            mlte->m_txn, kTXNScrollUnitsInPixels, kTXNScrollUnitsInPixels,
+            &verticalDelta, &horizontalDelta );
 
         if ( isHorizontal )
             mlte->m_lastHorizontalValue = newValue ;
 
         if ( isHorizontal )
             mlte->m_lastHorizontalValue = newValue ;
 
 void wxMacMLTEClassicControl::MacFocusPaneText(bool setFocus)
 {
 
 void wxMacMLTEClassicControl::MacFocusPaneText(bool setFocus)
 {
-    TXNFocus( m_txn, setFocus);
+    TXNFocus( m_txn, setFocus );
 }
 
 // guards against inappropriate redraw (hidden objects drawing onto window)
 }
 
 // guards against inappropriate redraw (hidden objects drawing onto window)
     if ( iControlData[0].uValue != vis )
     {
         iControlData[0].uValue = vis ;
     if ( iControlData[0].uValue != vis )
     {
         iControlData[0].uValue = vis ;
-        verify_noerr( TXNSetTXNObjectControls( m_txn, false , 1, iControlTags, iControlData )) ;
+        verify_noerr( TXNSetTXNObjectControls( m_txn, false , 1, iControlTags, iControlData ) ) ;
-    // we right now are always clipping as partial visibility (overlapped) visibility
-    // is also a problem, if we run into further problems we might set the FrameBounds to an empty
-    // rect here
+    // currently, we always clip as partial visibility (overlapped) visibility is also a problem,
+    // if we run into further problems we might set the FrameBounds to an empty rect here
 }
 
 // make sure that the TXNObject is at the right position
 }
 
 // make sure that the TXNObject is at the right position
                 SetControlBounds( m_sbHorizontal , &sbBounds ) ;
                 SetControlViewSize( m_sbHorizontal , w ) ;
             }
                 SetControlBounds( m_sbHorizontal , &sbBounds ) ;
                 SetControlViewSize( m_sbHorizontal , w ) ;
             }
             if ( m_sbVertical )
             {
                 Rect sbBounds ;
             if ( m_sbVertical )
             {
                 Rect sbBounds ;
         // movement, therefore we have to force it
 
         // this problem has been reported in OSX as well, so we use this here once again
         // movement, therefore we have to force it
 
         // this problem has been reported in OSX as well, so we use this here once again
         TXNLongRect textRect ;
         TXNGetRectBounds( m_txn , NULL , NULL , &textRect ) ;
         if ( textRect.left < m_txnControlBounds.left )
         TXNLongRect textRect ;
         TXNGetRectBounds( m_txn , NULL , NULL , &textRect ) ;
         if ( textRect.left < m_txnControlBounds.left )
     Point where = { y , x } ;
     ControlPartCode result = kControlNoPart;
 
     Point where = { y , x } ;
     ControlPartCode result = kControlNoPart;
 
-    wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef);
+    wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference( m_controlRef );
     if ( (textctrl != NULL) && textctrl->MacIsReallyShown() )
     {
         if (PtInRect( where, &m_txnControlBounds ))
     if ( (textctrl != NULL) && textctrl->MacIsReallyShown() )
     {
         if (PtInRect( where, &m_txnControlBounds ))
-            if (PtInRect(where, &m_txnControlBounds))
+            if (PtInRect( where, &m_txnControlBounds ))
                 result = kControlEditTextPart ;
         }
     }
                 result = kControlEditTextPart ;
         }
     }
 {
     ControlPartCode result = kControlNoPart;
 
 {
     ControlPartCode result = kControlNoPart;
 
-    wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef);
+    wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference( m_controlRef );
     if ( (textctrl != NULL) && textctrl->MacIsReallyShown() )
     {
         Point startPt = { y , x } ;
     if ( (textctrl != NULL) && textctrl->MacIsReallyShown() )
     {
         Point startPt = { y , x } ;
     {
         case kControlFocusPrevPart:
         case kControlFocusNextPart:
     {
         case kControlFocusPrevPart:
         case kControlFocusNextPart:
-            MacFocusPaneText( ( !wasFocused));
-            focusResult = (!wasFocused) ? (ControlPartCode) kControlEditTextPart : (ControlPartCode) kControlFocusNoPart;
+            MacFocusPaneText( !wasFocused );
+            focusResult = (!wasFocused ? (ControlPartCode) kControlEditTextPart : (ControlPartCode) kControlFocusNoPart);
             break;
 
         case kControlFocusNoPart:
             break;
 
         case kControlFocusNoPart:
-    featureSet = kControlSupportsEmbedding | kControlSupportsFocus  | kControlWantsIdle
-            | kControlWantsActivate  | kControlHandlesTracking // | kControlHasSpecialBackground
-            | kControlGetsFocusOnClick | kControlSupportsLiveFeedback;
+    featureSet =
+        kControlSupportsEmbedding | kControlSupportsFocus | kControlWantsIdle
+        | kControlWantsActivate  | kControlHandlesTracking
+//    | kControlHasSpecialBackground
+        | kControlGetsFocusOnClick | kControlSupportsLiveFeedback;
-    verify_noerr( ::CreateUserPaneControl( MAC_WXHWND(wxPeer->GetParent()->MacGetTopLevelWindowRef()), &bounds, featureSet, &m_controlRef ) );
+    verify_noerr(
+        ::CreateUserPaneControl(
+            MAC_WXHWND(wxPeer->GetParent()->MacGetTopLevelWindowRef()),
+            &bounds, featureSet, &m_controlRef ) );
         wxMacConvertNewlines10To13( &st ) ;
         wxMacWindowClipper clipper( m_peer ) ;
         SetTXNData( st , kTXNStartOffset, kTXNEndOffset ) ;
         wxMacConvertNewlines10To13( &st ) ;
         wxMacWindowClipper clipper( m_peer ) ;
         SetTXNData( st , kTXNStartOffset, kTXNEndOffset ) ;
-        TXNSetSelection( m_txn, 0, 0);
+        TXNSetSelection( m_txn, 0, 0 ) ;
     }
 }
 
 wxMacMLTEClassicControl::~wxMacMLTEClassicControl()
 {
     }
 }
 
 wxMacMLTEClassicControl::~wxMacMLTEClassicControl()
 {
-    TXNDeleteObject(m_txn);
+    TXNDeleteObject( m_txn );
 
     m_scrollView = NULL ;
     TXNFrameOptions frameOptions = FrameOptionsFromWXStyle( style ) ;
 
     m_scrollView = NULL ;
     TXNFrameOptions frameOptions = FrameOptionsFromWXStyle( style ) ;
-    if ( frameOptions & (kTXNWantVScrollBarMask|kTXNWantHScrollBarMask) )
+    if ( frameOptions & (kTXNWantVScrollBarMask | kTXNWantHScrollBarMask) )
-        HIScrollViewCreate(( frameOptions & kTXNWantHScrollBarMask ? kHIScrollViewOptionsHorizScroll : 0) |
-            ( frameOptions & kTXNWantVScrollBarMask ? kHIScrollViewOptionsVertScroll: 0 ) , &m_scrollView ) ;
+        HIScrollViewCreate(
+            (frameOptions & kTXNWantHScrollBarMask ? kHIScrollViewOptionsHorizScroll : 0)
+            | (frameOptions & kTXNWantVScrollBarMask ? kHIScrollViewOptionsVertScroll : 0) ,
+            &m_scrollView ) ;
 
         HIViewSetFrame( m_scrollView, &hr );
         HIViewSetVisible( m_scrollView, true );
 
         HIViewSetFrame( m_scrollView, &hr );
         HIViewSetVisible( m_scrollView, true );
 
     m_textView = NULL ;
     HITextViewCreate( NULL , 0, frameOptions , &m_textView ) ;
 
     m_textView = NULL ;
     HITextViewCreate( NULL , 0, frameOptions , &m_textView ) ;
-    m_txn = HITextViewGetTXNObject( m_textView) ;
+    m_txn = HITextViewGetTXNObject( m_textView ) ;
     HIViewSetVisible( m_textView , true ) ;
     if ( m_scrollView )
     {
         HIViewAddSubview( m_scrollView , m_textView ) ;
         m_controlRef = m_scrollView ;
     HIViewSetVisible( m_textView , true ) ;
     if ( m_scrollView )
     {
         HIViewAddSubview( m_scrollView , m_textView ) ;
         m_controlRef = m_scrollView ;
-        wxPeer->MacInstallEventHandler( (WXWidget) m_textView  ) ;
+        wxPeer->MacInstallEventHandler( (WXWidget) m_textView ) ;
     component[1] = col.green / 65536.0 ;
     component[2] = col.blue / 65536.0 ;
     component[3] = 1.0 ; // alpha
     component[1] = col.green / 65536.0 ;
     component[2] = col.blue / 65536.0 ;
     component[3] = 1.0 ; // alpha
     CGColorRef color = CGColorCreate (rgbSpace , component );
     HITextViewSetBackgroundColor( m_textView , color ) ;
     CGColorSpaceRelease( rgbSpace );
     CGColorRef color = CGColorCreate (rgbSpace , component );
     HITextViewSetBackgroundColor( m_textView , color ) ;
     CGColorSpaceRelease( rgbSpace );