I am a little confused over the operation of the SetEOLMode command on the
styled text control (Python 2.0, wxPython 2.2.5, Windows2000). With view-EOL
mode on, the 'CRLF' or 'LF' displayed in the document does not seem to match
the results of the SetEOLMode operation. For example, if the document
currently has CRLF's and I set the EOLMode to use only line-feeds, then
execute ConvertEOLs(), the display does not change even after a refresh.
Also, when the document is saved, CRLF is still there instead of LF.
However, calls to GetEOLMode before and after the change reflect the correct
value.
Here is a snippet of code I have been experimenting with:
...
elif id == ID_VIEW_USELF:
print 'EOL mode before TO_LF=', stcpage.GetEOLMode()
stcpage.SetEOLMode(wxSTC_EOL_LF)
self.appparms[APP_EOLMODE] = wxSTC_EOL_LF
print 'EOL mode after TO_LF=', stcpage.GetEOLMode()
elif id == ID_VIEW_USECRLF:
print 'EOL mode before TO_CRLF=', stcpage.GetEOLMode()
stcpage.SetEOLMode(wxSTC_EOL_CRLF)
self.appparms[APP_EOLMODE] = wxSTC_EOL_CRLF
print 'EOL mode after TO_CRLF=', stcpage.GetEOLMode()
elif id == ID_VIEW_CONVERT_EOLS:
print 'EOL mode before conversion =',
stcpage.GetEOLMode()
stcpage.ConvertEOLs()
stcpage.Refresh()
print 'EOL mode after ConvertEOLS=',
stcpage.GetEOLMode()
...
Is there something else I need to do for ConvertEOLMode to work correctly on
Windows? No matter what I do, the document displays CRLF on Windows and LF
on Linux (same Python/wxPython versions under Red Hat 6.2).
Thanks for the help.
···
___________________________________________
Ron Clarke
Digital Printing Technologies
Hewlett-Packard Co.
ron_clarke@hp.com
ecard - https://ecardfile.com/id/ron_clarke