withimages.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: withimages.h
  3. // Purpose: Interface of wxWithImages class.
  4. // Licence: wxWindows licence
  5. ///////////////////////////////////////////////////////////////////////////////
  6. /**
  7. A mixin class to be used with other classes that use a wxImageList.
  8. */
  9. class wxWithImages
  10. {
  11. public:
  12. enum
  13. {
  14. NO_IMAGE = -1
  15. };
  16. wxWithImages();
  17. virtual ~wxWithImages();
  18. /**
  19. Sets the image list for the page control and takes ownership of the list.
  20. @see wxImageList, SetImageList()
  21. */
  22. void AssignImageList(wxImageList* imageList);
  23. /**
  24. Sets the image list to use. It does not take ownership of the image
  25. list, you must delete it yourself.
  26. @see wxImageList, AssignImageList()
  27. */
  28. virtual void SetImageList(wxImageList* imageList);
  29. /**
  30. Returns the associated image list, may be NULL.
  31. @see wxImageList, SetImageList()
  32. */
  33. wxImageList* GetImageList() const;
  34. protected:
  35. /**
  36. Return true if we have a valid image list.
  37. */
  38. bool HasImageList() const;
  39. /**
  40. Return the image with the given index from the image list.
  41. If there is no image list or if index == NO_IMAGE, silently returns
  42. wxNullIcon.
  43. */
  44. wxIcon GetImage(int iconIndex) const;
  45. };