- DECLARE_DYNAMIC_CLASS(wxImageList)
- public:
- /*
- * Public interface
- */
-
- wxImageList();
-
- // Creates an image list.
- // Specify the width and height of the images in the list,
- // whether there are masks associated with them (e.g. if creating images
- // from icons), and the initial size of the list.
- inline wxImageList(int width, int height, bool mask = TRUE, int initialCount = 1)
- {
- Create(width, height, mask, initialCount);
- }
- ~wxImageList();
-
-
- // Attributes
- ////////////////////////////////////////////////////////////////////////////
-
- // Returns the number of images in the image list.
- int GetImageCount() const;
-
- bool GetSize(int index, int&width, int &height) const;
-
- // Operations
- ////////////////////////////////////////////////////////////////////////////
-
- // Creates an image list
- // width, height specify the size of the images in the list (all the same).
- // mask specifies whether the images have masks or not.
- // initialNumber is the initial number of images to reserve.
- bool Create(int width, int height, bool mask = TRUE, int initialNumber = 1);
-
- // Adds a bitmap, and optionally a mask bitmap.
- // Note that wxImageList creates *new* bitmaps, so you may delete
- // 'bitmap' and 'mask' after calling Add.
- int Add(const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap);
-
- // Adds a bitmap, using the specified colour to create the mask bitmap
- // Note that wxImageList creates *new* bitmaps, so you may delete
- // 'bitmap' after calling Add.
- int Add(const wxBitmap& bitmap, const wxColour& maskColour);
-
- // Adds a bitmap and mask from an icon.
- int Add(const wxIcon& icon);
-
- // Replaces a bitmap, optionally passing a mask bitmap.
- // Note that wxImageList creates new bitmaps, so you may delete
- // 'bitmap' and 'mask' after calling Replace.
- bool Replace(int index, const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap);
-
-/* Not supported by Win95
- // Replacing a bitmap, using the specified colour to create the mask bitmap
- // Note that wxImageList creates new bitmaps, so you may delete
- // 'bitmap'.
- bool Replace(int index, const wxBitmap& bitmap, const wxColour& maskColour);
-*/
-
- // Replaces a bitmap and mask from an icon.
- // You can delete 'icon' after calling Replace.
- bool Replace(int index, const wxIcon& icon);
-
- // Removes the image at the given index.
- bool Remove(int index);
-
- // Remove all images
- bool RemoveAll();
-
- // Draws the given image on a dc at the specified position.
- // If 'solidBackground' is TRUE, Draw sets the image list background
- // colour to the background colour of the wxDC, to speed up
- // drawing by eliminating masked drawing where possible.
- bool Draw(int index, wxDC& dc, int x, int y,
- int flags = wxIMAGELIST_DRAW_NORMAL, bool solidBackground = FALSE);
-
-/* TODO (optional?)
- wxIcon *MakeIcon(int index);
-*/
-
-/* TODO
- // Implementation
- ////////////////////////////////////////////////////////////////////////////
-
- // Returns the native image list handle
- inline WXHIMAGELIST GetHIMAGELIST() const { return m_hImageList; }
-
-protected:
- WXHIMAGELIST m_hImageList;
-*/
-
+public:
+ wxImageList() { m_width = m_height = 0; }
+ wxImageList( int width, int height, bool mask = true, int initialCount = 1 );
+ ~wxImageList();
+ bool Create( int width, int height, bool mask = true, int initialCount = 1 );
+ bool Create();
+
+ virtual int GetImageCount() const;
+ virtual bool GetSize( int index, int &width, int &height ) const;
+
+ int Add( const wxIcon& bitmap );
+ int Add( const wxBitmap& bitmap );
+ int Add( const wxBitmap& bitmap, const wxBitmap& mask );
+ int Add( const wxBitmap& bitmap, const wxColour& maskColour );
+ wxBitmap GetBitmap(int index) const;
+ wxIcon GetIcon(int index) const;
+ bool Replace( int index, const wxIcon &bitmap );
+ bool Replace( int index, const wxBitmap &bitmap );
+ bool Remove( int index );
+ bool RemoveAll();
+
+ virtual bool Draw(int index, wxDC& dc, int x, int y,
+ int flags = wxIMAGELIST_DRAW_NORMAL,
+ bool solidBackground = false);
+
+private:
+ wxList m_images;
+
+ int m_width;
+ int m_height;
+
+ DECLARE_DYNAMIC_CLASS(wxImageList)