From 19bf0c69003ef4128157d157946144947aa628d2 Mon Sep 17 00:00:00 2001 From: David Webster Date: Mon, 27 Nov 2000 04:18:36 +0000 Subject: [PATCH] A few OS/2 additions to enable the colour database to work with PM. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8844 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gdicmn.h | 5 +++++ src/common/gdicmn.cpp | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index 0633285338..7518f8aaf0 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -383,6 +383,11 @@ public: wxColour *FindColour(const wxString& colour) ; wxString FindName(const wxColour& colour) const; void Initialize(); +#ifdef __WXPM__ + // PM keeps its own type of colour table + long* m_palTable; + size_t m_nSize; +#endif }; class WXDLLEXPORT wxBitmapList : public wxList diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index 10efa8c456..6e48b25fd3 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -136,6 +136,9 @@ wxColourDatabase::~wxColourDatabase () delete col; node = next; } +#ifdef __WXPM__ + delete [] m_palTable; +#endif } // Colour database stuff @@ -230,6 +233,15 @@ void wxColourDatabase::Initialize () const wxColourDesc& cc = wxColourTable[n]; Append(cc.name, new wxColour(cc.r,cc.g,cc.b)); } +#ifdef __WXPM__ + m_palTable = new long[n]; + for ( n = 0; n < WXSIZEOF(wxColourTable); n++ ) + { + const wxColourDesc& cc = wxColourTable[n]; + m_palTable[n] = OS2RGB(cc.r,cc.g,cc.b); + } + m_nSize = n; +#endif } /*