X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/559a723c1dcf8b3929ab3122fb04429d4abdda8e..363e2dc013a5e80e148cfe022963e2c78a6bbc3d:/src/msw/palette.cpp diff --git a/src/msw/palette.cpp b/src/msw/palette.cpp index aeb874150e..989ff48e22 100644 --- a/src/msw/palette.cpp +++ b/src/msw/palette.cpp @@ -43,13 +43,13 @@ wxPaletteRefData::~wxPaletteRefData(void) ::DeleteObject((HPALETTE) m_hPalette); } -wxPalette::wxPalette(void) +wxPalette::wxPalette() { } wxPalette::wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) { - Create(n, red, green, blue); + Create(n, red, green, blue); } wxPalette::~wxPalette(void) @@ -61,11 +61,22 @@ bool wxPalette::FreeResource(bool WXUNUSED(force)) { if ( M_PALETTEDATA && M_PALETTEDATA->m_hPalette) { - DeleteObject((HPALETTE)M_PALETTEDATA->m_hPalette); + DeleteObject((HPALETTE)M_PALETTEDATA->m_hPalette); } + return true; } +int wxPalette::GetColoursCount() const +{ + if ( M_PALETTEDATA && M_PALETTEDATA->m_hPalette) + { + return ::GetPaletteEntries((HPALETTE) M_PALETTEDATA->m_hPalette, 0, 0, NULL ); + } + + return 0; +} + bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) { UnRef();