InfText.MoveOperation¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
The number of characters of the selected text |
||
r/w/co |
Position where to place the user’s caret at |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class InfText.MoveOperation(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(position, length)¶
- Parameters:
- Returns:
A new
InfText.MoveOperation
.- Return type:
Creates a new move operation that, when applied, changes the caret and selection of the applying user.
- classmethod transform_delete(delete_position, delete_length, move_position, move_length)¶
- Parameters:
delete_position (
int
) – The position at which text is deleted.delete_length (
int
) – The number of deleted characters.move_position (
int
) – Points to the character offset to which the caret is moved.move_length (
int
) – Points to the number of characters selected. Negative means towards the beginning.
- Returns:
- move_position:
Points to the character offset to which the caret is moved.
- move_length:
Points to the number of characters selected. Negative means towards the beginning.
- Return type:
Changes move_position and move_length so that they point to the same region when delete_length characters are deleted starting from delete_position.
- classmethod transform_insert(insert_position, insert_length, move_position, move_length, left_gravity)¶
- Parameters:
insert_position (
int
) – The position at which text is inserted.insert_length (
int
) – The number of inserted characters.move_position (
int
) – Points to the character offset to which the caret is moved.move_length (
int
) – Points to the number of characters selected. Negative means towards the beginning.left_gravity (
bool
) – Whether the move position and length have left gravity.
- Returns:
- move_position:
Points to the character offset to which the caret is moved.
- move_length:
Points to the number of characters selected. Negative means towards the beginning.
- Return type:
Changes move_position and move_length so that they point to the same region when insert_length characters are inserted at insert_position.
If text is inserted at the same position as move_position, then move_position is kept at the position it currently is if left_gravity is
True
, otherwise it is shifted to the right.If move_length is nonzero, then the selection length is never enlarged if text is inserted at the selection bounds, not depending on whether left_gravity is set or not.
- get_length()¶
- Returns:
The length of self.
- Return type:
Returns the length to which self changes the user’s selection. Negative means selection towards the beginning of the buffer.
Property Details¶
- InfText.MoveOperation.props.length¶
- Name:
length
- Type:
- Default Value:
0
- Flags:
The number of characters of the selected text
- InfText.MoveOperation.props.position¶
- Name:
position
- Type:
- Default Value:
0
- Flags:
Position where to place the user’s caret at