X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cbea84022c92098e94956cc50a4271599773a975..5c7b506103cfc078a821860766e31c47d595e07f:/src/mac/carbon/textctrl.cpp?ds=sidebyside diff --git a/src/mac/carbon/textctrl.cpp b/src/mac/carbon/textctrl.cpp index f44ec41d34..79c591439c 100644 --- a/src/mac/carbon/textctrl.cpp +++ b/src/mac/carbon/textctrl.cpp @@ -44,6 +44,7 @@ #include "wx/filefn.h" #include "wx/sysopt.h" +#include "wx/thread.h" #include "wx/mac/uma.h" #include "wx/mac/carbon/private/mactext.h" @@ -485,7 +486,7 @@ void wxTextCtrl::MacSuperChangedPosition() void wxTextCtrl::MacVisibilityChanged() { - GetPeer()->VisibilityChanged( MacIsReallyShown() ) ; + GetPeer()->VisibilityChanged( GetPeer()->IsVisible() ); } void wxTextCtrl::MacCheckSpelling(bool check) @@ -1338,7 +1339,7 @@ bool wxMacUnicodeTextControl::Create( wxTextCtrl *wxPeer, Rect bounds = wxMacGetBoundsForControl( wxPeer , pos , size ) ; wxString st = str ; wxMacConvertNewlines10To13( &st ) ; - wxMacCFStringHolder cf(st , m_font.GetEncoding()) ; + wxCFStringRef cf(st , m_font.GetEncoding()) ; CFStringRef cfr = cf ; m_valueTag = kControlEditTextCFStringTag ; @@ -1382,7 +1383,7 @@ wxString wxMacUnicodeTextControl::GetStringValue() const CFStringRef value = GetData(0, m_valueTag) ; if ( value ) { - wxMacCFStringHolder cf(value) ; + wxCFStringRef cf(value) ; result = cf.AsString() ; } @@ -1399,7 +1400,7 @@ void wxMacUnicodeTextControl::SetStringValue( const wxString &str ) { wxString st = str ; wxMacConvertNewlines10To13( &st ) ; - wxMacCFStringHolder cf( st , m_font.GetEncoding() ) ; + wxCFStringRef cf( st , m_font.GetEncoding() ) ; verify_noerr( SetData( 0, m_valueTag , cf ) ) ; } @@ -1465,7 +1466,7 @@ void wxMacUnicodeTextControl::SetSelection( long from , long to ) CFStringRef value = GetData(0, m_valueTag) ; if ( value ) { - wxMacCFStringHolder cf(value) ; + wxCFStringRef cf(value) ; textLength = cf.AsString().length() ; } @@ -1498,7 +1499,7 @@ void wxMacUnicodeTextControl::WriteText( const wxString& str ) if ( HasFocus() ) { - wxMacCFStringHolder cf(st , m_font.GetEncoding() ) ; + wxCFStringRef cf(st , m_font.GetEncoding() ) ; CFStringRef value = cf ; SetData( 0, kControlEditTextInsertCFStringRefTag, &value ); } @@ -1811,11 +1812,12 @@ void wxMacMLTEControl::TXNSetAttribute( const wxTextAttr& style , long from , lo TXNTab* tabs = NULL; bool relayout = false; + wxFont font ; if ( style.HasFont() ) { wxASSERT( typeAttrCount < WXSIZEOF(typeAttr) ); - const wxFont &font = style.GetFont() ; + font = style.GetFont() ; typeAttr[typeAttrCount].tag = kTXNATSUIStyle ; typeAttr[typeAttrCount].size = kTXNATSUIStyleSize ; typeAttr[typeAttrCount].data.dataPtr = font.MacGetATSUStyle() ; @@ -2561,7 +2563,7 @@ void wxMacMLTEClassicControl::MacControlUserPaneDrawProc(wxInt16 WXUNUSED(thePar if ( textctrl == NULL ) return ; - if ( textctrl->MacIsReallyShown() ) + if ( textctrl->IsShownOnScreen() ) { wxMacWindowClipper clipper( textctrl ) ; TXNDraw( m_txn , NULL ) ; @@ -2574,7 +2576,7 @@ wxInt16 wxMacMLTEClassicControl::MacControlUserPaneHitTestProc(wxInt16 x, wxInt1 ControlPartCode result = kControlNoPart; wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference( m_controlRef ); - if ( (textctrl != NULL) && textctrl->MacIsReallyShown() ) + if ( (textctrl != NULL) && textctrl->IsShownOnScreen() ) { if (PtInRect( where, &m_txnControlBounds )) { @@ -2601,7 +2603,7 @@ wxInt16 wxMacMLTEClassicControl::MacControlUserPaneTrackingProc( wxInt16 x, wxIn ControlPartCode result = kControlNoPart; wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference( m_controlRef ); - if ( (textctrl != NULL) && textctrl->MacIsReallyShown() ) + if ( (textctrl != NULL) && textctrl->IsShownOnScreen() ) { Point startPt = { y , x } ; @@ -2637,7 +2639,7 @@ void wxMacMLTEClassicControl::MacControlUserPaneIdleProc() if ( textctrl == NULL ) return ; - if (textctrl->MacIsReallyShown()) + if (textctrl->IsShownOnScreen()) { if (IsControlActive(m_controlRef)) { @@ -2743,7 +2745,7 @@ wxMacMLTEClassicControl::wxMacMLTEClassicControl( wxTextCtrl *wxPeer, AdjustCreationAttributes( *wxWHITE , true ) ; - MacSetObjectVisibility( wxPeer->MacIsReallyShown() ) ; + MacSetObjectVisibility( wxPeer->IsShownOnScreen() ) ; { wxString st = str ; @@ -3031,7 +3033,7 @@ wxMacMLTEHIViewControl::wxMacMLTEHIViewControl( wxTextCtrl *wxPeer, m_scrollView = NULL ; TXNFrameOptions frameOptions = FrameOptionsFromWXStyle( style ) ; - if (( frameOptions & (kTXNWantVScrollBarMask | kTXNWantHScrollBarMask)) || !(frameOptions &kTXNSingleLineOnlyMask)) + if (( frameOptions & (kTXNWantVScrollBarMask | kTXNWantHScrollBarMask)) || (frameOptions &kTXNSingleLineOnlyMask)) { if ( frameOptions & (kTXNWantVScrollBarMask | kTXNWantHScrollBarMask) ) {