aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-03-17 16:02:45 +1100
committerNeil <nyamatongwe@gmail.com>2021-03-17 16:02:45 +1100
commitd5b1240eece116b2a13b635d25b041bf0de19305 (patch)
tree477c8b5c2bf07db996f5520957a447ee256eacf8 /src
parentf0861077dfa88fd1e2846b164701eca5de63c292 (diff)
downloadscintilla-mirror-d5b1240eece116b2a13b635d25b041bf0de19305.tar.gz
Change Window::Cursor to an enum class.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx18
-rw-r--r--src/Platform.h6
2 files changed, 12 insertions, 12 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 7fa790469..56164a312 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -4300,7 +4300,7 @@ bool Editor::DragThreshold(Point ptStart, Point ptNow) {
void Editor::StartDrag() {
// Always handled by subclasses
//SetMouseCapture(true);
- //DisplayCursor(Window::cursorArrow);
+ //DisplayCursor(Windows::Cursor::Arrow);
}
void Editor::DropAt(SelectionPosition position, const char *value, size_t lengthValue, bool moving, bool rectangular) {
@@ -4428,7 +4428,7 @@ Window::Cursor Editor::GetMarginCursor(Point pt) const noexcept {
return static_cast<Window::Cursor>(m.cursor);
x += m.width;
}
- return Window::cursorReverseArrow;
+ return Window::Cursor::reverseArrow;
}
void Editor::TrimAndSetSelection(Sci::Position currentPos_, Sci::Position anchor_) {
@@ -4868,7 +4868,7 @@ void Editor::ButtonMoveWithModifiers(Point pt, unsigned int, int modifiers) {
if (hotSpotClickPos != INVALID_POSITION && PositionFromLocation(pt, true, true) != hotSpotClickPos) {
if (inDragDrop == ddNone) {
- DisplayCursor(Window::cursorText);
+ DisplayCursor(Window::Cursor::text);
}
hotSpotClickPos = INVALID_POSITION;
}
@@ -4884,18 +4884,18 @@ void Editor::ButtonMoveWithModifiers(Point pt, unsigned int, int modifiers) {
}
// Display regular (drag) cursor over selection
if (PointInSelection(pt) && !SelectionEmpty()) {
- DisplayCursor(Window::cursorArrow);
+ DisplayCursor(Window::Cursor::arrow);
SetHoverIndicatorPosition(Sci::invalidPosition);
} else {
SetHoverIndicatorPoint(pt);
if (PointIsHotspot(pt)) {
- DisplayCursor(Window::cursorHand);
+ DisplayCursor(Window::Cursor::hand);
SetHotSpotRange(&pt);
} else {
if (hoverIndicatorPos != Sci::invalidPosition)
- DisplayCursor(Window::cursorHand);
+ DisplayCursor(Window::Cursor::hand);
else
- DisplayCursor(Window::cursorText);
+ DisplayCursor(Window::Cursor::text);
SetHotSpotRange(nullptr);
}
}
@@ -4925,7 +4925,7 @@ void Editor::ButtonUpWithModifiers(Point pt, unsigned int curTime, int modifiers
if (PointInSelMargin(pt)) {
DisplayCursor(GetMarginCursor(pt));
} else {
- DisplayCursor(Window::cursorText);
+ DisplayCursor(Window::Cursor::text);
SetHotSpotRange(nullptr);
}
ptMouseLast = pt;
@@ -7891,7 +7891,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_SETCURSOR:
cursorMode = static_cast<int>(wParam);
- DisplayCursor(Window::cursorText);
+ DisplayCursor(Window::Cursor::text);
break;
case SCI_GETCURSOR:
diff --git a/src/Platform.h b/src/Platform.h
index 5b2116fcd..c0a13d911 100644
--- a/src/Platform.h
+++ b/src/Platform.h
@@ -223,13 +223,13 @@ class Window {
protected:
WindowID wid;
public:
- Window() noexcept : wid(nullptr), cursorLast(cursorInvalid) {
+ Window() noexcept : wid(nullptr), cursorLast(Cursor::invalid) {
}
Window(const Window &source) = delete;
Window(Window &&) = delete;
Window &operator=(WindowID wid_) noexcept {
wid = wid_;
- cursorLast = cursorInvalid;
+ cursorLast = Cursor::invalid;
return *this;
}
Window &operator=(const Window &) = delete;
@@ -245,7 +245,7 @@ public:
void Show(bool show=true);
void InvalidateAll();
void InvalidateRectangle(PRectangle rc);
- enum Cursor { cursorInvalid, cursorText, cursorArrow, cursorUp, cursorWait, cursorHoriz, cursorVert, cursorReverseArrow, cursorHand };
+ enum class Cursor { invalid, text, arrow, up, wait, horizontal, vertical, reverseArrow, hand };
void SetCursor(Cursor curs);
PRectangle GetMonitorRect(Point pt);
private: