fixed bug with wxcolourDatabase::FindColour(); added (and documented) new Find() and AddColour(const wxColour&) methods to avoid such problems in the future

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24206 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-10-16 17:42:31 +00:00
parent 9551b6fe2f
commit c50f92d08c
4 changed files with 187 additions and 115 deletions

View File

@@ -417,23 +417,32 @@ class WXDLLEXPORT wxColourDatabase
{
public:
wxColourDatabase();
~wxColourDatabase() ;
~wxColourDatabase();
// Not const because it may add a name to the database
wxColour *FindColour(const wxString& colour) ;
wxColour *FindColourNoAdd(const wxString& colour) const;
// find colour by name or name for the given colour
wxColour Find(const wxString& name) const;
wxString FindName(const wxColour& colour) const;
void AddColour(const wxString& name, wxColour* colour);
void Initialize();
// add a new colour to the database
void AddColour(const wxString& name, const wxColour& colour);
// deprecated, use Find()/Add() instead
wxColour *FindColour(const wxString& name);
void AddColour(const wxString& name, wxColour *colour);
#ifdef __WXPM__
// PM keeps its own type of colour table
long* m_palTable;
size_t m_nSize;
#endif
private:
wxColour* FindColour(const wxString& colour, bool add);
wxStringToColourHashMap* m_map;
private:
// load the database with the built in colour values when called for the
// first time, do nothing after this
void Initialize();
wxStringToColourHashMap *m_map;
};
class WXDLLEXPORT wxBitmapList : public wxList