text attributes corrected
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -199,7 +199,6 @@ public :
|
|||||||
virtual wxString GetStringValue() const ;
|
virtual wxString GetStringValue() const ;
|
||||||
virtual void SetStringValue( const wxString &str) ;
|
virtual void SetStringValue( const wxString &str) ;
|
||||||
|
|
||||||
static int ConvertAttribute( const wxTextAttr& style , TXNTypeAttributes attr[] ) ;
|
|
||||||
static TXNFrameOptions FrameOptionsFromWXStyle( long wxStyle ) ;
|
static TXNFrameOptions FrameOptionsFromWXStyle( long wxStyle ) ;
|
||||||
void AdjustCreationAttributes( const wxColour& background , bool visible ) ;
|
void AdjustCreationAttributes( const wxColour& background , bool visible ) ;
|
||||||
|
|
||||||
@@ -234,6 +233,7 @@ public :
|
|||||||
void SetTXNData( const wxString& st , TXNOffset start , TXNOffset end ) ;
|
void SetTXNData( const wxString& st , TXNOffset start , TXNOffset end ) ;
|
||||||
|
|
||||||
protected :
|
protected :
|
||||||
|
void TXNSetAttribute( const wxTextAttr& style , long from , long to ) ;
|
||||||
TXNObject m_txn ;
|
TXNObject m_txn ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -1493,8 +1493,9 @@ void wxMacMLTEControl::SetBackground( const wxBrush &brush )
|
|||||||
TXNSetBackground( m_txn , &tback);
|
TXNSetBackground( m_txn , &tback);
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxMacMLTEControl::ConvertAttribute( const wxTextAttr& style , TXNTypeAttributes typeAttr[] )
|
void wxMacMLTEControl::TXNSetAttribute( const wxTextAttr& style , long from , long to)
|
||||||
{
|
{
|
||||||
|
TXNTypeAttributes typeAttr[4] ;
|
||||||
Str255 fontName = "\pMonaco" ;
|
Str255 fontName = "\pMonaco" ;
|
||||||
SInt16 fontSize = 12 ;
|
SInt16 fontSize = 12 ;
|
||||||
Style fontStyle = normal ;
|
Style fontStyle = normal ;
|
||||||
@@ -1531,29 +1532,21 @@ int wxMacMLTEControl::ConvertAttribute( const wxTextAttr& style , TXNTypeAttribu
|
|||||||
color = MAC_WXCOLORREF(style.GetTextColour().GetPixel()) ;
|
color = MAC_WXCOLORREF(style.GetTextColour().GetPixel()) ;
|
||||||
attrCounter += 1 ;
|
attrCounter += 1 ;
|
||||||
}
|
}
|
||||||
return attrCounter ;
|
if ( attrCounter > 0 )
|
||||||
|
{
|
||||||
|
verify_noerr( TXNSetTypeAttributes ( m_txn , attrCounter , typeAttr, from , to) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMacMLTEControl::SetFont( const wxFont & font , const wxColour& foreground , long windowStyle )
|
void wxMacMLTEControl::SetFont( const wxFont & font , const wxColour& foreground , long windowStyle )
|
||||||
{
|
{
|
||||||
EditHelper help(m_txn) ;
|
EditHelper help(m_txn) ;
|
||||||
wxTextAttr style(foreground,wxNullColour,font) ;
|
TXNSetAttribute( wxTextAttr(foreground,wxNullColour,font) , kTXNStartOffset,kTXNEndOffset ) ;
|
||||||
TXNTypeAttributes typeAttr[4] ;
|
|
||||||
int attrCounter = ConvertAttribute( style , typeAttr ) ;
|
|
||||||
if ( attrCounter > 0 )
|
|
||||||
{
|
|
||||||
verify_noerr( TXNSetTypeAttributes ( m_txn , attrCounter , typeAttr, kTXNStartOffset,kTXNEndOffset) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
void wxMacMLTEControl::SetStyle(long start, long end, const wxTextAttr& style)
|
void wxMacMLTEControl::SetStyle(long start, long end, const wxTextAttr& style)
|
||||||
{
|
{
|
||||||
EditHelper help(m_txn) ;
|
EditHelper help(m_txn) ;
|
||||||
TXNTypeAttributes typeAttr[4] ;
|
TXNSetAttribute( style , start,end ) ;
|
||||||
int attrCounter = ConvertAttribute( style , typeAttr ) ;
|
|
||||||
if ( attrCounter > 0 )
|
|
||||||
{
|
|
||||||
verify_noerr( TXNSetTypeAttributes ( m_txn , attrCounter , typeAttr, start,end) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMacMLTEControl::Copy()
|
void wxMacMLTEControl::Copy()
|
||||||
|
Reference in New Issue
Block a user