// CS:TODO we still have a problem getting properly at the text events of a control because under Carbon
// the MLTE engine registers itself for the key events thus the normal flow never occurs, the only measure for the
// CS:TODO we still have a problem getting properly at the text events of a control because under Carbon
// the MLTE engine registers itself for the key events thus the normal flow never occurs, the only measure for the
if ( ! EqualRect(&bounds, &varsp->fRFocusOutline) ) {
// scrollbar is on the border, we add one
Rect oldbounds = varsp->fRFocusOutline ;
if ( ! EqualRect(&bounds, &varsp->fRFocusOutline) ) {
// scrollbar is on the border, we add one
Rect oldbounds = varsp->fRFocusOutline ;
if ((**tpvars).fIsActive && varsp->fInFocus) DrawThemeFocusRect(&varsp->fRFocusOutline, true);
/* release our globals */
HSetState((Handle) tpvars, state);
if ((**tpvars).fIsActive && varsp->fInFocus) DrawThemeFocusRect(&varsp->fRFocusOutline, true);
/* release our globals */
HSetState((Handle) tpvars, state);
varsp = *tpvars;
/* get the current mouse coordinates (in our window) */
SetPortWindowPort(GetControlOwner(theControl));
varsp = *tpvars;
/* get the current mouse coordinates (in our window) */
SetPortWindowPort(GetControlOwner(theControl));
if ((**tpvars).fInFocus) {
/* turn autoscrolling on and send the key event to text edit */
SetPort((**tpvars).fDrawingEnvironment);
if ((**tpvars).fInFocus) {
/* turn autoscrolling on and send the key event to text edit */
SetPort((**tpvars).fDrawingEnvironment);
GetControlBounds(theControl, &bounds);
varsp->fIsActive = activating;
TPActivatePaneText(tpvars, varsp->fIsActive && varsp->fInFocus);
GetControlBounds(theControl, &bounds);
varsp->fIsActive = activating;
TPActivatePaneText(tpvars, varsp->fIsActive && varsp->fInFocus);
define your own value for handling click-to-focus type events. */
/* save the drawing state */
SetPort((**tpvars).fDrawingEnvironment);
define your own value for handling click-to-focus type events. */
/* save the drawing state */
SetPort((**tpvars).fDrawingEnvironment);
- TXNSetData( ((TXNObject) m_macTXN), kTXNTextData, (void*)value.c_str(), value.Length(),
- kTXNStartOffset, kTXNEndOffset);
+ bool formerEditable = IsEditable() ;
+ SetEditable(true) ;
+ TXNSetData( ((TXNObject) m_macTXN), kTXNTextData, (void*)value.c_str(), value.Length(),
+ kTXNStartOffset, kTXNEndOffset);
+ TXNSetSelection( (TXNObject) m_macTXN, 0, 0);
+ TXNShowSelection( (TXNObject) m_macTXN, kTXNShowStart);
+ SetEditable(formerEditable) ;
{
OSStatus status = TXNSetTypeAttributes ((TXNObject)m_macTXN, attrCounter , typeAttr,
start,end);
{
OSStatus status = TXNSetTypeAttributes ((TXNObject)m_macTXN, attrCounter , typeAttr,
start,end);
}
wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_windowId);
event.SetString( GetValue() ) ;
}
wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_windowId);
event.SetString( GetValue() ) ;
- UMADeactivateControl((ControlHandle) m_macControl ) ;
+ {
+ TXNControlTag tag[] = { kTXNIOPrivilegesTag } ;
+ TXNControlData data[] = { { editable ? kTXNReadWrite : kTXNReadOnly } } ;
+ TXNSetTXNObjectControls( (TXNObject) m_macTXN , false , sizeof(tag) / sizeof (TXNControlTag) , tag , data ) ;
+ }
- TXNSetSelection( ((TXNObject) m_macTXN) , from , to ) ;
- TXNClear( ((TXNObject) m_macTXN) ) ;
- TXNSetData( ((TXNObject) m_macTXN), kTXNTextData, (void*)value.c_str(), value.Length(),
- kTXNUseCurrentSelection, kTXNUseCurrentSelection);
+ bool formerEditable = IsEditable() ;
+ SetEditable(true) ;
+ TXNSetSelection( ((TXNObject) m_macTXN) , from , to ) ;
+ TXNClear( ((TXNObject) m_macTXN) ) ;
+ TXNSetData( ((TXNObject) m_macTXN), kTXNTextData, (void*)value.c_str(), value.Length(),
+ kTXNUseCurrentSelection, kTXNUseCurrentSelection);
+ SetEditable( formerEditable ) ;
TXNSetSelection( ((TXNObject) m_macTXN) , from , to ) ;
TXNClear( ((TXNObject) m_macTXN) ) ;
TXNSetSelection( ((TXNObject) m_macTXN) , from , to ) ;
TXNClear( ((TXNObject) m_macTXN) ) ;
SetPort((**tpvars).fDrawingEnvironment);
/* change the selection */
TXNSetSelection( (**tpvars).fTXNRec, from, to);
SetPort((**tpvars).fDrawingEnvironment);
/* change the selection */
TXNSetSelection( (**tpvars).fTXNRec, from, to);
long start , end , dummy ;
GetSelection( &start , &dummy ) ;
TXNSetData( ((TXNObject) m_macTXN), kTXNTextData, (void*) (const char*)value, value.Length(),
kTXNUseCurrentSelection, kTXNUseCurrentSelection);
GetSelection( &dummy , &end ) ;
SetStyle( start , end , GetDefaultStyle() ) ;
long start , end , dummy ;
GetSelection( &start , &dummy ) ;
TXNSetData( ((TXNObject) m_macTXN), kTXNTextData, (void*) (const char*)value, value.Length(),
kTXNUseCurrentSelection, kTXNUseCurrentSelection);
GetSelection( &dummy , &end ) ;
SetStyle( start , end , GetDefaultStyle() ) ;
if ( !IsEditable() && key != WXK_LEFT && key != WXK_RIGHT && key != WXK_DOWN && key != WXK_UP && key != WXK_TAB &&
!( key == WXK_RETURN && ( (m_windowStyle & wxPROCESS_ENTER) || (m_windowStyle & wxTE_MULTILINE) ) )
/* && key != WXK_PRIOR && key != WXK_NEXT && key != WXK_HOME && key != WXK_END */
if ( !IsEditable() && key != WXK_LEFT && key != WXK_RIGHT && key != WXK_DOWN && key != WXK_UP && key != WXK_TAB &&
!( key == WXK_RETURN && ( (m_windowStyle & wxPROCESS_ENTER) || (m_windowStyle & wxTE_MULTILINE) ) )
/* && key != WXK_PRIOR && key != WXK_NEXT && key != WXK_HOME && key != WXK_END */