17 skipped lines |
18 | | 18 | | inCallTipMode = false; |
|
19 | | 19 | | posStartCallTip = 0; |
|
|
21 | | xUp = -100; | | 21 | | rectUp = PRectangle(0,0,0,0); |
22 | | xDown = -100; | | 22 | | rectDown = PRectangle(0,0,0,0); |
|
24 | | 24 | | startHighlight = 0; |
|
|
49 skipped lines |
75 | | 75 | | if (IsArrowCharacter(s[startSeg])) { |
|
76 | | 76 | | xEnd = x + widthArrow; |
|
|
| | 78 | | rcClient.left = x; |
| | 79 | | rcClient.right = xEnd; |
|
79 | | 81 | | const int halfWidth = widthArrow / 2 - 3; |
|
80 | | 82 | | const int centreX = x + widthArrow / 2 - 1; |
|
81 | | 83 | | const int centreY = (rcClient.top + rcClient.bottom) / 2; |
|
82 | | rcClient.left = x; | | |
83 | | rcClient.right = xEnd; | | |
84 | | 84 | | surface->FillRectangle(rcClient, colourBG.allocated); |
|
85 | | 85 | | PRectangle rcClientInner(rcClient.left+1, rcClient.top+1, rcClient.right-2, rcClient.bottom-1); |
|
86 | | 86 | | surface->FillRectangle(rcClientInner, colourUnSel.allocated); |
|
17 skipped lines |
104 | | 104 | | surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]), |
|
105 | | 105 | | colourBG.allocated, colourBG.allocated); |
|
|
107 | | } else { | | 107 | | } |
108 | | if (s[startSeg] == '\001') { | | 108 | | if (s[startSeg] == '\001') { |
109 | | xUp = x+1; | | 109 | | rectUp = rcClient; |
110 | | } else { | | 110 | | } else if (s[startSeg] == '\002') { |
111 | | xDown = x+1; | | 111 | | rectDown = rcClient; |
112 | | } | | |
|
|
115 | | 114 | | xEnd = x + surface->WidthText(font, s+startSeg, endSeg - startSeg); |
|
87 skipped lines |
|
204 | | 203 | | void CallTip::MouseClick(Point pt) { |
|
|
206 | | if (pt.y < lineHeight) { | | 205 | | if (rectUp.Contains(pt)) |
207 | | if ((pt.x > xUp) && (pt.x < xUp + widthArrow - 2)) { | | |
208 | | clickPlace = 1; | | 206 | | clickPlace = 1; |
209 | | } else if ((pt.x > xDown) && (pt.x < xDown + widthArrow - 2)) { | | 207 | | if (rectDown.Contains(pt)) |
210 | | clickPlace = 2; | | 208 | | clickPlace = 2; |
211 | | } | | |
212 | | } | | |
|
|
215 | | 211 | | PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn, |
|
24 skipped lines |
240 | | 236 | | int numLines = 1; |
|
241 | | 237 | | const char *newline; |
|
242 | | 238 | | const char *look = val; |
|
243 | | xUp = -100; | | 239 | | rectUp = PRectangle(0,0,0,0); |
244 | | xDown = -100; | | 240 | | rectDown = PRectangle(0,0,0,0); |
|
246 | | 242 | | int width = PaintContents(surfaceMeasure, false) + 5; |
|
247 | | 243 | | while ((newline = strchr(look, '\n')) != NULL) { |
|
28 skipped lines |