From 1d36d7e91e44d0675bf1c1e3c8834b1d0a4804ee Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Wed, 19 Jun 2002 11:01:21 +0000 Subject: TextHeight feature contributed by Josh Wingstrom. --- doc/ScintillaDoc.html | 5 ++++- doc/ScintillaHistory.html | 1 + include/Scintilla.h | 3 +-- include/Scintilla.iface | 3 +++ src/Editor.cxx | 3 +++ 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index 30d7660dd..39cc14a34 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -244,6 +244,7 @@ SCI_MOVECARETINSIDEVIEW SCI_WORDENDPOSITION(int position, bool onlyWordCharacters) SCI_WORDSTARTPOSITION(int position, bool onlyWordCharacters) SCI_TEXTWIDTH(int stylenumber, char *text) +SCI_TEXTHEIGHT(int line)

Scintilla maintains a selection which stretches between two points, the anchor and the @@ -267,7 +268,9 @@ SCI_TEXTWIDTH(int stylenumber, char *text) can be used to find the pixel location of text on the display. SCI_TEXTWIDTH can be used to find the pixel width of a string which can be used, for example, to decide how wide to make the line number - margin in order to display a given number of numerals. + margin in order to display a given number of numerals. SCI_TEXTHEIGHT + returns the height in pixels of a particular line. Currently all lines are the + same height.

SCI_WORDENDPOSITION and SCI_WORDSTARTPOSITION can be used to find diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 9cd02286f..6bbc94b7e 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -105,6 +105,7 @@

  • Don Paul Beletsky
  • Gerhard Kalab
  • Olivier Dagenais
  • +
  • Josh Wingstrom
  • Sponsorship diff --git a/include/Scintilla.h b/include/Scintilla.h index a15d3da92..b583ab746 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -372,6 +372,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_TEXTWIDTH 2276 #define SCI_SETENDATLASTLINE 2277 #define SCI_GETENDATLASTLINE 2278 +#define SCI_TEXTHEIGHT 2279 #define SCI_LINEDOWN 2300 #define SCI_LINEDOWNEXTEND 2301 #define SCI_LINEUP 2302 @@ -518,11 +519,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCK_ADD 310 #define SCK_SUBTRACT 311 #define SCK_DIVIDE 312 -#define KeyMod SCMOD_ #define SCMOD_SHIFT 1 #define SCMOD_CTRL 2 #define SCMOD_ALT 4 -#define Lexer SCLEX_ #define SCN_STYLENEEDED 2000 #define SCN_CHARADDED 2001 #define SCN_SAVEPOINTREACHED 2002 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index e5daa4f96..c310da062 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -979,6 +979,9 @@ set void SetEndAtLastLine=2277(bool endAtLastLine,) # line at the bottom of the view. get int GetEndAtLastLine=2278(,) +# Retrieve the height of a particular line of text in pixels. +fun int TextHeight=2279(int line,) + ## Start of key messages # Move caret down one line. fun void LineDown=2300(,) diff --git a/src/Editor.cxx b/src/Editor.cxx index fbf44883c..aa05775de 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -4729,6 +4729,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { PLATFORM_ASSERT(lParam); return TextWidth(wParam, CharPtrFromSPtr(lParam)); + case SCI_TEXTHEIGHT: + return vs.lineHeight; + case SCI_SETENDATLASTLINE: PLATFORM_ASSERT((wParam == 0) || (wParam ==1)); if (endAtLastLine != (wParam != 0)) { -- cgit v1.2.3