CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
FxUITextCursor.h
Go to the documentation of this file.
1//
2// (C) Copyright 2005-2025 by Graebert GmbH.
3//
4// Permission to use, copy, modify, and distribute this software in
5// object code form for any purpose and without fee is hereby granted,
6// provided that the above copyright notice appears in all copies and
7// that both that copyright notice and the limited warranty and
8// restricted rights notice below appear in all supporting
9// documentation.
10//
11// GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
12// GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
13// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
14// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
15// UNINTERRUPTED OR ERROR FREE.
16
17#pragma once
18
19class CFxUITextCursorImpl;
20class CFxUITextView;
21
25
27{
28public:
30 {
31 NoMove = 0, //Keep the cursor where it is
32 Start = 1, //Move to the start of the document.
33 StartOfLine = 3, //Move to the start of the current line.
34 StartOfBlock = 5, //Move to the start of the current word.
35 PreviousBlock = 6, //Move to the start of the previous block.
36 PreviousCharacter = 7, //Move to the previous character.
37 PreviousWord = 8, //Move to the beginning of the previous word.
38 Up = 2, //Move up one line.
39 Left = 9, //Move left one character.
40 WordLeft = 10, //Move left one word.
41 End = 11, //Move to the end of the document.
42 EndOfLine = 13, //Move to the end of the current line.
43 EndOfWord = 14, //Move to the end of the current word.
44 EndOfBlock = 15, //Move to the end of the current block.
45 NextBlock = 16, //Move to the beginning of the next block.
46 NextCharacter = 17, //Move to the next character.
47 NextWord = 18, //Move to the next word.
48 Down = 12, //Move down one line.
49 Right = 19, //Move right one character.
50 WordRight = 20, //Move right one word.
51 NextCell = 21, //Move to the beginning of the next table cell inside the current table.If the current cell is the last cell in the row, the cursor will move to the first cell in the next row.
52 PreviousCell = 22, //Move to the beginning of the previous table cell inside the current table.If the current cell is the first cell in the row, the cursor will move to the last cell in the previous row.
53 NextRow = 23, //Move to the first new cell of the next row in the current table.
54 PreviousRow = 24 //Move to the last cell of the previous row in the current table.
55 };
56
58 MoveAnchor, //Moves the anchor to the same position as the cursor itself.
59 KeepAnchor //Keeps the anchor where it is.
60 };
61
62public:
63
66
69
75 bool movePosition( FxUIMoveOperation moveOperation, FxUIMoveMode moveMode, int n = 1 );
76
83
88
93
99 int position() const;
100
106 void setPosition( int pos );
107
108protected:
109 CFxUITextCursorImpl* m_pImpl = nullptr;
110};
#define COMMONUI_API
CFxString CFxUIString
CFxUIString selectedText()
void setPosition(int pos)
int position() const
void removeSelectedText()
void deletePreviousChar()
CFxUITextCursor(CFxUITextView *view)
CFxUITextCursorImpl * m_pImpl
bool movePosition(FxUIMoveOperation moveOperation, FxUIMoveMode moveMode, int n=1)