Package Gnumed :: Package wxpython :: Module gmResizingWidgets :: Class cResizingSTC
[frames] | no frames]

Class cResizingSTC

source code

     object --+                    
              |                    
wx._core.Object --+                
                  |                
wx._core.EvtHandler --+            
                      |            
        wx._core.Window --+        
                          |        
           wx._core.Control --+    
                              |    
          wx.stc.StyledTextCtrl --+
                                  |
                                 cResizingSTC

A StyledTextCrl that monitors the size of its internal text and resizes the parent accordingly.

MUST ONLY be used inside ResizingWindow !

FIXME: override standard STC popup menu

Instance Methods
EvtHandler
__init__(self, parent, id, pos=wx.Point(-1, -1), size=wx.Size(-1, -1), style=0, data=None)
__init__(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition, ...
source code
 
set_keywords(self, popup_keywords=None) source code
 
SetText(self, text)
SetText(self, String text)
source code
 
ReplaceText(self, start, end, text, style=None) source code
 
Embed(self, text, data=None) source code
 
DelPhrase(self, pos) source code
 
SetFocus(self, x=None, line=None)
Set focus to current position in STC.
source code
 
AttachMatcher(self, matcher)
Attaches a gmMatchProvider to the STC,this will be used to drive auto-completion
source code
 
SetData(self, data)
Configures the data associated with this STC @param data The associated data @type data Any object
source code
 
GetData(self)
Retrieves the data associated with this STC
source code
 
replace_text(self, start=None, end=None, text=None, style=None)
Oddly, the otherwise very rich wx.STC API does not provide an easy way to replace text, so we provide it here.
source code
 
replace_keyword_with_expansion(self, keyword=None, position=None) source code
 
MakePopup(self, text, data, parent, cursor_position)
An overrideable method, called whenever a match is made in this STC Designed for producing popups, but the overrider can in fact, do whatever they please.
source code

Inherited from wx.stc.StyledTextCtrl: AddRefDocument, AddStyledText, AddText, AddTextRaw, AddTextUTF8, Allocate, AppendText, AppendTextRaw, AppendTextUTF8, AutoCompActive, AutoCompCancel, AutoCompComplete, AutoCompGetAutoHide, AutoCompGetCancelAtStart, AutoCompGetChooseSingle, AutoCompGetCurrent, AutoCompGetDropRestOfWord, AutoCompGetIgnoreCase, AutoCompGetMaxHeight, AutoCompGetMaxWidth, AutoCompGetSeparator, AutoCompGetTypeSeparator, AutoCompPosStart, AutoCompSelect, AutoCompSetAutoHide, AutoCompSetCancelAtStart, AutoCompSetChooseSingle, AutoCompSetDropRestOfWord, AutoCompSetFillUps, AutoCompSetIgnoreCase, AutoCompSetMaxHeight, AutoCompSetMaxWidth, AutoCompSetSeparator, AutoCompSetTypeSeparator, AutoCompShow, AutoCompStops, BackTab, BeginUndoAction, BraceBadLight, BraceHighlight, BraceMatch, CallTipActive, CallTipCancel, CallTipPosAtStart, CallTipSetBackground, CallTipSetForeground, CallTipSetForegroundHighlight, CallTipSetHighlight, CallTipShow, CanPaste, CanRedo, CanUndo, Cancel, CharLeft, CharLeftExtend, CharLeftRectExtend, CharRight, CharRightExtend, CharRightRectExtend, ChooseCaretX, Clear, ClearAll, ClearDocumentStyle, ClearRegisteredImages, CmdKeyAssign, CmdKeyClear, CmdKeyClearAll, CmdKeyExecute, Colourise, ConvertEOLs, Copy, CopyRange, CopyText, Create, CreateDocument, Cut, DelLineLeft, DelLineRight, DelWordLeft, DelWordRight, DeleteBack, DeleteBackNotLine, DoDragOver, DoDropText, DocLineFromVisible, DocumentEnd, DocumentEndExtend, DocumentStart, DocumentStartExtend, EditToggleOvertype, EmptyUndoBuffer, EndUndoAction, EnsureCaretVisible, EnsureVisible, EnsureVisibleEnforcePolicy, FindColumn, FindText, FormFeed, FormatRange, GetAnchor, GetBackSpaceUnIndents, GetBufferedDraw, GetCaretForeground, GetCaretLineBack, GetCaretLineVisible, GetCaretPeriod, GetCaretSticky, GetCaretWidth, GetCharAt, GetCodePage, GetColumn, GetControlCharSymbol, GetCurLine, GetCurLineRaw, GetCurLineUTF8, GetCurrentLine, GetCurrentPos, GetDocPointer, GetEOLMode, GetEdgeColour, GetEdgeColumn, GetEdgeMode, GetEndAtLastLine, GetEndStyled, GetFirstVisibleLine, GetFoldExpanded, GetFoldLevel, GetFoldParent, GetHighlightGuide, GetIndent, GetIndentationGuides, GetLastChild, GetLastKeydownProcessed, GetLayoutCache, GetLength, GetLexer, GetLine, GetLineCount, GetLineEndPosition, GetLineIndentPosition, GetLineIndentation, GetLineRaw, GetLineSelEndPosition, GetLineSelStartPosition, GetLineState, GetLineUTF8, GetLineVisible, GetMarginLeft, GetMarginMask, GetMarginRight, GetMarginSensitive, GetMarginType, GetMarginWidth, GetMaxLineState, GetModEventMask, GetModify, GetMouseDownCaptures, GetMouseDwellTime, GetOvertype, GetPasteConvertEndings, GetPrintColourMode, GetPrintMagnification, GetPrintWrapMode, GetProperty, GetPropertyExpanded, GetPropertyInt, GetReadOnly, GetSTCCursor, GetSTCFocus, GetScrollWidth, GetSearchFlags, GetSelectedText, GetSelectedTextRaw, GetSelectedTextUTF8, GetSelection, GetSelectionEnd, GetSelectionMode, GetSelectionStart, GetStatus, GetStyleAt, GetStyleBits, GetStyleBitsNeeded, GetStyledText, GetTabIndents, GetTabWidth, GetTargetEnd, GetTargetStart, GetText, GetTextLength, GetTextRange, GetTextRangeRaw, GetTextRangeUTF8, GetTextRaw, GetTextUTF8, GetTwoPhaseDraw, GetUndoCollection, GetUseAntiAliasing, GetUseHorizontalScrollBar, GetUseTabs, GetUseVerticalScrollBar, GetViewEOL, GetViewWhiteSpace, GetWrapMode, GetWrapStartIndent, GetWrapVisualFlags, GetWrapVisualFlagsLocation, GetXOffset, GetZoom, GotoLine, GotoPos, HideLines, HideSelection, Home, HomeDisplay, HomeDisplayExtend, HomeExtend, HomeRectExtend, HomeWrap, HomeWrapExtend, IndicatorGetForeground, IndicatorGetStyle, IndicatorSetForeground, IndicatorSetStyle, InsertText, InsertTextRaw, InsertTextUTF8, LineCopy, LineCut, LineDelete, LineDown, LineDownExtend, LineDownRectExtend, LineDuplicate, LineEnd, LineEndDisplay, LineEndDisplayExtend, LineEndExtend, LineEndRectExtend, LineEndWrap, LineEndWrapExtend, LineFromPosition, LineLength, LineScroll, LineScrollDown, LineScrollUp, LineTranspose, LineUp, LineUpExtend, LineUpRectExtend, LinesJoin, LinesOnScreen, LinesSplit, LoadFile, LowerCase, MarkerAdd, MarkerAddSet, MarkerDefine, MarkerDefineBitmap, MarkerDelete, MarkerDeleteAll, MarkerDeleteHandle, MarkerGet, MarkerLineFromHandle, MarkerNext, MarkerPrevious, MarkerSetBackground, MarkerSetForeground, MoveCaretInsideView, NewLine, PageDown, PageDownExtend, PageDownRectExtend, PageUp, PageUpExtend, PageUpRectExtend, ParaDown, ParaDownExtend, ParaUp, ParaUpExtend, Paste, PointFromPosition, PositionAfter, PositionBefore, PositionFromLine, PositionFromPoint, PositionFromPointClose, Redo, RegisterImage, ReleaseDocument, ReplaceSelection, ReplaceTarget, ReplaceTargetRE, SaveFile, ScrollToColumn, ScrollToLine, SearchAnchor, SearchInTarget, SearchNext, SearchPrev, SelectAll, SelectionDuplicate, SelectionIsRectangle, SendMsg, SetAnchor, SetBackSpaceUnIndents, SetBufferedDraw, SetCaretForeground, SetCaretLineBack, SetCaretLineVisible, SetCaretPeriod, SetCaretSticky, SetCaretWidth, SetCharsDefault, SetCodePage, SetControlCharSymbol, SetCurrentPos, SetDocPointer, SetEOLMode, SetEdgeColour, SetEdgeColumn, SetEdgeMode, SetEndAtLastLine, SetFoldExpanded, SetFoldFlags, SetFoldLevel, SetFoldMarginColour, SetFoldMarginHiColour, SetHScrollBar, SetHighlightGuide, SetHotspotActiveBackground, SetHotspotActiveForeground, SetHotspotActiveUnderline, SetHotspotSingleLine, SetIndent, SetIndentationGuides, SetKeyWords, SetLastKeydownProcessed, SetLayoutCache, SetLexer, SetLexerLanguage, SetLineIndentation, SetLineState, SetMarginLeft, SetMarginMask, SetMarginRight, SetMarginSensitive, SetMarginType, SetMarginWidth, SetMargins, SetModEventMask, SetMouseDownCaptures, SetMouseDwellTime, SetOvertype, SetPasteConvertEndings, SetPrintColourMode, SetPrintMagnification, SetPrintWrapMode, SetProperty, SetReadOnly, SetSTCCursor, SetSTCFocus, SetSavePoint, SetScrollWidth, SetSearchFlags, SetSelBackground, SetSelForeground, SetSelection, SetSelectionEnd, SetSelectionMode, SetSelectionStart, SetStatus, SetStyleBits, SetStyleBytes, SetStyling, SetTabIndents, SetTabWidth, SetTargetEnd, SetTargetStart, SetTextRaw, SetTextUTF8, SetTwoPhaseDraw, SetUndoCollection, SetUseAntiAliasing, SetUseHorizontalScrollBar, SetUseTabs, SetUseVerticalScrollBar, SetVScrollBar, SetViewEOL, SetViewWhiteSpace, SetVisiblePolicy, SetWhitespaceBackground, SetWhitespaceChars, SetWhitespaceForeground, SetWordChars, SetWrapMode, SetWrapStartIndent, SetWrapVisualFlags, SetWrapVisualFlagsLocation, SetXCaretPolicy, SetXOffset, SetYCaretPolicy, SetZoom, ShowLines, StartRecord, StartStyling, StopRecord, StutteredPageDown, StutteredPageDownExtend, StutteredPageUp, StutteredPageUpExtend, StyleClearAll, StyleResetDefault, StyleSetBackground, StyleSetBold, StyleSetCase, StyleSetChangeable, StyleSetCharacterSet, StyleSetEOLFilled, StyleSetFaceName, StyleSetFont, StyleSetFontAttr, StyleSetFontEncoding, StyleSetForeground, StyleSetHotSpot, StyleSetItalic, StyleSetSize, StyleSetSpec, StyleSetUnderline, StyleSetVisible, Tab, TargetFromSelection, TextHeight, TextWidth, ToggleCaretSticky, ToggleFold, Undo, UpperCase, UsePopUp, UserListShow, VCHome, VCHomeExtend, VCHomeRectExtend, VCHomeWrap, VCHomeWrapExtend, VisibleFromDocLine, WordEndPosition, WordLeft, WordLeftEnd, WordLeftEndExtend, WordLeftExtend, WordPartLeft, WordPartLeftExtend, WordPartRight, WordPartRightExtend, WordRight, WordRightEnd, WordRightEndExtend, WordRightExtend, WordStartPosition, WrapCount, ZoomIn, ZoomOut, __repr__

Inherited from wx._core.Control: Command, GetLabel, SetLabel

Inherited from wx._core.Window: AcceptsFocus, AcceptsFocusFromKeyboard, AddChild, AssociateHandle, CacheBestSize, CaptureMouse, Center, CenterOnParent, CenterOnScreen, Centre, CentreOnParent, CentreOnScreen, ClearBackground, ClientToScreen, ClientToScreenXY, Close, ConvertDialogPointToPixels, ConvertDialogSizeToPixels, ConvertPixelPointToDialog, ConvertPixelSizeToDialog, DLG_PNT, DLG_SZE, Destroy, DestroyChildren, Disable, DissociateHandle, DragAcceptFiles, Enable, FindWindowById, FindWindowByName, Fit, FitInside, Freeze, GetAcceleratorTable, GetAdjustedBestSize, GetAutoLayout, GetBackgroundColour, GetBackgroundStyle, GetBestFittingSize, GetBestSize, GetBestSizeTuple, GetBestVirtualSize, GetBorder, GetCaret, GetCharHeight, GetCharWidth, GetChildren, GetClientAreaOrigin, GetClientRect, GetClientSize, GetClientSizeTuple, GetConstraints, GetContainingSizer, GetCursor, GetDefaultAttributes, GetDefaultItem, GetDropTarget, GetEventHandler, GetExtraStyle, GetFont, GetForegroundColour, GetFullTextExtent, GetGrandParent, GetHandle, GetHelpText, GetId, GetMaxHeight, GetMaxSize, GetMaxWidth, GetMinHeight, GetMinSize, GetMinWidth, GetName, GetParent, GetPosition, GetPositionTuple, GetRect, GetScrollPos, GetScrollRange, GetScrollThumb, GetSize, GetSizeTuple, GetSizer, GetTextExtent, GetThemeEnabled, GetTitle, GetToolTip, GetUpdateClientRect, GetUpdateRegion, GetValidator, GetVirtualSize, GetVirtualSizeTuple, GetWindowStyle, GetWindowStyleFlag, GetWindowVariant, HasCapture, HasFlag, HasScrollbar, HasTransparentBackground, Hide, HitTest, HitTestXY, InheritAttributes, InheritsBackgroundColour, InitDialog, InvalidateBestSize, IsBeingDeleted, IsEnabled, IsExposed, IsExposedPoint, IsExposedRect, IsRetained, IsShown, IsTopLevel, Layout, Lower, MakeModal, Move, MoveAfterInTabOrder, MoveBeforeInTabOrder, MoveXY, Navigate, PopEventHandler, PopupMenu, PopupMenuXY, PostCreate, PrepareDC, PushEventHandler, Raise, Refresh, RefreshRect, RegisterHotKey, ReleaseMouse, RemoveChild, RemoveEventHandler, Reparent, ScreenToClient, ScreenToClientXY, ScrollLines, ScrollPages, ScrollWindow, SendSizeEvent, SetAcceleratorTable, SetAutoLayout, SetBackgroundColour, SetBackgroundStyle, SetBestFittingSize, SetCaret, SetClientRect, SetClientSize, SetClientSizeWH, SetConstraints, SetContainingSizer, SetCursor, SetDefaultItem, SetDimensions, SetDropTarget, SetEventHandler, SetExtraStyle, SetFocusFromKbd, SetFont, SetForegroundColour, SetHelpText, SetHelpTextForId, SetId, SetMaxSize, SetMinSize, SetName, SetOwnBackgroundColour, SetOwnFont, SetOwnForegroundColour, SetPosition, SetRect, SetScrollPos, SetScrollbar, SetSize, SetSizeHints, SetSizeHintsSz, SetSizeWH, SetSizer, SetSizerAndFit, SetThemeEnabled, SetTitle, SetTmpDefaultItem, SetToolTip, SetToolTipString, SetValidator, SetVirtualSize, SetVirtualSizeHints, SetVirtualSizeHintsSz, SetVirtualSizeWH, SetWindowStyle, SetWindowStyleFlag, SetWindowVariant, ShouldInheritColours, Show, Thaw, TransferDataFromWindow, TransferDataToWindow, UnregisterHotKey, Update, UpdateWindowUI, UseBgCol, Validate, WarpPointer

Inherited from wx._core.EvtHandler: AddPendingEvent, Bind, Connect, Disconnect, GetEvtHandlerEnabled, GetNextHandler, GetPreviousHandler, ProcessEvent, ProcessPendingEvents, SetEvtHandlerEnabled, SetNextHandler, SetPreviousHandler, Unbind

Inherited from wx._core.Object: GetClassName

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods

Inherited from wx._core.Control: GetClassDefaultAttributes

Inherited from wx._core.Window: FindFocus, GetCapture, NewControlId, NextControlId, PrevControlId

Properties

Inherited from object: __class__

Method Details

__init__(self, parent, id, pos=wx.Point(-1, -1), size=wx.Size(-1, -1), style=0, data=None)
(Constructor)

source code 

__init__(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition, 
    Size size=DefaultSize, long style=0, String name=STCNameStr) -> StyledTextCtrl

Returns: EvtHandler
Overrides: object.__init__
(inherited documentation)

SetText(self, text)

source code 

SetText(self, String text)

Replace the contents of the document with the argument text.

Overrides: wx.stc.StyledTextCtrl.SetText
(inherited documentation)

SetFocus(self, x=None, line=None)

source code 
Set focus to current position in STC.

- make sure that's visible, too

Overrides: wx._core.Window.SetFocus

replace_text(self, start=None, end=None, text=None, style=None)

source code 

Oddly, the otherwise very rich wx.STC API does not provide an easy way to replace text, so we provide it here.

Parameters:
  • start - the position in the text to start from
  • length - the length of the string to replace
  • text - the new string
  • style - the style for the replaced string

MakePopup(self, text, data, parent, cursor_position)

source code 

An overrideable method, called whenever a match is made in this STC Designed for producing popups, but the overrider can in fact, do whatever they please.

@return True if a poup-up or similar actually happened (which suppresses inserting the match string in the text @rtype boolean