cleanups after SciTech commit :-(

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14063 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-02-08 00:18:10 +00:00
parent e0a76d8d8a
commit b95edd4708
7 changed files with 96 additions and 55 deletions

View File

@@ -227,7 +227,7 @@ public:
void DrawCircle(wxCoord x, wxCoord y, wxCoord radius)
{ DoDrawEllipse(x - radius, y - radius, 2*radius, 2*radius); }
void DrawCircle(const wxPoint& pt, wxCoord radius)
{ DoDrawEllipse(pt.x, pt.y, radius); }
{ DrawCircle(pt.x, pt.y, radius); }
void DrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{ DoDrawEllipse(x, y, width, height); }
@@ -743,7 +743,7 @@ protected:
#if wxUSE_PALETTE
wxPalette m_palette;
bool m_custompalette;
bool m_hasCustomPalette;
#endif // wxUSE_PALETTE
private:

View File

@@ -102,13 +102,15 @@ public:
virtual void SelectOldObjects(WXHDC dc);
wxWindow *GetWindow() const { return m_canvas; }
void SetWindow(wxWindow *win) {
void SetWindow(wxWindow *win)
{
m_canvas = win;
#if wxUSE_PALETTE
// if we have palettes use the correct one for this window
InitializePalette();
#endif
}
#endif // wxUSE_PALETTE
}
WXHDC GetHDC() const { return m_hDC; }
void SetHDC(WXHDC dc, bool bOwnsDC = FALSE)
@@ -195,10 +197,12 @@ protected:
// (tell windows to translate pixel from other palettes to our custom one
// and vice versa)
// Realize tells it to also reset the system palette to this one.
void DoSelectPalette(bool realize = false);
void DoSelectPalette(bool realize = FALSE);
// Find out what palette our parent window has, then select it into the dc
void InitializePalette();
#endif
#endif // wxUSE_PALETTE
// common part of DoDrawText() and DoDrawRotatedText()
void DrawAnyText(const wxString& text, wxCoord x, wxCoord y);

View File

@@ -396,7 +396,7 @@ private:
#define GetHfontOf(font) ((HFONT)(font).GetHFONT())
#define GetHpalette() ((HPALETTE)GetHPALETTE())
#define GetHpaletteOf(pal) ((HPALETTE)(pal)->GetHPALETTE())
#define GetHpaletteOf(pal) ((HPALETTE)(pal).GetHPALETTE())
#define GetHrgn() ((HRGN)GetHRGN())
#define GetHrgnOf(rgn) ((HRGN)(rgn).GetHRGN())

View File

@@ -770,15 +770,16 @@ public:
// Store the palette used by DCs in wxWindow so that the dcs can share
// a palette. And we can respond to palette messages.
wxPalette GetPalette() const { return m_palette; }
// When palette is changed tell the DC to set the system palette to the
// new one.
void SetPalette(wxPalette &pal) {
m_custompalette=true;
m_palette=pal;
wxWindowDC d((wxWindow *) this);
d.SetPalette(pal);
}
bool HasCustomPalette() { return m_custompalette; }
void SetPalette(const wxPalette& pal);
// return true if we have a specific palette
bool HasCustomPalette() const { return m_hasCustomPalette; }
// return the first parent window with a custom palette or NULL
wxWindow *GetAncestorWithCustomPalette() const;
#endif // wxUSE_PALETTE
protected:
@@ -866,8 +867,8 @@ protected:
#ifdef wxUSE_PALETTE
wxPalette m_palette;
bool m_custompalette;
#endif
bool m_hasCustomPalette;
#endif // wxUSE_PALETTE
protected: