From dfd84e5dbd36aba02b8aedfb66d03ad8a1755fc0 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 2 Oct 2001 06:04:52 +0000 Subject: Patch from Mark to make the x offset accessible through the API. --- include/Scintilla.h | 2 ++ include/Scintilla.iface | 4 ++++ src/Editor.cxx | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/include/Scintilla.h b/include/Scintilla.h index 7202712ad..19429a493 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -442,6 +442,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETVISIBLEPOLICY 2394 #define SCI_DELLINELEFT 2395 #define SCI_DELLINERIGHT 2396 +#define SCI_SETXOFFSET 2397 +#define SCI_GETXOFFSET 2398 #define SCI_GRABFOCUS 2400 #define SCI_STARTRECORD 3001 #define SCI_STOPRECORD 3002 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index 6c31eaa70..c77fe2b9e 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -1169,6 +1169,10 @@ fun void DelLineLeft=2395(,) # Delete forwards from the current position to the end of the line fun void DelLineRight=2396(,) +# Get and Set the xOffset (ie, horizonal scroll position) +set void SetXOffset=2397(int newOffset,) +get int GetXOffset=2398(,) + # Set the focus to this Scintilla widget. # GTK+ Specific fun void GrabFocus=2400(,) diff --git a/src/Editor.cxx b/src/Editor.cxx index cbf3a951f..0730bc280 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -3700,6 +3700,14 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { HorizontalScrollTo(xOffset + wParam * vs.spaceWidth); return TRUE; + case SCI_SETXOFFSET: + xOffset = wParam; + Redraw(); + break; + + case SCI_GETXOFFSET: + return xOffset; + case SCI_SCROLLCARET: EnsureCaretVisible(); break; -- cgit v1.2.3