git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36315 
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
 class wxMacFunctor
 {
 public :
 class wxMacFunctor
 {
 public :
     virtual ~wxMacFunctor() {}
     virtual void* operator()() = 0 ;
     static void* CallBackProc(void *param)
     virtual ~wxMacFunctor() {}
     virtual void* operator()() = 0 ;
     static void* CallBackProc(void *param)
         (m_object->*m_function)(m_param1) ;
         return NULL ;
     }
         (m_object->*m_function)(m_param1) ;
         return NULL ;
     }
 private :
     classtype* m_object ;
     param1type m_param1 ;
 private :
     classtype* m_object ;
     param1type m_param1 ;
     wxMutexGuiEnter() ;
     return result ;
 }
     wxMutexGuiEnter() ;
     return result ;
 }
 // common interface for all implementations
 class wxMacTextControl : public wxMacControl
 {
 // common interface for all implementations
 class wxMacTextControl : public wxMacControl
 {
     virtual OSStatus SetFocus( ControlFocusPart focusPart ) ;
     virtual bool HasFocus() const ;
     virtual void SetBackground( const wxBrush &brush) ;
     virtual OSStatus SetFocus( ControlFocusPart focusPart ) ;
     virtual bool HasFocus() const ;
     virtual void SetBackground( const wxBrush &brush) ;
 protected :
     HIViewRef m_scrollView ;
     HIViewRef m_textView ;
 protected :
     HIViewRef m_scrollView ;
     HIViewRef m_textView ;
     virtual void GetSelection( long* from, long* to) const ;
     virtual void SetSelection( long from , long to ) ;
     virtual void WriteText(const wxString& str) ;
     virtual void GetSelection( long* from, long* to) const ;
     virtual void SetSelection( long from , long to ) ;
     virtual void WriteText(const wxString& str) ;
 protected :
     // contains the tag for the content (is different for password and non-password controls)
     OSType m_valueTag ;
 protected :
     // contains the tag for the content (is different for password and non-password controls)
     OSType m_valueTag ;
     void                    MacFocusPaneText(Boolean setFocus) ;
 
     void                    MacSetObjectVisibility(Boolean vis) ;
     void                    MacFocusPaneText(Boolean setFocus) ;
 
     void                    MacSetObjectVisibility(Boolean vis) ;
 private :
     TXNFrameID              m_txnFrameID ;
     GrafPtr                 m_txnPort ;
 private :
     TXNFrameID              m_txnFrameID ;
     GrafPtr                 m_txnPort ;
 END_EVENT_TABLE()
 
 // Text item
 END_EVENT_TABLE()
 
 // Text item
 {
     m_editable = true ;
     m_dirty = false;
 {
     m_editable = true ;
     m_dirty = false;
     delete m_privateContextMenu;
 }
 
     delete m_privateContextMenu;
 }
 
 bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
            const wxString& str,
            const wxPoint& pos,
 bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
            const wxString& str,
            const wxPoint& pos,
     MacSuperChangedPosition() ;
 
     if ( m_windowStyle & wxTE_READONLY)
     MacSuperChangedPosition() ;
 
     if ( m_windowStyle & wxTE_READONLY)
 
     SetCursor( wxCursor( wxCURSOR_IBEAM ) ) ;
 
 
     SetCursor( wxCursor( wxCURSOR_IBEAM ) ) ;
 
 void wxTextCtrl::Copy()
 {
     if (CanCopy())
 void wxTextCtrl::Copy()
 {
     if (CanCopy())
 bool wxTextCtrl::CanCut() const
 {
     if ( !IsEditable() )
 bool wxTextCtrl::CanCut() const
 {
     if ( !IsEditable() )
     // Can cut if there's a selection
     long from, to;
     GetSelection(& from, & to);
     // Can cut if there's a selection
     long from, to;
     GetSelection(& from, & to);
 bool wxTextCtrl::LoadFile(const wxString& file)
 {
     if ( wxTextCtrlBase::LoadFile(file) )
 bool wxTextCtrl::LoadFile(const wxString& file)
 {
     if ( wxTextCtrlBase::LoadFile(file) )
-    // these are the numbers from the HIG, we reduce them by the borders
-    // first
+    // these are the numbers from the HIG:
+    // we reduce them by the borders first
 
     switch( m_windowVariant )
     {
         case wxWINDOW_VARIANT_NORMAL :
             hText = 22 - 6 ;
             break ;
 
     switch( m_windowVariant )
     {
         case wxWINDOW_VARIANT_NORMAL :
             hText = 22 - 6 ;
             break ;
         case wxWINDOW_VARIANT_SMALL :
             hText = 19 - 6 ;
             break ;
         case wxWINDOW_VARIANT_SMALL :
             hText = 19 - 6 ;
             break ;
         case wxWINDOW_VARIANT_MINI :
             hText= 15 - 6 ;
             break ;
         case wxWINDOW_VARIANT_MINI :
             hText= 15 - 6 ;
             break ;
         default :
             hText = 22 - 6;
             break ;
         default :
             hText = 22 - 6;
             break ;
     // as the above numbers have some free space around the text
     // we get 5 lines like this anyway
     if ( m_windowStyle & wxTE_MULTILINE )
     // as the above numbers have some free space around the text
     // we get 5 lines like this anyway
     if ( m_windowStyle & wxTE_MULTILINE )
 
     if ( !HasFlag(wxNO_BORDER) )
         hText += 6 ;
 
     if ( !HasFlag(wxNO_BORDER) )
         hText += 6 ;
 void wxTextCtrl::Undo()
 {
     if (CanUndo())
 void wxTextCtrl::Undo()
 {
     if (CanUndo())
 }
 
 void wxTextCtrl::Redo()
 {
     if (CanRedo())
 }
 
 void wxTextCtrl::Redo()
 {
     if (CanRedo())
 }
 
 bool wxTextCtrl::CanUndo() const
 {
     if ( !IsEditable() )
 }
 
 bool wxTextCtrl::CanUndo() const
 {
     if ( !IsEditable() )
     return GetPeer()->CanUndo() ;
 }
 
 bool wxTextCtrl::CanRedo() const
 {
     if ( !IsEditable() )
     return GetPeer()->CanUndo() ;
 }
 
 bool wxTextCtrl::CanRedo() const
 {
     if ( !IsEditable() )
     return GetPeer()->CanRedo() ;
 }
 
     return GetPeer()->CanRedo() ;
 }
 
     return GetPeer()->GetLineText(lineNo) ;
 }
 
     return GetPeer()->GetLineText(lineNo) ;
 }
 
 void wxTextCtrl::Command(wxCommandEvent & event)
 {
     SetValue (event.GetString());
 void wxTextCtrl::Command(wxCommandEvent & event)
 {
     SetValue (event.GetString());
 {
     // By default, load the first file into the text window.
     if (event.GetNumberOfFiles() > 0)
 {
     // By default, load the first file into the text window.
     if (event.GetNumberOfFiles() > 0)
         LoadFile(event.GetFiles()[0]);
         LoadFile(event.GetFiles()[0]);
 }
 
 void wxTextCtrl::OnEraseBackground(wxEraseEvent& event)
 }
 
 void wxTextCtrl::OnEraseBackground(wxEraseEvent& event)
     switch ( key )
     {
         case WXK_RETURN:
     switch ( key )
     {
         case WXK_RETURN:
                 // text control
                 eat_key = true;
             }
                 // text control
                 eat_key = true;
             }
                 // be inserted.
                 WriteText(wxT("\t"));
             }
                 // be inserted.
                 WriteText(wxT("\t"));
             }
     if ( ( key >= 0x20 && key < WXK_START ) ||
          key == WXK_RETURN ||
          key == WXK_DELETE ||
     if ( ( key >= 0x20 && key < WXK_START ) ||
          key == WXK_RETURN ||
          key == WXK_DELETE ||
     event.Enable(GetLastPosition() > 0);
 }
 
     event.Enable(GetLastPosition() > 0);
 }
 
-// CS: Context Menus only work with mlte implementations or non-multiline HIViews at the moment
+// CS: Context Menus only work with MLTE implementations or non-multiline HIViews at the moment
 
 void wxTextCtrl::OnContextMenu(wxContextMenuEvent& event)
 {
 
 void wxTextCtrl::OnContextMenu(wxContextMenuEvent& event)
 {
 #if !TARGET_API_MAC_OSX
 
 // user pane implementation
 #if !TARGET_API_MAC_OSX
 
 // user pane implementation
 // ----------------------------------------------------------------------------
 // implementation base class
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // implementation base class
 // ----------------------------------------------------------------------------
-void wxMacTextControl::Undo() { }
+void wxMacTextControl::Undo()
+{
+}
 
 bool wxMacTextControl::CanRedo()  const
 {
 
 bool wxMacTextControl::CanRedo()  const
 {
     {
         if (content[i] == '\r') lines++;
     }
     {
         if (content[i] == '\r') lines++;
     }
         if (content[i] == '\n') count++;
     }
         if (content[i] == '\n') count++;
     }
-int  wxMacTextControl::GetLineLength(long lineNo) const
+int wxMacTextControl::GetLineLength(long lineNo) const
 {
     // TODO change this if possible to reflect real lines
     wxString content = GetStringValue() ;
 {
     // TODO change this if possible to reflect real lines
     wxString content = GetStringValue() ;
             for (size_t j = i; j < content.Length(); j++)
             {
                 count++;
             for (size_t j = i; j < content.Length(); j++)
             {
                 count++;
-                if (content[j] == '\n') return count;
+                if (content[j] == '\n')
+                    return count;
         if (content[i] == '\n') count++;
     }
         if (content[i] == '\n') count++;
     }
     CreateEditUnicodeTextControl( MAC_WXHWND(wxPeer->MacGetTopLevelWindowRef()), &bounds , cfr , isPassword , NULL , &m_controlRef ) ;
 
     if ( !(m_windowStyle & wxTE_MULTILINE) )
     CreateEditUnicodeTextControl( MAC_WXHWND(wxPeer->MacGetTopLevelWindowRef()), &bounds , cfr , isPassword , NULL , &m_controlRef ) ;
 
     if ( !(m_windowStyle & wxTE_MULTILINE) )
         SetData<Boolean>( kControlEditTextPart , kControlEditTextSingleLineTag , true ) ;
         SetData<Boolean>( kControlEditTextPart , kControlEditTextSingleLineTag , true ) ;
 }
 
 wxMacUnicodeTextControl::~wxMacUnicodeTextControl()
 }
 
 wxMacUnicodeTextControl::~wxMacUnicodeTextControl()
 wxString wxMacUnicodeTextControl::GetStringValue() const
 {
     wxString result ;
 wxString wxMacUnicodeTextControl::GetStringValue() const
 {
     wxString result ;
         wxMacCFStringHolder cf(value) ;
         result = cf.AsString() ;
     }
         wxMacCFStringHolder cf(value) ;
         result = cf.AsString() ;
     }
 #if '\n' == 10
     wxMacConvertNewlines13To10( &result ) ;
 #else
     wxMacConvertNewlines10To13( &result ) ;
 #endif
 #if '\n' == 10
     wxMacConvertNewlines13To10( &result ) ;
 #else
     wxMacConvertNewlines10To13( &result ) ;
 #endif
 void wxMacUnicodeTextControl::SetStringValue( const wxString &str)
 {
     wxString st = str ;
 void wxMacUnicodeTextControl::SetStringValue( const wxString &str)
 {
     wxString st = str ;
     wxMacCFStringHolder cf(st , m_font.GetEncoding() ) ;
     verify_noerr( SetData<CFStringRef>(  0, m_valueTag , cf ) ) ;
 }
     wxMacCFStringHolder cf(st , m_font.GetEncoding() ) ;
     verify_noerr( SetData<CFStringRef>(  0, m_valueTag , cf ) ) ;
 }
 void wxMacUnicodeTextControl::Copy()
 {
     SendHICommand( kHICommandCopy ) ;
 }
 void wxMacUnicodeTextControl::Copy()
 {
     SendHICommand( kHICommandCopy ) ;
 }
 void wxMacUnicodeTextControl::Cut()
 {
     SendHICommand( kHICommandCut ) ;
 }
 void wxMacUnicodeTextControl::Cut()
 {
     SendHICommand( kHICommandCut ) ;
 }
 void wxMacUnicodeTextControl::Paste()
 {
     SendHICommand( kHICommandPaste ) ;
 }
 void wxMacUnicodeTextControl::Paste()
 {
     SendHICommand( kHICommandPaste ) ;
 }
 bool wxMacUnicodeTextControl::CanPaste() const
 {
     return true ;
 }
 bool wxMacUnicodeTextControl::CanPaste() const
 {
     return true ;
 }
 void wxMacUnicodeTextControl::SetEditable(bool editable)
 {
     SetData<Boolean>( 0 , kControlEditTextLockedTag , (Boolean) !editable ) ;
 void wxMacUnicodeTextControl::SetEditable(bool editable)
 {
     SetData<Boolean>( 0 , kControlEditTextLockedTag , (Boolean) !editable ) ;
         from = 0 ;
         to = 32767 ; // sel has 16 bit signed values, max is 32767
     }
         from = 0 ;
         to = 32767 ; // sel has 16 bit signed values, max is 32767
     }
     sel.selStart = from ;
     sel.selEnd = to ;
     SetData<ControlEditTextSelectionRec>( 0 , kControlEditTextSelectionTag, &sel ) ;
     sel.selStart = from ;
     sel.selEnd = to ;
     SetData<ControlEditTextSelectionRec>( 0 , kControlEditTextSelectionTag, &sel ) ;
 // MLTE control implementation (common part)
 // ----------------------------------------------------------------------------
 
 // MLTE control implementation (common part)
 // ----------------------------------------------------------------------------
 
-// if mlte is on read only , no changes at all are allowed, not even from
+// if MTLE is read only, no changes at all are allowed, not even from
 // procedural API, in order to allow changes via API all the same we must undo
 // the readonly status while we are executing, this class helps to do so
 
 // procedural API, in order to allow changes via API all the same we must undo
 // the readonly status while we are executing, this class helps to do so
 
             TXNSetTXNObjectControls( m_txn , false , 1 , tag , data ) ;
         }
     }
             TXNSetTXNObjectControls( m_txn , false , 1 , tag , data ) ;
         }
     }
     ~wxMacEditHelper()
     {
         TXNControlTag tag[] = { kTXNIOPrivilegesTag } ;
         if ( m_data[0].uValue == kTXNReadOnly )
     ~wxMacEditHelper()
     {
         TXNControlTag tag[] = { kTXNIOPrivilegesTag } ;
         if ( m_data[0].uValue == kTXNReadOnly )
             TXNSetTXNObjectControls( m_txn , false , 1 , tag , m_data ) ;
             TXNSetTXNObjectControls( m_txn , false , 1 , tag , m_data ) ;
     protected :
         TXNObject m_txn ;
         TXNControlData m_data[1] ;
     protected :
         TXNObject m_txn ;
         TXNControlData m_data[1] ;
                 result = wxString( ptr ) ;
                 delete[] ptr ;
             }
                 result = wxString( ptr ) ;
                 delete[] ptr ;
             }
             DisposeHandle( theText ) ;
         }
 #else
             DisposeHandle( theText ) ;
         }
 #else
                 result = wxString( *theText , wxConvLocal , actualSize ) ;
                 HUnlock( theText ) ;
             }
                 result = wxString( *theText , wxConvLocal , actualSize ) ;
                 HUnlock( theText ) ;
             }
             DisposeHandle( theText ) ;
         }
 #endif
     }
             DisposeHandle( theText ) ;
         }
 #endif
     }
 #if '\n' == 10
     wxMacConvertNewlines13To10( &result ) ;
 #else
     wxMacConvertNewlines10To13( &result ) ;
 #endif
 #if '\n' == 10
     wxMacConvertNewlines13To10( &result ) ;
 #else
     wxMacConvertNewlines10To13( &result ) ;
 #endif
     tback.bgType = kTXNBackgroundTypeRGB;
     tback.bg.color = MAC_WXCOLORREF( background.GetPixel() );
     TXNSetBackground( m_txn , &tback);
     tback.bgType = kTXNBackgroundTypeRGB;
     tback.bg.color = MAC_WXCOLORREF( background.GetPixel() );
     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 )
     {
     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)
 {
     wxMacEditHelper help(m_txn) ;
 void wxMacMLTEControl::SetStyle(long start, long end, const wxTextAttr& style)
 {
     wxMacEditHelper help(m_txn) ;
         wxMacEditHelper helper( m_txn ) ;
         SetTXNData( st , kTXNUseCurrentSelection, kTXNUseCurrentSelection ) ;
     }
         wxMacEditHelper helper( m_txn ) ;
         SetTXNData( st , kTXNUseCurrentSelection, kTXNUseCurrentSelection ) ;
     }
     GetSelection( &dummy , &end ) ;
     // TODO SetStyle( start , end , GetDefaultStyle() ) ;
 }
     GetSelection( &dummy , &end ) ;
     // TODO SetStyle( start , end , GetDefaultStyle() ) ;
 }
         if ( y ) *y = ypos ;
         if ( x ) *x = xpos ;
     }
         if ( y ) *y = ypos ;
         if ( x ) *x = xpos ;
     }
 wxString wxMacMLTEControl::GetLineText(long lineNo) const
 {
     wxString line ;
 wxString wxMacMLTEControl::GetLineText(long lineNo) const
 {
     wxString line ;
 wxInt16 wxMacMLTEClassicControl::MacControlUserPaneHitTestProc(wxInt16 x, wxInt16 y)
 {
     Point where = { y , x } ;
 wxInt16 wxMacMLTEClassicControl::MacControlUserPaneHitTestProc(wxInt16 x, wxInt16 y)
 {
     Point where = { y , x } ;
-    ControlPartCode result;
+    ControlPartCode result = kControlNoPart;
     wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef);
     wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef);
-    if ( textctrl == NULL )
-        return 0 ;
-
-    if (textctrl->MacIsReallyShown() )
+    if ( (textctrl != NULL) && textctrl->MacIsReallyShown() )
     {
         if (PtInRect(where, &m_txnControlBounds))
             result = kControlEditTextPart ;
     {
         if (PtInRect(where, &m_txnControlBounds))
             result = kControlEditTextPart ;
             }
             if (PtInRect(where, &m_txnControlBounds))
                 result = kControlEditTextPart ;
             }
             if (PtInRect(where, &m_txnControlBounds))
                 result = kControlEditTextPart ;
     return result;
 }
 
 wxInt16 wxMacMLTEClassicControl::MacControlUserPaneTrackingProc( wxInt16 x, wxInt16 y, void* actionProc )
 {
     return result;
 }
 
 wxInt16 wxMacMLTEClassicControl::MacControlUserPaneTrackingProc( wxInt16 x, wxInt16 y, void* actionProc )
 {
-    wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef);
-    if ( textctrl == NULL )
-        return 0;
-
-    ControlPartCode partCodeResult = 0;
+    ControlPartCode result = kControlNoPart;
-    if (textctrl->MacIsReallyShown() )
+    wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef);
+    if ( (textctrl != NULL) && textctrl->MacIsReallyShown() )
-        Point startPt = { y ,x } ;
+        Point startPt = { y , x } ;
         // for compositing, we must convert these into toplevel window coordinates, because hittesting expects them
         if ( textctrl->MacGetTopLevelWindow()->MacUsesCompositing() )
         {
         // for compositing, we must convert these into toplevel window coordinates, because hittesting expects them
         if ( textctrl->MacGetTopLevelWindow()->MacUsesCompositing() )
         {
                 EventRecord rec ;
                 ConvertEventRefToEventRecord( (EventRef) wxTheApp->MacGetCurrentEvent() , &rec ) ;
                 TXNClick( m_txn, &rec );
                 EventRecord rec ;
                 ConvertEventRefToEventRecord( (EventRef) wxTheApp->MacGetCurrentEvent() , &rec ) ;
                 TXNClick( m_txn, &rec );
 }
 
 void wxMacMLTEClassicControl::MacControlUserPaneIdleProc()
 }
 
 void wxMacMLTEClassicControl::MacControlUserPaneIdleProc()
 {
     wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef);
     if ( textctrl == NULL )
 {
     wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(m_controlRef);
     if ( textctrl == NULL )
 
     wxMacWindowClipper clipper( textctrl ) ;
 
 
     wxMacWindowClipper clipper( textctrl ) ;
 
 
     wxMacWindowClipper clipper( textctrl ) ;
 
 
     wxMacWindowClipper clipper( textctrl ) ;
 
-    ControlRef controlFocus = 0 ;
+    ControlRef controlFocus = NULL ;
     GetKeyboardFocus( m_txnWindow , &controlFocus ) ;
     bool wasFocused = ( controlFocus == m_controlRef ) ;
 
     GetKeyboardFocus( m_txnWindow , &controlFocus ) ;
     bool wasFocused = ( controlFocus == m_controlRef ) ;
 
 
         case kControlFocusNoPart:
         default:
 
         case kControlFocusNoPart:
         default:
-            MacFocusPaneText( false);
+            MacFocusPaneText( false );
             focusResult = kControlFocusNoPart;
             break;
     }
             focusResult = kControlFocusNoPart;
             break;
     }
     m_windowStyle = style ;
     Rect bounds = wxMacGetBoundsForControl( wxPeer , pos , size ) ;
 
     m_windowStyle = style ;
     Rect bounds = wxMacGetBoundsForControl( wxPeer , pos , size ) ;
 
-    featurSet = kControlSupportsEmbedding | kControlSupportsFocus  | kControlWantsIdle
+    featureSet = kControlSupportsEmbedding | kControlSupportsFocus  | kControlWantsIdle
             | kControlWantsActivate  | kControlHandlesTracking // | kControlHasSpecialBackground
             | kControlGetsFocusOnClick | kControlSupportsLiveFeedback;
 
             | kControlWantsActivate  | kControlHandlesTracking // | kControlHasSpecialBackground
             | kControlGetsFocusOnClick | kControlSupportsLiveFeedback;
 
-    verify_noerr( ::CreateUserPaneControl( MAC_WXHWND(wxPeer->GetParent()->MacGetTopLevelWindowRef()), &bounds, featurSet, &m_controlRef ) );
+    verify_noerr( ::CreateUserPaneControl( MAC_WXHWND(wxPeer->GetParent()->MacGetTopLevelWindowRef()), &bounds, featureSet, &m_controlRef ) );
-    AdjustCreationAttributes( *wxWHITE , true) ;
+    AdjustCreationAttributes( *wxWHITE , true ) ;
 
     MacSetObjectVisibility( wxPeer->MacIsReallyShown() ) ;
 
 
     MacSetObjectVisibility( wxPeer->MacIsReallyShown() ) ;
 
 
     /* set the initial settings for our private data */
 
 
     /* set the initial settings for our private data */
 
-    m_txnWindow =GetControlOwner(m_controlRef);
+    m_txnWindow = GetControlOwner(m_controlRef);
     m_txnPort = (GrafPtr) GetWindowPort(m_txnWindow);
 
 #ifdef __WXMAC_OSX__
     m_txnPort = (GrafPtr) GetWindowPort(m_txnWindow);
 
 #ifdef __WXMAC_OSX__
 
     TXNSetSelection( m_txn, 0, 0);
     TXNShowSelection( m_txn, kTXNShowStart);
 
     TXNSetSelection( m_txn, 0, 0);
     TXNShowSelection( m_txn, kTXNShowStart);
 }
 
 OSStatus wxMacMLTEHIViewControl::SetFocus( ControlFocusPart focusPart )
 }
 
 OSStatus wxMacMLTEHIViewControl::SetFocus( ControlFocusPart focusPart )