cleanup - reformat - 4th pass
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36810 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -351,6 +351,7 @@ public :
|
||||
const wxPoint& pos,
|
||||
const wxSize& size, long style ) ;
|
||||
~wxMacMLTEClassicControl() ;
|
||||
|
||||
virtual void VisibilityChanged(bool shown) ;
|
||||
virtual void SuperChangedPosition() ;
|
||||
|
||||
@@ -363,7 +364,11 @@ public :
|
||||
virtual wxInt16 MacControlUserPaneFocusProc(wxInt16 action) ;
|
||||
virtual void MacControlUserPaneBackgroundProc(void* info) ;
|
||||
|
||||
virtual bool SetupCursor( const wxPoint& WXUNUSED(pt) ) { MacControlUserPaneIdleProc() ; return true ;}
|
||||
virtual bool SetupCursor( const wxPoint& WXUNUSED(pt) )
|
||||
{
|
||||
MacControlUserPaneIdleProc();
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void SetRect( Rect *r ) ;
|
||||
|
||||
@@ -617,6 +622,7 @@ bool wxTextCtrl::CanCopy() const
|
||||
// Can copy if there's a selection
|
||||
long from, to;
|
||||
GetSelection( &from, &to );
|
||||
|
||||
return (from != to);
|
||||
}
|
||||
|
||||
@@ -628,6 +634,7 @@ bool wxTextCtrl::CanCut() const
|
||||
// Can cut if there's a selection
|
||||
long from, to;
|
||||
GetSelection( &from, &to );
|
||||
|
||||
return (from != to);
|
||||
}
|
||||
|
||||
@@ -663,6 +670,7 @@ long wxTextCtrl::GetInsertionPoint() const
|
||||
{
|
||||
long begin, end ;
|
||||
GetSelection( &begin , &end ) ;
|
||||
|
||||
return begin ;
|
||||
}
|
||||
|
||||
@@ -688,10 +696,7 @@ void wxTextCtrl::SetSelection(long from, long to)
|
||||
|
||||
bool wxTextCtrl::LoadFile(const wxString& file)
|
||||
{
|
||||
if ( wxTextCtrlBase::LoadFile(file) )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return wxTextCtrlBase::LoadFile( file );
|
||||
}
|
||||
|
||||
void wxTextCtrl::WriteText(const wxString& str)
|
||||
@@ -702,13 +707,12 @@ void wxTextCtrl::WriteText(const wxString& str)
|
||||
// unfortunately CW 8 is not able to correctly deduce the template types,
|
||||
// so we have to instantiate explicitly
|
||||
wxMacMPRemoteGUICall<wxTextCtrl,wxString>( this , &wxTextCtrl::WriteText , str ) ;
|
||||
|
||||
return ;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
GetPeer()->WriteText( str ) ;
|
||||
}
|
||||
}
|
||||
|
||||
void wxTextCtrl::AppendText(const wxString& text)
|
||||
{
|
||||
@@ -1048,6 +1052,7 @@ void wxTextCtrl::OnRedo(wxCommandEvent& WXUNUSED(event))
|
||||
void wxTextCtrl::OnDelete(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
long from, to;
|
||||
|
||||
GetSelection( &from, &to );
|
||||
if (from != -1 && to != -1)
|
||||
Remove( from, to );
|
||||
@@ -1086,6 +1091,7 @@ void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent& event)
|
||||
void wxTextCtrl::OnUpdateDelete(wxUpdateUIEvent& event)
|
||||
{
|
||||
long from, to;
|
||||
|
||||
GetSelection( &from, &to );
|
||||
event.Enable( from != -1 && to != -1 && from != to && IsEditable() ) ;
|
||||
}
|
||||
@@ -1355,7 +1361,8 @@ int wxMacTextControl::GetLineLength(long lineNo) const
|
||||
wxMacUnicodeTextControl::wxMacUnicodeTextControl( wxTextCtrl *wxPeer,
|
||||
const wxString& str,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size, long style ) : wxMacTextControl( wxPeer )
|
||||
const wxSize& size, long style )
|
||||
: wxMacTextControl( wxPeer )
|
||||
{
|
||||
m_font = wxPeer->GetFont() ;
|
||||
m_windowStyle = style ;
|
||||
@@ -1366,9 +1373,11 @@ wxMacUnicodeTextControl::wxMacUnicodeTextControl( wxTextCtrl *wxPeer,
|
||||
CFStringRef cfr = cf ;
|
||||
Boolean isPassword = ( m_windowStyle & wxTE_PASSWORD ) != 0 ;
|
||||
m_valueTag = isPassword ? kControlEditTextPasswordCFStringTag : kControlEditTextCFStringTag ;
|
||||
CreateEditUnicodeTextControl(
|
||||
|
||||
OSStatus err = CreateEditUnicodeTextControl(
|
||||
MAC_WXHWND(wxPeer->MacGetTopLevelWindowRef()), &bounds , cfr ,
|
||||
isPassword , NULL , &m_controlRef ) ;
|
||||
verify_noerr( err );
|
||||
|
||||
if ( !(m_windowStyle & wxTE_MULTILINE) )
|
||||
SetData<Boolean>( kControlEditTextPart , kControlEditTextSingleLineTag , true ) ;
|
||||
@@ -1529,7 +1538,8 @@ protected :
|
||||
TXNControlData m_data[1] ;
|
||||
} ;
|
||||
|
||||
wxMacMLTEControl::wxMacMLTEControl( wxTextCtrl *peer ) : wxMacTextControl( peer )
|
||||
wxMacMLTEControl::wxMacMLTEControl( wxTextCtrl *peer )
|
||||
: wxMacTextControl( peer )
|
||||
{
|
||||
SetNeedsFocusRect( true ) ;
|
||||
}
|
||||
@@ -1691,7 +1701,8 @@ void wxMacMLTEControl::AdjustCreationAttributes( const wxColour &background, boo
|
||||
: kTXNAutoWrap;
|
||||
}
|
||||
|
||||
verify_noerr( TXNSetTXNObjectControls( m_txn, false, toptag, iControlTags, iControlData ) ) ;
|
||||
OSStatus err = TXNSetTXNObjectControls( m_txn, false, toptag, iControlTags, iControlData ) ;
|
||||
verify_noerr( err );
|
||||
|
||||
// setting the default font:
|
||||
// under 10.2 this causes a visible caret, therefore we avoid it
|
||||
@@ -1711,16 +1722,17 @@ void wxMacMLTEControl::AdjustCreationAttributes( const wxColour &background, boo
|
||||
{ kTXNQDFontStyleAttribute , kTXNQDFontStyleAttributeSize , { (void*) normal } } ,
|
||||
} ;
|
||||
|
||||
verify_noerr(
|
||||
TXNSetTypeAttributes(
|
||||
err = TXNSetTypeAttributes(
|
||||
m_txn, sizeof(typeAttr) / sizeof(TXNTypeAttributes),
|
||||
typeAttr, kTXNStartOffset, kTXNEndOffset ) );
|
||||
typeAttr, kTXNStartOffset, kTXNEndOffset );
|
||||
verify_noerr( err );
|
||||
}
|
||||
|
||||
if ( m_windowStyle & wxTE_PASSWORD )
|
||||
{
|
||||
UniChar c = 0xA5 ;
|
||||
verify_noerr (TXNEchoMode( m_txn , c , 0 , true ) );
|
||||
UniChar c = 0x00A5 ;
|
||||
err = TXNEchoMode( m_txn , c , 0 , true );
|
||||
verify_noerr( err );
|
||||
}
|
||||
|
||||
TXNBackground tback;
|
||||
@@ -2070,7 +2082,7 @@ void wxMacMLTEControl::ShowPosition( long pos )
|
||||
OSErr theErr = noErr;
|
||||
SInt32 dv = desired.v - current.v;
|
||||
SInt32 dh = desired.h - current.h;
|
||||
TXNShowSelection( m_txn, kTXNShowEnd ); // NB: should this be kTXNShowStart or kTXNShowEnd ??
|
||||
TXNShowSelection( m_txn, kTXNShowStart ) ; // NB: should this be kTXNShowStart or kTXNShowEnd ??
|
||||
theErr = TXNScroll( m_txn, kTXNScrollUnitsInPixels, kTXNScrollUnitsInPixels, &dv, &dh );
|
||||
|
||||
// there will be an error returned for classic MLTE implementation when the control is
|
||||
@@ -2241,7 +2253,6 @@ pascal void wxMacMLTEClassicControl::TXNScrollActionProc( ControlRef controlRef
|
||||
|
||||
switch ( partCode )
|
||||
{
|
||||
|
||||
case kControlDownButtonPart :
|
||||
delta = 10 ;
|
||||
break ;
|
||||
@@ -2287,6 +2298,7 @@ pascal void wxMacMLTEClassicControl::TXNScrollActionProc( ControlRef controlRef
|
||||
err = TXNScroll(
|
||||
mlte->m_txn, kTXNScrollUnitsInPixels, kTXNScrollUnitsInPixels,
|
||||
&verticalDelta, &horizontalDelta );
|
||||
verify_noerr( err );
|
||||
|
||||
if ( isHorizontal )
|
||||
mlte->m_lastHorizontalValue = newValue ;
|
||||
@@ -2630,7 +2642,8 @@ void wxMacMLTEClassicControl::MacControlUserPaneBackgroundProc( void *info )
|
||||
wxMacMLTEClassicControl::wxMacMLTEClassicControl( wxTextCtrl *wxPeer,
|
||||
const wxString& str,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size, long style ) : wxMacMLTEControl( wxPeer )
|
||||
const wxSize& size, long style )
|
||||
: wxMacMLTEControl( wxPeer )
|
||||
{
|
||||
m_font = wxPeer->GetFont() ;
|
||||
m_windowStyle = style ;
|
||||
@@ -2642,10 +2655,10 @@ wxMacMLTEClassicControl::wxMacMLTEClassicControl( wxTextCtrl *wxPeer,
|
||||
// | kControlHasSpecialBackground
|
||||
| kControlGetsFocusOnClick | kControlSupportsLiveFeedback;
|
||||
|
||||
verify_noerr(
|
||||
::CreateUserPaneControl(
|
||||
OSStatus err = ::CreateUserPaneControl(
|
||||
MAC_WXHWND(wxPeer->GetParent()->MacGetTopLevelWindowRef()),
|
||||
&bounds, featureSet, &m_controlRef ) );
|
||||
&bounds, featureSet, &m_controlRef );
|
||||
verify_noerr( err );
|
||||
|
||||
DoCreate();
|
||||
|
||||
@@ -2771,7 +2784,6 @@ static pascal void wxMacControlUserPaneBackgroundProc(ControlRef control, Contro
|
||||
OSStatus wxMacMLTEClassicControl::DoCreate()
|
||||
{
|
||||
Rect bounds;
|
||||
|
||||
OSStatus err = noErr ;
|
||||
|
||||
// set up our globals
|
||||
@@ -2851,11 +2863,11 @@ OSStatus wxMacMLTEClassicControl::DoCreate()
|
||||
|
||||
#endif
|
||||
|
||||
verify_noerr(
|
||||
TXNNewObject(
|
||||
err = TXNNewObject(
|
||||
NULL, m_txnWindow, &bounds, frameOptions,
|
||||
kTXNTextEditStyleFrameType, kTXNTextensionFile, kTXNSystemDefaultEncoding,
|
||||
&m_txn, &m_txnFrameID, NULL ) );
|
||||
&m_txn, &m_txnFrameID, NULL );
|
||||
verify_noerr( err );
|
||||
|
||||
#if 0
|
||||
TXNControlTag iControlTags[] = { kTXNUseCarbonEvents };
|
||||
@@ -2875,6 +2887,7 @@ OSStatus wxMacMLTEClassicControl::DoCreate()
|
||||
#endif
|
||||
|
||||
SetGWorld( origPort , origDev ) ;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -2897,7 +2910,8 @@ wxMacMLTEHIViewControl::wxMacMLTEHIViewControl( wxTextCtrl *wxPeer,
|
||||
wxString st = str ;
|
||||
wxMacConvertNewlines10To13( &st ) ;
|
||||
|
||||
HIRect hr = { { bounds.left , bounds.top} ,
|
||||
HIRect hr = {
|
||||
{ bounds.left , bounds.top },
|
||||
{ bounds.right - bounds.left, bounds.bottom - bounds.top } } ;
|
||||
|
||||
m_scrollView = NULL ;
|
||||
|
Reference in New Issue
Block a user