diff options
| author | Sébastien Granjoux <seb.sfo@free.fr> | 2011-09-23 23:16:12 +0200 |
|---|---|---|
| committer | Sébastien Granjoux <seb.sfo@free.fr> | 2011-09-23 23:16:12 +0200 |
| commit | 64ebd8eea5c3210e0013c529a7b56c49c4350986 (patch) | |
| tree | ac2a064c703a906af44a653f47ccec56ca6c3dd0 /src/CallTip.cxx | |
| parent | 813050dedd80fbcce19a54e548b6283a92b9ade1 (diff) | |
| download | scintilla-mirror-64ebd8eea5c3210e0013c529a7b56c49c4350986.tar.gz | |
Allow to display calltip above or below the text
Diffstat (limited to 'src/CallTip.cxx')
| -rw-r--r-- | src/CallTip.cxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/CallTip.cxx b/src/CallTip.cxx index 8fc34eb0f..4da4142a8 100644 --- a/src/CallTip.cxx +++ b/src/CallTip.cxx @@ -33,6 +33,7 @@ CallTip::CallTip() { startHighlight = 0; endHighlight = 0; tabSize = 0; + above = false; useStyleCallTip = false; // for backwards compatibility #ifdef __APPLE__ @@ -245,7 +246,7 @@ void CallTip::MouseClick(Point pt) { clickPlace = 2; } -PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn, +PRectangle CallTip::CallTipStart(int pos, Point pt, int textHeight, const char *defn, const char *faceName, int size, int codePage_, int characterSet, int technology, Window &wParent) { @@ -288,7 +289,14 @@ PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn, // the tip text, else to the tip text left edge. int height = lineHeight * numLines - surfaceMeasure->InternalLeading(font) + 2 + 2; delete surfaceMeasure; - return PRectangle(pt.x - offsetMain, pt.y + 1, pt.x + width - offsetMain, pt.y + 1 + height); + if (above) + { + return PRectangle(pt.x - offsetMain, pt.y - 1 - height, pt.x + width - offsetMain, pt.y - 1); + } + else + { + return PRectangle(pt.x - offsetMain, pt.y + 1 + textHeight, pt.x + width - offsetMain, pt.y + 1 + textHeight + height); + } } void CallTip::CallTipCancel() { @@ -316,6 +324,12 @@ void CallTip::SetTabSize(int tabSz) { useStyleCallTip = true; } +// Set the calltip position, below the text by default or if above is false +// else above the text. +void CallTip::SetPosition(bool aboveText) { + above = aboveText; +} + // It might be better to have two access functions for this and to use // them for all settings of colours. void CallTip::SetForeBack(const ColourDesired &fore, const ColourDesired &back) { |
