logctrl
Log Control, supporting text copying and zoom.
Classes:
|
Log Window based on StyledTextCtrl. |
-
class
LogCtrl
(parent, id=- 1, pos=(- 1, - 1), size=(- 1, - 1), style=138412032, name='Log')[source] Bases:
StyledTextCtrl
Log Window based on StyledTextCtrl.
- Parameters
parent (
Window
) – The parent window.id (
int
) – An identifier for the Log window. wx.ID_ANY is taken to mean a default. Default-1
.pos (
Point
) – The Log window position. The valuewx.DefaultPosition
indicates a default position, chosen by either the windowing system or wxWidgets, depending on platform. Default(-1, -1)
.size (
Size
) – The Log window size. The value ::wxDefaultSize indicates a default size, chosen by either the windowing system or wxWidgets, depending on platform. Default(-1, -1)
.style (
int
) – The window style. See wxPanel. Default138412032
.name (
str
) – Window name. Default'Log'
.
Methods:
Append
(text[, c])Add the text to the end of the control using colour c which should be suitable for feeding directly to wx.NamedColour.
AppendStderr
(text)Add the stderr text to the end of the control using colour “red”
CanCopy
()Returns
True
if text is selected and can be copied,False
otherwise.Copy
()Copy the selection and place it on the clipboard.
DoFindNext
(findData[, findDlg])Create and return a context menu for the log.
GetRange
(start, end)vent Handler for showing the context menu
OnFindClose
(_)OnFindText
(*_)OnZoomDefault
(*_)Event Handler for resetting the zoom
OnZoomIn
(*_)Event Handler for zooming in
OnZoomOut
(*_)Event Handler for zooming out
ShowPosition
(pos)ToggleWrap
(*_)Toggle word wrap.
fixLineEndings
(text)Return text with line endings replaced by OS-specific endings.
getStyle
([c])Returns a style for a given colour if one exists.
onKeyPress
(event)Event Handler for key being pressed.
setDisplayLineNumbers
(state)setStyles
(faces)Configure font size, typeface and color for lexer.
wrap
([wrap])Set whether text is word wrapped.
write
(text)Display text in the log.
Attributes:
-
Append
(text, c=None)[source] Add the text to the end of the control using colour c which should be suitable for feeding directly to wx.NamedColour.
- Parameters
text – … Should be a unicode string or contain only ascii data.
c – Default
None
.
-
AppendStderr
(text)[source] Add the stderr text to the end of the control using colour “red”
- Parameters
text – … Should be a unicode string or contain only ascii data.
-
GetContextMenu
()[source] Create and return a context menu for the log. This is used instead of the scintilla default menu in order to correctly respect our immutable buffer.
-
findDlg
Type:
Optional
[FindReplaceDialog
]
-
fixLineEndings
(text)[source] Return text with line endings replaced by OS-specific endings.
- Parameters
text
-
getStyle
(c='black')[source] Returns a style for a given colour if one exists.
If no style exists for the colour, make a new style.
If we run out of styles, (only 32 allowed here) we go to the top of the list and reuse previous styles.
- Parameters
c (
str
) – Default'black'
.