aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/CallTip.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2001-10-28 04:39:23 +0000
committernyamatongwe <devnull@localhost>2001-10-28 04:39:23 +0000
commitb6272aec16732b184844bd2773f410f3c0a152dd (patch)
tree219ef4a2b3d794cebeedb9a0d3baa7e79cb9a1bb /src/CallTip.cxx
parent32056de116bf65368ccff2e887d29fbf81075bed (diff)
downloadscintilla-mirror-b6272aec16732b184844bd2773f410f3c0a152dd.tar.gz
Fixed Platform changes for GTK+ and hid most of the implementation of
Surface.
Diffstat (limited to 'src/CallTip.cxx')
-rw-r--r--src/CallTip.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/CallTip.cxx b/src/CallTip.cxx
index 006e2cb51..807b745f6 100644
--- a/src/CallTip.cxx
+++ b/src/CallTip.cxx
@@ -118,9 +118,11 @@ void CallTip::PaintCT(Surface *surfaceWindow) {
PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn,
const char *faceName, int size) {
- Surface surfaceMeasure;
- surfaceMeasure.Init();
- int deviceHeight = surfaceMeasure.DeviceHeightFont(size);
+ Surface *surfaceMeasure=Surface::Allocate();
+ if (!surfaceMeasure)
+ return PRectangle();
+ surfaceMeasure->Init();
+ int deviceHeight = surfaceMeasure->DeviceHeightFont(size);
font.Create(faceName, SC_CHARSET_DEFAULT, deviceHeight, false, false);
if (val)
delete []val;
@@ -139,16 +141,16 @@ PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn,
const char *newline;
const char *look = val;
while ((newline = strchr(look, '\n')) != NULL) {
- int thisWidth = surfaceMeasure.WidthText(font, look, newline - look);
+ int thisWidth = surfaceMeasure->WidthText(font, look, newline - look);
width = Platform::Maximum(width, thisWidth);
look = newline + 1;
numLines++;
}
- int lastWidth = surfaceMeasure.WidthText(font, look, strlen(look));
+ int lastWidth = surfaceMeasure->WidthText(font, look, strlen(look));
width = Platform::Maximum(width, lastWidth) + 10;
- int lineHeight = surfaceMeasure.Height(font);
+ int lineHeight = surfaceMeasure->Height(font);
// Extra line for border and an empty line at top and bottom
- int height = lineHeight * numLines - surfaceMeasure.InternalLeading(font) + 2 + 2;
+ int height = lineHeight * numLines - surfaceMeasure->InternalLeading(font) + 2 + 2;
return PRectangle(pt.x -5, pt.y + 1, pt.x + width - 5, pt.y + 1 + height);
}