tback.bg.color = MAC_WXCOLORREF( GetBackgroundColour().GetPixel() );
TXNSetBackground( (TXNObject) m_macTXN , &tback);
- if ( m_windowStyle & wxTE_READONLY)
- {
- SetEditable( false ) ;
- }
#else
wxMacCFStringHolder cf(st , m_font.GetEncoding()) ;
- CreateEditUnicodeTextControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds , cf , style & wxTE_PASSWORD , NULL , (ControlRef*) &m_macControl ) ;
+ CFStringRef cfr = cf ;
+ Boolean isPassword = ( m_windowStyle & wxTE_PASSWORD ) != 0 ;
+ CreateEditUnicodeTextControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds , cfr , isPassword , NULL , (ControlRef*) &m_macControl ) ;
+ if ( !(m_windowStyle & wxTE_MULTILINE) )
+ {
+ Boolean singleline = true ;
+ ::SetControlData( (ControlHandle) m_macControl, kControlEditTextPart , kControlEditTextSingleLineTag , sizeof( singleline ) , &singleline ) ;
+ }
MacPostControlCreate(pos,size) ;
+
#endif
+ if ( m_windowStyle & wxTE_READONLY)
+ {
+ SetEditable( false ) ;
+ }
return TRUE;
void wxTextCtrl::MacVisibilityChanged()
{
-#if wxMAC_USE_MLTE && !wxMAC_USE_MLTE_HIVIEW
+#if wxMAC_USE_MLTE
+#if !wxMAC_USE_MLTE_HIVIEW
MLTESetObjectVisibility((STPTextPaneVars*) m_macTXNvars , MacIsReallyShown() , GetWindowStyle() ) ;
if ( !MacIsReallyShown() )
InvalWindowRect( GetControlOwner( (ControlHandle) m_macControl ) , &((STPTextPaneVars *)m_macTXNvars)->fRBounds ) ;
#endif
+#else
+ if ( !(m_windowStyle & wxTE_MULTILINE) && MacIsReallyShown() )
+ {
+ // work around a refresh issue insofar as not always the entire content is shown even if this would be possible
+ ControlEditTextSelectionRec sel ;
+ CFStringRef value = NULL ;
+ Size actualSize = 0 ;
+ ResType datatag = GetWindowStyle() & wxTE_PASSWORD ?
+ kControlEditTextPasswordCFStringTag : kControlEditTextCFStringTag ;
+
+ verify_noerr( GetControlData( (ControlRef) m_macControl , 0, kControlEditTextSelectionTag,
+ sizeof(ControlEditTextSelectionRec), &sel, &actualSize ) );
+ verify_noerr( GetControlData( (ControlRef) m_macControl , 0, datatag , sizeof(CFStringRef), &value, &actualSize ) );
+
+ verify_noerr( SetControlData( (ControlRef) m_macControl , 0, datatag, sizeof(CFStringRef), &value ) );
+ verify_noerr( SetControlData( (ControlRef) m_macControl , 0, kControlEditTextSelectionTag, sizeof(ControlEditTextSelectionRec), &sel ) );
+
+ CFRelease( value ) ;
+ }
+#endif
}
void wxTextCtrl::MacEnabledStateChanged()
TXNControlTag tag[] = { kTXNIOPrivilegesTag } ;
TXNControlData data[] = { { editable ? kTXNReadWrite : kTXNReadOnly } } ;
TXNSetTXNObjectControls( (TXNObject) m_macTXN , false , sizeof(tag) / sizeof (TXNControlTag) , tag , data ) ;
+#else
+ Boolean value = !editable ;
+ ::SetControlData( (ControlHandle) m_macControl, 0, kControlEditTextLockedTag , sizeof( value ) , &value ) ;
#endif
}
}
{
if ( !wxIsMainThread() )
{
- wxMacMPRemoteGUICall( this , &wxTextCtrl::WriteText , str ) ;
+ // unfortunately CW 8 is not able to correctly deduce the template types, so we have
+ // to instantiate explicitely
+ wxMacMPRemoteGUICall<wxTextCtrl,wxString>( this , &wxTextCtrl::WriteText , str ) ;
return ;
}
else
val.Remove( start , end - start ) ;
val.insert( start , str ) ;
SetValue( val ) ;
+ SetInsertionPoint( start + str.Length() ) ;
#endif
#endif
}
break ;
}
+#if !wxMAC_USE_MLTE
+ // unicode text control is using client size, ie 3 pixels on every side
+ // TODO make this fit into normal window size concept, probably having
+ // to reintroduce the margin vars
+ hText -= 6 ;
+#endif
+
if ( m_windowStyle & wxTE_MULTILINE )
{
hText *= 5 ;
}
}
- // this will make wxWindows 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
eat_key = TRUE;