Class EditWidgetBase
base for all editor widgets
Constructors
| Name | Description |
|---|---|
this
(ID, hscrollbarMode, vscrollbarMode)
|
Fields
| Name | Type | Description |
|---|---|---|
contentChange
|
Signal!(dcanvas.widgets.editors.EditableContentChangeListener) | Signal to emit when editor content is changed |
editorStateChange
|
Signal!(dcanvas.widgets.editors.EditorStateListener) | Signal to emit when editor cursor position or Insert/Replace mode is changed. |
modifiedStateChange
|
Signal!(dcanvas.widgets.editors.ModifiedStateListener) | Modified state change listener (e.g. content has been saved, or first time modified after save) |
previousXScrollPos
|
int | To hold scrollpos.x toggling between normal and word wrap mode |
splitChars
|
immutable(dchar[]) | Characters at which content is split for word wrap mode |
_backgroundDrawable
|
Ref!(dcanvas.graphics.resources.Drawable) | |
checkChange
|
Signal!(dcanvas.widgets.widget.OnCheckHandler) | checked state change event listener (bool delegate(Widget, bool)) |
click
|
Signal!(dcanvas.widgets.widget.OnClickHandler) | on click event listener (bool delegate(Widget)) |
doubleClick
|
Signal!(dcanvas.widgets.widget.OnDoubleClickHandler) | On double click event listener (bool delegate(Widget)) |
focusChange
|
Signal!(dcanvas.widgets.widget.OnFocusHandler) | focus state change event listener (bool delegate(Widget, bool)) |
keyEvent
|
Signal!(dcanvas.widgets.widget.OnKeyHandler) | key event listener (bool delegate(Widget, KeyEvent)) - return true if event is processed by handler |
keyToAction
|
Listener!(dcanvas.widgets.widget.OnKeyActionHandler) | action by key lookup handler |
mouseEvent
|
Signal!(dcanvas.widgets.widget.OnMouseHandler) | mouse event listener (bool delegate(Widget, MouseEvent)) - return true if event is processed by handler |
onAction
|
Signal!(dcanvas.widgets.widget.OnActionHandler) | action handlers |
_camelCasePartsAsWords
|
bool | |
_caretBlingingInterval
|
int | |
_caretBlinkingPhase
|
bool | |
_caretBlinks
|
bool | |
_caretColor
|
uint | |
_caretColorReplace
|
uint | |
_caretPos
|
TextPosition | |
_caretTimerId
|
ulong | |
_colorIconBookmark
|
uint | |
_colorIconBreakpoint
|
uint | |
_colorIconError
|
uint | |
_content
|
EditableContent | |
_contentChanged
|
bool | when true, call measureVisibileText on next layout |
_copyCurrentLineWhenNoSelection
|
bool | |
_deselectAllWhenUnfocused
|
bool | |
_fixedFont
|
bool | |
_foldingPaneWidth
|
uint | |
_foldingWidth
|
int | |
_hoverMousePosition
|
Point | |
_hoverTextPosition
|
TextPosition | |
_hoverTimeoutMillis
|
long | |
_hoverTimer
|
ulong | |
_iconsPaneWidth
|
uint | |
_iconsWidth
|
int | |
_lastBlinkStartTs
|
long | |
_lastReportedModifiedState
|
bool | |
_leftPaneBackgroundColor
|
uint | |
_leftPaneBackgroundColor2
|
uint | |
_leftPaneBackgroundColor3
|
uint | |
_leftPaneLineNumberBackgroundColor
|
uint | |
_leftPaneLineNumberBackgroundColorCurrentLine
|
uint | |
_leftPaneLineNumberColor
|
uint | |
_leftPaneLineNumberColorCurrentLine
|
uint | |
_leftPaneLineNumberColorEdited
|
uint | |
_leftPaneLineNumberColorSaved
|
uint | |
_leftPaneWidth
|
int | |
_lineHeight
|
int | |
_lineNumbersWidth
|
int | |
_matchingBracketHightlightColor
|
uint | |
_maxFontSize
|
int | |
_minFontSize
|
int | |
_modificationMarksPaneWidth
|
uint | |
_modificationMarksWidth
|
int | |
_ownContent
|
bool | when ownContent is false, content should not be destroyed in editor destructor |
_replaceMode
|
bool | |
_scrollPos
|
Point | |
_searchHighlightColorCurrent
|
uint | |
_searchHighlightColorOther
|
uint | |
_selectAllWhenFocusedWithTab
|
bool | |
_selectionColorFocused
|
uint | |
_selectionColorNormal
|
uint | |
_selectionRange
|
TextRange | |
_showFolding
|
bool | |
_showIcons
|
bool | |
_showLineNumbers
|
bool | |
_showModificationMarks
|
bool | |
_showTabPositionMarks
|
bool | |
_spaceWidth
|
int | |
_span
|
LineSpan[] | information about line span into several lines - in word wrap mode |
_spanCache
|
LineSpan[] | |
_textToHighlight
|
dstring | |
_textToHighlightOptions
|
uint | |
_wantTabs
|
bool | |
_wordWrap
|
bool | |
caretHeightOffset
|
int | |
_acceleratorMap
|
ActionMap | |
_action
|
Action | |
_checkable
|
bool | |
_checked
|
bool | |
_children
|
ObjectList!(dcanvas.widgets.widget.Widget) | |
_clickable
|
bool | |
_clientRect
|
Rect | inner area, excluding additional controls like scrollbars |
_focusable
|
bool | |
_focusGroup
|
bool | |
_fullScrollableArea
|
Rect | |
_hscrollbar
|
ScrollBar | horizontal scrollbar control |
_hscrollbarMode
|
ScrollBarMode | |
_id
|
string | widget id |
_insideChangeScrollbarVisibility
|
bool | |
_measuredHeight
|
int | height measured by measure() |
_measuredWidth
|
int | width measured by measure() |
_needDraw
|
bool | true to force redraw |
_needLayout
|
bool | true to force layout |
_ownStyle
|
Style | own copy of style - to override some of style properties, null of no properties overriden |
_parent
|
Widget | parent widget |
_popupMenu
|
MenuItem | |
_pos
|
Rect | current widget position, set by layout() |
_state
|
uint | widget state (set of flags from State enum) |
_styleId
|
string | style id to lookup style in theme |
_tabOrder
|
ushort | |
_tooltipText
|
UIString | |
_trackHover
|
bool | does widget need to track mouse Hover |
_visibility
|
Visibility | widget visibility: either Visible, Invisible, Gone |
_visibleScrollableArea
|
Rect | |
_vscrollbar
|
ScrollBar | vertical scrollbar control |
_vscrollbarMode
|
ScrollBarMode | |
_window
|
Window | window (to be used for top level widgets only!) |
Properties
| Name | Type | Description |
|---|---|---|
canFocus[get]
|
bool | returns true if widget is focusable and visible and enabled |
caretPos[get]
|
TextPosition | returns caret position |
content[get]
|
EditableContent | editor content object |
content[set]
|
EditWidgetBase | set content object |
copyCurrentLineWhenNoSelection[get]
|
bool | when true allows copy / cut whole current line if there is no selection |
copyCurrentLineWhenNoSelection[set]
|
EditWidgetBase | |
currentLineRange[get]
|
TextRange | returns range for line with cursor |
readOnly[get]
|
bool | readonly flag (when true, user cannot change content of editor) |
readOnly[set]
|
EditWidgetBase | sets readonly flag |
replaceMode[get]
|
bool | replace mode flag (when true, entered character replaces character under cursor) |
replaceMode[set]
|
EditWidgetBase | sets replace mode flag |
selectionRange[set]
|
TextRange | sets current selection range |
selectionRange[get]
|
TextRange | returns current selection range |
showCaretBlinking[get, set]
|
bool | when true, enables caret blinking, otherwise it's always visible |
showFolding[get, set]
|
bool | when true, show folding controls at the left |
showIcons[get, set]
|
bool | when true, show icons like bookmarks or breakpoints at the left |
showLineNumbers[get, set]
|
bool | when true, line numbers are shown |
showModificationMarks[get, set]
|
bool | when true, show modification marks for lines (whether line is unchanged/modified/modified_saved) |
showTabPositionMarks[get]
|
bool | when true shows mark on tab positions in beginning of line |
showTabPositionMarks[set]
|
EditWidgetBase | |
smartIndents[get]
|
bool | true if smart indents are enabled |
smartIndents[set]
|
EditWidgetBase | set smart indents enabled flag |
smartIndentsAfterPaste[get]
|
bool | true if smart indents are enabled |
smartIndentsAfterPaste[set]
|
EditWidgetBase | set smart indents enabled flag |
supportsSmartIndents[get]
|
bool | true if smart indents are supported |
tabSize[get]
|
int | returns tab size (in number of spaces) |
tabSize[set]
|
EditWidgetBase | sets tab size (in number of spaces) |
text[set]
|
Widget | set text |
text[get]
|
dstring | get widget text |
textToHighlight[get]
|
dstring | text pattern to highlight - e.g. for search |
useSpacesForTabs[get]
|
bool | when true, spaces will be inserted instead of tabs |
useSpacesForTabs[set]
|
EditWidgetBase | set new Tab key behavior flag: when true, spaces will be inserted instead of tabs |
wantTabs[get, set]
|
bool | when true, Tab / Shift+Tab presses are processed internally in widget (e.g. insert tab character) instead of focus change navigation. |
wordWrap[get, set]
|
bool | true if word wrap mode is set |
acceleratorMap[get]
|
ActionMap | |
action[get, set]
|
const(Action) | action to emit on click |
alignment[get]
|
ubyte | returns alignment (combined vertical and horizontal) |
alignment[set]
|
Widget | sets alignment (combined vertical and horizontal) |
alpha[get]
|
uint | widget drawing alpha value (0=opaque .. 255=transparent) |
alpha[set]
|
Widget | set widget drawing alpha value (0=opaque .. 255=transparent) |
animating[get]
|
bool | returns true is widget is being animated - need to call animate() and redraw |
backgroundColor[get]
|
uint | returns background color |
backgroundColor[set]
|
Widget | set background color for widget - override one from style |
backgroundColor[set]
|
Widget | set background color for widget - from string like "#5599CC" or "white" |
backgroundDrawable[get, set]
|
Ref!(dcanvas.graphics.resources.Drawable) | background drawable |
backgroundImageId[get, set]
|
string | background image id |
canCheck[get]
|
bool | |
canClick[get]
|
bool | |
checkable[get]
|
bool | when true, control supports Checked state |
checkable[set]
|
Widget | |
checked[set]
|
Widget | set checked state |
checked[get]
|
bool | get checked state |
childCount[get]
|
int | returns number of children of this widget |
clickable[get]
|
bool | when true, user can click this control, and get onClick listeners called |
clickable[set]
|
Widget | |
clientRect[get]
|
Rect | returns client area rectangle |
enabled[get]
|
bool | return true if state has State.Enabled flag set |
enabled[set]
|
Widget | change enabled state |
focusable[get]
|
bool | whether widget can be focused |
focusable[set]
|
Widget | |
focused[get]
|
bool | |
focusGroup[get]
|
bool | When focus group is set for some parent widget, focus from one of containing widgets can be moved using keyboard only to one of other widgets containing in it and cannot bypass bounds of focusGroup. |
focusGroup[set]
|
Widget | set focus group flag for container widget |
focusGroupFocused[get]
|
bool | |
focusGroupFocused[set]
|
Widget | |
focusRectColors[get]
|
const(uint[]) | returns colors to draw focus rectangle (one for solid, two for vertical gradient) or null if no focus rect should be drawn for style |
font[get]
|
Ref!(dcanvas.graphics.fonts.Font) | returns font set for widget using style or set manually |
fontFace[set]
|
Widget | set font face for widget - override one from style |
fontFace[get]
|
string | returns font face |
fontFamily[set]
|
Widget | set font family for widget - override one from style |
fontFamily[get]
|
FontFamily | returns font family |
fontItalic[set]
|
Widget | set font style (italic/normal) for widget - override one from style |
fontItalic[get]
|
bool | returns font style (italic/normal) |
fontSize[set]
|
Widget | set font size for widget - override one from style |
fontSize[get]
|
int | returns font size in pixels |
fontWeight[set]
|
Widget | set font weight for widget - override one from style |
fontWeight[get]
|
ushort | returns font weight |
halign[get]
|
Align | returns vertical alignment |
hasTooltip[get]
|
bool | returns true if widget has tooltip to show |
height[get]
|
int | returns current height of widget in pixels |
hscrollbar[get]
|
ScrollBar | |
hscrollbar[set]
|
ScrollBar | |
hscrollbarMode[get]
|
ScrollBarMode | horizontal scrollbar mode |
hscrollbarMode[set]
|
ScrollBarMode | |
id[get]
|
string | returns widget id, null if not set |
id[set]
|
Widget | set widget id |
layoutHeight[set]
|
Widget | sets layout height options (WRAP_CONTENT, FILL_PARENT, or some constant value) |
layoutHeight[get]
|
int | returns layout height options (WRAP_CONTENT, FILL_PARENT, some constant value or percent but only for one widget in layout) |
layoutWeight[set]
|
Widget | sets layout weight (while resizing to fill parent, widget will be resized proportionally to this value) |
layoutWeight[get]
|
int | returns layout weight (while resizing to fill parent, widget will be resized proportionally to this value) |
layoutWidth[set]
|
Widget | sets layout width options (WRAP_CONTENT, FILL_PARENT, or some constant value) |
layoutWidth[get]
|
int | returns layout width options (WRAP_CONTENT, FILL_PARENT, some constant value or percent but only for one widget in layout) |
left[get]
|
int | returns widget rectangle left position |
margins[set]
|
Widget | set margins for widget with the same value for left, top, right, bottom - override one from style |
margins[set]
|
Widget | set margins for widget - override one from style |
margins[get]
|
Rect | get margins (between widget bounds and its background) |
maxHeight[set]
|
Widget | set max height constraint (SIZE_UNSPECIFIED for no constraint) |
maxHeight[get]
|
int | returns max height constraint (SIZE_UNSPECIFIED if no constraint set) |
maxWidth[set]
|
Widget | set max width constraint (SIZE_UNSPECIFIED for no constraint) |
maxWidth[get]
|
int | returns max width constraint (SIZE_UNSPECIFIED if no constraint set) |
measuredHeight[get]
|
int | returns measured height (calculated during measure() call) |
measuredWidth[get]
|
int | returns measured width (calculated during measure() call) |
minHeight[set]
|
Widget | set max height constraint (0 for no constraint) |
minHeight[get]
|
int | returns min height constraint |
minWidth[set]
|
Widget | set max width constraint (0 for no constraint) |
minWidth[get]
|
int | returns min width constraint |
needDraw[get]
|
bool | returns true if redraw is required for widget and its children |
needLayout[get]
|
bool | returns true if layout is required for widget and its children |
ownStyle[get]
|
Style | enforces widget's own style - allows override some of style properties |
padding[set]
|
Widget | set padding for widget to the same value for left, top, right, bottom - override one from style |
padding[set]
|
Widget | set padding for widget - override one from style |
padding[get]
|
Rect | get padding (between background bounds and content of widget) |
parent[get]
|
Widget | returns parent widget, null for top level widget |
parent[set]
|
Widget | sets parent for widget |
popupMenu[get]
|
MenuItem | |
popupMenu[set]
|
Widget | |
pos[get]
|
Rect | returns widget rectangle |
resetState[set]
|
Widget | remove state flags (set of flags from State enum) |
setState[set]
|
Widget | add state flags (set of flags from State enum) |
state[set]
|
Widget | set new widget state (set of flags from State enum) |
state[get]
|
uint | widget state (set of flags from State enum) |
styleId[set]
|
Widget | set widget style id |
styleId[get]
|
string | returns widget style id, null if not set |
tabOrder[get]
|
ushort | tab order - hint for focus movement using Tab/Shift+Tab |
tabOrder[set]
|
Widget | |
textColor[set]
|
Widget | set text color for widget - from string like "#5599CC" or "white" |
textColor[set]
|
Widget | set text color (ARGB 32 bit value) |
textColor[get]
|
uint | get text color (ARGB 32 bit value) |
textFlags[set]
|
Widget | set text flags (bit set of TextFlag enum values) |
textFlags[get]
|
uint | get text flags (bit set of TextFlag enum values) |
tooltipText[get, set]
|
dstring | tooltip text - when not empty, widget will show tooltips automatically; for advanced tooltips - override hasTooltip and createTooltip |
top[get]
|
int | returns widget rectangle top position |
trackHover[get]
|
bool | mouse movement processing flag (when true, widget will change Hover state while mouse is moving) |
trackHover[set]
|
Widget | set new trackHover flag value (when true, widget will change Hover state while mouse is moving) |
valign[get]
|
Align | returns horizontal alignment |
visibility[get]
|
Visibility | returns widget visibility (Visible, Invisible, Gone) |
visibility[set]
|
Widget | sets widget visibility (Visible, Invisible, Gone) |
visible[get]
|
bool | returns true if this widget and all its parents are visible |
vscrollbar[set]
|
ScrollBar | |
vscrollbar[get]
|
ScrollBar | |
vscrollbarMode[set]
|
ScrollBarMode | |
vscrollbarMode[get]
|
ScrollBarMode | vertical scrollbar mode |
wantsKeyTracking[get]
|
bool | override and return true to track key events even when not focused |
width[get]
|
int | returns current width of widget in pixels |
window[get]
|
Window | returns window (if widget or its parent is attached to window) |
window[set]
|
Window | sets window (to be used for top level widget from Window implementation). TODO: hide it from API? |
stateStyle[get]
|
const(Style) | returns style for current widget state |
style[get, set]
|
const(Style) | accessor to style - by lookup in theme by styleId (if style id is not set, theme base style will be used). |
Methods
| Name | Description |
|---|---|
canShowPopupMenu
(x, y)
|
returns true if widget can show popup (e.g. by mouse right click at point x,y) |
clearSelection
()
|
clears selection (don't change text, just unselect) |
explode
(str, splitChars)
|
Divide (and conquer) text into words |
findWrapLine
(textPos)
|
Based on a TextPosition, finds which wrapLine it is on for its current line |
findWrapPoint
(text)
|
Finds good visual wrapping point for string |
getCursorType
(x, y)
|
returns mouse cursor type for widget |
getRangeText
(range)
|
returns text for specified range (joined with LF when span over multiple lines) |
getSelectedText
()
|
returns current selection text (joined with LF when span over multiple lines) |
getSpan
(lineNumber)
|
Returns LineSpan for line based on actual line number |
handleActionStateRequest
(a)
|
override to handle specific actions state (e.g. change enabled state for supported actions) |
isActionEnabled
(action)
|
override to change popup menu items state |
isAZaz
(ch)
|
|
lineSpanIterate
(iterator)
|
Simple way of iterating through span |
measureWrappedText
(text)
|
Calls measureText for word wrap |
onContentChange
(content, operation, rangeBefore, rangeAfter, source)
|
|
onKeyEvent
(event)
|
handle keys |
onMenuItemAction
(action)
|
|
onMouseEvent
(event)
|
process mouse event; return true if event is processed by widget. |
onPopupMenuItem
(item)
|
|
onThemeChanged
()
|
handle theme change: e.g. reload some themed resources |
onTimer
(id)
|
handle timer; return true to repeat timer event after next interval, false cancel timer |
replaceSelectionText
(newText)
|
|
selectAll
()
|
Select whole text |
setBoolProperty
(name, value)
|
set string property value, for ML loaders |
setCaretPos
(line, column, makeVisible, center)
|
change caret position and ensure it is visible |
setFocus
(reason)
|
sets focus to this widget or suitable focusable child, returns previously focused widget |
setIntProperty
(name, value)
|
set int property value, for ML loaders |
setTextToHighlight
(pattern, textToHighlightOptions)
|
set text to highlight -- e.g. for search |
showPopupMenu
(x, y)
|
shows popup at (x,y) |
wordWrapRefresh
()
|
Override for EditBox |
wrapLine
(str, lineNumber)
|
Divides up a string for word wrapping, sets info in span |
wrapsUpTo
(line)
|
Returns number of visible wraps up to a line (not including the first wrapLines themselves) |
addChild
(item)
|
adds child, returns added item |
addChildren
(items)
|
adds child, returns added item |
addOnCheckChangeListener
(listener)
|
helper function to add onCheckChangeListener in method chain |
addOnClickListener
(listener)
|
helper function to add onClickListener in method chain |
addOnFocusChangeListener
(listener)
|
helper function to add onFocusChangeListener in method chain |
animate
(interval)
|
animates window; interval is time left from previous draw, in hnsecs (1/10000000 of second) |
applyAlign
(rc, sz)
|
Applies alignment for content of size sz - set rectangle rc to aligned value of content inside of initial value of rc. |
applyMargins
(rc)
|
Helper function: applies margins to rectangle |
applyPadding
(rc)
|
Helper function: applies padding to rectangle |
cancelLayout
()
|
|
cancelTimer
(timerId)
|
cancel timer - pass value returned from setTimer() as timerId parameter |
child
(index)
|
returns child by index |
childById
(id, deepSearch)
|
find child of specified type T by id, returns null if not found or cannot be converted to type T |
childIndex
(item)
|
returns index of widget in child list, -1 if passed widget is not a child of this widget |
compareId
(id)
|
compare widget id with specified value, returs true if matches |
createTooltip
(mouseX, mouseY, alignment, x, y)
|
will be called from window once tooltip request timer expired; if null is returned, popup will not be shown; you can change alignment and position of popup here |
dispatchAction
(a)
|
call to dispatch action |
drawFocusRect
(buf, rc)
|
draws focus rectangle, if enabled in styles |
executeInUiThread
(runnable)
|
execute delegate later in UI thread if this widget will be still available (can be used to modify UI from background thread, or just to postpone execution of action) |
fillHorizontal
()
|
sets layoutWidth=FILL_PARENT |
fillParent
()
|
sets layoutWidth=FILL_PARENT and layoutHeight=FILL_PARENT |
fillVertical
()
|
sets layoutHeight=FILL_PARENT |
findFocusableChild
(defaultOnly)
|
searches children for first focusable item, returns null if not found |
focusGroupWidget
()
|
find nearest parent of this widget with focusGroup flag, returns topmost parent if no focusGroup flag set to any of parents. |
fullContentSize
()
|
calculate full content size in pixels |
fullContentSizeWithBorders
()
|
calculate full content size in pixels including widget borders / margins |
handleActionStateChanged
()
|
called when state of action assigned on widget is changed |
handleMoveFocusUsingKeys
(event)
|
|
insertChild
(item, index)
|
inserts child at given index, returns inserted item |
invalidate
()
|
request redraw |
isChild
(item, deepSearch)
|
returns true if item is child of this widget (when deepSearch == true - returns true if item is this widget or one of children inside children tree). |
isPointInside
(x, y)
|
returns true if point is inside of this widget |
isPointInside
(pt)
|
|
layout
(rc)
|
Set widget rectangle to specified value and layout widget contents. (Step 2 of two phase layout). |
makeRectVisible
(rc, alignHorizontally, alignVertically)
|
|
measure
(parentWidth, parentHeight)
|
Measure widget according to desired width and height constraints. (Step 1 of two phase layout). |
minimumVisibleContentSize
()
|
|
onDraw
(buf)
|
Draw widget at its position to buffer |
onEvent
(event)
|
handle custom event |
onHScroll
(event)
|
process horizontal scrollbar event |
onScrollEvent
(source, event)
|
handle scroll event |
onVScroll
(event)
|
process vertical scrollbar event |
removeAllChildren
(destroyObj)
|
|
removeChild
(index)
|
removes child, returns removed item |
removeChild
(ID)
|
removes child by ID, returns removed item |
removeChild
(child)
|
removes child, returns removed item |
replaceChild
(newChild, oldChild)
|
replace child with other child |
requestActionsUpdate
(immediateUpdate)
|
set action update request flag, will be cleared after redraw |
requestLayout
()
|
request relayout of widget and its children |
scheduleTooltip
(delay, alignment, x, y)
|
schedule tooltip |
setDoubleProperty
(name, value)
|
set double property value, for ML loaders |
setDstringProperty
(name, value)
|
set string property value, for ML loaders |
setRectProperty
(name, value)
|
set Rect property value, for ML loaders |
setStringListValueListProperty
(propName, values)
|
StringListValue list values |
setStringProperty
(name, value)
|
set string property value, for ML loaders |
setTimer
(intervalMillis)
|
set new timer to call onTimer() after specified interval (for recurred notifications, return true from onTimer) |
setUIStringListProperty
(propName, values)
|
UIString list values |
setUistringProperty
(name, value)
|
set string property value, for ML loaders |
updateActionState
(force)
|
call to update state for action (if action is assigned for widget) |
updateActionState
(a, force, allowDefault)
|
ask for update state of some action (unles force=true, checks window flag actionsUpdateRequested), returns true if action state is changed |
updateStateFromAction
(a)
|
apply enabled, visibile and checked state for this widget from action's state |
calcLineWidth
(s)
|
|
cancelHoverTimer
()
|
|
caretRect
()
|
returns cursor rectangle |
clientToTextPos
(pt)
|
|
correctCaretPos
()
|
when cursor position or selection is out of content bounds, fix it to nearest valid position |
drawCaret
(buf)
|
draws caret |
drawLeftPane
(buf, rc, line)
|
|
drawLeftPaneFolding
(buf, rc, line)
|
|
drawLeftPaneIcon
(buf, rc, icon)
|
|
drawLeftPaneIcons
(buf, rc, line)
|
|
drawLeftPaneLineNumbers
(buf, rc, line)
|
|
drawLeftPaneModificationMarks
(buf, rc, line)
|
|
ensureCaretVisible
(center)
|
|
findKeyAction
(keyCode, flags)
|
map key to action |
getLeftPaneIconsPopupMenu
(line)
|
|
handleAction
(a)
|
override to handle specific actions |
handleClientRectLayout
(rc)
|
override to support modification of client rect after change, e.g. apply offset |
handleEditorStateChange
()
|
updates editorStateChange with recent position |
handleFocusChange
(focused, receivedFocusFromKeyboard)
|
override to handle focus changes |
handleLeftPaneFoldingMouseClick
(event, rc, line)
|
|
handleLeftPaneIconsMouseClick
(event, rc, line)
|
|
handleLeftPaneLineNumbersMouseClick
(event, rc, line)
|
|
handleLeftPaneModificationMarksMouseClick
(event, rc, line)
|
|
handleLeftPaneMouseClick
(event, rc, line)
|
|
indentLine
(src, back, cursorPos)
|
change line indent |
indentRange
(back)
|
indent / unindent range |
lineCount
()
|
override for multiline editors |
measureVisibleText
()
|
|
multipleLinesSelected
()
|
returns true if one or more lines selected fully |
onControlClick
()
|
Handle Ctrl + Left mouse click on text |
onHover
(pos)
|
|
onHoverTimeout
(pt, pos)
|
override to handle mouse hover timeout in text |
onLeftPaneMouseClick
(event)
|
|
processSmartIndent
(operation)
|
|
removeRangeText
(range)
|
|
removeSelectionTextIfSelected
()
|
|
selectLineByMouse
(x, y, onSameLineOnly)
|
|
selectWordByMouse
(x, y)
|
|
spaceBefore
(pos)
|
|
spacesForTab
(currentPos)
|
generate string of spaces, to reach next tab position |
startCaretBlinking
()
|
|
stopCaretBlinking
()
|
|
textPosToClient
(p)
|
|
updateCaretPositionByMouse
(x, y, selecting)
|
|
updateFontProps
()
|
|
updateLeftPaneWidth
()
|
override to add custom items on left panel |
updateMaxLineWidth
()
|
|
updateSelectionAfterCursorMovement
(oldCaretPos, selecting)
|
|
wordWrapMouseOffset
(x, y)
|
Used instead of using clientToTextPos for mouse input when in word wrap mode |
checkIfNeededToChangeScrollbarVisibility
()
|
|
checkIfScrollbarsNeeded
(needHScroll, needVScroll)
|
override to determine if scrollbars are needed or not |
drawClient
(buf)
|
|
drawExtendedArea
(buf)
|
|
handleCheckChange
(checked)
|
override to handle check changes |
handleClick
()
|
|
handleDoubleClick
()
|
|
handleFontChanged
()
|
override to handle font changes |
measuredContent
(parentWidth, parentHeight, contentWidth, contentHeight)
|
helper function for implement measure() when widget's content dimensions are known |
setWindowFocusedFlag
(flg)
|
|
updateHScrollBar
()
|
update horizontal scrollbar widget position |
updateScrollBars
()
|
update scrollbar positions |
updateVScrollBar
()
|
update verticat scrollbar widget position |
Aliases
| Name | Description |
|---|---|
~this
|