Wx files working

This commit is contained in:
Joey Yakimowich-Payne 2023-02-11 16:21:02 -07:00
commit 30cb0f8f63
No known key found for this signature in database
GPG key ID: 6BFE655FA5ABD1E1
54 changed files with 3157 additions and 5197 deletions

View file

@ -129,6 +129,70 @@ public:
return m_imageList;
}
#if wxABI_VERSION >= 30202
// Return logical size of the image to use or (0, 0) if there are none.
wxSize GetImageLogicalSize(const wxWindow* window, int iconIndex) const
{
wxSize size;
if ( iconIndex != NO_IMAGE )
{
if ( !m_images.empty() )
{
size = m_images.at(iconIndex).GetPreferredLogicalSizeFor(window);
}
else if ( m_imageList )
{
// All images in the image list are of the same size.
size = m_imageList->GetSize();
}
}
return size;
}
// Overload provided to facilitate transition from the existing code using
// wxImageList::GetSize() -- don't use it in the new code.
void GetImageLogicalSize(const wxWindow* window, int iconIndex,
int& width, int& height) const
{
const wxSize size = GetImageLogicalSize(window, iconIndex);
width = size.x;
height = size.y;
}
// Return the bitmap to use at the current DPI of the given window.
//
// If index == NO_IMAGE, just returns wxNullBitmap.
wxBitmap GetImageBitmapFor(const wxWindow* window, int iconIndex) const
{
wxBitmap bitmap;
if ( iconIndex != NO_IMAGE )
{
if ( !m_images.empty() )
{
bitmap = m_images.at(iconIndex).GetBitmapFor(window);
}
else if ( m_imageList )
{
bitmap = m_imageList->GetBitmap(iconIndex);
}
else
{
wxFAIL_MSG
(
"Image index specified, but there are no images.\n"
"\n"
"Did you forget to call SetImages()?"
);
}
}
return bitmap;
}
#endif // wxABI_VERSION >= 3.2.2
protected:
// This function is called when the images associated with the control
// change, due to either SetImages() or SetImageList() being called.