Difference between revisions of "CudaText API"
From Free Pascal wiki
Jump to navigationJump to searchLine 15: | Line 15: | ||
Returns 4-tuple: info about top visible caret: (PosX, PosY, EndX, EndY). PosY is line index (0-base), PosX is column (0-base), EndY/EndX are position of selection end for this caret or both -1 if no selection. | Returns 4-tuple: info about top visible caret: (PosX, PosY, EndX, EndY). PosY is line index (0-base), PosX is column (0-base), EndY/EndX are position of selection end for this caret or both -1 if no selection. | ||
+ | |||
+ | ===get_carets=== | ||
+ | |||
+ | get_carets() | ||
+ | |||
+ | Returns list of 4-tuples. Each list item is info about each caret, see get_caret. | ||
+ | |||
+ | ===add_caret=== | ||
+ | |||
+ | add_caret(posx, posy, endx, endy) | ||
+ | |||
+ | Adds caret with given info (4 integers, see get_caret). If called with posx<0, then all carets deleted. | ||
==Text read/write== | ==Text read/write== | ||
==Properties get/set== | ==Properties get/set== | ||
==Misc== | ==Misc== |
Revision as of 17:55, 23 September 2015
Intro
This is API for CudaText in Python.
- Main Py module is cudatext. Main module has constants, funcs, class Editor, objects of class Editor.
- Additional module: cudatext_cmd has constants for command runner func.
Global funcs
msg_box
Editor class
get_caret
get_caret()
Returns 4-tuple: info about top visible caret: (PosX, PosY, EndX, EndY). PosY is line index (0-base), PosX is column (0-base), EndY/EndX are position of selection end for this caret or both -1 if no selection.
get_carets
get_carets()
Returns list of 4-tuples. Each list item is info about each caret, see get_caret.
add_caret
add_caret(posx, posy, endx, endy)
Adds caret with given info (4 integers, see get_caret). If called with posx<0, then all carets deleted.