char state;
Rect bounds;
/* set up our globals */
+
tpvars = (STPTextPaneVars **) GetControlReference(theControl);
if (tpvars != NULL) {
state = HGetState((Handle) tpvars);
memset( &ev , 0 , sizeof( ev ) ) ;
ev.what = keyDown ;
ev.modifiers = modifiers ;
- ev.message = (( keyCode & keyCodeMask ) << 8 ) + ( charCode & charCodeMask ) ;
+ ev.message = (( keyCode << 8 ) & keyCodeMask ) + ( charCode & charCodeMask ) ;
TXNKeyDown( (**tpvars).fTXNRec, &ev);
}
}
( multiline ? kTXNWantVScrollBarMask : 0 ) |
kTXNDontDrawCaretWhenInactiveMask |
kTXNDontDrawSelectionWhenInactiveMask |
- kTXNAlwaysWrapAtViewEdgeMask,
+ kTXNAlwaysWrapAtViewEdgeMask ,
kTXNTextEditStyleFrameType,
kTXNTextensionFile,
kTXNSystemDefaultEncoding,
break;
}
- EventRecord *ev = (EventRecord*) wxTheApp->MacGetCurrentEvent();
- short keychar = short(ev->message & charCodeMask);
if (!eat_key)
{
- short keycode = short(ev->message & keyCodeMask) >> 8 ;
- ::HandleControlKey( (ControlHandle) m_macControl , keycode , keychar , ev->modifiers );
+ // default handling
+ event.Skip() ;
}
- if ( keychar >= 0x20 ||
- event.KeyCode() == WXK_RETURN ||
- event.KeyCode() == WXK_DELETE ||
- event.KeyCode() == WXK_BACK)
+ if ( key >= 0x20 ||
+ key == WXK_RETURN ||
+ key == WXK_DELETE ||
+ key == WXK_BACK)
{
wxCommandEvent event1(wxEVT_COMMAND_TEXT_UPDATED, m_windowId);
event1.SetString( GetValue() ) ;
event1.SetEventObject( this );
- GetEventHandler()->ProcessEvent(event1);
+ wxPostEvent(GetEventHandler(),event1);
+ }
+}
+
+void wxTextCtrl::MacSuperShown( bool show )
+{
+ bool former = m_macControlIsShown ;
+ wxControl::MacSuperShown( show ) ;
+ if ( (former != m_macControlIsShown) && m_macUsesTXN )
+ {
+ if ( m_macControlIsShown )
+ TXNSetFrameBounds( (TXNObject) m_macTXN, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.top, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.left,
+ (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.bottom,(**(STPTextPaneVars **)m_macTXNvars).fRTextArea.right, (**(STPTextPaneVars **)m_macTXNvars).fTXNFrame);
+ else
+ TXNSetFrameBounds( (TXNObject) m_macTXN, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.top + 30000, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.left,
+ (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.bottom + 30000, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.right, (**(STPTextPaneVars **)m_macTXNvars).fTXNFrame);
+ }
+}
+
+bool wxTextCtrl::Show(bool show)
+{
+ bool former = m_macControlIsShown ;
+
+ bool retval = wxControl::Show( show ) ;
+
+ if ( former != m_macControlIsShown )
+ {
+ if ( m_macControlIsShown )
+ TXNSetFrameBounds( (TXNObject) m_macTXN, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.top, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.left,
+ (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.bottom,(**(STPTextPaneVars **)m_macTXNvars).fRTextArea.right, (**(STPTextPaneVars **)m_macTXNvars).fTXNFrame);
+ else
+ TXNSetFrameBounds( (TXNObject) m_macTXN, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.top + 30000, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.left,
+ (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.bottom + 30000, (**(STPTextPaneVars **)m_macTXNvars).fRTextArea.right, (**(STPTextPaneVars **)m_macTXNvars).fTXNFrame);
}
+
+ return retval ;
}
// ----------------------------------------------------------------------------