#define TE_UNLIMITED_LENGTH 0xFFFFFFFFUL
-extern wxApp *wxTheApp ;
extern wxControl *wxFindControlFromMacControl(ControlHandle inControl ) ;
// CS:TODO we still have a problem getting properly at the text events of a control because under Carbon
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , "\p" , true , 0 , 0 , 1,
(style & wxTE_PASSWORD) ? kControlEditTextPasswordProc : kControlEditTextProc , (long) this ) ;
long size ;
- ::GetControlData((ControlHandle) m_macControl , 0, kControlEditTextTEHandleTag , sizeof( TEHandle ) , (char*) &((TEHandle) m_macTE) , &size ) ;
+ ::GetControlData((ControlHandle) m_macControl , 0, kControlEditTextTEHandleTag , sizeof( TEHandle ) , (char*)((TEHandle *)&m_macTE) , &size ) ;
}
else
}
else
{
- bool formerEditable = IsEditable() ;
+ bool formerEditable = m_editable ;
if ( !formerEditable )
SetEditable(true) ;
#if wxUSE_UNICODE
{
if ( m_macUsesTXN )
{
- bool formerEditable = IsEditable() ;
+ bool formerEditable = m_editable ;
if ( !formerEditable )
SetEditable(true) ;
TXNTypeAttributes typeAttr[4] ;
if ( attrCounter > 0 )
{
- OSStatus status = TXNSetTypeAttributes ((TXNObject)m_macTXN, attrCounter , typeAttr,
- start,end);
+#ifdef __WXDEBUG__
+ OSStatus status =
+#endif // __WXDEBUG__
+ TXNSetTypeAttributes ((TXNObject)m_macTXN, attrCounter , typeAttr, start,end);
wxASSERT_MSG( status == noErr , wxT("Couldn't set text attributes") ) ;
}
if ( !formerEditable )
}
else
{
- bool formerEditable = IsEditable() ;
+ bool formerEditable = m_editable ;
if ( !formerEditable )
SetEditable(true) ;
TXNSetSelection( ((TXNObject) m_macTXN) , from , to ) ;
}
else
{
- bool formerEditable = IsEditable() ;
+ bool formerEditable = m_editable ;
if ( !formerEditable )
SetEditable(true) ;
TXNSetSelection( ((TXNObject) m_macTXN) , from , to ) ;
}
else
{
- bool formerEditable = IsEditable() ;
+ bool formerEditable = m_editable ;
if ( !formerEditable )
SetEditable(true) ;
long start , end , dummy ;
{
if (CanUndo())
{
+ if ( m_macUsesTXN )
+ {
+ TXNUndo((TXNObject)m_macTXN);
+ }
}
}
{
if (CanRedo())
{
+ if ( m_macUsesTXN )
+ {
+ TXNRedo((TXNObject)m_macTXN);
+ }
}
}
bool wxTextCtrl::CanUndo() const
{
+ if ( !IsEditable() )
+ {
+ return false ;
+ }
+ if ( m_macUsesTXN )
+ {
+ return TXNCanUndo((TXNObject)m_macTXN,NULL);
+ }
return FALSE ;
}
bool wxTextCtrl::CanRedo() const
{
+ if ( !IsEditable() )
+ {
+ return false ;
+ }
+ if ( m_macUsesTXN )
+ {
+ return TXNCanRedo((TXNObject)m_macTXN,NULL);
+ }
return FALSE ;
}