public :
wxMacMLTEControl( wxTextCtrl *peer ) ;
~wxMacMLTEControl() {}
-
+
virtual bool CanFocus() const
{ return true; }
return true;
}
- virtual void Move(int x, int y, int width, int height);
+ virtual void Move(int x, int y, int width, int height);
protected :
OSStatus DoCreate();
SInt32 m_lastVerticalValue ;
};
-wxWidgetImplType* wxWidgetImpl::CreateTextControl( wxTextCtrl* wxpeer,
- wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(id),
+wxWidgetImplType* wxWidgetImpl::CreateTextControl( wxTextCtrl* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
const wxString& str,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long WXUNUSED(extraStyle))
{
bool forceMLTE = false ;
DEFINE_ONE_SHOT_HANDLER_GETTER( wxMacUnicodeTextControlEventHandler )
-wxMacUnicodeTextControl::wxMacUnicodeTextControl( wxTextCtrl *wxPeer ) : wxMacControl( wxPeer )
+wxMacUnicodeTextControl::wxMacUnicodeTextControl( wxTextCtrl *wxPeer )
+ : wxMacControl( wxPeer ),
+ wxTextWidgetImpl( wxPeer )
{
}
const wxString& str,
const wxPoint& pos,
const wxSize& size, long style )
- : wxMacControl( wxPeer )
+ : wxMacControl( wxPeer ),
+ wxTextWidgetImpl( wxPeer )
{
m_font = wxPeer->GetFont() ;
m_windowStyle = style ;
} ;
wxMacMLTEControl::wxMacMLTEControl( wxTextCtrl *peer )
- : wxMacControl( peer )
+ : wxMacControl( peer ),
+ wxTextWidgetImpl( peer )
{
SetNeedsFocusRect( true ) ;
}
{
wxChar *ptr = NULL ;
-#if SIZEOF_WCHAR_T == 2
- ptr = new wxChar[actualSize + 1] ;
- wxStrncpy( ptr , (wxChar*)(*theText) , actualSize ) ;
-#else
SetHandleSize( theText, (actualSize + 1) * sizeof(UniChar) ) ;
HLock( theText ) ;
(((UniChar*)*theText)[actualSize]) = 0 ;
wxMBConvUTF16 converter ;
size_t noChars = converter.MB2WC( NULL , (const char*)*theText , 0 ) ;
- wxASSERT_MSG( noChars != wxCONV_FAILED, _T("Unable to count the number of characters in this string!") );
+ wxASSERT_MSG( noChars != wxCONV_FAILED, wxT("Unable to count the number of characters in this string!") );
ptr = new wxChar[noChars + 1] ;
noChars = converter.MB2WC( ptr , (const char*)*theText , noChars + 1 ) ;
- wxASSERT_MSG( noChars != wxCONV_FAILED, _T("Conversion of string failed!") );
+ wxASSERT_MSG( noChars != wxCONV_FAILED, wxT("Conversion of string failed!") );
ptr[noChars] = 0 ;
HUnlock( theText ) ;
-#endif
ptr[actualSize] = 0 ;
result = wxString( ptr ) ;
DisposeHandle( theText ) ;
}
-#else
+#else // !wxUSE_UNICODE
Handle theText ;
err = TXNGetDataEncoded( m_txn , kTXNStartOffset, kTXNEndOffset, &theText, kTXNTextData );
DisposeHandle( theText ) ;
}
-#endif
+#endif // wxUSE_UNICODE/!wxUSE_UNICODE
}
#if '\n' == 10
} ;
err = TXNSetTypeAttributes(
- m_txn, sizeof(typeAttr) / sizeof(TXNTypeAttributes),
+ m_txn, WXSIZEOF(typeAttr),
typeAttr, kTXNStartOffset, kTXNEndOffset );
verify_noerr( err );
// 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
- // wxASSERT_MSG( theErr == noErr, _T("TXNScroll returned an error!") );
+ // wxASSERT_MSG( theErr == noErr, wxT("TXNScroll returned an error!") );
}
void wxMacMLTEControl::SetTXNData( const wxString& st, TXNOffset start, TXNOffset end )
{
#if wxUSE_UNICODE
-#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,
- _T("Conversion to UTF-16 unexpectedly failed") );
+ wxT("Conversion to UTF-16 unexpectedly 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 ) ;
-#endif
-#else
+#else // !wxUSE_UNICODE
wxCharBuffer text = st.mb_str( wxConvLocal ) ;
TXNSetData( m_txn, kTXNTextData, (void*)text.data(), strlen( text ), start, end ) ;
-#endif
+#endif // wxUSE_UNICODE/!wxUSE_UNICODE
}
wxString wxMacMLTEControl::GetLineText(long lineNo) const
}
}
-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() ;