m_formerClip = NewRgn() ;
m_newClip = NewRgn() ;
GetClip( m_formerClip ) ;
-
+
if ( win )
{
// guard against half constructed objects, this just leads to a empty clip
{
int x = 0 , y = 0;
win->MacWindowToRootWindow( &x, &y ) ;
-
+
// get area including focus rect
HIShapeGetAsQDRgn( ((wxWindow*)win)->MacGetVisibleRegion(true).GetWXHRGN() , m_newClip );
if ( !EmptyRgn( m_newClip ) )
OffsetRgn( m_newClip , x , y ) ;
}
-
+
SetClip( m_newClip ) ;
}
}
void wxTextCtrl::MacVisibilityChanged()
{
- GetPeer()->VisibilityChanged( MacIsReallyShown() ) ;
+ GetPeer()->VisibilityChanged( GetPeer()->IsVisible() );
}
void wxTextCtrl::MacCheckSpelling(bool check)
{
int key = event.GetKeyCode() ;
bool eat_key = false ;
+ long from, to;
if ( key == 'a' && event.MetaDown() )
{
// Check if we have reached the max # of chars (if it is set), but still
// allow navigation and deletion
+ GetSelection( &from, &to );
if ( !IsMultiLine() && m_maxLength && GetValue().length() >= m_maxLength &&
key != WXK_LEFT && key != WXK_RIGHT && key != WXK_TAB &&
- key != WXK_BACK && !( key == WXK_RETURN && (m_windowStyle & wxTE_PROCESS_ENTER) )
- )
+ key != WXK_BACK && key != WXK_DELETE && !( key == WXK_RETURN && (m_windowStyle & wxTE_PROCESS_ENTER) ) &&
+ from == to )
{
// eat it, we don't want to add more than allowed # of characters
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 ;
CFStringRef value = GetData<CFStringRef>(0, m_valueTag) ;
if ( value )
{
- wxMacCFStringHolder cf(value) ;
+ wxCFStringRef cf(value) ;
result = cf.AsString() ;
}
{
wxString st = str ;
wxMacConvertNewlines10To13( &st ) ;
- wxMacCFStringHolder cf( st , m_font.GetEncoding() ) ;
+ wxCFStringRef cf( st , m_font.GetEncoding() ) ;
verify_noerr( SetData<CFStringRef>( 0, m_valueTag , cf ) ) ;
}
CFStringRef value = GetData<CFStringRef>(0, m_valueTag) ;
if ( value )
{
- wxMacCFStringHolder cf(value) ;
+ wxCFStringRef cf(value) ;
textLength = cf.AsString().length() ;
}
if ( HasFocus() )
{
- wxMacCFStringHolder cf(st , m_font.GetEncoding() ) ;
+ wxCFStringRef cf(st , m_font.GetEncoding() ) ;
CFStringRef value = cf ;
SetData<CFStringRef>( 0, kControlEditTextInsertCFStringRefTag, &value );
}
| kTXNSupportFontCommandProcessing
| kTXNSupportFontCommandUpdating;
- // only spell check when not read-only
+ // only spell check when not read-only
// use system options for the default
- bool checkSpelling = false ;
+ bool checkSpelling = false ;
if ( !(m_windowStyle & wxTE_READONLY) )
- {
+ {
#if wxUSE_SYSTEM_OPTIONS
if ( wxSystemOptions::HasOption( wxMAC_TEXTCONTROL_USE_SPELL_CHECKER ) && (wxSystemOptions::GetOptionInt( wxMAC_TEXTCONTROL_USE_SPELL_CHECKER ) == 1) )
{
}
#endif
}
-
+
if ( checkSpelling )
options |=
kTXNSupportSpellCheckCommandProcessing
- | kTXNSupportSpellCheckCommandUpdating;
+ | kTXNSupportSpellCheckCommandUpdating;
TXNSetCommandEventSupport( m_txn , options ) ;
}
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() ;
if ( textctrl == NULL )
return ;
- if ( textctrl->MacIsReallyShown() )
+ if ( textctrl->IsShownOnScreen() )
{
wxMacWindowClipper clipper( textctrl ) ;
TXNDraw( m_txn , NULL ) ;
ControlPartCode result = kControlNoPart;
wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference( m_controlRef );
- if ( (textctrl != NULL) && textctrl->MacIsReallyShown() )
+ if ( (textctrl != NULL) && textctrl->IsShownOnScreen() )
{
if (PtInRect( where, &m_txnControlBounds ))
{
ControlPartCode result = kControlNoPart;
wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference( m_controlRef );
- if ( (textctrl != NULL) && textctrl->MacIsReallyShown() )
+ if ( (textctrl != NULL) && textctrl->IsShownOnScreen() )
{
Point startPt = { y , x } ;
if ( textctrl == NULL )
return ;
- if (textctrl->MacIsReallyShown())
+ if (textctrl->IsShownOnScreen())
{
if (IsControlActive(m_controlRef))
{
AdjustCreationAttributes( *wxWHITE , true ) ;
- MacSetObjectVisibility( wxPeer->MacIsReallyShown() ) ;
+ MacSetObjectVisibility( wxPeer->IsShownOnScreen() ) ;
{
wxString st = str ;
m_scrollView = NULL ;
TXNFrameOptions frameOptions = FrameOptionsFromWXStyle( style ) ;
- if (( frameOptions & (kTXNWantVScrollBarMask | kTXNWantHScrollBarMask)) || !(frameOptions &kTXNSingleLineOnlyMask))
+ if (( frameOptions & (kTXNWantVScrollBarMask | kTXNWantHScrollBarMask)) || (frameOptions &kTXNSingleLineOnlyMask))
{
if ( frameOptions & (kTXNWantVScrollBarMask | kTXNWantHScrollBarMask) )
{