From 2189d4ff82cd7a48802fd5ce545a29d80e198adf Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Wed, 20 Mar 2013 20:37:41 +1100 Subject: Add ScrollRange feature. --- src/Editor.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/Editor.h') diff --git a/src/Editor.h b/src/Editor.h index 91cbd59a4..f2b452a77 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -381,10 +381,19 @@ protected: // ScintillaBase subclass needs access to much of Editor int xOffset; int topLine; XYScrollPosition(int xOffset_, int topLine_) : xOffset(xOffset_), topLine(topLine_) {} + bool operator==(const XYScrollPosition &other) const { + return (xOffset == other.xOffset) && (topLine == other.topLine); + } }; - XYScrollPosition XYScrollToMakeVisible(const bool useMargin, const bool vert, const bool horiz); + enum XYScrollOptions { + xysUseMargin=0x1, + xysVertical=0x2, + xysHorizontal=0x4, + xysDefault=xysUseMargin|xysVertical|xysHorizontal}; + XYScrollPosition XYScrollToMakeVisible(const SelectionRange range, const XYScrollOptions options); void SetXYScroll(XYScrollPosition newXY); void EnsureCaretVisible(bool useMargin=true, bool vert=true, bool horiz=true); + void ScrollRange(SelectionRange range); void ShowCaretAtCurrentPosition(); void DropCaret(); void InvalidateCaret(); -- cgit v1.2.3