DeleteCurrentHandleIfNeeded() is already called from Free() which is
unconditionally called at the beginning of the function, so there is no
need to call it again.
This is just a micro-optimization: there is no need to call
InvalidateBestSize() if the size of the bitmap doesn't actually change
(as will most often be the case when this method is called after the
control creation).
wxStaticBitmap tried to automatically resize itself to its new size, but
did it wrongly (since what looks like ever, or at least since the first
version in the VCS, which is 2bda0e1738,
from 21 years ago) because it assumed that the size of wxStaticBitmap
window is the same as the size of the bitmap it is showing, which is not
the case when it uses border style such as wxBORDER_RAISED.
Fix this by resizing it to the current size adjusted by the difference
between the old and new bitmap sizes. Alternative approach would be to
just use SetSize(GetBestSize()), as the other ports do, but keep the
changes to the minimum for now.
Closes#18398.
Calling Flush() is supposed to make everything drawn so far immediately
visible, which means propagating it to the wxImage being drawn on in the
case of image-based graphics context, but wxMacCoreGraphicsImageContext
didn't do it, unlike Cairo and GDI+ version.
Fix this by overriding Flush() in it to explicitly update m_image.
Closes https://github.com/wxWidgets/wxWidgets/pull/1321
So far it was implemented as property which could take int values 0/1 so it was acting essentially as a Boolean property. Implementing it explicitly as a Boolean one will make it more intuitive. Legacy code setting 0/1 int values shouldn't be affected because conversion from int to bool is implicit.
All wxPG_FILE_xxx attributes are used only in wxFileProperty to set respective internal data members and don't have to be stored in the property's attribute store.
By moving the code to display file selector dialog from wxPGFileDialogAdapter to wxFileProperty we can encapsulate the operation of showing the dialog because all required parameters are stored in the corresponding data members and there is no need to use call generic GetAttribute() function to retrieve them. This also helps in making wxFileProperty attributes built-ones in the future.
This attribute is used only internally in wxFileProperty so it can be considered as a built-in attribute which value can be stored in the local data member and not in the property's attribute store.
Don't call wxDataViewColumn::GetWidth() in OnPaint() for columns that
are hidden: they won't be drawn and their width won't affect anything.
The call looks deceptively simple, but may invoke best width
recalculation that can be very expensive on large models.
RegisterHotKey() wrongly expected to be given VK_XXX MSW virtual key
code constant, which couldn't work in portable code, so fix it to accept
WXK_XXX constants, while preserving compatibility by still accepting
VK_XXX values not clashing with them.
Add wxFileDialog::GetCurrentlySelectedFilterIndex() similar to the
existing GetCurrentlySelectedFilename(), which can be used to retrieve
the index of the currently selected filter and update the state of the
extra controls in wxFileDialog accordingly.
Implement this for wxMSW only by updating the internally stored value
from the native CDN_TYPECHANGE notification and also generating a
wxEVT_UPDATE_UI event to allow the extra controls to update themselves.
Closes https://github.com/wxWidgets/wxWidgets/pull/1310
We need implement copy ctor and assignment operator because we are going to do a shallow copy of wxPGHashMapS2P data member and therefore we have to manually update reference counters of the objects being referenced in this map.
Notification about changes of column widths needs to be sent locally from wxPropertyGrid to wxPropertyGridManager (to update the header) so it would be good to use a dedicated non-public event type for these purposes.
For some operations when grid needs to be recreated currently selected options to show the header and to enable label editing are being ignored and it can be seen a discrepancy between the options selected (and shown) in the menu and the mode of just created wxPropertyGrid. To avoid this inconsistency respective flags can be stored and used to enable/disable features in just created grid.
This shouldn't be done unconditionally, trace mask can always be enabled
using WXTRACE environment variable from outside the test.
Also remove a useless tracing message.