- virtual void SetFont( const wxFont & font, const wxColour& foreground, long windowStyle ) ;
+ virtual void SetFont( const wxFont & font, const wxColour& foreground, long windowStyle, bool ignoreBlack ) ;
virtual void SetBackgroundColour(const wxColour& col );
virtual void SetStyle( long start, long end, const wxTextAttr& style ) ;
virtual void Copy() ;
virtual void SetBackgroundColour(const wxColour& col );
virtual void SetStyle( long start, long end, const wxTextAttr& style ) ;
virtual void Copy() ;
- virtual void Move(int x, int y, int width, int height);
+ virtual void Move(int x, int y, int width, int height);
-wxWidgetImplType* wxWidgetImpl::CreateTextControl( wxTextCtrl* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateTextControl( wxTextCtrl* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
-wxMacUnicodeTextControl::wxMacUnicodeTextControl( wxTextCtrl *wxPeer ) : wxMacControl( wxPeer )
+wxMacUnicodeTextControl::wxMacUnicodeTextControl( wxTextCtrl *wxPeer )
+ : wxMacControl( wxPeer ),
+ wxTextWidgetImpl( wxPeer )
SetHandleSize( theText, (actualSize + 1) * sizeof(UniChar) ) ;
HLock( theText ) ;
(((UniChar*)*theText)[actualSize]) = 0 ;
wxMBConvUTF16 converter ;
size_t noChars = converter.MB2WC( NULL , (const char*)*theText , 0 ) ;
SetHandleSize( theText, (actualSize + 1) * sizeof(UniChar) ) ;
HLock( theText ) ;
(((UniChar*)*theText)[actualSize]) = 0 ;
wxMBConvUTF16 converter ;
size_t noChars = converter.MB2WC( NULL , (const char*)*theText , 0 ) ;
ptr = new wxChar[noChars + 1] ;
noChars = converter.MB2WC( ptr , (const char*)*theText , noChars + 1 ) ;
ptr = new wxChar[noChars + 1] ;
noChars = converter.MB2WC( ptr , (const char*)*theText , noChars + 1 ) ;
Handle theText ;
err = TXNGetDataEncoded( m_txn , kTXNStartOffset, kTXNEndOffset, &theText, kTXNTextData );
Handle theText ;
err = TXNGetDataEncoded( m_txn , kTXNStartOffset, kTXNEndOffset, &theText, kTXNTextData );
void wxMacMLTEControl::SetFont(const wxFont & font,
const wxColour& foreground,
void wxMacMLTEControl::SetFont(const wxFont & font,
const wxColour& foreground,
{
wxMacEditHelper help( m_txn ) ;
TXNSetAttribute( wxTextAttr( foreground, wxNullColour, font ), kTXNStartOffset, kTXNEndOffset ) ;
{
wxMacEditHelper help( m_txn ) ;
TXNSetAttribute( wxTextAttr( foreground, wxNullColour, font ), kTXNStartOffset, kTXNEndOffset ) ;
+#if wxUSE_UNICODE
+ OSErr err = TXNGetDataEncoded( m_txn, kTXNStartOffset, kTXNEndOffset, &theText, kTXNUnicodeTextData );
+ // all done
+ if ( err == noErr )
+ {
+ actualsize = GetHandleSize( theText )/sizeof(UniChar);
+ DisposeHandle( theText ) ;
+ }
+#else
OSErr err = TXNGetDataEncoded( m_txn, kTXNStartOffset, kTXNEndOffset, &theText, kTXNTextData );
// all done
OSErr err = TXNGetDataEncoded( m_txn, kTXNStartOffset, kTXNEndOffset, &theText, kTXNTextData );
// all done
// there will be an error returned for classic MLTE implementation when the control is
// invisible, but HITextView works correctly, so we don't assert that one
// there will be an error returned for classic MLTE implementation when the control is
// invisible, but HITextView works correctly, so we don't assert that one
-#if SIZEOF_WCHAR_T == 2
- size_t len = st.length() ;
- TXNSetData( m_txn, kTXNUnicodeTextData, (void*)st.wc_str(), len * 2, start, end );
-#else
wxMBConvUTF16 converter ;
ByteCount byteBufferLen = converter.WC2MB( NULL, st.wc_str(), 0 ) ;
wxASSERT_MSG( byteBufferLen != wxCONV_FAILED,
wxMBConvUTF16 converter ;
ByteCount byteBufferLen = converter.WC2MB( NULL, st.wc_str(), 0 ) ;
wxASSERT_MSG( byteBufferLen != wxCONV_FAILED,
UniChar *unibuf = (UniChar*)malloc( byteBufferLen + 2 ) ; // 2 for NUL in UTF-16
converter.WC2MB( (char*)unibuf, st.wc_str(), byteBufferLen + 2 ) ;
TXNSetData( m_txn, kTXNUnicodeTextData, (void*)unibuf, byteBufferLen, start, end ) ;
free( unibuf ) ;
UniChar *unibuf = (UniChar*)malloc( byteBufferLen + 2 ) ; // 2 for NUL in UTF-16
converter.WC2MB( (char*)unibuf, st.wc_str(), byteBufferLen + 2 ) ;
TXNSetData( m_txn, kTXNUnicodeTextData, (void*)unibuf, byteBufferLen, start, end ) ;
free( unibuf ) ;
wxCharBuffer text = st.mb_str( wxConvLocal ) ;
TXNSetData( m_txn, kTXNTextData, (void*)text.data(), strlen( text ), start, end ) ;
wxCharBuffer text = st.mb_str( wxConvLocal ) ;
TXNSetData( m_txn, kTXNTextData, (void*)text.data(), strlen( text ), start, end ) ;
-void wxMacMLTEClassicControl::Move(int x, int y, int width, int height)
+void wxMacMLTEClassicControl::Move(int x, int y, int width, int height)
{
wxMacControl::Move(x,y,width,height) ;
MacUpdatePosition() ;
{
wxMacControl::Move(x,y,width,height) ;
MacUpdatePosition() ;