aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/CallTip.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/CallTip.cxx')
-rw-r--r--src/CallTip.cxx40
1 files changed, 16 insertions, 24 deletions
diff --git a/src/CallTip.cxx b/src/CallTip.cxx
index 0e1e80cc1..8fc34eb0f 100644
--- a/src/CallTip.cxx
+++ b/src/CallTip.cxx
@@ -37,15 +37,15 @@ CallTip::CallTip() {
#ifdef __APPLE__
// proper apple colours for the default
- colourBG.desired = ColourDesired(0xff, 0xff, 0xc6);
- colourUnSel.desired = ColourDesired(0, 0, 0);
+ colourBG = ColourDesired(0xff, 0xff, 0xc6);
+ colourUnSel = ColourDesired(0, 0, 0);
#else
- colourBG.desired = ColourDesired(0xff, 0xff, 0xff);
- colourUnSel.desired = ColourDesired(0x80, 0x80, 0x80);
+ colourBG = ColourDesired(0xff, 0xff, 0xff);
+ colourUnSel = ColourDesired(0x80, 0x80, 0x80);
#endif
- colourSel.desired = ColourDesired(0, 0, 0x80);
- colourShade.desired = ColourDesired(0, 0, 0);
- colourLight.desired = ColourDesired(0xc0, 0xc0, 0xc0);
+ colourSel = ColourDesired(0, 0, 0x80);
+ colourShade = ColourDesired(0, 0, 0);
+ colourLight = ColourDesired(0xc0, 0xc0, 0xc0);
codePage = 0;
clickPlace = 0;
}
@@ -57,14 +57,6 @@ CallTip::~CallTip() {
val = 0;
}
-void CallTip::RefreshColourPalette(Palette &pal, bool want) {
- pal.WantFind(colourBG, want);
- pal.WantFind(colourUnSel, want);
- pal.WantFind(colourSel, want);
- pal.WantFind(colourShade, want);
- pal.WantFind(colourLight, want);
-}
-
// Although this test includes 0, we should never see a \0 character.
static bool IsArrowCharacter(char ch) {
return (ch == 0) || (ch == '\001') || (ch == '\002');
@@ -120,10 +112,10 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s,
const int halfWidth = widthArrow / 2 - 3;
const int centreX = rcClient.left + widthArrow / 2 - 1;
const int centreY = (rcClient.top + rcClient.bottom) / 2;
- surface->FillRectangle(rcClient, colourBG.allocated);
+ surface->FillRectangle(rcClient, colourBG);
PRectangle rcClientInner(rcClient.left + 1, rcClient.top + 1,
rcClient.right - 2, rcClient.bottom - 1);
- surface->FillRectangle(rcClientInner, colourUnSel.allocated);
+ surface->FillRectangle(rcClientInner, colourUnSel);
if (upArrow) { // Up arrow
Point pts[] = {
@@ -132,7 +124,7 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s,
Point(centreX, centreY - halfWidth + halfWidth / 2),
};
surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
- colourBG.allocated, colourBG.allocated);
+ colourBG, colourBG);
} else { // Down arrow
Point pts[] = {
Point(centreX - halfWidth, centreY - halfWidth / 2),
@@ -140,7 +132,7 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s,
Point(centreX, centreY + halfWidth - halfWidth / 2),
};
surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
- colourBG.allocated, colourBG.allocated);
+ colourBG, colourBG);
}
}
xEnd = rcClient.right;
@@ -159,7 +151,7 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s,
rcClient.right = xEnd;
surface->DrawTextTransparent(rcClient, font, ytext,
s+startSeg, endSeg - startSeg,
- highlight ? colourSel.allocated : colourUnSel.allocated);
+ highlight ? colourSel : colourUnSel);
}
}
x = xEnd;
@@ -227,7 +219,7 @@ void CallTip::PaintCT(Surface *surfaceWindow) {
rcClientPos.bottom - rcClientPos.top);
PRectangle rcClient(1, 1, rcClientSize.right - 1, rcClientSize.bottom - 1);
- surfaceWindow->FillRectangle(rcClient, colourBG.allocated);
+ surfaceWindow->FillRectangle(rcClient, colourBG);
offsetMain = insetX; // initial alignment assuming no arrows
PaintContents(surfaceWindow, true);
@@ -236,10 +228,10 @@ void CallTip::PaintCT(Surface *surfaceWindow) {
// OSX doesn't put borders on "help tags"
// Draw a raised border around the edges of the window
surfaceWindow->MoveTo(0, rcClientSize.bottom - 1);
- surfaceWindow->PenColour(colourShade.allocated);
+ surfaceWindow->PenColour(colourShade);
surfaceWindow->LineTo(rcClientSize.right - 1, rcClientSize.bottom - 1);
surfaceWindow->LineTo(rcClientSize.right - 1, 0);
- surfaceWindow->PenColour(colourLight.allocated);
+ surfaceWindow->PenColour(colourLight);
surfaceWindow->LineTo(0, 0);
surfaceWindow->LineTo(0, rcClientSize.bottom - 1);
#endif
@@ -326,7 +318,7 @@ void CallTip::SetTabSize(int tabSz) {
// It might be better to have two access functions for this and to use
// them for all settings of colours.
-void CallTip::SetForeBack(const ColourPair &fore, const ColourPair &back) {
+void CallTip::SetForeBack(const ColourDesired &fore, const ColourDesired &back) {
colourBG = back;
colourUnSel = fore;
}