MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / SelectionPosition

Class SelectionPosition

scintilla/src/Selection.h:15–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13#endif
14
15class SelectionPosition {
16 int position;
17 int virtualSpace;
18public:
19 explicit SelectionPosition(int position_=INVALID_POSITION, int virtualSpace_=0) : position(position_), virtualSpace(virtualSpace_) {
20 PLATFORM_ASSERT(virtualSpace < 800000);
21 if (virtualSpace < 0)
22 virtualSpace = 0;
23 }
24 void Reset() {
25 position = 0;
26 virtualSpace = 0;
27 }
28 void MoveForInsertDelete(bool insertion, int startChange, int length);
29 bool operator ==(const SelectionPosition &other) const {
30 return position == other.position && virtualSpace == other.virtualSpace;
31 }
32 bool operator <(const SelectionPosition &other) const;
33 bool operator >(const SelectionPosition &other) const;
34 bool operator <=(const SelectionPosition &other) const;
35 bool operator >=(const SelectionPosition &other) const;
36 int Position() const {
37 return position;
38 }
39 void SetPosition(int position_) {
40 position = position_;
41 virtualSpace = 0;
42 }
43 int VirtualSpace() const {
44 return virtualSpace;
45 }
46 void SetVirtualSpace(int virtualSpace_) {
47 PLATFORM_ASSERT(virtualSpace_ < 800000);
48 if (virtualSpace_ >= 0)
49 virtualSpace = virtualSpace_;
50 }
51 void Add(int increment) {
52 position = position + increment;
53 }
54 bool IsValid() const {
55 return position >= 0;
56 }
57};
58
59// Ordered range to make drawing simpler
60struct SelectionSegment {

Callers 15

EditorMethod · 0.85
LocationFromPositionMethod · 0.85
SPositionFromLocationMethod · 0.85
SPositionFromLineXMethod · 0.85
SetSelectionMethod · 0.85
SetEmptySelectionMethod · 0.85
MovePositionToMethod · 0.85
MovePositionSoVisibleMethod · 0.85
DrawEOLMethod · 0.85
InsertPasteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected