cleanup mac

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50103 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2007-11-20 08:02:56 +00:00
parent 315e9e5a66
commit d8f3e9da02

View File

@@ -174,23 +174,14 @@ public :
virtual bool HasOwnContextMenu() const virtual bool HasOwnContextMenu() const
{ {
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 TXNCommandEventSupportOptions options ;
if ( UMAGetSystemVersion() >= 0x1040 ) TXNGetCommandEventSupport( m_txn , & options ) ;
{ return options & kTXNSupportEditCommandProcessing ;
TXNCommandEventSupportOptions options ;
TXNGetCommandEventSupport( m_txn , & options ) ;
return options & kTXNSupportEditCommandProcessing ;
}
#endif
return false ;
} }
virtual void CheckSpelling(bool check) virtual void CheckSpelling(bool check)
{ {
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 TXNSetSpellCheckAsYouType( m_txn, (Boolean) check );
TXNSetSpellCheckAsYouType( m_txn, (Boolean) check );
#endif
} }
virtual void Clear() ; virtual void Clear() ;
@@ -1028,52 +1019,6 @@ bool wxTextCtrl::MacSetupCursor( const wxPoint& pt )
return true ; return true ;
} }
#if !TARGET_API_MAC_OSX
// user pane implementation
void wxTextCtrl::MacControlUserPaneDrawProc(wxInt16 part)
{
GetPeer()->MacControlUserPaneDrawProc( part ) ;
}
wxInt16 wxTextCtrl::MacControlUserPaneHitTestProc(wxInt16 x, wxInt16 y)
{
return GetPeer()->MacControlUserPaneHitTestProc( x , y ) ;
}
wxInt16 wxTextCtrl::MacControlUserPaneTrackingProc(wxInt16 x, wxInt16 y, void* actionProc)
{
return GetPeer()->MacControlUserPaneTrackingProc( x , y , actionProc ) ;
}
void wxTextCtrl::MacControlUserPaneIdleProc()
{
GetPeer()->MacControlUserPaneIdleProc( ) ;
}
wxInt16 wxTextCtrl::MacControlUserPaneKeyDownProc(wxInt16 keyCode, wxInt16 charCode, wxInt16 modifiers)
{
return GetPeer()->MacControlUserPaneKeyDownProc( keyCode , charCode , modifiers ) ;
}
void wxTextCtrl::MacControlUserPaneActivateProc(bool activating)
{
GetPeer()->MacControlUserPaneActivateProc( activating ) ;
}
wxInt16 wxTextCtrl::MacControlUserPaneFocusProc(wxInt16 action)
{
return GetPeer()->MacControlUserPaneFocusProc( action ) ;
}
void wxTextCtrl::MacControlUserPaneBackgroundProc(void* info)
{
GetPeer()->MacControlUserPaneBackgroundProc( info ) ;
}
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// implementation base class // implementation base class
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -1251,8 +1196,6 @@ int wxMacTextControl::GetLineLength(long lineNo) const
// standard unicode control implementation // standard unicode control implementation
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#if TARGET_API_MAC_OSX
// the current unicode textcontrol implementation has a bug : only if the control // the current unicode textcontrol implementation has a bug : only if the control
// is currently having the focus, the selection can be retrieved by the corresponding // is currently having the focus, the selection can be retrieved by the corresponding
// data tag. So we have a mirroring using a member variable // data tag. So we have a mirroring using a member variable
@@ -1509,8 +1452,6 @@ void wxMacUnicodeTextControl::WriteText( const wxString& str )
} }
} }
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// MLTE control implementation (common part) // MLTE control implementation (common part)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -1748,40 +1689,36 @@ void wxMacMLTEControl::AdjustCreationAttributes(const wxColour &background,
tback.bg.color = MAC_WXCOLORREF( background.GetPixel() ); tback.bg.color = MAC_WXCOLORREF( background.GetPixel() );
TXNSetBackground( m_txn , &tback ); TXNSetBackground( m_txn , &tback );
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
if ( UMAGetSystemVersion() >= 0x1040 ) TXNCommandEventSupportOptions options ;
if ( TXNGetCommandEventSupport( m_txn, &options ) == noErr )
{ {
TXNCommandEventSupportOptions options ; options |=
if ( TXNGetCommandEventSupport( m_txn, &options ) == noErr ) kTXNSupportEditCommandProcessing
{ | kTXNSupportEditCommandUpdating
options |= | kTXNSupportFontCommandProcessing
kTXNSupportEditCommandProcessing | kTXNSupportFontCommandUpdating;
| kTXNSupportEditCommandUpdating
| kTXNSupportFontCommandProcessing
| kTXNSupportFontCommandUpdating;
// only spell check when not read-only // only spell check when not read-only
// use system options for the default // use system options for the default
bool checkSpelling = false ; bool checkSpelling = false ;
if ( !(m_windowStyle & wxTE_READONLY) ) if ( !(m_windowStyle & wxTE_READONLY) )
{ {
#if wxUSE_SYSTEM_OPTIONS #if wxUSE_SYSTEM_OPTIONS
if ( wxSystemOptions::HasOption( wxMAC_TEXTCONTROL_USE_SPELL_CHECKER ) && (wxSystemOptions::GetOptionInt( wxMAC_TEXTCONTROL_USE_SPELL_CHECKER ) == 1) ) if ( wxSystemOptions::HasOption( wxMAC_TEXTCONTROL_USE_SPELL_CHECKER ) && (wxSystemOptions::GetOptionInt( wxMAC_TEXTCONTROL_USE_SPELL_CHECKER ) == 1) )
{ {
checkSpelling = true ; checkSpelling = true ;
}
#endif
} }
if ( checkSpelling )
options |=
kTXNSupportSpellCheckCommandProcessing
| kTXNSupportSpellCheckCommandUpdating;
TXNSetCommandEventSupport( m_txn , options ) ;
}
}
#endif #endif
}
if ( checkSpelling )
options |=
kTXNSupportSpellCheckCommandProcessing
| kTXNSupportSpellCheckCommandUpdating;
TXNSetCommandEventSupport( m_txn , options ) ;
}
} }
void wxMacMLTEControl::SetBackground( const wxBrush &brush ) void wxMacMLTEControl::SetBackground( const wxBrush &brush )
@@ -2985,13 +2922,10 @@ static pascal OSStatus wxMacUnicodeTextEventHandler( EventHandlerCallRef handler
{ {
case kEventTextInputUnicodeForKeyEvent : case kEventTextInputUnicodeForKeyEvent :
{ {
if ( UMAGetSystemVersion() >= 0x1040 ) TXNOffset from , to ;
{ TXNGetSelection( focus->GetTXNObject() , &from , &to ) ;
TXNOffset from , to ; if ( from == to )
TXNGetSelection( focus->GetTXNObject() , &from , &to ) ; TXNShowSelection( focus->GetTXNObject() , kTXNShowStart );
if ( from == to )
TXNShowSelection( focus->GetTXNObject() , kTXNShowStart );
}
result = CallNextEventHandler(handler,event); result = CallNextEventHandler(handler,event);
break; break;
} }