#include "wx/filefn.h"
#include "wx/sysopt.h"
+#include "wx/thread.h"
#include "wx/mac/uma.h"
#include "wx/mac/carbon/private/mactext.h"
RgnHandle m_newClip;
};
+wxMacPortSaver::wxMacPortSaver( GrafPtr port )
+{
+ ::GetPort( &m_port );
+ ::SetPort( port );
+}
+
+wxMacPortSaver::~wxMacPortSaver()
+{
+ ::SetPort( m_port );
+}
+
+wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win ) :
+wxMacPortSaver( (GrafPtr) GetWindowPort( (WindowRef) win->MacGetTopLevelWindowRef() ) )
+{
+ m_newPort = (GrafPtr) GetWindowPort( (WindowRef) win->MacGetTopLevelWindowRef() ) ;
+ m_formerClip = NewRgn() ;
+ m_newClip = NewRgn() ;
+ GetClip( m_formerClip ) ;
+
+ if ( win )
+ {
+ // guard against half constructed objects, this just leads to a empty clip
+ if ( win->GetPeer() )
+ {
+ 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 ) ;
+ }
+}
+
+wxMacWindowClipper::~wxMacWindowClipper()
+{
+ SetPort( m_newPort ) ;
+ SetClip( m_formerClip ) ;
+ DisposeRgn( m_newClip ) ;
+ DisposeRgn( m_formerClip ) ;
+}
+
// common parts for implementations based on MLTE
class wxMacMLTEControl : public wxMacTextControl
if ( !forceMLTE )
{
- if ( m_windowStyle & wxTE_MULTILINE )
+ if ( m_windowStyle & wxTE_MULTILINE || ( UMAGetSystemVersion() >= 0x1050 ) )
m_peer = new wxMacMLTEHIViewControl( this , str , pos , size , style ) ;
}
wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, m_windowId );
event.SetEventObject( this );
- GetEventHandler()->ProcessEvent( event );
+ HandleWindowEvent( event );
}
}
wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, m_windowId );
event.SetEventObject( this );
- GetEventHandler()->ProcessEvent( event );
+ HandleWindowEvent( event );
}
}
wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
event.SetEventObject( this );
event.SetString( GetValue() );
- if ( GetEventHandler()->ProcessEvent(event) )
+ if ( HandleWindowEvent(event) )
return;
}
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 );
}
if ( wxStyle & wxTE_MULTILINE )
{
- frameOptions |= kTXNAlwaysWrapAtViewEdgeMask ;
+ if ( ! (wxStyle & wxTE_DONTWRAP ) )
+ frameOptions |= kTXNAlwaysWrapAtViewEdgeMask ;
if ( !(wxStyle & wxTE_NO_VSCROLL) )
{
// while this can be solved on 10.3 by reassigning them the correct place, on 10.2 there is
// no way out, therefore we are using our own implementation and our own scrollbars ....
-wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win ) :
- wxMacPortSaver( (GrafPtr) GetWindowPort( (WindowRef) win->MacGetTopLevelWindowRef() ) )
-{
- m_newPort = (GrafPtr) GetWindowPort( (WindowRef) win->MacGetTopLevelWindowRef() ) ;
- m_formerClip = NewRgn() ;
- m_newClip = NewRgn() ;
- GetClip( m_formerClip ) ;
-
- if ( win )
- {
- // guard against half constructed objects, this just leads to a empty clip
- if ( win->GetPeer() )
- {
- 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 ) ;
- }
-}
-
-wxMacWindowClipper::~wxMacWindowClipper()
-{
- SetPort( m_newPort ) ;
- SetClip( m_formerClip ) ;
- DisposeRgn( m_newClip ) ;
- DisposeRgn( m_formerClip ) ;
-}
-
TXNScrollInfoUPP gTXNScrollInfoProc = NULL ;
ControlActionUPP gTXNScrollActionProc = NULL ;
m_scrollView = NULL ;
TXNFrameOptions frameOptions = FrameOptionsFromWXStyle( style ) ;
- if (( frameOptions & (kTXNWantVScrollBarMask | kTXNWantHScrollBarMask)) || !(frameOptions &kTXNSingleLineOnlyMask))
+ if (( frameOptions & (kTXNWantVScrollBarMask | kTXNWantHScrollBarMask)) || (frameOptions &kTXNSingleLineOnlyMask))
{
if ( frameOptions & (kTXNWantVScrollBarMask | kTXNWantHScrollBarMask) )
{