Add wxWithImages::SetImages() and update wxMSW wxNotebook for it
This new function will allow selecting the bitmap of the most suitable size and automatically react to DPI scale changes (although this hasn't been implemented yet) in all controls using image lists. For now, only wxNotebook in wxMSW has been updated to work with it, the other classes and ports will be updated to override OnImagesChanged() instead of SetImageList() later. Also update the notebook sample to use SetImages() rather than SetImageList() -- which means that it doesn't show the icons any longer in non-MSW ports, which haven't been updated yet.
This commit is contained in:
@@ -62,14 +62,6 @@ public:
|
||||
bool SetPageText(size_t nPage, const wxString& strText) wxOVERRIDE;
|
||||
wxString GetPageText(size_t nPage) const wxOVERRIDE;
|
||||
|
||||
// image list stuff: each page may have an image associated with it. All
|
||||
// the images belong to an image list, so you have to
|
||||
// 1) create an image list
|
||||
// 2) associate it with the notebook
|
||||
// 3) set for each page it's image
|
||||
// associate image list with a control
|
||||
void SetImageList(wxImageList* imageList) wxOVERRIDE;
|
||||
|
||||
// sets/returns item's image index in the current image list
|
||||
int GetPageImage(size_t nPage) const wxOVERRIDE;
|
||||
bool SetPageImage(size_t nPage, int nImage) wxOVERRIDE;
|
||||
@@ -161,6 +153,9 @@ protected:
|
||||
// remove one page from the notebook, without deleting
|
||||
virtual wxNotebookPage *DoRemovePage(size_t nPage) wxOVERRIDE;
|
||||
|
||||
// update the image list used by the native control
|
||||
virtual void OnImagesChanged() wxOVERRIDE;
|
||||
|
||||
// get the page rectangle for the current notebook size
|
||||
//
|
||||
// returns empty rectangle if an error occurs, do test for it
|
||||
|
||||
Reference in New Issue
Block a user